Manuscript Offprint

arXiv:2609.08185

Cassette: Case-to-Case Structural Distillation for Efficient Legal Case Retrieval

Yanran Tang, Ruihong Qiu, Hongzhi Yin, Xue Li, Zi Huang

YANRAN TANG, RUIHONG QIU, HONGZHI YIN, XUE LI, and ZI HUANG, School of EECS, The University of Queensland, Brisbane, Australia

Legal case retrieval (LCR) is an essential tool for not only assisting legal practitioners to efficiently retrieve precedents, but also enabling ordinary individuals to find valuable legal case information without relying on expensive professional legal service. Our previous work CaseLink [50] demonstrated the effectiveness of using case to case graph structures to improve retrieval accuracy. However, its high computational cost during inference on large scale legal databases limits its practical use in real world settings. The main inefficiency comes from constructing test time graphs and computing pairwise term frequency similarities of cases. This process has O(n2)O(n^2) complexity for nn legal cases, making the runtime prohibitive as the number of candidates grows. For example, the retrieval time for one query on a database (COLIEE2022 [20]) with 1,563 candidate cases is more than 500 milliseconds, while the runtime would increase drastically to more than 3,500 seconds for a database (LeCaRDv2 [24]) with 55,192 candidate cases. To further enhance the retrieval performance while achieving a significant speed-up, in this extension paper, Cassette framework is proposed with a distillation strategy involving ranking objective and eigen-matching objective for an effective transfer of knowledge from a powerful and well-trained heavy teacher retriever to a lightweight and efficient hybrid student dual encoder. Specifically, the student query encoder is implemented as a multilayer perceptron model designed for fast online processing, whereas the student candidate encoder adopts a GNN architecture, suitable for an offline manner within the case database. Extensive experiments are conducted on three benchmark datasets and the results verify the effectiveness of the ranking distillation while achieving high efficiency. The code has been released on https://github.com/yanran-tang/Cassette.

CCS Concepts: • Information systems → Specialized information retrieval.

Additional Key Words and Phrases: Information Retrieval, Legal Case Retrieval, Graph Neural Networks

ACM Reference Format:

Yanran Tang, Ruihong Qiu, Hongzhi Yin, Xue Li, and Zi Huang. 2026. Cassette: Case-to-Case Structural Distillation for Efficient Legal Case Retrieval. ACM Trans. Inf. Syst. 44, 5, Article 121 (July 2026), 27 pages. https://doi.org/10.1145/3816732

1 INTRODUCTION

Legal case retrieval (LCR) is a vital tool that facilitates the identification of relevant cases from a large legal database based on a given query case, providing substantial benefits to both legal professionals and the general public. In legal terminology, these relevant cases are known as precedents, which play a pivotal role in most legal systems worldwide by promoting consistency and fairness in judicial decision-making, as well as strengthening the arguments presented by legal practitioners [15].

Existing LCR methods can be broadly categorised into two main types: statistical models and neural network models. (1) Statistical retrieval methods, also referred to as lexical models, such as TF-IDF [19], BM25 [39], and LMIR [34], rely

Authors' address: Yanran Tang, yanran.tang@uq.edu.au; Ruihong Qiu, r.qiu@uq.edu.au; Hongzhi Yin, h.yin1@uq.edu.au; Xue Li, xueli@eecs.uq.edu.au; Zi Huang, helen.huang@uq.edu.au, School of EECS, The University of Queensland, Brisbane, Australia.

Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org.

© 2026 Copyright held by the owner/author(s). Publication rights licensed to ACM.

Tang et al.

Figure

(a) COLIEE2022

Figure

(b) LeCaRDv2

Fig. 1. Retrieval performance versus inference efficiency of Cassette (green dots), compared with two baselines: CaseGNN (red dots), an efficient but less effective two-tower method that servers as the initial feature, and CaseLink (blue dots), a graph-based method that is more effective but computationally intensive. Results are shown on two datasets: (a) COLIEE2022 with 1,563 candidate cases (measured in milliseconds); and (b) LeCaRDv2 with 55,192 candidate cases (measured in seconds).

on document term frequency to compute similarity scores. (2) Neural network-based methods, by contrast, leverage deep learning architectures to encode the semantic representations of legal cases and assess relevance, typically within a two-tower framework [1, 2, 6–8, 23, 28, 37, 40, 46, 48, 55, 58, 63]. More recently, CaseLink [50] has achieved state-of-the-art (SOTA) performance explicitly modelling inter-case relationships using graph neural networks (GNNs), thereby enabling effective message passing across a constructed case graph.

Although graph-based LCR methods demonstrate strong retrieval accuracy, they face significant computational challenges in real-world applications. As illustrated in Figure 1, the heavy graph-based method CaseLink [50] (blue dots) outperforms the traditional two-tower dense retrieval baseline, CaseGNN (red dots), in terms of accuracy. However, this performance gain comes at the cost of substantially reduced efficiency. From the perspective of query-candidate case graph construction, establishing case-to-case relationships for incoming query cases is particularly time-consuming. In LCR task, query cases are unseen during model development, necessitating dynamic graph updates upon their arrival. This involves recalculating BM25-based edges and re-indexing [39], resulting in O(n2)O(n^2) computational complexity due to the pairwise similarity computations [50]. As shown in Figure 1, the graph-based model demonstrates an inference time of more than 500 milliseconds (ms) on the COLIEE2022[20] dataset, which is approximately 50 times slower than the traditional retrieval baseline. On large scale datasets such as LeCaRDv2 [24], which includes 55,192 candidate cases, CaseLink exhibits extreme inference latency, which is approximately 340,000 times slower than the baseline method. This substantial delay renders graph-based approaches impractical for real-time retrieval scenarios, particularly when online processing is required for unseen queries in large legal databases.

