Papers
Topics
Authors
Recent
Search
2000 character limit reached

JudiFair: Judicial Fairness in LLM Decision-Making

Updated 6 July 2026
  • JudiFair is a legally grounded benchmark that defines judicial fairness using a multidimensional framework covering both substance and procedure.
  • It employs a counterfactual prompting methodology and a structured 65-label taxonomy to isolate the effects of legal attributes on model outputs.
  • Empirical analysis on 16 LLMs reveals widespread bias and an accuracy-equity trade-off, underscoring the need for robust judicial auditing methods.

Searching arXiv for JudiFair and related judicial fairness papers. JudiFair is a benchmark and evaluation framework for assessing judicial fairness in LLMs when they are deployed as decision-making or decision-support systems in legal contexts. It was introduced in “LLMs on Trial: Evaluating Judicial Fairness for LLMs” (Hu et al., 14 Jul 2025) to address the claim that existing fairness benchmarks are insufficient for judicial settings because they are typically narrow, emphasize demographic factors, and lack legal grounding and statistical rigor. In this formulation, judicial fairness is treated as a multidimensional property encompassing stability under counterfactual changes, systematic directional bias, and disparities in predictive accuracy across groups. JudiFair combines a legally structured label taxonomy, a large counterfactually generated dataset, and a statistical auditing methodology designed for robust inference (Hu et al., 14 Jul 2025).

1. Conceptual scope and motivation

JudiFair was created for the setting in which LLMs function as judges or judge-like evaluators in high-stakes legal tasks. The underlying premise is that fairness in judicial decision-making cannot be reduced to a single demographic-bias test. Instead, fairness must be assessed across both substance and procedure, and across both demographic and non-demographic factors (Hu et al., 14 Jul 2025).

The framework distinguishes two major axes. The first is substance vs. procedure. Substance factors concern case facts and characteristics of the offense and the people involved. Procedure factors concern the judicial process, including attributes such as court level, open trial, broadcasting, defender type, recusal, judicial committee, pretrial conference, litigation duration, and immediate judgment (Hu et al., 14 Jul 2025). The second is demographic vs. non-demographic. Demographic factors include attributes such as gender, ethnicity, age, sexual orientation, religion, and wealth, while non-demographic factors include variables such as crime date, location, court level, whether the trial was public, and whether the judgment was immediate (Hu et al., 14 Jul 2025).

This structure reflects a broader conception of judicial fairness than conventional fairness benchmarks. A central claim of the benchmark is that prior work often ignored procedural fairness, even though procedure-related variables can materially affect judicial outcomes (Hu et al., 14 Jul 2025). This suggests that JudiFair is designed not merely as a bias-detection dataset, but as a legal auditing framework aimed at exposing fairness failures that would remain invisible under narrower demographic-only protocols.

2. Framework architecture and label system

The judicial fairness framework in JudiFair leads to 65 labels and 161 corresponding values (Hu et al., 14 Jul 2025). These labels are organized into four broad groups: Substance and demographic, Substance and non-demographic, Procedure and demographic, and Procedure and non-demographic (Hu et al., 14 Jul 2025).

The label system expands the LEEC base source and includes labels that are often absent from judicial records but are regarded as relevant to fairness analysis. The benchmark explicitly includes labels such as sexual orientation, and also covers attributes of actors beyond defendants, including judges, prosecutors, defenders, and victims (Hu et al., 14 Jul 2025). Procedure-oriented labels include court level, court location, collegial panel, assessor, pretrial conference, online broadcast, open trial, defender type, recusal applied, judicial committee, litigation duration, immediate judgment, compulsory measure (Hu et al., 14 Jul 2025).

The following table summarizes the framework organization.

Axis Categories Illustrative labels from the benchmark
Substance / Procedure Substance factors; Procedure factors crime time/location; court level; pretrial conference; immediate judgment
Demographic / Non-demographic Demographic factors; Non-demographic factors gender, ethnicity, religion, wealth; open trial, online broadcast, litigation duration
Actor coverage Multiple legal participants defendant, victim, defender, prosecutor, judge

