arXiv:2504.21020cs.CLcs.AI2025-04中稿 · publication in the…被引 5

改进对比搜索算法,让大模型生成更连贯有创意的长文本

Context-Enhanced Contrastive Search for Improved LLM Text Generation

  • 引入上下文重要性动态加权和多层级搜索机制
  • 在多个指标上优于传统对比搜索,显著提升文本连贯性和相关性
  • 适合法律文书、客服对话等需要高质量长文本的场景

近年来,大语言模型在自然语言处理领域取得显著进展。然而,在生成兼具连贯性、多样性和相关性的高质量文本方面仍具挑战,尤其在长文本生成任务中,传统解码方法如束搜索和top-k采样常出现重复或不连贯问题。为此,本文提出一种名为上下文增强对比搜索(CECS)的新算法,通过引入动态上下文重要性加权、多层级对比搜索及自适应温度控制,优化流畅性、创造性与精确性的平衡。在标准评估指标(如BLEU、ROUGE、语义相似度)上的实验表明,CECS在生成文本的连贯性和相关性方面均显著优于现有对比搜索方法。该算法可广泛应用于法律文件起草、客服聊天机器人和内容营销等实际场景。

原文摘要 · Abstract (English)

Recently, Large Language Models (LLMs) have demonstrated remarkable advancements in Natural Language Processing (NLP). However, generating high-quality text that balances coherence, diversity, and relevance remains challenging. Traditional decoding methods, such as bean search and top-k sampling, often struggle with either repetitive or incoherent outputs, particularly in tasks that require long-form text generation. To address these limitations, the paper proposes a novel enhancement of the well-known Contrastive Search algorithm, Context-Enhanced Contrastive Search (CECS) with contextual calibration. The proposed scheme introduces several novelties including dynamic contextual importance weighting, multi-level Contrastive Search, and adaptive temperature control, to optimize the balance between fluency, creativity, and precision. The performance of CECS is evaluated using several standard metrics such as BLEU, ROUGE, and semantic similarity. Experimental results demonstrate significant improvements in both coherence and relevance of the generated texts by CECS outperforming the existing Contrastive Search techniques. The proposed algorithm has several potential applications in the real world including legal document drafting, customer service chatbots, and content marketing.

大模型生成文本质量解码优化

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