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 +5 more
1/27/2024
2 citations
cs.CL
contrastive-ssl

Official code: NEUIR/LegalDuet (16 stars, Python, MIT, last commit 2026-02-11).

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

NEUIR/LegalDuetOfficial100%
MIT

[ADMA 2025 Best Paper Award] Code repo for our ADMA'25 paper: LegalDuet: Learning Fine-grained Representations for Legal Judgment Prediction via a Dual-View Contrastive Learning

161PythonDec 18, 20249 months agoMIT

Similar Papers

Cite this paper

@article{xu2024legalduet,
  title  = {LegalDuet: Learning Fine-grained Representations for Legal Judgment Prediction via a Dual-View Contrastive Learning},
  author = {Buqiang Xu and Xin Dai and Zhenghao Liu and Huiyuan Xie and Xiaoyuan Yi and Shuo Wang and Yukun Yan and Liner Yang and Yu Gu and Ge Yu},
  year   = {2024},
  eprint = {2401.15371},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2401.15371v4}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2401.15371.svg)](https://codeofpaper.com/paper/2401.15371)

Discussion