Length Controlled Generation for Black-box LLMs
Yuxuan Gu, Wenjie Wang, Xiaocheng Feng, Weihong Zhong, Kun Zhu, Lei, Huang, Tat-Seng Chua, Bing Qin

TL;DR
This paper introduces an iterative sampling framework combining Metropolis-Hastings and importance sampling to control text length in black-box LLMs, achieving high success rates without fine-tuning.
Contribution
A novel length control method for LLMs that does not require parameter fine-tuning, using an efficient iterative sampling approach.
Findings
Achieves nearly 100% length control success on Llama3.1.
Works effectively for summarization and instruction tasks.
Minimal additional computational overhead.
Abstract
Large language models (LLMs) have demonstrated impressive instruction following capabilities, while still struggling to accurately manage the length of the generated text, which is a fundamental requirement in many real-world applications. Existing length control methods involve fine-tuning the parameters of LLMs, which is inefficient and suboptimal for practical use. In this paper, we propose a novel iterative sampling framework for text length control, integrating the Metropolis-Hastings algorithm with an importance sampling acceleration strategy. This framework efficiently and reliably regulates LLMs to generate length-constrained text without modifying the underlying parameters, thereby preserving the original capabilities of LLMs. Experimental results demonstrate that our framework achieves almost 100\% success rates of length control on Llama3.1 for tasks such as length-controlled…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
Taxonomy
TopicsSemiconductor Lasers and Optical Devices · Advancements in Photolithography Techniques · Iterative Learning Control Systems
