Precise Length Control in Large Language Models
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) are increasingly used in production systems, powering applications such as chatbots, summarization, and question answering. Despite their success, controlling the length of their response remains a significant challenge, particularly for tasks requiring structured outputs or specific levels of detail. In this work, we propose a method to adapt pre-trained decoder-only LLMs for precise control of response length. Our approach incorporates a secondary length-difference positional encoding (LDPE) into the input embeddings, which counts down to a user-set response termination length. Fine-tuning with LDPE allows the model to learn to terminate responses coherently at the desired length, achieving mean token errors of less than 3 tokens. We also introduce Max New Tokens++, an extension that enables flexible upper-bound length control, rather than an exact target. Experimental results on tasks such as question answering and document summarization demonstrate that our method enables precise length control without compromising response quality.
Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Builds on 4 of its 7 references that are in the map. First posted on arXiv 16 Dec 2024.
Builds on
4 of 7 references.
References · 4
- 2019BERTScore: Evaluating Text Generation with BERTcited by 5,512
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,234
- 2023The Impact of Positional Encoding on Length Generalization in Transformerscited by 327
Built on by
Citing papers per year: 2025: 9; 2026: 4.
13 papers.
Sort:
By area:
- 2025L1: Controlling How Long A Reasoning Model Thinks With Reinforcement Learningcited by 384
- 2025Scalable Chain of Thoughts via Elastic Reasoningcited by 34
- 2025Train Long, Think Short: Curriculum Learning for Efficient Reasoningcited by 20
- 2025An Empirical Study of LLM Reasoning Ability Under Strict Output Length Constraintcited by 17
- 2025Making Small Language Models Efficient Reasoners: Intervention, Supervision, Reinforcementcited by 14
- 2025ConciseRL: Conciseness-Guided Reinforcement Learning for Efficient Reasoning Modelscited by 14
- 2025On Reasoning Strength Planning in Large Reasoning Modelscited by 13
- 2025Strategic Planning and Rationalizing on Trees Make LLMs Better Debaterscited by 2
- 2025ConCISE: A Reference-Free Conciseness Evaluation Metric for LLM-Generated Answerscited by 1
- 2026LARFT: Closing the Cognition-Action Gap for Length Instruction Following in Large Language Modelscited by 1
- 2026TiCo: Time-Controllable Spoken Dialogue Modelcited by 1
- 2026Toward IIT-Inspired Consciousness in LLMs: A Reward-Based Learning Frameworkcited by 0
1 more
- 2026Length Value Model: Scalable Value Pretraining for Token-Level Length Modeling29 Apr 2026
- 2026TiCo: Time-Controllable Spoken Dialogue Model23 Mar 2026
- 2026LARFT: Closing the Cognition-Action Gap for Length Instruction Following in Large Language Models25 Feb 2026
- 2026Toward IIT-Inspired Consciousness in LLMs: A Reward-Based Learning Framework30 Jan 2026
- 2025ConCISE: A Reference-Free Conciseness Evaluation Metric for LLM-Generated Answers20 Nov 2025
- 2025Train Long, Think Short: Curriculum Learning for Efficient Reasoning12 Aug 2025
- 2025On Reasoning Strength Planning in Large Reasoning Models10 Jun 2025
- 2025ConciseRL: Conciseness-Guided Reinforcement Learning for Efficient Reasoning Models22 May 2025
- 2025Strategic Planning and Rationalizing on Trees Make LLMs Better Debaters20 May 2025
- 2025Making Small Language Models Efficient Reasoners: Intervention, Supervision, Reinforcement12 May 2025
- 2025Scalable Chain of Thoughts via Elastic Reasoning8 May 2025
- 2025An Empirical Study of LLM Reasoning Ability Under Strict Output Length Constraint19 Apr 2025
1 more
- 2025L1: Controlling How Long A Reasoning Model Thinks With Reinforcement Learningcited by 384
- 2025Scalable Chain of Thoughts via Elastic Reasoningcited by 34
- 2025Train Long, Think Short: Curriculum Learning for Efficient Reasoningcited by 20
- 2025An Empirical Study of LLM Reasoning Ability Under Strict Output Length Constraintcited by 17
- 2025Making Small Language Models Efficient Reasoners: Intervention, Supervision, Reinforcementcited by 14
- 2025ConciseRL: Conciseness-Guided Reinforcement Learning for Efficient Reasoning Modelscited by 14
- 2025On Reasoning Strength Planning in Large Reasoning Modelscited by 13
- 2025Train Long, Think Short: Curriculum Learning for Efficient Reasoning12 Aug 2025
- 2025On Reasoning Strength Planning in Large Reasoning Models10 Jun 2025
- 2025ConciseRL: Conciseness-Guided Reinforcement Learning for Efficient Reasoning Models22 May 2025
- 2025Making Small Language Models Efficient Reasoners: Intervention, Supervision, Reinforcement12 May 2025
- 2025Scalable Chain of Thoughts via Elastic Reasoning8 May 2025
- 2025An Empirical Study of LLM Reasoning Ability Under Strict Output Length Constraint19 Apr 2025
- 2025L1: Controlling How Long A Reasoning Model Thinks With Reinforcement Learning6 Mar 2025
- 2025Strategic Planning and Rationalizing on Trees Make LLMs Better Debaterscited by 2
- 2025ConCISE: A Reference-Free Conciseness Evaluation Metric for LLM-Generated Answerscited by 1
- 2026LARFT: Closing the Cognition-Action Gap for Length Instruction Following in Large Language Modelscited by 1
- 2026TiCo: Time-Controllable Spoken Dialogue Modelcited by 1
- 2026Toward IIT-Inspired Consciousness in LLMs: A Reward-Based Learning Frameworkcited by 0
- 2026Length Value Model: Scalable Value Pretraining for Token-Level Length Modelingcited by 0
- 2026Length Value Model: Scalable Value Pretraining for Token-Level Length Modeling29 Apr 2026
- 2026TiCo: Time-Controllable Spoken Dialogue Model23 Mar 2026
- 2026LARFT: Closing the Cognition-Action Gap for Length Instruction Following in Large Language Models25 Feb 2026
- 2026Toward IIT-Inspired Consciousness in LLMs: A Reward-Based Learning Framework30 Jan 2026
- 2025ConCISE: A Reference-Free Conciseness Evaluation Metric for LLM-Generated Answers20 Nov 2025
- 2025Strategic Planning and Rationalizing on Trees Make LLMs Better Debaters20 May 2025