Enhancing Court View Generation with Knowledge Injection and Guidance

Ang Li, Yiquan Wu, Yifei Liu, Kun Kuang, Fei Wu, Ming Cai

Abstract

Court View Generation (CVG) is a challenging task in the field of Legal Artificial Intelligence (LegalAI), which aims to generate court views based on the plaintiff claims and the fact descriptions. While Pretrained Language Models (PLMs) have showcased their prowess in natural language generation, their application to the complex, knowledge-intensive domain of CVG often reveals inherent limitations. In this paper, we present a novel approach, named Knowledge Injection and Guidance (KIG), designed to bolster CVG using PLMs. To efficiently incorporate domain knowledge during the training stage, we introduce a knowledge-injected prompt encoder for prompt tuning, thereby reducing computational overhead. Moreover, to further enhance the model’s ability to utilize domain knowledge, we employ a generating navigator, which dynamically guides the text generation process in the inference stage without altering the model’s architecture, making it readily transferable. Comprehensive experiments on real-world data demonstrate the effectiveness of our approach compared to several established baselines, especially in the responsivity of claims, where it outperforms the best baseline by 11.87%.

Introduction

In the legal domain, Court View Generation (CVG) involves automatically producing a judge's reasoning based on case facts and plaintiff claims. While general Pretrained Language Models (PLMs) like GPT or BART are highly fluent, they often lack the specialized domain knowledge required for legal accuracy. As illustrated in Figure 1, standard models can fail to address specific legal claims or even hallucinate facts—such as incorrectly assuming a marital relationship between parties—which undermines their utility in judicial contexts.

Figure 1: Comparison of court views generated by a human judge versus a standard BART model, highlighting the latter's failure to address specific claims and its tendency to hallucinate facts.

Methodology

The proposed Knowledge Injection and Guidance (KIG) framework addresses these challenges by augmenting a frozen PLM (e.g., GPT-2) through two primary components: a specialized training phase and a guided inference phase.

Figure 2: The KIG framework architecture, showing (1) the base PLM, (2) the Knowledge-injected Prompt Encoder, (3) the prefix-tuned generation, and (4) the Generating Navigator.

Knowledge-injected Prompt Encoder

Instead of standard random initialization, KIG initializes prompt embeddings using aggregated representations of legal keywords. It utilizes a Label Attention mechanism that incorporates definitions of legal claim labels (e.g., "Principal Claim" or "Guarantee Liability") to query the input text. This process creates a "claim-aware" context, efficiently baking legal semantics into the model's prompt encoder while keeping the main PLM weights frozen.

Generating Navigator

To ensure the model remains responsive to specific plaintiff claims during inference, KIG employs a "Generating Navigator." This is a separate multi-label classifier that scores potential next tokens based on their alignment with the required legal claims. The navigator dynamically adjusts the PLM's decoding distribution. Crucially, the guidance strength is designed to scale up as the generated text grows, allowing the model to establish sufficient context before being strictly steered.

Experimental Results

The framework was evaluated using a dataset of 41,693 Chinese civil cases. KIG demonstrated significant improvements over established baselines:

  • Superior Accuracy: KIG outperformed GPT-2, BART, T5, and ChatGPT across standard similarity metrics like BLEU and ROUGE.
  • Enhanced Claim Responsiveness: Using novel Claim Response Metrics, KIG improved the Macro-F1 score by 11.87% over the best baseline, indicating a much higher success rate in addressing all legal claims present in the input.
  • Efficiency: KIG achieved these results by tuning only 18M parameters, compared to 118M for full fine-tuning, reducing training time by over 60%.

Conclusion

KIG effectively bridges the gap between general-purpose language generation and the rigorous demands of the legal domain. By decoupling knowledge injection from the core model weights, the framework provides a computationally efficient and transferable method for improving the reliability of AI-generated legal reasoning. Future work will explore applying KIG to larger-scale models and diverse international legal systems.

Summary updated

BibTeX
@inproceedings{li2024enhancing,
  author = {Ang Li and Yiquan Wu and Yifei Liu and Kun Kuang and Fei Wu and Ming Cai},
  title = {{Enhancing Court View Generation with Knowledge Injection and Guidance}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=AebWStxYPC},
}
Figure