Search papers, labs, and topics across Lattice.
This study investigates how large language models (LLMs) encode their remaining output length by training minimal-capacity linear probes on the hidden states of three 7-8B parameter models across various datasets. The findings reveal that the total response length can be linearly decoded from the last hidden state of the prompt, suggesting that LLMs possess an internal estimate of how much output remains, which is evidenced by the probe's behavior during retractions. This research highlights the models' ability to maintain a plan-like representation of output length, providing insights into their generation mechanisms beyond mere token counting.
LLMs possess an internal estimate of their remaining output length, revealing a surprising layer of planning in their generation process.
Large language models generate one token at a time, yet their responses show remarkably consistent length structure: step-by-step solutions converge in predictable token counts, retrievals stop after a few sentences, retractions extend responses by measurable amounts. We ask whether the model carries an internal estimate of how much response remains. Training minimal-capacity linear probes on frozen hidden states of three open-weight 7-8B models across seven completion-style datasets, we find three converging pieces of evidence. First, total response length is linearly decodable from the prompt's last hidden state alone, before any output is emitted. Second, probe directions trained on natural-language datasets transfer broadly, including to controlled synthetic completions never seen in training, outperforming a statistical baseline; the converse direction generally fails, and this asymmetry is itself informative. Third, on curated high-loss completions, the probe's per-position estimate shifts upward at the moment the model retracts and restarts a partial solution, a directional behavior no position-only predictor can reproduce (qualitative, not aggregate). We frame this as approximate estimation of remaining generation length, distinct from exact-counting impossibility results for transformers, and interpret it as evidence that LLMs maintain a plan-like internal representation of output length (decodable, not necessarily used causally).