Length Representations in Large Language Models

Sangjun Moon, Dasom Choi, Jingun Kwon, Hidetaka Kamigaito, Manabu Okumura


Abstract
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.
Anthology ID:
2025.findings-emnlp.1078
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2025
Month:
November
Year:
2025
Address:
Suzhou, China
Editors:
Christos Christodoulopoulos, Tanmoy Chakraborty, Carolyn Rose, Violet Peng
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
19775–19793
Language:
URL:
https://preview.aclanthology.org/ingest-luhme/2025.findings-emnlp.1078/
DOI:
10.18653/v1/2025.findings-emnlp.1078
Bibkey:
Cite (ACL):
Sangjun Moon, Dasom Choi, Jingun Kwon, Hidetaka Kamigaito, and Manabu Okumura. 2025. Length Representations in Large Language Models. In Findings of the Association for Computational Linguistics: EMNLP 2025, pages 19775–19793, Suzhou, China. Association for Computational Linguistics.
Cite (Informal):
Length Representations in Large Language Models (Moon et al., Findings 2025)
Copy Citation:
PDF:
https://preview.aclanthology.org/ingest-luhme/2025.findings-emnlp.1078.pdf
Checklist:
 2025.findings-emnlp.1078.checklist.pdf