Domain adaptation of Russian ModernBERT for long legal documents
I. Litvak, D. Gvozdetsky, F. Lashkin, V. Kirova, S. Lagutin, V. Volf, T. Maksiyan, A. Kostin, R. Leva, I. Kiselev
Abstract
We investigate whether continued pretraining on Russian legislative documents improves a Russian ModernBERT encoder on legal text. The adapted model, RuModernBERT-ruLaw, was trained on a corpus reported to contain 304,382 legislative documents and 194,425,905 corpus tokens. Corpus token counts are distinguished from positions produced by the model tokenizer. We compare the original and adapted encoders on a fixed external collection of 1,031 court-decision segments. Both models receive the same hidden positions in each of five masking realizations. At maximum input lengths of 512, 2,048, and 8,192 tokens, mean masked-token cross-entropy decreases by 0.10942, 0.07052, and 0.06604 natural-log units, respectively. The reported 95% intervals summarize sensitivity to masking on this fixed collection; they do not quantify uncertainty across document collections. A second evaluation addresses legal-entity extraction. The original and adapted models achieve entity-level F1 scores of 0.99852 and 0.99820. However, 99.95% of test spans have the same normalized surface form and class in the training split. This evaluation therefore provides limited evidence about transfer to previously unseen forms. The paper explains the masking objective, overlapping windows, averaging rules, and exact entity-boundary scoring using editable diagrams and clearly marked illustrative examples. The comparison supports lower masked-token prediction loss for the studied pair of models and collection. It does not isolate the contribution of distant context or establish practical legal utility.
Create a lesson
Metadata
- Comments
- 17 pages, 11 figures, 4 tables
Related papers
A Comparative Study of Evaluation Metrics for Long-Document Financial Narrative Summarization with Transformers
Shared title terminologycs.CLNadhem Zmandar, Mo El-Haj, Paul Rayson
Breaking Bureaucracy: Evaluating open-source LLMs for legal document review
Shared title terminologycs.CLFarrukh Baratov, Niki van Stein, Suzan Verberne
HuatuoGPT-3: RL-Only Domain Adaptation from Base Models
Shared title terminologycs.CLJunying Chen, Xinyuan Xie, Ziniu Li et al.
Self-Generated Feedback Destabilizes Test-Time Training: A Causal Decomposition of Long-Horizon Adaptation
Shared title terminologycs.CLCheng Luo, Bing Li, Bernard Ghanem
From Data Room to Report: End-to-End AI Support for M&A Legal Due Diligence
Shared title terminologycs.CLJohannes R. Hübers, Daniel Uedelhoven, Manuela Bergau et al.
Failure Broadens, Success Sharpens: Continual Adaptation of Tool-Use Agents Across Diverse Tasks with Dual-Polarity Memory
Shared title terminologycs.CLTianmai M. Zhang, Hoda Shajari, Amr Hendy et al.