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 struggle with this task. In this work, we demonstrate that LLMs often fail to accurately measure their response lengths, leading to poor adherence to length constraints. To address this issue, we propose a novel length regulation approach that incorporates dynamic length feedback during generation, enabling adaptive adjustments to meet target lengths. Experiments on summarization and biography tasks show our training-free approach significantly improves precision in achieving target token, word, or sentence counts without compromising quality. Additionally, we demonstrate that further supervised fine-tuning allows our method to generalize effectively to broader text-generation tasks.


翻译:精确控制生成文本的长度是实际应用中的常见需求。然而,尽管在遵循人类指令方面取得了显著进展,大型语言模型(LLMs)在此任务上仍存在困难。在本研究中,我们证明LLMs常常无法准确测量其响应长度,导致对长度约束的遵循效果不佳。为解决此问题,我们提出了一种新颖的长度调控方法,该方法在生成过程中引入动态长度反馈,从而能够进行自适应调整以满足目标长度。在摘要和传记任务上的实验表明,我们这种无需训练的方法在实现目标标记数、词数或句子数方面显著提高了精度,且不损害生成质量。此外,我们证明进一步的监督微调可以使我们的方法有效地泛化到更广泛的文本生成任务中。

0
下载
关闭预览

相关内容

大语言模型与小语言模型协同机制综述
专知会员服务
38+阅读 · 2025年5月15日
Transformer-XL:释放注意力模型的潜力
谷歌开发者
31+阅读 · 2019年2月19日
自然语言处理中的语言模型预训练方法
PaperWeekly
14+阅读 · 2018年10月21日
干货|当深度学习遇见自动文本摘要,seq2seq+attention
机器学习算法与Python学习
10+阅读 · 2018年5月28日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关VIP内容
大语言模型与小语言模型协同机制综述
专知会员服务
38+阅读 · 2025年5月15日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员