Abstract
RLJP (Rule-enhanced Legal Judgment Prediction) addresses the "logic rigidity" gap in legal AI by combining the reasoning capabilities of Large Language Models (LLMs) with the structured precision of First-Order Logic (FOL). By implementing a "quiz-based" contrastive learning mechanism to iteratively refine legal rules, RLJP achieves state-of-the-art performance in predicting law articles, charges, and prison terms. Evaluation on major Chinese legal datasets demonstrates that RLJP significantly outperforms existing semantic and logic-based models, particularly in complex cases with lengthy, noisy factual descriptions.
Introduction
Legal Judgment Prediction (LJP) is a critical task in legal tech, requiring the analysis of case facts to predict applicable laws, charges, and penalties. Existing approaches typically fall into two categories: semantic-based models, which rely on neural networks for similarity matching but often lack intrinsic legal logic, and logic-based models, which use rigid expert-defined rules that struggle with the nuances of complex real-world cases. RLJP bridges this gap by using LLMs to generate and optimize FOL rules, creating a system that is both logically rigorous and adaptively flexible.
Methods
The RLJP framework operates in three distinct stages designed to mimic the learning process of a legal professional:
- Rules Initialization: LLMs extract "rough" legal rules from judicial precedents, formalizing them into FOL structures consisting of symbolic antecedents and consequents.
- Rules Optimization: The core innovation involves an "Optimization Tree" and Confusion-aware Contrastive Learning (CACL). The system identifies "confusable" case pairs—those with similar facts but different legal outcomes—and uses them as "quizzes" to identify ineffective logic parts and refine the FOL rules.
- Examination: A hybrid approach where a lightweight BERT model identifies the top 10 candidate labels, followed by the application of optimized FOL rules via a Chain-of-Thought (CoT) process to reach the final judgment.
Key Results
RLJP was evaluated on the CAIL2018 and CJO22 datasets, demonstrating superior performance across all metrics (Accuracy, Macro-Precision, Macro-Recall, and Macro-F1) compared to baselines like BERT, Llama 3, and specialized models like D-LADAN.
- Accuracy Boost: On the CAIL2018 dataset, RLJP achieved 96.00% accuracy for charge prediction and 88.12% for law articles.
- Complex Case Mastery: In analysis of the top 5% most complex cases, RLJP outperformed the second-best model by a massive margin, jumping from 28.06% to 79.27% accuracy on law article prediction in CAIL2018_long. This suggests that symbolic logic acts as a robust filter against noise in lengthy case descriptions.
- Prison Term Prediction: RLJP showed significant improvements in the challenging task of prison term prediction, hitting a Macro-F1 of 48.45%.
Conclusion
RLJP demonstrates that symbolic logic, when enhanced by LLMs and contrastive learning, provides a robust framework for legal reasoning. While currently focused on Chinese law, the methodology offers a path toward more interpretable and accurate legal AI. Future work will focus on expanding the framework to different legal systems and improving the user-facing interpretability of the rule optimization phase.
Summary updated