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 input text length, 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
下载
关闭预览

相关内容

【TPAMI2024】增强视频-语言表示的结构时空对齐方法
专知会员服务
24+阅读 · 2024年6月30日
AAAI 2022 | ProtGNN:自解释图神经网络
专知
10+阅读 · 2022年2月28日
【NeurIPS2019】图变换网络:Graph Transformer Network
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
Arxiv
0+阅读 · 1月6日
VIP会员
相关VIP内容
相关基金
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
46+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
国家自然科学基金
6+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员