🤖 AI Summary
This paper identifies a significant “length bias” in large language models (LLMs): during in-context learning, LLMs implicitly learn and rely on statistical regularities in the lengths of input/output examples, undermining their generalization and robustness. To address this, the authors first systematically establish the learnability and reversibility of this bias, then propose a novel parameter-free “context debiasing” paradigm. At inference time, it actively corrects the model’s predictive distribution using carefully constructed length-balanced or counterfactual-length demonstrations—without any parameter updates. The method operates within standard in-context learning, integrating controllable prompt engineering, bias probing, and counterfactual intervention. Empirical evaluation across mainstream LLMs reveals pervasive length bias; the proposed approach effectively equalizes predicted length distributions and improves out-of-distribution generalization and robustness by up to 12.4%.
📝 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.