Skip to main content
QUICK REVIEW

[论文解读] Is In-Context Learning Sufficient for Instruction Following in LLMs?

Hao Zhao, Maksym Andriushchenko|arXiv (Cornell University)|May 30, 2024
Online Learning and Analytics被引用 4
一句话总结

本文研究了仅靠上下文学习(ICL)是否能有效对齐大型语言模型(LLM)以遵循指令,通过在多个基础模型上评估Urial提示方法,发现即使采用贪心示例选择方法,ICL在MT-Bench和AlpacaEval 2.0等基准测试中仍表现逊于指令微调,尤其在更强大的模型上表现更差,揭示了ICL在无参数更新的情况下完全捕捉指令遵循行为的根本局限性。

ABSTRACT

In-context learning (ICL) allows LLMs to learn from examples without changing their weights: this is a particularly promising capability for long-context LLMs that can potentially learn from many examples. Recently, Lin et al. (2024) proposed URIAL, a method using only three in-context examples to align base LLMs, achieving non-trivial instruction following performance. In this work, we show that, while effective, ICL alignment with URIAL still underperforms compared to instruction fine-tuning on the established benchmark MT-Bench, especially with more capable base LLMs. We then uncover the most relevant elements for successful in-context alignment, finding the crucial role of the decoding parameters. Based on these insights, we show that the approach of URIAL can indeed be improved by adding high-quality, potentially carefully selected via greedy search, demonstrations in context, getting closer to the performance of instruct models. Finally, we provide the first, to our knowledge, systematic comparison of ICL and instruction fine-tuning (IFT) for instruction following in the low data regime, where ICL can be a viable alternative to IFT. Overall, our work advances the understanding of ICL as an alignment technique and its relationship to IFT. We provide our code at https://github.com/tml-epfl/icl-alignment.

研究动机与目标

  • 评估通过Urial提示方法实现的上下文学习(ICL)是否能在基础LLM上达到与监督微调(SFT)相当的指令遵循性能。
  • 探究尽管ICL具有灵活性且无需参数更新,为何其在指令遵循基准测试中仍无法弥合与微调模型之间的性能差距。
  • 分析上下文演示的数量、质量与结构(尤其是正确答案对齐)对ICL在指令遵循任务中有效性的影响。
  • 评估ICL演示在不同LLM架构间的可迁移性,特别是针对未参与初始Urial示例选择的新模型或更大模型。
  • 理解ICL在指令遵循任务中的行为是否与分类或翻译等其他NLP任务存在根本性差异。

提出的方法

  • 在多个基础LLM(包括Llama-2、Llama-3、Mistral和GPT-4-Base)上评估Urial提示策略,使用MT-Bench和AlpacaEval 2.0(LC)等既定基准。
  • 通过从现有数据集中添加高质量指令遵循演示,扩展Urial提示至超过三个示例,测试少样本上下文学习。
  • 提出一种贪心选择算法,以识别能最大化MT-Bench得分的上下文示例,从而在不修改模型权重的情况下提升性能。
  • 通过消融研究分析演示结构的影响,包括仅包含问题、错误答案或随机采样答案的情况,以隔离正确答案对齐的作用。
  • 评估所选ICL示例在不同基础模型(如Llama-2-7B-80k、Mixtral-8x22B)间的可迁移性,以评估有效演示对模型的敏感性。
  • 分析多轮对话与单轮对话演示的影响,以及为何ICL下第二轮表现显著劣于微调模型。
Figure 1: The results of scaling experiments with different sampling strategies on Mistral-7B-v0.2-32k. The black dashed line refers to the 1st-turn MT-Bench score of Mistral-7B-Instruct-v0.2. ICL with more demonstrations does not bridge the gap between the base model and its aligned counterpart. Su
Figure 1: The results of scaling experiments with different sampling strategies on Mistral-7B-v0.2-32k. The black dashed line refers to the 1st-turn MT-Bench score of Mistral-7B-Instruct-v0.2. ICL with more demonstrations does not bridge the gap between the base model and its aligned counterpart. Su

实验结果

研究问题

  • RQ1在长上下文LLM中,增加上下文演示数量是否能提升指令遵循性能,如同在翻译或摘要任务中所见?
  • RQ2能否通过贪心选择上下文示例策略,弥合ICL与监督微调在指令遵循基准测试中的性能差距?
  • RQ3为何ICL在指令遵循任务中与在分类或多选任务中的行为存在根本性差异,特别是对正确答案对齐的必要性?
  • RQ4有效的上下文演示在多大程度上能泛化到不同基础LLM上,尤其是未参与原始Urial示例选择的新模型或更大模型?
  • RQ5错误或结构不良的演示在多大程度上会降低ICL在指令遵循任务中的性能?

主要发现

  • 在MT-Bench上,将上下文演示数量增加到三个以上,并未系统性提升指令遵循性能,与摘要或翻译等任务中的表现不同。
  • 贪心选择上下文示例能显著提升性能,几乎弥合了Mistral-7B-v0.2与其指令微调版本在MT-Bench上的差距(得分从6.27提升至7.68)。
  • 正确答案对齐至关重要:若省略答案或使用错误答案或随机采样答案,性能会急剧下降,答案循环移位的得分甚至降至1.80。
  • 使用领域内随机答案可提升性能(得分为6.24),但使用领域外随机答案则会降低性能(得分为4.13),表明答案的语义相关性至关重要。
  • 最有效的ICL演示在不同模型间泛化效果不佳:将相同选定的示例应用于Llama-2-7B-80k和Mixtral-8x22B-v0.1-4bit,导致性能提升不一致,甚至出现性能下降。
  • 错误演示会严重损害性能,答案循环移位使MT-Bench得分降至1.80,凸显ICL在指令遵循任务中对演示质量的高度敏感性。
Figure 2: The distribution of the 1st-turn MT-Bench score (GPT-4-Turbo as judge) on Mistral-7B-v0.2-32k obtained by adding 100 instructions from Evol-Instruct-70k as a 4th demonstration to Urial . The black dashed line refers to the 1st-turn MT-Bench score of the base model with Urial . A majority o
Figure 2: The distribution of the 1st-turn MT-Bench score (GPT-4-Turbo as judge) on Mistral-7B-v0.2-32k obtained by adding 100 instructions from Evol-Instruct-70k as a 4th demonstration to Urial . The black dashed line refers to the 1st-turn MT-Bench score of the base model with Urial . A majority o

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。