Abstract
Legal Judgment Prediction (LJP) aims to predict a case's charge, law article, and penalty term based on fact description text. A primary challenge in LJP is distinguishing between "confusing" legal cases that share subtle textual similarities but differ in legal outcomes. Traditional models often fail to differentiate classification errors using standard cross-entropy loss and frequently ignore numerical data critical for determining penalty terms. To address these issues, we propose NumSCL, a framework utilizing MoCo-based supervised contrastive learning to generate distinguishable representations. Furthermore, we enhance fact description representations with extracted crime amounts encoded by a pre-trained numeracy model. Extensive experiments on public benchmarks demonstrate that NumSCL achieves new state-of-the-art results, particularly in confusing cases and penalty term prediction.
Introduction
Predicting legal outcomes from natural language descriptions is a complex multi-task learning problem. Current LJP systems face two significant hurdles. First, many charges are linguistically similar but legally distinct—for instance, "Picking a Quarrel" versus "Intentional Injury." Standard classification models treat all mispredictions equally, failing to capture the nuanced boundaries between these confusing pairs. Second, the term of penalty is often strictly tied to numerical evidence, such as the total amount of money stolen or defrauded. However, these figures are typically scattered throughout the text, making it difficult for standard NLP encoders to aggregate them into a coherent "total crime amount."
Methodology
The NumSCL framework introduces two primary innovations to overcome these hurdles: MoCo-based Supervised Contrastive Learning (SCL) and a Numerical Evidence Extraction module.
MoCo-based Supervised Contrastive Learning
To better distinguish confusing charges, we employ contrastive learning to "pull" representations of similar cases together and "push" different charges apart. Because LJP involves hundreds of classes, standard in-batch contrastive loss lacks sufficient negative examples. We implement a Momentum Contrast (MoCo) queue to maintain a large, consistent pool of case representations.
A key discovery in our research is the "Contradictory Phenomenon," where cases sharing a charge might differ in law articles or penalty terms. To resolve this, we adopted a strict strategy for constructing positive pairs: two cases are only considered a positive pair if they share identical labels across all three subtasks (charge, law, and penalty). This ensures that the learned representations are robust across the entire multi-task landscape.
Numerical Evidence Extraction
For penalty prediction, we treat the identification of financial figures as a specialized Named Entity Recognition (NER) task. We utilize a 0-1 knapsack algorithm to automatically label which numbers in the training text sum up to the known total crime amount, creating a high-quality labeled dataset without manual intervention. These extracted numbers are then processed by NumEncoder, a specialized LSTM-based model designed to preserve numerical magnitude (e.g., understanding that $10,000 is significantly larger than $100), rather than treating them as simple text tokens.
Experiments and Results
We evaluated NumSCL on the CAIL-Small and CAIL-Big datasets, which contain over one million Chinese legal cases. The framework was designed to be model-agnostic, serving as a "plug-and-play" enhancement for backbones like BERT or GNNs.
Our results show that NumSCL consistently outperforms state-of-the-art baselines like LADAN and CrimeBERT. Specifically:
- Overall Performance: NumSCL achieved superior F1 scores across all three subtasks.
- Confusing Cases: On a subset of specifically identified confusing charges, the model saw an absolute F1 score improvement of up to 1.6 points.
- Numerical Sensitivity: In cases where penalties are highly dependent on dollar amounts, the inclusion of the NumEncoder led to a massive 3.73 F1 score improvement over baseline models.
Conclusion
By combining supervised contrastive learning with specialized numerical encoding, NumSCL effectively addresses the twin challenges of linguistic confusion and numerical blindness in legal judgment prediction. While current limitations include the additive nature of the knapsack approach—which may struggle with complex subtractions like returned funds—the framework provides a significant step toward more accurate and interpretable legal AI. Future work will focus on expanding these techniques to different jurisdictions and improving the interpretability of the contrastive representations.
Summary updated