arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.26350cs.LGcs.AI
收藏

当正确示例有害时:重新思考示例在上下文学习中的作用

When Correct Demonstrations Hurt: Rethinking the Role of Exemplars in In-Context Learning

Texas A&M University(德克萨斯理工大学)

Chenghao Qiu, Chunli Peng, Yufeng Yang, Kuan-Hao Huang, Yi Zhou

AI总结:

本文通过引入任务保持扰动,揭示了正确示例不一定有益甚至可能降低上下文学习准确性的反直觉现象,并提出了上下文证据转移的概念来解释正确性与效用之间的差距。

摘要:

上下文学习(ICL)通常被直觉所驱动,即示例之所以有帮助是因为它们提供了正确的输入-输出对。然而,我们揭示了一个反直觉的现象:正确性并不能保证示例的效用,一些正确的示例甚至可能降低ICL的准确性。为了研究这种正确性-效用差距,我们引入了任务保持扰动,其中仅改变示例输入,而该示例仍然是同一任务的正确实例。具体来说,每个扰动后的示例被赋予由任务映射诱导的目标。该框架涵盖了标签更新扰动(其中任务相关语义发生变化且目标被重新计算)和更严格的目标保持扰动(其中原始目标仍然有效)。我们将由此产生的失败模式形式化为上下文证据转移:任务保持扰动可以改变模型用于上下文推理的有效证据混合,从而将示例正确性与示例效用分离。在情感分类、逻辑推理和数学应用题中,我们发现任务保持扰动的示例会显著降低ICL性能,尤其是对于较小的模型、较难的任务和较高的扰动比例。我们的结果表明,鲁棒的ICL不仅需要评估示例是否正确,还需要评估它们如何影响上下文推理。代码可在 https://github.com/Chenghao-Qiu/Task-Preserving-ICL 获取。

英文摘要:

In-context learning (ICL) is often motivated by the intuition that demonstrations help because they provide correct input-output examples. However, we reveal a counterintuitive phenomenon: correctness does not guarantee exemplar utility, and some correct demonstrations can even reduce ICL accuracy. To study this correctness-utility gap, we introduce task-preserving perturbations, where only the exemplar input is changed, while the example remains a correct instance of the same task. Concretely, each perturbed exemplar is assigned the target induced by the task mapping. This framework covers both label-updating perturbations, where task-relevant semantics change and targets are recomputed, and stricter target-preserving perturbations, where the original target remains valid. We formalize the resulting failure mode as contextual evidence shift: task-preserving perturbations can change the effective mixture of evidence used by the model for contextual inference, thereby separating exemplar correctness from exemplar utility. Across sentiment classification, logical reasoning, and math word problems, we find that task-preserving perturbed demonstrations can substantially degrade ICL performance, especially for smaller models, harder tasks, and higher perturbation ratios. Our results show that robust ICL requires evaluating not only whether demonstrations are correct, but also how they influence contextual inference. Code is available at https://github.com/Chenghao-Qiu/Task-Preserving-ICL.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