Abstract
Legal case retrieval (LCR) is a cornerstone of real-world legal decision making, as it enables practitioners to identify precedents for a given query case. Existing approaches mainly rely on traditional lexical models and pretrained language models to encode the texts of legal cases. Yet there are rich information in the relations among different legal entities as well as the crucial reasoning process that uncovers how legal facts and legal issues can lead to judicial decisions. Such relational reasoning process reflects the distinctive characteristics of each case that can distinguish one from another, mirroring the real-world judicial process. Naturally, incorporating such information into the precise case embedding could further enhance the accuracy of case retrieval. In this paper, a novel ReaKase-8B framework is proposed to leverage extracted legal facts, legal issues, legal relation triplets and legal reasoning for effective legal case retrieval. ReaKase-8B designs an in-context legal case representation learning paradigm with a fine-tuned large language model. Extensive experiments on two benchmark datasets from COLIEE 2022 and COLIEE 2023 demonstrate that our knowledge and reasoning augmented embeddings substantially improve retrieval performance over baseline models, highlighting the potential of integrating legal reasoning into legal case retrieval systems.
Introduction
Finding the right legal precedent is often a daunting task, requiring legal practitioners to navigate through dozens of pages of dense legalese across vast document repositories. Historically, Legal Case Retrieval (LCR) has relied on lexical models like BM25 or semantic models like BERT. However, these approaches often treat legal documents as flat text, failing to capture the underlying logical path—the "why"—that connects legal facts and issues to a final judicial decision. Two cases might share high text similarity by citing the same statutes but apply them in fundamentally different ways. To bridge this "reasoning gap," we introduce ReaKase-8B, a framework that retrieves cases based on the actual logic and reasoning used by judges.
Methodology
The ReaKase-8B framework utilizes a multi-stage pipeline to transform raw legal text into reasoning-aware embeddings. The process is divided into four primary phases:
- Legal Element Extraction: The system isolates four key components: Legal Facts, Legal Issues, the Final Judgment, and Relation Triplets (structured data such as [claimant, filed, appeal]).
- Reasoning Generation: Utilizing a high-end LLM (GPT-5), the framework generates a concise explanation of the inferential logic linking facts to the decision. This serves as a logical map for the case.
- Contextualized Case Encoding: These structured elements are fed into a prompt template, ensuring the embedding model focuses on legally significant content rather than administrative noise.
- Contrastive Fine-Tuning: The model (Qwen3-Embedding-8B) is fine-tuned using a contrastive learning objective. This pulls relevant cases closer in vector space while pushing away "hard negatives"—cases that appear similar but possess divergent logical reasoning.
Experimental Evaluation
We evaluated ReaKase-8B on two premier benchmarks for English legal retrieval: COLIEE 2022 and COLIEE 2023. These datasets, derived from the Federal Court of Canada, are known for their extreme document lengths, often exceeding 100,000 tokens.
Results and Discussion
ReaKase-8B established a new state-of-the-art (SOTA) across nearly all metrics. On the COLIEE 2022 benchmark, the Mean Reciprocal Rank (MRR@5) improved from 35.1% (the previous best language model) to 52.7%. The model demonstrated consistent performance across both 2022 and 2023 benchmarks, outperforming larger models like Mistral-7B and specialized models like LEGAL-BERT.
Ablation studies confirmed that while entity relations (triplets) are beneficial, the generated reasoning provided the most significant performance boost. This suggests that the logical pathway is the most distinctive feature of a legal case. Furthermore, ReaKase-8B proved superior at filtering "false positives"—cases that cite identical laws but are irrelevant to the specific legal argument of the query.
Conclusion
ReaKase-8B demonstrates that incorporating structured legal reasoning into LLM embeddings significantly enhances the accuracy of legal case retrieval. While the framework currently involves preprocessing overhead due to reasoning generation and faces input length constraints, it proves that how data is represented is as critical as model size. Future work will focus on expanding these reasoning-extraction pipelines to other languages and legal systems.
Summary updated