JurisCTC: Enhancing Legal Judgment Prediction via Cross-Domain Transfer and Contrastive Learning

Zhaolu Kang, Hongtian Cai, Xiangyang Ji, Jinzhe Li, Nanfei Gu

Introduction

Legal Judgment Prediction (LJP) is the task of automatically forecasting court outcomes based on case facts. While it holds significant potential for improving judicial efficiency and access to justice, current models face two primary challenges: data scarcity and domain silos. In many jurisdictions, such as China, the availability of criminal judgment documents has fluctuated, creating a need for models that can leverage data from related but distinct fields. Furthermore, most existing LJP models are specialized for a single domain (e.g., civil or criminal law) and fail to generalize across different legal logics.

JurisCTC addresses these issues by proposing a framework that transfers knowledge from data-rich domains (like civil law) to data-constrained ones (like criminal law). By integrating unsupervised domain adaptation with contrastive learning, JurisCTC learns domain-invariant features that capture the underlying legal reasoning common to various branches of law.

Methodology

The JurisCTC framework is built upon three core components designed to facilitate cross-domain knowledge transfer.

High-level flow of source and target text through the feature extractor to generate domain-specific features.

1. Feature Extraction

The model utilizes a pre-trained BERT backbone to convert complex legal text into high-dimensional semantic embeddings. This provides a robust starting point for understanding legal language.

2. Adversarial Domain Adaptation

To bridge the gap between civil and criminal law, JurisCTC employs a Domain Classifier paired with a Gradient Reversal Layer (GRL). This setup encourages the feature extractor to produce "domain-invariant" representations—features that are useful for prediction but do not distinguish between the source (civil) and target (criminal) domains.

3. Distribution Alignment and Contrastive Learning

The model optimizes a multi-faceted loss function to refine the feature space:

  • Maximum Mean Discrepancy (MMD): Minimizes the statistical distance between the feature distributions of the two domains.
  • Contrastive Learning (CTC): This component pulls cases with similar legal outcomes closer together in the embedding space while pushing dissimilar ones apart, regardless of their original domain.
Detailed architecture of the JurisCTC loss components, including class and domain classifiers, MMD loss, and contrastive loss.

Experimental Setup

The framework was evaluated using two major Chinese legal datasets:

  • LJP-MSJudge (Civil Law): Focused on whether a plaintiff's claims were supported.
  • CAIL-2018 (Criminal Law): Focused on "guilty" vs. "not guilty" outcomes.

The task was framed as binary classification for both domains to test the transferability of decision-making logic.

Results and Discussion

JurisCTC demonstrated superior performance compared to both traditional LJP models and state-of-the-art Large Language Models (LLMs).

  • Performance: In criminal law tasks, JurisCTC achieved 76.59% accuracy, significantly outperforming Gemini-1.5-Flash (68.77%) and TOPJUDGE (44.80%). In civil law, it reached 78.83% accuracy, surpassing GPT-4o (52.04%).
  • Specialization vs. Scale: The results suggest that for domain-specific tasks like law, targeted architectural choices (GRL, MMD, and contrastive learning) can be more effective than simply increasing the parameter count of a general-purpose LLM.
  • Transferable Logic: The success of the model confirms that the logical structures used in civil adjudication—such as evidence weighing—are highly relevant to criminal cases.

Limitations

While JurisCTC excels in recall, its precision in criminal tasks (75.92%) was lower than GPT-4o’s (83.00%), indicating a higher rate of false positives. Future work will focus on refining linguistic feature analysis and exploring more complex domain adaptation strategies to improve precision and understand the specific drivers of cross-domain transfer.

Summary updated

BibTeX
@inproceedings{kang2025jurisctc,
  author = {Zhaolu Kang and Hongtian Cai and Xiangyang Ji and Jinzhe Li and Nanfei Gu},
  title = {{JurisCTC: Enhancing Legal Judgment Prediction via Cross-Domain Transfer and Contrastive Learning}},
  booktitle = {IJCNN},
  year = {2025},
  doi = {10.1109/ijcnn64981.2025.11229207},
}
Figure