[论文解读] Mind Your Format: Towards Consistent Evaluation of In-Context Learning Improvements
本文研究了在19个大型语言模型和4个分类数据集上,提示模板格式对上下文学习(ICL)性能的影响,这一影响常被忽视但至关重要。研究发现,模板选择可能导致模型性能降至随机猜测水平,且最优模板在不同模型或方法间不具备可转移性。为此,作者提出模板集成(Template Ensembles)——一种无需微调的推理时增强方法,通过在多个模板上平均预测结果,显著提升平均性能与鲁棒性。
Large language models demonstrate a remarkable capability for learning to solve new tasks from a few examples. The prompt template, or the way the input examples are formatted to obtain the prompt, is an important yet often overlooked aspect of in-context learning. In this work, we conduct a comprehensive study of the template format's influence on the in-context learning performance. We evaluate the impact of the prompt template across 21 models (from 770M to 70B parameters) and 4 standard classification datasets. We show that a poor choice of the template can reduce the performance of the strongest models and inference methods to a random guess level. More importantly, the best templates do not transfer between different setups and even between models of the same family. Our findings show that the currently prevalent approach to evaluation, which ignores template selection, may give misleading results due to different templates in different works. As a first step towards mitigating this issue, we propose Template Ensembles that aggregate model predictions across several templates. This simple test-time augmentation boosts average performance while being robust to the choice of random set of templates.
研究动机与目标
- 研究提示模板格式在不同模型和数据集上对上下文学习性能的影响程度。
- 揭示最优模板在不同模型、提示方法和演示集之间缺乏可转移性。
- 证明当前ICL研究中的评估实践因模板选择不一致而存在偏差。
- 提出一种实用的推理时解决方案,以提升在不同模板设置下的鲁棒性与平均性能。
提出的方法
- 作者在每个设置下使用30个随机采样的提示模板,对19个大型语言模型(参数量从770M到70B)在4个标准文本分类数据集上进行评估。
- 通过测量不同格式(包括输入/输出词元化器、内部与外部分隔符)下的性能变化,系统分析模板敏感性。
- 提出模板集成(Template Ensembles),一种推理时增强方法,通过在多个模板上聚合模型预测结果,以提升鲁棒性与平均准确率。
- 使用斯皮尔曼等级相关系数和交并比(IoU)等统计度量,评估模板在不同模型间的可转移性。
- 在不同模板集合下比较多种ICL方法(直接法、通道法、校准法)的性能,并报告基于5个随机种子的平均结果。

实验结果
研究问题
- RQ1提示模板格式如何影响在不同模型和数据集上的上下文学习性能?
- RQ2在给定模型或方法上表现最佳的模板,能在多大程度上被迁移到其他模型或提示技术上?
- RQ3像模板集成这样的简单推理时增强方法,能否缓解模板敏感性并提升平均性能?
- RQ4在不同模型和数据集中,第10名表现的模板性能与最佳模板相比如何?
主要发现
- 糟糕的提示模板选择可使最先进模型的性能降至随机猜测水平,即使使用强大的模型和先进的提示技术亦如此。
- 对于特定模型、数据集和方法表现最佳的模板,无法迁移到其他模型上——即使在同一模型家族内也存在极端敏感性。
- 在SST-2和AGNews数据集中,第10名模板的准确率约为最佳模板的90%,表明中等程度的可转移性;然而,在DBPedia和TREC数据集中,性能衰减更快。
- 使用5个模板的模板集成方法在所有模型和数据集中均显著优于单模板推理,准确率提升范围为2至10个百分点。
- 该方法降低了对模板选择的敏感性,并在无需微调或超参数调优的情况下实现了更高的平均性能。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。