Open-weight models encode output length in hidden states before generation
Source published ·Modelwire updated
Original coverage: arXiv cs.LG ↗·How Modelwire adds context

The development
Researchers have discovered that open-weight language models encode predictions about their own output length directly in hidden states, detectable before generation begins. By training lightweight linear probes on frozen representations from 7-8B parameter models across multiple datasets, the team found response length is linearly decodable from the prompt's final hidden state alone. Critically, probe directions learned on natural datasets generalize to unseen synthetic tasks, suggesting models develop a robust internal mechanism for length planning. This finding illuminates how LLMs structure generation and opens new angles for mechanistic interpretability work, with implications for understanding model internals and potentially improving length control during inference.
Modelwire’s AI-generated summary of coverage from arXiv cs.LG.
Modelwire analysis
ExplainerOur AI-generated reading of the wider context and the next developments to watch.
The more provocative implication buried in the finding is that length planning appears to be a pre-generation commitment, not an emergent property of token-by-token decoding. That reframes a long-standing assumption: that LLMs have no meaningful 'plan' before they start writing.
This sits squarely in the mechanistic interpretability thread Modelwire has been tracking. The gradient-based inversion paper from July 1st showed that hidden states carry recoverable input information; this new work extends the logic in the opposite direction, showing hidden states also carry recoverable output intentions. Similarly, the Logit-Contribution Scoring paper (also July 1st) demonstrated that specific attention heads perform computations invisible to surface-level analysis. Together these papers are building a picture of transformer internals as far more structured and pre-loaded than the 'next token prediction' framing suggests. The broader survey 'Understanding Large Language Models' from July 1st provides the conceptual scaffolding for why this matters: distinguishing architectural artifacts from genuine planning-like behavior is exactly the kind of question that survey flagged as unresolved.
The critical test is whether these linear probe directions hold in instruction-tuned or RLHF-trained models at larger scales (30B+), since those models face explicit length-shaping pressure during training. If the linearity breaks down there, the mechanism may be a base-model artifact rather than a general property of transformer generation.
This interpretation is generated from the summary above and the archive coverage cited below. Our methodology · Report an error
Coverage behind this analysis
These archive entries ground the connection in our analysis. They are ordered by source publication date, with links to our coverage and the original sources.
·arXiv cs.CL
Recovering Input Text from Hidden States: Study of Gradient-Based Inversion of Decoder-Only Language Models
Researchers have developed a gradient-based method to reconstruct input token sequences from decoder-only language model hidden states, treating inversion as continuous embedding-space optimization rather than discrete token recovery. The work exposes internal model signals including rank trajectories and per-position loss curves, offering new insights into how information flows through transformer architectures. This advances understanding of…
MentionsarXiv
How this coverage is produced
Modelwire uses AI to generate summaries and context from source headlines, snippets, and selected archive coverage. Automated checks do not verify every claim, and items are not routinely reviewed by a person before publication. Zacaria Solis operates the site. Read the linked source for the full evidence and report errors through our corrections process.
Modelwire summarizes, we don’t republish. arXiv cs.LG originally reported this story as “How Much is Left? LLMs Linearly Encode Their Remaining Output Length”. The full content lives on arxiv.org. If you’re a publisher and want a different summarization policy for your work, see our takedown page.