Can LLMs Track Their Output Length? A Dynamic Feedback Mechanism for Precise Length Regulation

Meiman Xiao, Ante Wang, Qingguo Hu, Zhongjian Miao, Huangjun Shen +3 more
1/5/2026
cs.CL

No confident code implementation found for this paper.

Abstract

Precisely controlling the length of generated text is a common requirement in real-world applications. However, despite significant advancements in following human instructions, Large Language Models (LLMs) still struggle with this task. In this work, we demonstrate that LLMs often fail to accurately measure their response lengths, leading to poor adherence to length constraints. To address this issue, we propose a novel length regulation approach that incorporates dynamic length feedback during generation, enabling adaptive adjustments to meet target lengths. Experiments on summarization and biography tasks show our training-free approach significantly improves precision in achieving target token, word, or sentence counts without compromising quality. Additionally, we demonstrate that further supervised fine-tuning allows our method to generalize effectively to broader text-generation tasks.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{xiao2026llms,
  title  = {Can LLMs Track Their Output Length? A Dynamic Feedback Mechanism for Precise Length Regulation},
  author = {Meiman Xiao and Ante Wang and Qingguo Hu and Zhongjian Miao and Huangjun Shen and Longyue Wang and Weihua Luo and Jinsong Su},
  year   = {2026},
  eprint = {2601.01768},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.01768v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.01768.svg)](https://codeofpaper.com/paper/2601.01768)

Discussion