The benchmark’s taxonomy is legally motivated rather than purely data-driven. It is intended to support analyses of whether an LLM’s sentencing output is altered by changes in attributes that should be irrelevant, or whether prediction quality is uneven across values of a given label (Hu et al., 14 Jul 2025). A plausible implication is that the framework can support both normative fairness analysis and descriptive diagnosis of which legal or extra-legal variables most strongly perturb model behavior.

3. Dataset construction and counterfactual methodology

JudiFair comprises 177,100 unique case facts and is built from 1,100 judicial documents derived from Chinese judicial materials (Hu et al., 14 Jul 2025). The benchmark construction process relies on counterfactual prompting. For each case and label, legal experts identify the relevant trigger sentence in the judicial document, construct a baseline prompt from the original case facts, replace the selected label value with alternative values, and submit each counterfactual as a separate query to the model (Hu et al., 14 Jul 2025).

The defining methodological principle is that only the label value changes, while the remainder of the case description is held fixed (Hu et al., 14 Jul 2025). This is designed to isolate the effect of the selected label on the model’s judgment. The paper states that the prompting scheme is minimally altered from the original judicial documents in order to preserve legal realism (Hu et al., 14 Jul 2025).

The prompt format is a role-play instruction in which the model is told to act as a judge familiar with Chinese law, is given sentencing rules, receives the case facts, and returns a JSON sentencing result (Hu et al., 14 Jul 2025). The authors also report a prompt validation stage involving 420 queries, with each query run three times, to check compliance with the desired format and the stability of outputs (Hu et al., 14 Jul 2025).

Counterfactual prompting is central to the benchmark’s epistemic design. It is used because it tests whether the model remains neutral when irrelevant facts change, reduces reliance on simple data patterns, and helps expose systematic fairness issues (Hu et al., 14 Jul 2025). This design also separates JudiFair from evaluation paradigms based solely on static test sets with demographic annotations. In JudiFair, fairness is probed through controlled perturbation of legally situated narratives rather than by comparing aggregate subgroup scores in isolation.

4. Fairness metrics and statistical evaluation

JudiFair evaluates fairness using three metrics: Inconsistency, Bias, and Imbalanced inaccuracy (Hu et al., 14 Jul 2025). These metrics are intentionally not collapsed into a single scalar. Instead, fairness is assessed as a multidimensional profile across labels, models, and metric types (Hu et al., 14 Jul 2025).

Inconsistency

Inconsistency measures how often the model changes its output when only a label value changes. For one LLM, the paper defines:

Inconsistency=l=1Nwlpll=1NwlInconsistency = \frac{\sum_{l=1}^{N} w_l \cdot p_l}{\sum_{l=1}^{N} w_l}

where NN is the total number of labels, wlw_l is the weight for label ll calculated as its effective sample size, and plp_l is the proportion of judicial documents for which the model’s prediction changes when the value of label ll changes (Hu et al., 14 Jul 2025). Higher inconsistency indicates lower stability, but the paper explicitly notes that inconsistency is not automatically equivalent to bias (Hu et al., 14 Jul 2025).

Bias

Bias is defined as a systematic directional effect of label values on sentence length. The paper estimates this through a high-dimensional fixed-effects regression:

Ln(Sentence)=γ+j=1j1αjTreatedj+i=1i1βiIDi+εLn(Sentence) = \gamma + \sum_{j=1}^{j-1} \alpha_j \cdot \text{Treated}_{j} + \sum_{i=1}^{i-1} \beta_i \cdot \text{ID}_{i} + \varepsilon

Here, Treated denotes the label of interest, one value serves as the reference group, IDi\text{ID}_i are fixed effects for each judicial document, and the dependent variable is the natural log of sentencing length + 1. The main outcome is limited imprisonment length in months (Hu et al., 14 Jul 2025). Estimation uses high-dimensional fixed-effect linear regression with cluster-robust standard errors at the ID level (Hu et al., 14 Jul 2025).

To aggregate significance across many tested label values, the paper counts how many values are significant at a chosen threshold such as p0.1p \le 0.1 or p0.05p \le 0.05, then applies a Bernoulli/binomial tail test:

NN0

The paper notes that the formula text contains a typesetting inconsistency in the exponent notation, but states that the intended meaning is the right-tail probability under the binomial/Bernoulli null (Hu et al., 14 Jul 2025). This test is applied both within each model and across all models collectively (Hu et al., 14 Jul 2025).

Imbalanced inaccuracy

Imbalanced inaccuracy captures group disparities in predictive error. JudiFair reports MAE and MAPE, then uses a regression analogous to the bias regression, with absolute error as the dependent variable:

NN1

The same Bernoulli test is then used to determine whether the number of labels with significant error disparities exceeds what would be expected by chance (Hu et al., 14 Jul 2025). The paper emphasizes that bias and imbalanced inaccuracy are distinct: a model can exhibit one without the other, or both simultaneously (Hu et al., 14 Jul 2025).

This tripartite structure is one of JudiFair’s defining features. It operationalizes judicial fairness as a combination of output stability, directional neutrality, and equality of predictive performance, rather than assuming that any single dimension is sufficient.

5. Experimental protocol and empirical findings

The main experiment evaluates 16 LLMs drawn from different countries and spanning both open and closed models (Hu et al., 14 Jul 2025). The listed models include GLM-4, GLM-4 Flash, Qwen2.5 72B Instruct, Qwen2.5 7B Instruct, Gemini Flash 1.5, Gemini Flash 1.5 8B, LFM 40B MoE, LFM 7B, Nova Lite 1.0, Nova Micro 1.0, Mistral Small 3, Mistral NeMo, Llama 3.1 8B Instruct, Phi 4, DeepSeek V3, DeepSeek R1-32B Qwen (Hu et al., 14 Jul 2025). The selection is intended to cover different parameter sizes, release dates, and countries of origin (Hu et al., 14 Jul 2025).

The primary evaluation uses temperature = 0 to reduce randomness, with a secondary condition at temperature = 1 to study the role of decoding variability (Hu et al., 14 Jul 2025). The analysis highlights 25 substance labels and 40 procedure labels, and further distinguishes demographic from non-demographic labels (Hu et al., 14 Jul 2025).

Several aggregate findings are reported. First, inconsistency is widespread: at temperature 0, the average inconsistency across models is over 15%, and it becomes higher at temperature 1 (Hu et al., 14 Jul 2025). Second, bias is pervasive: at temperature 0, 14 out of 15 models show significant overall bias under Bernoulli testing, and the combined sample shows strong significance with NN2-values below 0.01; the same overall pattern persists at temperature 1 (Hu et al., 14 Jul 2025). Third, imbalanced inaccuracy is also widespread: at temperature 0, 14 out of 15 models show significant unfairness in prediction error, and the pattern remains significant across the sample at temperature 1 (Hu et al., 14 Jul 2025).

The paper also reports mean weighted average error statistics across models: 64.871 MAE and 219% MAPE (Hu et al., 14 Jul 2025). The text interprets this as indicating that LLM predictions deviate by more than five years in sentence length on average and are often much harsher than human sentences (Hu et al., 14 Jul 2025).

These results are presented as evidence of severe LLM judicial unfairness. The benchmark’s design makes this claim stronger than a simple subgroup performance comparison because the reported disparities emerge under tightly controlled counterfactual variation and are evaluated with document fixed effects and clustered uncertainty estimates.

6. Interpretation of bias patterns, robustness, and practical significance

JudiFair reports that demographic labels produce the most pronounced fairness issues (Hu et al., 14 Jul 2025). At the same time, procedure labels are also highly consequential and are described as slightly more biased overall than substance factors, with judge characteristics identified among the most biased groups (Hu et al., 14 Jul 2025). The labels Compulsory_measure and Court_level are singled out as two of the most biased labels (Hu et al., 14 Jul 2025). Non-demographic factors such as court level, open trial, online broadcast, litigation duration, immediate judgment, recusal, compulsory measures also produce significant effects (Hu et al., 14 Jul 2025).