Additionally, from the perspective of case modelling with GNNs, the message passing operation in GNNs presents another major efficiency bottleneck due to the need for neighbourhood fetching and aggregation. In LCR scenario, retrieval is under an inductive setting during model testing, where candidate case pool is fixed while the query cases are unseen, similar to the legal practitioners searching for precedents for an unjudged case within a database of historically judged cases. For graph-based case-to-case retrieval methods, this inductive scenario necessitates dynamic reconstruction of the case graph and recalculation of case representations upon the arrival of each new query. Such requirements preclude offline pre-computation and leads to high online computational demands, highlighting the Manuscript submitted to ACM necessity for efficient LCR models that can maintain high retrieval accuracy while meeting the demands of real-world deployment.

Moreover, considering the specific structural and semantic information in legal domain, directly distilling a MLP model in the context of LCR often results in suboptimal performance due to its limited capacity to capture and leverage rich legal information. In particular, the MLP encoder tends to disregard essential structural information, such as implicit case-to-case reference relationships, which is crucial for distinguishing legally relevant cases beyond surface-level textual similarity and for effective legal reasoning and retrieval. Cases with similar factual descriptions may lead to different judicial outcomes depending on factors such as applicable charges, precedent relationships, or shared legal issues. For example, cases involving similar facts but different charge types require retrieval systems to capture case-charge relationships rather than relying solely on surface-level textual similarity. Moreover, prior legal IR methods, such as SLR [30] and CFGL-LCR [74], have demonstrated that incorporating structural information within legal cases or modelling the structure relations among legal case graphs can significantly improve retrieval accuracy. Furthermore, naively applying distillation process focuses solely on transferring ranking signals from the teacher model to student model will result in failures of preserving the latent inter-case relationships encoded in the learned case representations. Therefore, an effective and ideal distillation strategy must consider both relevance ranking and structural alignment to ensure meaningful legal knowledge transfer.

In this paper, we propose a novel Cassette module by utilising distillation strategy involving ranking objective and eigen-matching objective to effectively transfer knowledge from a well-trained teacher retriever to a hybrid student dual encoder. First, a GNN-based teacher retriever is trained by leveraging the complete case-to-case relations including both query and candidate to capture case representative abilities. Subsequently, to increase the efficiency by avoiding the repetitive graph structure update, a GNN-based student candidate encoder is distilled to only calculate the case representations of candidate cases in an offline manner. To further relieve the computation overhead brought by GNN in online processing query cases, a MLP-based student query encoder is distilled to obtain effective query case representations. During distillation, a ranking objective and an eigen-matching objective are combined to distil case representation as well as the latent inter-case structural information from teacher retriever to hybrid student dual encoder. While existing approaches generally focus on model compression or the transfer of ranking supervision in generic retrieval settings, our method is tailored to legal case retrieval by distilling both semantic relevance and legally grounded structural relationships through a candidate legal graph. Unlike standard GNN-to-MLP distillation methods like Graph-MLP [18] and GLNN [75], Cassette does not aim to replicate the full graph reasoning process, but instead transfers structure-aware signals into a lightweight student suitable for large-scale deployment. Compared with conventional ranking distillation, our approach further incorporates legal-specific relational constraints, such as case-charge associations, making it more closely aligned with the unique requirements of the LCR task. This approach can also maintains the retrieval performance of the teacher model while significantly improving computational efficiency.

In the proposed method Cassette, structurally guided distillation aligns with judicial reasoning principles because it transfers relational dependencies that reflect how courts analyse and compare cases. Judicial decision-making emphasizes consistency across similar charges, reliance on precedents, and adherence to structured legal constraints rather than isolated textual similarity. By distilling graph-based relational signals, the student model preserves proximity among cases sharing related charges or legal elements, promoting charge-level coherence in the representation space. At the same time, hierarchical relationships embedded in the legal graph enable the model to internalize precedent authority and analogical reasoning patterns. Unlike generic distillation methods that primarily transfer predictive

Tang et al.

distributions, our approach transfers legally structured inductive biases, ensuring that the learned representations are not only accurate but also aligned with core principles of judicial reasoning.

Experiments on three benchmark datasets, COLIEE2022 [20], COLIEE2023 [12] and LeCaRDv2 [24], demonstrate the efficacy of the proposed distillation strategy, showcasing both its knowledge preservation capabilities and significant efficiency improvements. In addition to our previously proposed CaseLink [50], the key contributions of this paper can be summarised as follows:

  • A Cassette framework is proposed to distil efficient yet effective models for real-world LCR. Cassette includes a powerful but heavy GNN-based teacher retriever, and a lightweight but effective hybrid student dual encoder for query and candidate cases respectively.
  • A distillation strategy with a ranking objective and an eigen-matching objective are devised by transforming ranking results and graph structural information given by GNN-based teacher retriever into supervision signals for effective hybrid student dual encoder training.
  • Extensive multi-lingual experiments on three benchmark datasets verify the outstanding performance and high efficiency of Cassette over the previous baselines.

References (18)