Source-linked AI summary

Mitigating Label Length Bias in Large Language Models

Mario Sanz-Guerrero, Katharina von der Wense

arXiv:2511.14385v1cs.CL

TL;DR

LLM calibration methods often overlook biases involving multi-token labels, despite their use in practical tasks. NCC normalizes and calibrates full-label probabilities. It improves performance across datasets and models, with reported gains up to 10% F1, and extends bias mitigation to multiple-choice question answering.

  • Problem

    Existing calibration methods often overlook biases in multi-token class labels, although practical tasks frequently use full-label sequences.

    Source: §1 · p. 1, §3 · p. 3
  • Method

    NCC normalizes multi-token label probabilities by length and calibrates them against prior probabilities measured with content-free inputs.

    Source: §1 · p. 1, §4 · p. 4
  • Results

    NCC improves performance across datasets and models, with statistically significant gains of up to 10% F1, and extends bias mitigation to multiple-choice question answering.

    Source: §1 · p. 2, §9 · pp. 8–9
  • Takeaways & Limitations

    Addressing full-label biases is important for LLM performance and reliability, especially where class labels contain multiple tokens.

    Source: §9 · p. 9

    NCC requires token-level probabilities for all possible class labels, limiting its use to models that provide complete distributions, typically locally run open-source models.

    Source: Limitations · p. 9

Abstract

from arXiv · show

Large language models (LLMs) are powerful zero- and few-shot learners. However, when predicting over a set of candidate options, LLMs suffer from label biases, and existing calibration methods overlook biases arising from multi-token class labels. We tackle an issue we call label length bias, where labels of different lengths are treated inconsistently, even after standard length normalization. To mitigate it, we propose normalized contextual calibration (NCC), an effective method that normalizes and calibrates predictions at the full-label level. NCC achieves statistically significant improvements over prior approaches across multiple datasets and models, with gains of up to 10% F1. Moreover, NCC extends bias mitigation to broader tasks such as multiple-choice question answering. Our analysis shows that, when combined with in-context learning, NCC is less sensitive to few-shot example selection, requires fewer examples for competitive performance, and produces more reliable confidence estimates. These findings highlight the importance of mitigating full-label biases to improve the performance and robustness of LLM-based methods, particularly in real-world applications where class labels naturally consist of multiple tokens.

1 Introduction

LLMs can favor labels because of lexical priors and label length, while existing calibration often overlooks the joint probabilities of multi-token labels. The paper introduces normalized contextual calibration (NCC), which normalizes and calibrates full-label probabilities; it reports improvements across tasks and models.

2 Related Work

  • Prior calibration methods typically focus on single-token labels, overlooking the joint probability of full-label sequences common in practical tasks.Replacing multi-token labels with their first token can collapse distinct labels or misrepresent semantically rich classes.Source: §1 · p. 1, §2 · p. 2

1 Introduction

  • NCC addresses label length bias by calibrating full-label probabilities after normalizing each multi-token label by its length.It divides each normalized probability by the corresponding prior probability computed from content-free inputs.Source: §1 · p. 1
  • NCC outperforms prior approaches across multiple datasets and models, with statistically significant improvements of up to 10% F1.The introduction also reports effectiveness on multiple-choice question answering, reduced sensitivity to few-shot example selection and order, fewer examples for competitive performance, and more reliable confidence estimates.Source: Figure 1 · p. 1, §1 · p. 2

2 Related Work

  • Existing alternatives include domain-context calibration and free generation followed by similarity matching, but they retain single-token assumptions or prevent calibration of label probabilities.Dataset label simplification is also not universally feasible for multi-token or semantically rich labels.Source: §2 · p. 2

1 Introduction

  • The paper identifies label length bias as favoring classes based on label length rather than semantic alignment with the input.It positions this as complementary to prior work on input length bias.Source: §2 · p. 2

3 Label Length Bias in LLMs

Multiplying token probabilities can disadvantage longer labels, and simple length normalization can instead favor predictable continuations. NCC normalizes full-label probabilities and calibrates them against content-free label priors.

3 Label Length Bias in LLMs

  • Multiplying a label’s token probabilities penalizes longer labels, so shorter labels can receive higher scores regardless of semantic fit.The paper identifies this as label length bias and notes that prior calibration approaches focused on single-token labels do not address it effectively.Source: §3 · p. 3
  • Length normalization removes the raw penalty but can over-score labels with predictable later tokens, shifting predictions away from input alignment.The paper gives “Business & Finance” as an example of a sequence whose later token can be highly predictable.Source: §3 · p. 3

4 Normalized Contextual Calibration

  • NCC takes the geometric mean of token probabilities to normalize label length, balancing token contributions and enabling calibration across labels.The paper chooses this normalization over alternatives because labels can sum to 1 for calibration and support confidence-reliability analysis.Source: §4 · p. 3
  • NCC probes content-free inputs to estimate each label’s baseline probability, then calibrates input-conditioned scores so predictions account for prior label biases.The paper emphasizes that calibration is needed after normalization to address preferences for familiar or frequent label sequences.Source: §4 · p. 4

