Length Controlled Generation for Black-box LLMs
Fuente:
arXiv
Salvato in:
| Autori principali: | , , , , , , , |
|---|---|
| Natura: | Preprint |
| Pubblicazione: |
2024
|
| Soggetti: | |
| Accesso online: | |
| Tags: |
Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
|
| _version_ | 1866913618710233088 |
|---|---|
| author | Gu, Yuxuan Wang, Wenjie Feng, Xiaocheng Zhong, Weihong Zhu, Kun Huang, Lei Chua, Tat-Seng Qin, Bing |
| author_facet | Gu, Yuxuan Wang, Wenjie Feng, Xiaocheng Zhong, Weihong Zhu, Kun Huang, Lei Chua, Tat-Seng Qin, Bing |
| contents | 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 abstractive summarization and length-constrained instruction following, with minimal additional computational overhead. This also highlights the significant potential of our method for precise length control across a broader range of applications, without compromising the versatility of LLMs. |
| format | Preprint |
| id |
arxiv_https___arxiv_org_abs_2412_14656 |
| institution | arXiv |
| publishDate | 2024 |
| record_format | arxiv |
| spellingShingle | Length Controlled Generation for Black-box LLMs Gu, Yuxuan Wang, Wenjie Feng, Xiaocheng Zhong, Weihong Zhu, Kun Huang, Lei Chua, Tat-Seng Qin, Bing Computation and Language 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 abstractive summarization and length-constrained instruction following, with minimal additional computational overhead. This also highlights the significant potential of our method for precise length control across a broader range of applications, without compromising the versatility of LLMs. |
| title | Length Controlled Generation for Black-box LLMs |
| topic | Computation and Language |
| url | https://arxiv.org/abs/2412.14656 |