Abstract
Court View Generation (CVG) is a critical task in Legal AI, requiring the automated drafting of legal rationales and judgments based on case facts. While Large Language Models (LLMs) excel in general text generation, they often struggle with the domain-specific precision required for legal reasoning, frequently hallucinating or failing to apply statutory logic correctly. This paper presents a novel framework that decomposes CVG into three specialized sub-tasks: charge identification, law article citation, and prison term calculation. By stimulating internal knowledge and incorporating external legal databases, the proposed method enables LLMs to outperform fully supervised models in a few-shot setting.
Introduction
In the high-stakes domain of Legal Artificial Intelligence, accuracy is paramount. Court View Generation (CVG) involves synthesizing a coherent legal judgment that includes the specific charge, relevant statutes, and a calculated sentence. General-purpose LLMs, despite their linguistic prowess, face significant hurdles in CVG due to the "knowledge-intensive" nature of law. They often struggle with arbitrary article numbers and the complex mathematical logic required for sentencing.
Problem Statement
A comprehensive Court View must address three distinct components:
- The Charge: Identifying the specific crime committed.
- Law Articles: Citing the exact statutes applicable to the case.
- Prison Terms: Determining a precise sentence based on case variables.
Traditional state-of-the-art (SOTA) models rely on extensive supervised training, which is problematic for rare crimes with limited data. LLMs, while capable of reasoning, lack the specific "library" of legal definitions and the "calculator" for precise sentencing.
Methodology
The researchers propose a three-pronged strategy to augment LLMs for CVG, as illustrated in the overall framework.
Stimulating Internal Knowledge
To improve charge identification, the framework prompts the LLM to generate clarifications for commonly confused legal concepts (e.g., drug possession vs. trafficking). This "stimulated" internal knowledge is then used as context to help the model distinguish between similar crimes.
Incorporating External Knowledge
Since article numbers lack inherent semantic meaning for models, the system uses a retriever (Contriever) to fetch the full text of relevant laws from an external database. This ensures the model reasons based on actual legal definitions rather than hallucinated associations.
Symbolic Reasoning for Sentencing
For prison term calculation, the model is provided with "Penalty Principles." Instead of predicting a number directly, the LLM generates Python code based on these principles. The model extracts variables from the case (like the weight of drugs) and runs the code to calculate the sentence, moving the task from black-box prediction to transparent calculation.
Datasets and Evaluation
The framework was evaluated using two datasets: LAIC2021, a standard real-world legal dataset, and CJO2022, a new dataset of criminal cases from 2022. The latter was specifically curated to prevent data leakage, as most LLMs were trained on data preceding 2022.
Results
The "2-shot with Knowledge Base (KB)" approach demonstrated significant improvements over fully supervised models like BERT and specialized legal models.
- Sentencing Accuracy: On the CJO2022 dataset, GPT-3.5 with KB achieved an Acc25 (accuracy within 25% of the actual sentence) of 43.74, significantly higher than BERT's 33.34.
- Rare Case Handling: The LLM-based approach proved far more robust for low-frequency crimes where supervised models typically fail due to lack of training data.
- Human Evaluation: Blind tests confirmed that the generated views were more consistent and fluent than those produced by previous SOTA models.
Conclusion
Decomposing the CVG task into semantic, retrieval-based, and symbolic components allows LLMs to leverage their strengths while compensating for their weaknesses. By treating the charge, the law, and the sentence as different types of intelligence, this framework provides a path toward more reliable and transparent legal AI. Future work will focus on expanding context windows for legal precedents and improving variable extraction in complex narratives like fraud.
Summary updated