paper-with-me

Papers

Precise Length Control in Large Language Models

2024-12-16 · Bradley Butcher, Michael O'Keefe, James Titchener

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.

📄 PDF Abstract BibTeX arXiv:2412.11937

Code (0)

등록된 구현이 없습니다.

Tasks

DecoderDocument SummarizationQuestion Answering

Similar Papers 제목 키워드 기반

Zero-Shot Strategies for Length-Controllable Summarization

2024-12-31 · Fabian Retkowski, Alexander Waibel

Large language models (LLMs) struggle with precise length control, particularly in zero-shot settings. We conduct a comprehensive study evaluating LLMs' length control capabilities across multiple measures and propose pr…

Text Generation

LARFT: Closing the Cognition-Action Gap for Length Instruction Following in Large Language Models

2026-02-25 · Wei Zhang, Lintong Du, Yuanhe Zhang, Zhenhong Zhou 외 arxiv

Despite the strong performance of Large Language Models (LLMs) on complex instruction-following tasks, precise control of output length remains a persistent challenge. Existing methods primarily attempt to enforce length…

Reinforcement LearningInstruction Following

Plan-and-Write: Structure-Guided Length Control for LLMs without Model Retraining

2025-11-03 · Adewale Akinfaderin, Shreyas Subramanian, Akarsha Sehwag arxiv

Length control in Large Language Models (LLMs) is a crucial but under-addressed challenge, with applications ranging from voice interfaces requiring concise responses to research summaries needing comprehensive outputs. …

Document SummarizationPrompt Engineering

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

2026-01-05 · Meiman Xiao, Ante Wang, Qingguo Hu, Zhongjian Miao 외 arxiv

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 struggl…

Ruler: A Model-Agnostic Method to Control Generated Length for Large Language Models

2024-09-27 · Jiaming Li, Lei Zhang, Yunshui Li, Ziqiang Liu 외

The instruction-following ability of large language models enables humans to interact with AI agents in a natural way. However, when required to generate responses of a specific length, large language models often strugg…

Instruction Following