arXiv:2605.23180cs.CLcs.LG2026-05

通过优化提示嵌入提升模型少样本推理能力,无需微调或生成新词。

Self-Improving In-Context Learning

论文配图:Self-Improving In-Context Learning
图 1 · 摘自论文原文
  • 用单次前向传播的输出概率作为自我监督信号,动态调整提示嵌入。
  • 在多数任务上优于基线模型,且与下游准确率提升显著相关。
  • 适用于分类与自由生成任务,无需微调、标签集或外部数据。

我们提出通过在测试时优化固定少样本提示的连续嵌入来改进上下文学习(ICL)。核心观察是,模型对所演示输出分配的对数概率——仅需一次前向传播即可获得,无需生成任何标记——提供了模型从示范中推断任务的可靠信号。我们将该信号形式化为有界的自监督置信度代理,并通过零阶优化最大化它,从而实现测试时校准。该方法无需微调、无需生成标记、无需预定义标签集,也无需外部数据,因此同时适用于分类和自由形式生成任务。在涵盖多种ICL任务的综合测试中,该校准方法始终匹配或超越基线模型表现,且在大多数任务上优于特定分类基线。代理改进与下游准确率提升之间存在统计显著相关性,证实该代理能有效编码用于上下文学习的优化信号。

原文摘要 · Abstract (English)

We propose to improve in-context learning (ICL) by optimizing the continuous embeddings of a fixed few-shot prompt at test time. The key observation is that the log-probabilities a model assigns to its demonstrated outputs$\unicode{x2013}$available from a single forward pass without generating any tokens$\unicode{x2013}$provide a meaningful signal for how well the model has inferred the task from its demonstrations. We formalize this signal as a bounded, self-supervised confidence proxy and maximize it via zeroth-order optimization over the prompt embeddings, yielding a test-time calibration procedure. The approach requires no finetuning, no token generation, no predefined label set, and no external data, making it equally applicable to both classification and free-form generation tasks. Across a comprehensive suite of ICL tasks, the proposed calibration consistently matches or improves upon the base model and outperforms classification-specific baselines on most tasks. The statistically significant correlation between proxy improvement and downstream accuracy gain confirms that the proposed proxy encodes a reliable optimization signal for in-context learning.

上下文学习提示优化自监督零阶优化

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