arXiv:2506.05017cs.CLcs.LG2025-06被引 4

通过加权结束符标记,简单控制摘要长度且不损失质量

Controlling Summarization Length Through EOS Token Weighting

  • 在交叉熵损失中提高结束符预测权重,实现长度控制
  • 在多种模型上验证,长度可控且摘要质量基本不变
  • 无需修改模型结构,适配各类生成任务和推理方法

在文本生成任务(如摘要生成)中,控制生成文本长度至关重要。现有方法常需复杂模型修改,限制了与预训练模型的兼容性。本文提出一种简单方法:在交叉熵损失计算中提高正确预测结束符(EOS)的重要性,从而控制生成摘要的长度。该方法与模型架构和解码算法无关,且可与其他推理阶段的长度控制技术并行使用。我们在编码器-解码器模型和现代GPT风格大模型上进行了测试,结果表明该方法能有效控制生成长度,通常不影响摘要质量。

原文摘要 · Abstract (English)

Controlling the length of generated text can be crucial in various text-generation tasks, including summarization. Existing methods often require complex model alterations, limiting compatibility with pre-trained models. We address these limitations by developing a simple approach for controlling the length of automatic text summaries by increasing the importance of correctly predicting the EOS token in the cross-entropy loss computation. The proposed methodology is agnostic to architecture and decoding algorithms and orthogonal to other inference-time techniques to control the generation length. We tested it with encoder-decoder and modern GPT-style LLMs, and show that this method can control generation length, often without affecting the quality of the summary.

摘要生成长度控制语言模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。