In-Context Learning (and Unlearning) of Length Biases

Stephanie Schoch, Yangfeng Ji
2/10/2025
cs.CL

No confident code implementation found for this paper.

Abstract

Large language models have demonstrated strong capabilities to learn in-context, where exemplar input-output pairings are appended to the prompt for demonstration. However, existing work has demonstrated the ability of models to learn lexical and label biases in-context, which negatively impacts both performance and robustness of models. The impact of other statistical data biases remains under-explored, which this work aims to address. We specifically investigate the impact of length biases on in-context learning. We demonstrate that models do learn length biases in the context window for their predictions, and further empirically analyze the factors that modulate the level of bias exhibited by the model. In addition, we show that learning length information in-context can be used to counter the length bias that has been encoded in models (e.g., via fine-tuning). This reveals the power of in-context learning in debiasing model prediction behaviors without the need for costly parameter updates.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{schoch2025incontext,
  title  = {In-Context Learning (and Unlearning) of Length Biases},
  author = {Stephanie Schoch and Yangfeng Ji},
  year   = {2025},
  eprint = {2502.06653},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.06653v1}
}

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/2502.06653.svg)](https://codeofpaper.com/paper/2502.06653)

Discussion