Abstract
In the judicial domain, identifying similar precedents is essential for ensuring consistent and fair sentencing. However, traditional Legal Case Retrieval (LCR) and Legal Case Matching (LCM) systems often struggle to distinguish between general semantic similarity and specific jurisprudential relevance. This paper introduces LCM-LAI (Legal Case Matching with Law Article Intervention), an end-to-end framework designed to bridge this gap. By utilizing a dependent multi-task learning approach, LCM-LAI predicts applicable law articles as a latent representation of legal rationale, enabling the model to match cases based on their legal significance rather than mere word overlap. Experimental results across four large-scale datasets demonstrate that LCM-LAI achieves state-of-the-art performance while maintaining the efficiency required for real-world judicial applications.
Introduction
The search for "comparable cases" is a cornerstone of modern legal practice. Whether for a judge determining a sentence or a lawyer building a defense, the ability to retrieve and match cases based on legal precedent is vital. This task is categorized into Legal Case Retrieval (LCR), which involves finding relevant cases from a large database, and Legal Case Matching (LCM), which assesses the similarity between two specific cases.
The primary challenge in this field is that legal relevance is distinct from semantic relevance. Two cases may share significant factual overlap—such as the location of an incident or the items involved—yet fall under entirely different legal statutes due to nuanced differences in intent or circumstance. Conversely, cases with different factual descriptions may be legally identical. Existing models often rely on surface-level text matching or require the applicable law articles to be known beforehand—a "chicken and egg" problem that limits their utility in practice, as the goal of the search is often to discover those very laws.
The LCM-LAI Framework
To address these challenges, we propose the LCM-LAI framework. This model treats law articles as a bridge between raw case facts and legal similarity, allowing the system to "think" like a legal professional by identifying the underlying legal principles at play.
1. Law Article Prediction (LAP) Sub-task
Instead of requiring law articles as an input, LCM-LAI incorporates a Law Article Prediction sub-task. During training, the model learns to predict which statutes apply to a given set of facts. This forces the model to extract "legal-rational" information from the text, effectively filtering out factual noise that has no bearing on the legal outcome.
2. Article-Aware Attention
A key technical innovation of this work is the Article-Aware Attention mechanism. Rather than comparing standard sentence embeddings, the model calculates a "law distribution" for every sentence. It evaluates which law articles a specific sentence is most likely to trigger. Case matching is then performed by comparing these legal distributions, ensuring that the similarity score reflects jurisprudential relevance.
3. Dual Interaction Modules
The framework employs two parallel paths to capture the full scope of case similarity:
- Basic Interaction Module (BIM): This module captures standard semantic similarity, focusing on the factual narrative of the cases.
- Legal Interaction Module (LIM): This module focuses exclusively on jurisprudential relevance, utilizing the outputs of the LAP sub-task to match cases based on their legal implications.
4. Late Interaction Architecture
Efficiency is a prerequisite for any system intended for real-world use. LCM-LAI adopts a "late interaction" design. This allows the complex, high-dimensional embeddings for millions of candidate cases to be pre-calculated and stored offline. When a query is made, the system only needs to perform the computationally inexpensive matching calculations, ensuring low latency.
Experimental Evaluation
Datasets
The model was rigorously evaluated on four prominent Chinese legal datasets:
- LeCaRD & LeCaRDv2: Large-scale benchmarks for legal case retrieval containing thousands of criminal cases.
- ELAM: A dataset designed for explainable legal matching, featuring labeled rationales.
- eCAIL: An extension of the CAIL 2021 competition dataset focused on legal matching tasks.
Results
LCM-LAI achieved State-of-the-Art (SOTA) results across all evaluated datasets. On the LeCaRD dataset, the model showed a relative improvement of up to 7.02% over existing baselines. Furthermore, the framework demonstrated "backbone independence," providing significant performance gains regardless of whether it was implemented using BERT, Lawformer, or RoBERTa.
In terms of efficiency, the model's inference latency is approximately 76.52ms for re-ranking 100 candidates. This is well within the 500ms threshold typically required for online search systems, proving its readiness for practical deployment.
Discussion and Future Work
The success of LCM-LAI stems from its treatment of law articles as a latent variable representing legal rationale. By using mediation analysis and Bayesian theory, we have demonstrated that this multi-task framework is mathematically more robust for legal matching than simple joint training models.
However, some challenges remain. The current model is optimized for "Civil Law" systems where statutes are explicitly codified. Adapting this approach to "Common Law" jurisdictions, which rely on unwritten judicial precedents, may require using Large Language Models (LLMs) to generate synthetic "law substitutes." Additionally, error analysis indicates that the model occasionally struggles with the "focus of dispute"—the specific points of contention between opposing parties. Future research will explore the integration of LLMs to better capture these nuances and provide even more granular legal matching.
Summary updated