arXiv:2604.13552cs.CLcs.AI2026-04ACL

让冻结的LLM通过自我反思优化推理,无需训练即可应对分布外场景。

Training-Free Test-Time Contrastive Learning for Large Language Models

论文配图:Training-Free Test-Time Contrastive Learning for Large Language Models
图 1 · 摘自论文原文
  • 利用多智能体角色扮演生成多样化推理路径,实现动态探索。
  • 通过对比优劣路径提炼出可执行的文本规则,提升推理鲁棒性。
  • 适合需要快速适应新任务且无法微调的部署场景。

大型语言模型(LLM)虽具强大推理能力,但在分布外场景下性能常下降。现有测试时自适应(TTA)方法依赖梯度更新,需白盒访问且开销大;而无训练替代方案或为静态,或依赖外部指导。本文提出训练自由的测试时对比学习(TF-TTCL),使冻结的LLM可通过自身推理经验在线优化。该框架采用动态“探索-反思-引导”循环,包含三模块:1)语义查询增强通过多智能体角色扮演生成不同推理轨迹;2)对比经验蒸馏捕捉优劣轨迹间的语义差异,提炼为显式文本规则;3)上下文规则检索在推理时激活存储规则,动态引导模型避开错误模式。在闭合式推理与开放式评估任务中,TF-TTCL持续优于强零样本基线及代表性TTA方法。代码已开源:https://github.com/KevinSCUTer/TF-TTCL。

原文摘要 · Abstract (English)

Large language models (LLMs) demonstrate strong reasoning capabilities, but their performance often degrades under distribution shift. Existing test-time adaptation (TTA) methods rely on gradient-based updates that require white-box access and need substantial overhead, while training-free alternatives are either static or depend on external guidance. In this paper, we propose Training-Free Test-Time Contrastive Learning TF-TTCL, a training-free adaptation framework that enables a frozen LLM to improve online by distilling supervision from its own inference experiences. Specifically, TF-TTCL implements a dynamic "Explore-Reflect-Steer" loop through three core modules: 1) Semantic Query Augmentation first diversifies problem views via multi-agent role-playing to generate different reasoning trajectories; 2) Contrastive Experience Distillation then captures the semantic gap between superior and inferior trajectories, distilling them into explicit textual rules; and 3) Contextual Rule Retrieval finally activates these stored rules during inference to dynamically steer the frozen LLM toward robust reasoning patterns while avoiding observed errors. Extensive experiments on closed-ended reasoning tasks and open-ended evaluation tasks demonstrate that TF-TTCL consistently outperforms strong zero-shot baselines and representative TTA methods under online evaluation. Code is available at https://github.com/KevinSCUTer/TF-TTCL.

大模型自适应推理优化

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