[Paper Review] Lawformer: A Pre-trained Language Model for Chinese Legal Long Documents
Lawformer is a Longformer-based pre-trained language model designed for Chinese legal long documents, leveraging local sliding window attention and global task-specific attention to handle thousands of tokens. It achieves state-of-the-art performance on legal tasks like judgment prediction, case retrieval, and reading comprehension, outperforming standard models on long-context inputs while maintaining strong performance on shorter ones.
Legal artificial intelligence (LegalAI) aims to benefit legal systems with the technology of artificial intelligence, especially natural language processing (NLP). Recently, inspired by the success of pre-trained language models (PLMs) in the generic domain, many LegalAI researchers devote their effort to apply PLMs to legal tasks. However, utilizing PLMs to address legal tasks is still challenging, as the legal documents usually consist of thousands of tokens, which is far longer than the length that mainstream PLMs can process. In this paper, we release the Longformer-based pre-trained language model, named as Lawformer, for Chinese legal long documents understanding. We evaluate Lawformer on a variety of LegalAI tasks, including judgment prediction, similar case retrieval, legal reading comprehension, and legal question answering. The experimental results demonstrate that our model can achieve promising improvement on tasks with long documents as inputs.
Motivation & Objective
- To address the challenge of processing long Chinese legal documents, which often exceed 512 tokens and are poorly handled by standard pre-trained language models.
- To develop a domain-specific pre-trained language model tailored for legal text understanding in both criminal and civil cases.
- To evaluate the model across diverse LegalAI tasks, including judgment prediction, case retrieval, reading comprehension, and question answering.
- To construct new, large-scale datasets for legal judgment prediction covering both criminal and civil cases, improving real-world data distribution coverage.
- To demonstrate that long-sequence modeling capabilities significantly enhance performance on tasks requiring deep understanding of lengthy legal documents.
Proposed method
- Adopt the Longformer architecture, which combines local sliding window self-attention with selective global attention to efficiently process long sequences.
- Pre-train Lawformer on a large-scale corpus of tens of millions of Chinese criminal and civil case documents.
- Use global attention only on key tokens, such as the question in question-answering tasks, to preserve long-range dependencies without incurring full self-attention cost.
- Fine-tune Lawformer on downstream LegalAI tasks using standard classification and sequence labeling heads.
- Construct new datasets for legal judgment prediction with balanced coverage of criminal and civil cases, improving data distribution realism.
- Apply transfer learning by fine-tuning on existing benchmarks for similar case retrieval, legal reading comprehension, and legal question answering.
Experimental results
Research questions
- RQ1Can a pre-trained language model effectively handle Chinese legal documents that are thousands of tokens long, overcoming the sequence length limitations of standard PLMs?
- RQ2How does Lawformer's performance compare to RoBERTa and BERT-based models on legal tasks with long input sequences?
- RQ3To what extent does in-domain pre-training on legal documents improve performance on legal judgment prediction and other legal NLP tasks?
- RQ4Does the integration of global attention on key input segments (e.g., questions) enhance reasoning in legal question answering and reading comprehension?
- RQ5Can Lawformer generalize across diverse legal tasks, including both long-context and short-context inputs, with consistent performance gains?
Key findings
- Lawformer achieves a 55.02% EM and 69.98% F1 on legal reading comprehension, outperforming RoBERTa (53.81% EM, 68.86% F1) and L-RoBERTa (54.12% EM, 69.76% F1), demonstrating superior long-context understanding.
- On legal question answering, Lawformer achieves 45.81% accuracy on single-answer questions and 27.43% on all questions, slightly outperforming L-RoBERTa and showing strong performance despite the task's complexity.
- Lawformer significantly improves performance on judgment prediction tasks involving long documents, especially when compared to models pre-trained on out-of-domain corpora.
- The model maintains competitive performance on shorter inputs, achieving comparable results to RoBERTa on short-sequence tasks, indicating robustness across input lengths.
- The new dataset for legal judgment prediction, covering both criminal and civil cases, enables more realistic evaluation and better generalization than existing datasets.
- Extensive ablation shows that global attention on key tokens (e.g., questions) is crucial for maintaining performance in long-context reasoning tasks.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.