NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Prompt-based Effective Input Reformulation for Legal Case Retrieval

Yanran Tang, Ruihong Qiu, Xue Li · OpenReview

Abstract

Legal case retrieval plays an important role for legal practitioners to effectively retrieve relevant cases given a query case. Most existing neural legal case retrieval models directly encode the whole legal text of a case to generate a case representation, which is then utilised to conduct a nearest neighbour search for retrieval. Although these straightforward methods have achieved improvement over conventional statistical methods in retrieval accuracy, two significant challenges are identified in this paper: (1) Legal feature alignment: the usage of the whole case text as the input will generally incorporate redundant and noisy information because, from the legal perspective, the determining factor of relevant cases is the alignment of key legal features instead of whole text matching; (2) Legal context preservation: furthermore, since the existing text encoding models usually have an input length limit shorter than the case, the whole case text needs to be truncated or divided into paragraphs, which leads to the loss of the global context of legal information. In this paper, a novel legal case retrieval framework, PromptCase, is proposed to tackle these challenges. Firstly, legal facts and legal issues are identified and formally defined as the key features facilitating legal case retrieval based on a thorough study of the definition of relevant cases from a legal perspective. Secondly, with the determining legal features, a prompt-based encoding scheme is designed to conduct an effective encoding with language models. Extensive zero-shot experiments have been conducted on two benchmark datasets in legal case retrieval, which demonstrate the superior retrieval effectiveness of the proposed PromptCase. The code has been released on https://github.com/yanran-tang/PromptCase.

Introduction

Legal Case Retrieval (LCR) is a fundamental task in legal research, aiding practitioners in identifying historical precedents that share similar legal foundations with a current case. While neural models have significantly improved retrieval accuracy over traditional keyword-based methods, they face two major hurdles when processing legal documents: legal feature alignment and legal context preservation.

Legal documents are often dense with procedural noise and boilerplate language that does not contribute to legal relevance. Furthermore, the extreme length of these documents—often ranging from 5,000 to nearly 100,000 words—far exceeds the token limits of standard language models like BERT. This leads to arbitrary truncation, causing a massive loss of global context and often cutting out the most decisive legal information.

The PromptCase Framework

To address these challenges, the authors propose PromptCase, a framework that reformulates the input into a semantically rich format focused on two key features: Legal Facts and Legal Issues.

1. Feature Extraction

Instead of using the entire case text, PromptCase extracts specific components:

  • Legal Facts ($C_{fact}$): The narrative circumstances (who, what, when, where). For English cases (COLIEE), the authors use ChatGPT to generate a 50-word summary of the "Background" section. For Chinese cases (LeCaRD), the fact section is extracted directly.
  • Legal Issues ($C_{issue}$): The core points of dispute. In common law, these are derived from the "Analysis" section where precedents are cited. In civil law, they often correspond to specific criminal charges.

2. Prompt-based Encoding

The extracted features are fed into a Language Model (LM) using a prompt-based encoding scheme. The framework utilizes a hybrid approach:

  • Dual Encoding: Facts and issues are encoded separately to avoid semantic interference.
  • Cross Encoding: Facts and issues are encoded together to capture how specific facts trigger specific legal issues.
The PromptCase framework: (a) extraction of facts/issues and (b) the dual/cross encoding architecture.

Experimental Evaluation

The framework was evaluated on two major benchmarks: LeCaRD (Chinese civil law) and COLIEE2023 (English common law).

Dataset Statistics

The statistics below highlight the "length challenge" PromptCase aims to solve. With cases reaching nearly 100,000 tokens, standard truncation methods are clearly insufficient for preserving legal context.

Statistics of the LeCaRD and COLIEE2023 datasets.

Key Results and Insights

PromptCase consistently improved the performance of various baseline models, including BM25, BERT, and domain-specific models like Lawformer and SAILER, in zero-shot settings.

  • Performance Gains: On the LeCaRD dataset, adding PromptCase to the SAILER model improved the NDCG@5 from 70.1% to 74.2%. On COLIEE2023, the improvement was even more pronounced, with NDCG@5 jumping from 29.3% to 36.2%.
  • Prompts as Semantic Anchors: Simply adding the prefix "Legal facts:" helps the language model focus its attention on the relevant semantic space, even without task-specific training.
  • System Robustness: The results indicate that while common law retrieval relies heavily on "issues" (precedents) and civil law relies more on "facts," PromptCase handles both systems effectively by extracting both features explicitly.

Conclusion

PromptCase demonstrates that legal documents are not just bags of words but structured narratives. By exploiting this structure and using prompt-based reformulation, the framework bypasses the noise of long-form documents and overcomes the input limitations of modern language models, providing a robust solution for zero-shot legal case retrieval.

Summary updated

BibTeX
@inproceedings{tang2023prompt,
  author = {Yanran Tang and Ruihong Qiu and Xue Li},
  title = {{Prompt-based Effective Input Reformulation for Legal Case Retrieval}},
  booktitle = {ADC},
  year = {2023},
  doi = {10.1007/978-3-031-47843-7\_7},
}

Loading related content...

Figure