Length Representations in Large Language Models
Not on the map. Why?
Abstract (arXiv)
Large language models (LLMs) have shown remarkable capabilities across various tasks, that are learned from massive amounts of text-based data. Although LLMs can control output sequence length, particularly in instruction-based settings, the internal mechanisms behind this control have been unexplored yet. In this study, we provide empirical evidence on how output sequence length information is encoded within the internal representations in LLMs. In particular, our findings show that multi-head attention mechanisms are critical in determining output sequence length, which can be adjusted in a disentangled manner. By scaling specific hidden units within the model, we can control the output sequence length without losing the informativeness of the generated text, thereby indicating that length information is partially disentangled from semantic information. Moreover, some hidden units become increasingly active as prompts become more length-specific, thus reflecting the model's internal awareness of this attribute. Our findings suggest that LLMs have learned robust and adaptable internal mechanisms for controlling output length without any external control.
Key facts. Cited by 1 paper in the map (data through 14 Oct 2026). Builds on 30 of its 56 references that are in the map. First posted on arXiv 27 Jul 2025.
Builds on
30 of 56 references.
References · 30
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2022Training language models to follow instructions with human feedbackcited by 15,971
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2024Qwen2.5 Technical Reportcited by 4,942
- 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
- 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
- 2023Sparks of Artificial General Intelligence: Early experiments with GPT-4cited by 2,592
- 2016Google's Neural Machine Translation System: Bridging the Gap between Human and Machine Translationcited by 1,475
- 2019BERT Rediscovers the Classical NLP Pipelinecited by 1,059
- 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 876
- 2020A Primer in BERTology: What we know about how BERT workscited by 815
- 2016A Corpus and Evaluation Framework for Deeper Understanding of Commonsense Storiescited by 417
18 more
- 2023Towards Making the Most of ChatGPT for Machine Translationcited by 138
- 2023A Systematic Study and Comprehensive Evaluation of ChatGPT on Benchmark Datasetscited by 123
- 2018Correcting Length Bias in Neural Machine Translationcited by 120
- 2022Teaching Algorithmic Reasoning via In-context Learningcited by 112
- 2021Neuron-level Interpretation of Deep NLP Models: A Surveycited by 81
- 2023Loose lips sink ships: Mitigating Length Bias in Reinforcement Learning from Human Feedbackcited by 78
- 2016Controlling Output Length in Neural Encoder-Decoderscited by 75
- 2022Complementary Explanations for Effective In-Context Learningcited by 71
- 2023Empirical Study of Zero-Shot NER with ChatGPTcited by 60
- 2019Positional Encoding to Control Output Sequence Lengthcited by 56
- 2024From Tokens to Words: On the Inner Lexicon of LLMscited by 48
- 2020Asking Questions the Human Way: Scalable Question-Answer Generation from Text Corpuscited by 40
- 2020Controlling Dialogue Generation with Semantic Exemplarscited by 25
- 2020Discrete Optimization for Unsupervised Sentence Summarization with Word-Level Extractioncited by 23
- 2024Prompt-Based Length Controlled Generation with Multiple Control Typescited by 19
- 2022Efficient Unsupervised Sentence Compression by Fine-tuning Transformers with Reinforcement Learningcited by 18
- 2023InstructPTS: Instruction-Tuning LLMs for Product Title Summarizationcited by 9
- 2024PositionID: LLMs can Control Lengths, Copy and Paste with Explicit Positional Awarenesscited by 9
Built on by
Citing papers per year: 2026: 1.
1 paper.
Similar, not cited
Close in wording, no citation either way
- 2024Beyond the Limits: A Survey of Techniques to Extend the Context Length in Large Language Models
- 2025Plan-and-Write: Structure-Guided Length Control for LLMs without Model Retraining
- 2025LIFEBench: Evaluating Length Instruction Following in Large Language Models
- 2025Beyond Single-Task: Robust Multi-Task Length Generalization for LLMs
- 2025Long-Short Alignment for Effective Long-Context Modeling in LLMs
- 2024Exploring Concept Depth: How Large Language Models Acquire Knowledge and Concept at Different Layers?
- 2026How Much is Left? LLMs Linearly Encode Their Remaining Output Length
- 2024Same Task, More Tokens: the Impact of Input Length on the Reasoning Performance of Large Language Models