5 Experimental Setup

The experiments evaluate NCC on multi-token-label classification datasets using several LLMs, few-shot and zero-shot settings, and repeated runs. Comparisons use macro-F1 and include raw, normalized, calibrated, and generation-based baselines.

5 Experimental Setup

  • The evaluation covers eight text-classification datasets, all containing multi-token labels for the evaluated models.The dataset collection is described as widely used in prior in-context-learning studies.Source: §5 · p. 4
  • The study evaluates Llama 3.1 (8B), Mistral 7B v0.3, Qwen2.5 (7B), and GPT-J (6B), with an additional Llama 3.1 70B evaluation.The primary model set spans different model families and tokenization behavior; smaller models were used to keep computation reasonable.Source: §5 · p. 4
  • Few-shot experiments use five randomly selected examples with class balance where possible, repeat runs across five random seeds, and also test zero-shot settings.Unified prompts avoid task-specific instructions, and the seeds account for sensitivity to example selection.Source: §5 · p. 4
  • NCC is compared with raw probabilities, length-normalized probabilities, contextual calibration, and free generation followed by SBERT label matching.Performance is reported as macro-F1, and statistical significance is assessed with the Wilcoxon signed-rank test.Source: §5 · p. 4

6 Results

NCC improves few-shot results over prior methods and retains an advantage in zero-shot settings, with gains most pronounced for longer, more complex labels. Its adjustments can be unnecessary when few-shot prompts already represent the full label set.

Few-shot Results

  • NCC outperforms retrieval-based Gen+SBERT despite using randomly selected examples, indicating an advantage over retrieval similarity alone.Gen+SBERT uses similar few-shot examples, free-form label generation, and similarity matching to candidate labels.Source: §6 · p. 5
  • NCC improves performance across model sizes, including Llama 3.1 70B, and narrows the performance gap between large and small models.The authors interpret these trends as evidence that larger models still suffer from label bias and that calibration can make smaller models competitive.Source: §6 · p. 5
  • Standard contextual calibration can reach near-zero F1 on some datasets, including TREC-50, when applied to multi-token labels.Without length normalization, calibration over-penalizes short labels and overcompensates for long ones, skewing predictions toward longer labels regardless of input relevance.Source: §6 · p. 5
  • NCC underperforms raw probabilities on AG News and SST-5 when few-shot examples already represent the full label set and label semantics are simple.The authors attribute this to unnecessary adjustments; they contrast it with zero-shot settings where the label space is only implicitly defined.Source: §6 · pp. 5–6

Zero-shot Results

  • NCC maintains an advantage over baselines across most datasets and models in zero-shot evaluation.Figure 4 averages performance over datasets and marks absolute improvements over the second-best method.Source: Figure 4 · p. 5, §6 · p. 5

Few-shot Results

  • +7.6% average macro-F1 gain over the second-best method in few-shot evaluation; gains were most pronounced on longer-label datasets.Across datasets, reported gains ranged from +6.9% to +8.8%, with the largest gains on Banking77 and CLINC150.Source: §6 · p. 5, Table 2 · p. 6

7 Generalizability of NCC to Other Tasks

NCC extends calibration to multiple-choice question answering, where it achieves the highest average performance across the evaluated models. In this setting, common-token and label-length biases remain relevant, while gains are smaller than in text classification.

Multiple-choice question answering

  • NCC extends calibration beyond prior methods’ single-token-label setting to tasks with multi-token labels or options.The paper presents this extension as making bias correction possible in tasks previously inaccessible to calibration methods.Source: §7 · p. 7
  • NCC achieves the highest average performance across models on three multiple-choice QA datasets.The experiment uses a cloze prompt that obtains probabilities for independent choice completions without showing the options list.Source: §7 · p. 7
  • In multiple-choice QA, common-token and label-length biases are the primary challenges; gains are smaller than in classification, where majority and recency biases are absent.Each question has its own candidate answers, so majority and recency biases do not arise in the same way as in classification.Source: §7 · p. 7

8 Analysis

The analysis finds that NCC reduces variability across few-shot example selections, can remain competitive with far fewer examples on large-class datasets, and produces better-calibrated confidence estimates. Its performance advantage over raw probabilities narrows as the number of examples increases.

NCC Reduces Sensitivity to Example Selection

  • NCC exhibits the lowest variability in F1 across random example selections, indicating greater stability.The analysis compares standard deviation and coefficient of variation across model–dataset combinations.Source: §8 · p. 7, Table 4 · p. 8

Calibration Level vs. Few-shot Examples

  • With 2–5 examples, NCC performs almost as well as raw ICL with 50–77 examples on datasets with many classes.As k increases, the performance gap narrows and KL divergence between raw and calibrated distributions decreases.Source: §8 · pp. 7–8, Figure 6 · p. 8

NCC Enhances Reliability of Predictions

  • For Llama 3.1 (8B), NCC is the most reliable method, with reliability diagrams closest to perfect calibration and the lowest expected calibration error.The diagrams average results across datasets.Source: Figure 7 · p. 8, §8 · p. 8

