Honglin Li
2026
DcLM: Output Length Control of Large Language Models via Dynamic Length Markers
Zhe Chen | Jiaao Yu | Honglin Li
Findings of the Association for Computational Linguistics: ACL 2026
Zhe Chen | Jiaao Yu | Honglin Li
Findings of the Association for Computational Linguistics: ACL 2026
Length-controllable text generation (LCTG) is essential for tasks like text summarization and report generation. However, large language models (LLMs) have limited awareness of output length, so precise control over the length of generated text remains a significant challenge. Most existing methods focus on prompt-based frameworks, position encoding, and reinforcement learning for model training. These approaches may affect semantic quality, and struggle to maintain consistent length control across different models and tasks. In this paper, we propose DcLM, a model-agnostic approach that introduces dynamic length markers to guide length-controllable outputs. During training, the model leverages these markers as in-context information, without learning to generate them. At inference time, an external word counter and injected length information guide the model to produce outputs of accurate lengths. We evaluate our method across multiple datasets, and the experimental results demonstrate that DcLM significantly reduces length deviation, showcasing its robust generalization ability across various length scales and tasks.