Enhancing Legal Case Retrieval via Scaling High-quality Synthetic Query-Candidate Pairs

Cheng Gao, Chaojun Xiao, Zhenghao Liu, Huimin Chen, Zhiyuan Liu, Maosong Sun

Abstract

Legal Case Retrieval (LCR) is essential for ensuring judicial efficiency and consistency. However, the field is constrained by the scarcity of high-quality annotated data and a significant gap between academic symmetric retrieval (case-to-case) and real-world asymmetric retrieval (short query-to-case). We present LEAD, a massive legal retrieval dataset comprising over 100,000 synthetic query-candidate pairs. By utilizing Large Language Models (LLMs) for query synthesis and a novel knowledge-driven augmentation strategy, we demonstrate that scaling high-quality synthetic data can overcome existing bottlenecks, leading to state-of-the-art results across major LCR benchmarks.

Introduction

Finding relevant precedents is a cornerstone of legal practice, yet manual retrieval is labor-intensive. Automated LCR systems aim to assist this process but face two primary challenges. First, there is an asymmetric retrieval gap: while researchers often focus on matching long case documents, practitioners typically use short, factual queries. Second, the data scarcity wall prevents the training of robust neural models, as legal annotation requires expensive expert labor. Existing datasets like LeCaRD are limited to approximately 100 queries, which is insufficient for modern deep learning architectures.

The LEAD Pipeline

To address these challenges, we developed an automated pipeline to generate the LEAD (Legal Case Retrieval Dataset) without manual intervention. The process involves three main stages:

  1. Query Generation: Using real criminal case facts, an LLM extracts key events and rewrites them into concise search queries (averaging 79 characters, compared to 400+ in older datasets).
  2. Anonymization: To ensure the model learns legal principles rather than specific identifiers, entities such as names and locations are replaced with generic placeholders.
  3. Knowledge-Driven Augmentation: This strategy identifies additional relevant cases by matching primary legal articles and similar prison terms, forcing the model to capture deep legal relevance.
Overview of the LEAD data generation pipeline, showing the transition from millions of case documents to 100,000 synthetic query-candidate pairs.

Methods and Augmentation

A key innovation is the "knowledge-driven" approach. Traditional retrieval often relies on semantic similarity, which can be misleading in law (e.g., two cases involving similar injuries might fall under different statutes). By using legal "anchors"—specific statutes and sentencing outcomes—as ground truth for relevance, the model learns to prioritize legally significant features over surface-level text overlap. Additionally, we implement False Negative Masking during training to prevent the model from being penalized when it correctly identifies relevant cases that weren't explicitly labeled as positives.

Experimental Results

The LEAD dataset enables training of high-performance dual-encoder models that outperform domain-specific pre-trained models like SAILER.

Performance evaluation of LEAD-trained models on LeCaRD and CAIL2022-LCR benchmarks across various metrics including P@k, MAP, and NDCG@k.

Key findings include:

  • State-of-the-Art Performance: On the LeCaRD benchmark, our model achieved an NDCG@30 of 94.5. On CAIL2022-LCR, it reached 97.4, significantly outperforming traditional BM25 baselines.
  • Scaling with Model Size: Fine-tuning a 2.4B parameter LLM (MiniCPM) on LEAD further improved performance, reaching an NDCG@30 of 94.8 on LeCaRD.
  • Cross-Domain Transferability: Although LEAD is built on criminal cases, the methodology proved effective for civil law cases, such as private lending disputes in the CAIL2019-SCM dataset.

Conclusion

The introduction of LEAD demonstrates that the "data scarcity wall" in legal retrieval can be overcome through high-quality synthetic data generation. By bridging the asymmetric gap and incorporating legal knowledge into the training signal, we provide a scalable path toward more effective and reliable legal AI systems. Future work will explore extending this methodology to diverse jurisdictions and multi-task legal reasoning.

Summary updated

BibTeX
@inproceedings{gao2024enhancing,
  author = {Cheng Gao and Chaojun Xiao and Zhenghao Liu and Huimin Chen and Zhiyuan Liu and Maosong Sun},
  title = {{Enhancing Legal Case Retrieval via Scaling High-quality Synthetic Query-Candidate Pairs}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.402},
}
Figure