9 Conclusion

NCC addresses multi-token label length bias through normalization and full-label calibration, improving performance and confidence reliability across tasks. Its use is constrained by probability-access requirements and by the need for predefined, non-generative label settings; critical applications also require human oversight and domain-specific validation.

9 Conclusion

  • NCC improves performance across diverse datasets and models, extends bias mitigation to multiple-choice question answering, and produces more reliable confidence estimates.It also reduces sensitivity to few-shot example selection and requires fewer examples for competitive performance.Source: §9 · pp. 8–9

Limitations

  • NCC requires token-level probabilities for every possible class label, limiting use to models that expose complete distributions; top-20-only APIs can make it infeasible.This limitation applies to tasks requiring complete probability distributions.Source: Limitations · p. 9
  • NCC is not suitable for open-ended tasks with unrestricted output spaces because it calibrates prior biases across a fixed label set.Source: Limitations · p. 9
  • NCC is not designed for full-sentence generation, where calibration may penalize fluent responses rather than correct systematic biases.Source: Limitations · p. 9

Ethics Statement

  • The authors caution against relying solely on LLMs in critical settings without human oversight and domain-specific validation.Source: Ethics Statement · p. 9

A Prompt Formats

The appendix specifies unified prompts for classification and question answering, then illustrates how raw probabilities, length normalization, contextual calibration, and NCC handle a toy multi-token-label case. The example shows why length normalization alone and calibration alone can each leave a misleading prediction.

A Prompt Formats

  • Classification prompts end with “Label:” and QA prompts with “Answer:”, where candidate probabilities are extracted; first label tokens receive a leading space for tokenization alignment.The prompt formats are shown in Figures 8 and 9.Source: A Prompt Formats · p. 11, Figure 8 · p. 11, Figure 9 · p. 12

B Illustration of the Importance of NCC

C Dataset Details

The evaluation includes eight text-classification datasets and three multiple-choice QA datasets spanning varied domains and label complexities. For 20 Newsgroups, the authors remap non-descriptive original categories to more representative labels for LLM use.

C Dataset Details

  • The evaluation covers eight text-classification datasets and three multiple-choice QA datasets, with dataset characteristics including class count, balance, test-set size, and example labels.Table 6 summarizes these characteristics.Source: C Dataset Details · p. 12, Table 6 · p. 13

C.1 20 Newsgroups Dataset

  • 20 Newsgroups’ original non-descriptive labels are remapped to more representative descriptions because LLMs use label wording during inference.Table 7 gives the mapping from original categories to the labels used with LLMs.Source: §C.1 · p. 13, Table 7 · p. 13

D Detailed Results

The detailed results compare NCC across model sizes, zero-shot settings, and additional calibration methods. NCC narrows the performance gap between Llama 3.1 sizes, while comparisons on text classification show it performs best where multi-token label bias is strong.

D.1 Model Size Comparison

  • A 1.6% average-F1 gap separates Llama 3.1 (8B) and (70B) with NCC, versus 4.3% with standard raw probabilities.Figure 10 reports average performance and relative improvement from 8B to 70B across methods; NCC brings the smaller model closest to the larger one.Source: §D.1 · p. 13, Figure 10 · p. 14

D.2 Zero-Shot Results

  • Table 8 reports macro-F1 for all methods on each dataset and model in the zero-shot setting, with no standard deviations because performance is consistent across runs.Source: §D.2 · p. 13, Table 8 · p. 14

D.3 Comparison with Other Calibration Methods

  • The broader comparison applies normalized variants of DC, GC, and BC and is limited to Llama 3.1 (8B) on text-classification datasets.The methods compared are DC, GC, and BC and their normalized variants NDC, NGC, and NBC.Source: §D.3 · pp. 14–15, Table 9 · p. 15
  • For standard calibration, DC, GC, and BC generally improve over CC when label-length bias is limited, but NCC performs best when multi-token label bias is strong.With length normalization, NDC, NGC, and NBC can improve further over NCC, but the gains are smaller than the gaps between NCC and CC/DC/GC/BC.Source: §D.3 · p. 15

E Reliability of the LLMs Confidences

The analyses show that NCC mitigates biases across label lengths and works consistently with original multi-token labels. They also examine the reliability of confidence scores and whether label simplification is needed.

E Reliability of the LLMs Confidences

F Multi-Token vs. Single-Token Labels

  • Single-token remapping is not always feasible for semantically rich labels, such as nuanced Banking77 categories that are hard to distinguish with one-token substitutes.Source: F Multi-Token vs. Single-Token Labels · p. 16
  • NCC performs consistently across original multi-token and simplified single-token labels, indicating that retaining original labels does not hinder performance and avoids potential semantic loss.Figure 12 compares raw probabilities, length normalization, and NCC for both label types.Source: Figure 12 · p. 17, F Multi-Token vs. Single-Token Labels · p. 17
Loading 2511.14385v1…