arXiv:2511.06682cs.CLcs.AI2025-11AAAI

用自然语言模拟注意力机制,多候选回复协同优化输出

Textual Self-attention Network: Test-Time Preference Optimization through Textual Gradient-based Attention

  • 用文本形式构建键值对,让LLM动态加权多个候选回复
  • 仅需3轮测试时迭代,超越SFT模型和现有最先进方法
  • 无需更新参数,适合快速适配不同偏好场景

大型语言模型虽具强大泛化能力,但对齐人类偏好通常需昂贵的监督微调。现有测试时方法依赖文本反馈修正单一候选输出,缺乏系统性机制来分析、权衡并融合多个优质候选的优势。不同回复可能在清晰度、事实准确性和语气上各有所长,综合其最优特征可生成更优结果。本文提出文本自注意力网络(TSAN),一种无需参数更新的测试时偏好优化新范式。TSAN完全以自然语言模拟自注意力:将多个候选回复格式化为文本键值对,通过基于LLM的注意力模块评估其相关性,并在学习到的文本注意力引导下合成新响应。整个过程在文本梯度空间中运行,支持迭代且可解释的优化。实验证明,仅用3轮测试时迭代,基于基础SFT模型的TSAN即超越Llama-3.1-70B-Instruct等监督模型,显著优于当前最先进的测试时对齐方法,有效利用了多候选解。

原文摘要 · Abstract (English)

Large Language Models (LLMs) have demonstrated remarkable generalization capabilities, but aligning their outputs with human preferences typically requires expensive supervised fine-tuning. Recent test-time methods leverage textual feedback to overcome this, but they often critique and revise a single candidate response, lacking a principled mechanism to systematically analyze, weigh, and synthesize the strengths of multiple promising candidates. Such a mechanism is crucial because different responses may excel in distinct aspects (e.g., clarity, factual accuracy, or tone), and combining their best elements may produce a far superior outcome. This paper proposes the Textual Self-Attention Network (TSAN), a new paradigm for test-time preference optimization that requires no parameter updates. TSAN emulates self-attention entirely in natural language to overcome this gap: it analyzes multiple candidates by formatting them into textual keys and values, weighs their relevance using an LLM-based attention module, and synthesizes their strengths into a new, preference-aligned response under the guidance of the learned textual attention. This entire process operates in a textual gradient space, enabling iterative and interpretable optimization. Empirical evaluations demonstrate that with just three test-time iterations on a base SFT model, TSAN outperforms supervised models like Llama-3.1-70B-Instruct and surpasses the current state-of-the-art test-time alignment method by effectively leveraging multiple candidate solutions.

偏好优化测试时自注意力多候选融合

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