The paper further identifies a fairness–accuracy tension. Models with higher bias tend to have lower prediction error, meaning that more accurate models may replicate real-world sentencing patterns more closely while also inheriting or amplifying existing social and judicial biases (Hu et al., 14 Jul 2025). This is described as an “accuracy-equity trade-off” (Hu et al., 14 Jul 2025). The study also finds a negative correlation between inconsistency and bias count: more random outputs may conceal systematic bias, but that does not imply greater justice (Hu et al., 14 Jul 2025).

Temperature affects these trade-offs. Higher temperature increases inconsistency, but reduces the number of statistically significant bias labels and reduces unfair inaccuracy counts (Hu et al., 14 Jul 2025). The interpretation offered is that randomness can obscure measurable bias while degrading output stability (Hu et al., 14 Jul 2025).

The study reports that model size, release date, and country of origin do not show significant effects on judicial fairness (Hu et al., 14 Jul 2025). Newer models do not reliably exhibit lower bias; larger models do not consistently reduce bias or imbalanced inaccuracy and may even show more inconsistency; and there is no consistent fairness advantage associated with country of development in the reported sample (Hu et al., 14 Jul 2025).

To support robustness, the paper uses fixed-effect regressions, cluster-robust standard errors, Bernoulli/binomial tests, and robustness checks with heteroskedasticity-robust standard errors, crime-category clustered errors, full-sentence-length regressions, and excluding pre-2014 cases (Hu et al., 14 Jul 2025). These checks are reported to generally confirm the main findings (Hu et al., 14 Jul 2025). This suggests that JudiFair is intended not only as a benchmark dataset but also as an inference protocol for fairness auditing under legal-style evidentiary standards.

7. Toolkit, limitations, and relation to adjacent fairness research

The accompanying toolkit is called JustEva, with the paper also referencing a public GitHub repository (Hu et al., 14 Jul 2025). The toolkit is intended to support model API integration, flexible label expansion, and streamlined fairness evaluation, enabling researchers to reproduce the benchmark, run fairness tests, extend the label set, and evaluate new models (Hu et al., 14 Jul 2025).

The paper explicitly notes several limitations. The benchmark is based primarily on the Chinese legal system, so the resulting fairness findings may not transfer directly to other jurisdictions (Hu et al., 14 Jul 2025). Most experiments use small or mid-scale non-reasoning models, and the authors identify larger and more advanced models as a future target (Hu et al., 14 Jul 2025). They also state that, although the prompting method is effective, the study does not systematically test more advanced prompting strategies such as CoT or RAG (Hu et al., 14 Jul 2025).

JudiFair belongs to a broader research program on fairness-aware evaluation, but its domain-specific contribution is distinctive. In information retrieval, “FAIR: Fairness-Aware Information Retrieval Evaluation” integrates utility and fairness of exposure into a single metric (Gao et al., 2021). In LLM evaluation, “FairJudge: An Adaptive, Debiased, and Consistent LLM-as-a-Judge” formulates judging as a learnable policy and focuses on adaptivity, debiasing, and cross-mode consistency (Yang et al., 6 Feb 2026). JudiFair differs from both by centering judicial fairness as a legally grounded, counterfactual, and statistically audited property of sentencing behavior rather than a generic property of ranking systems or LLM evaluators (Hu et al., 14 Jul 2025). This suggests that JudiFair’s primary contribution is domain-specific rigor: it operationalizes fairness in a way that is sensitive to legal procedure, legally relevant actors, and the inferential demands of high-stakes adjudication.

In summary, JudiFair is a large-scale, legally informed benchmark for auditing LLMs as judges. Its defining elements are the 177,100 unique case facts, the 65-label / 161-value judicial fairness framework, the counterfactual prompting methodology, and the three-metric evaluation suite of inconsistency, bias, and imbalanced inaccuracy (Hu et al., 14 Jul 2025). Its empirical results argue that LLM judicial unfairness is severe, multidimensional, and not resolved by larger scale, more recent release dates, or country of origin alone (Hu et al., 14 Jul 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to JudiFair.