LegalDuet: Learning Fine-grained Representations for Legal Judgment Prediction via a Dual-View Contrastive Learning
Buqiang Xu, Xin Dai, Zhenghao Liu, Huiyuan Xie, Xiaoyuan Yi, Shuo Wang, Yukun Yan, Liner Yang, Yu Gu, Ge Yu
TL;DR
LegalDuet tackles fine-grained Legal Judgment Prediction by replacing reliance on token-level cues with a continuous pretraining regime that learns tailored embeddings for criminal facts. It introduces dual-view contrastive learning with Law Case Clustering ($\mathcal{L}_{LCC}$) and Legal Decision Matching ($\mathcal{L}_{LDM}$), jointly optimized as $\mathcal{L}_{LegalDuet} = \mathcal{L}_{LCC} + \mathcal{L}_{LDM}$ to shape a discriminative embedding space. Evaluated on CAIL2018, LegalDuet consistently outperforms baselines across tasks and backbones, reduces prediction entropy, and yields more compact, well-separated embeddings (lower Davies-Bouldin Index) that better align criminal facts with legal decisions. The approach generalizes to multiple PLMs (e.g., BERT-xs, BERT-Chinese) without requiring bespoke LJP architectures, and the authors release the code for reproducibility.
Abstract
Legal Judgment Prediction (LJP) is a fundamental task of legal artificial intelligence, aiming to automatically predict the judgment outcomes of legal cases. Existing LJP models primarily focus on identifying legal triggers within criminal fact descriptions by contrastively training language models. However, these LJP models overlook the importance of learning to effectively distinguish subtle differences among judgments, which is crucial for producing more accurate predictions. In this paper, we propose LegalDuet, which continuously pretrains language models to learn a more tailored embedding space for representing legal cases. Specifically, LegalDuet designs a dual-view mechanism to continuously pretrain language models: 1) Law Case Clustering retrieves similar cases as hard negatives and employs contrastive training to differentiate among confusing cases; 2) Legal Decision Matching aims to identify legal clues within criminal fact descriptions to align them with the chain of reasoning that contains the correct legal decision. Our experiments on the CAIL2018 dataset demonstrate the effectiveness of LegalDuet. Further analysis reveals that LegalDuet improves the ability of pretrained language models to distinguish confusing criminal charges by reducing prediction uncertainty and enhancing the separability of criminal charges. The experiments demonstrate that LegalDuet produces a more concentrated and distinguishable embedding space, effectively aligning criminal facts with corresponding legal decisions. The code is available at https://github.com/NEUIR/LegalDuet.
