Law Article-Enhanced Legal Case Matching: a Model-Agnostic Causal Learning Approach

Zhongxiang Sun, Jun Xu, Xiao Zhang, Zhenhua Dong, Ji-Rong Wen · DOI

Introduction

Legal case matching is a critical task in legal informatics, aiming to identify whether two legal cases are similar enough to be treated as precedents or related instances. However, "similarity" in a legal context differs significantly from standard document similarity. Two cases might share high semantic overlap—describing similar physical actions or settings—yet fall under entirely different legal statutes due to subtle nuances. Conversely, cases with different factual descriptions might be legally identical.

Figure 1: Legal case pairs demonstrating the discrepancy between factual description and cited law articles.

As shown in Figure 1, Case A and Case B might appear related at a surface level, but their legal classifications (Libel vs. Bribery) create a mismatch. Traditional NLP models often struggle with this because they treat the task as a black-box document similarity problem, failing to account for the mediating role of law articles.

The Law-Match Framework

To bridge this gap, the authors introduce Law-Match, a model-agnostic framework that leverages Causal Representation Learning. The core idea is to treat law articles as "Instrumental Variables" (IV) that help disentangle the case representation into legally relevant and irrelevant components.

Causal Modeling with Instrumental Variables

In the Law-Match causal graph, legal case embeddings are treated as "treatments" ($T$), law article embeddings as "instrumental variables" ($Z$), and the matching label as the "outcome" ($Y$). By applying IV regression, the framework decomposes a case embedding into two distinct parts:

  1. The Law-Related Part (Fitted): This captures the "mediation effect," representing how the law articles shape the interpretation of the case facts.
  2. The Law-Unrelated Part (Residual): This captures the "direct effect" of specific factual circumstances that are not governed by the cited laws (e.g., names, dates, specific locations).

Architecture: Treatment Reconstruction

The framework implements this decomposition through a specialized architecture. As illustrated in Figure 5, the model uses an encoder to generate initial embeddings for the source case ($X$), target case ($Y$), and their respective cited laws ($L_X, L_Y$).

Figure 5: The detailed architecture of the Law-Match framework, featuring the Treatment Reconstruction module.

The Treatment Reconstruction module performs the IV regression. It uses an attention mechanism to focus on the rationales within the case text that align with the law articles. The resulting "reconstructed treatment" vector ($e^{re}(X)$) is a refined representation that emphasizes legal logic while retaining necessary factual context. This reconstructed vector can then be passed to any "underlying model"—such as Sentence-BERT, Lawformer, or IOT-Match—to perform the final matching prediction.

Experimental Evaluation

The researchers evaluated Law-Match across three diverse Chinese legal datasets: ELAM (explainable matching), eCAIL (private lending cases), and LeCaRD (large-scale retrieval).

Key Results and Insights

Law-Match consistently achieved state-of-the-art results. On the ELAM dataset, it boosted the accuracy of the IOT-Match base model from 73.87% to 76.75%. More importantly, the framework proved to be truly model-agnostic, providing performance gains for every base model tested.

Beyond raw metrics, the framework offers two significant advantages:

  • Rationale Identification: By using law articles as a filter, the model learns to ignore factual "noise" and focus on the sentences that carry legal weight.
  • Efficiency: The module is lightweight, adding only 3% to 8% to the total inference time, making it suitable for production legal search engines.

Conclusion

Law-Match represents a significant step forward in legal AI by moving beyond simple semantic matching toward a more principled, causal understanding of legal similarity. By explicitly modeling the relationship between case facts and law articles, it allows NLP models to more closely emulate the reasoning process of legal professionals. Future work will explore the applicability of this framework to common law jurisdictions and other legal tasks like judgment prediction.

Summary updated

BibTeX
@inproceedings{sun2023law,
  author = {Zhongxiang Sun and Jun Xu and Xiao Zhang and Zhenhua Dong and Ji-Rong Wen},
  title = {{Law Article-Enhanced Legal Case Matching: a Model-Agnostic Causal Learning Approach}},
  booktitle = {International ACM SIGIR Conference on Research and Development in Information Retrieval},
  year = {2023},
  doi = {10.1145/3539618.3591709},
}
Figure