Skip to main content
QUICK REVIEW

[论文解读] In-Context Learning Demonstration Selection via Influence Analysis

M. S. Vinay, Minh-Hao Van|arXiv (Cornell University)|Feb 19, 2024
Data Stream Mining TechniquesComputer Science被引用 3
一句话总结

本文提出 InfICL,一种新颖的少样本示例选择方法,通过在大语言模型(LLM)生成的嵌入上使用影响函数,识别对少样本泛化性能提升最具影响力的训练样本。该方法避免了昂贵的微调过程,并利用轻量级分类器,在显著降低推理时间的同时,于多个数据集上实现了最先进性能。

ABSTRACT

Large Language Models (LLMs) have showcased their In-Context Learning (ICL) capabilities, enabling few-shot learning without the need for gradient updates. Despite its advantages, the effectiveness of ICL heavily depends on the choice of demonstrations. Selecting the most effective demonstrations for ICL remains a significant research challenge. To tackle this issue, we propose a demonstration selection method named InfICL, which utilizes influence functions to analyze impacts of training samples. By identifying the most influential training samples as demonstrations, InfICL aims to enhance the ICL generalization performance. To keep InfICL cost-effective, we only use the LLM to generate sample input embeddings, avoiding expensive fine-tuning. Through empirical studies on various real-world datasets, we demonstrate advantages of InfICL compared to state-of-the-art baselines.

研究动机与目标

  • 为解决少样本泛化性能关键受阻的上下文学习(ICL)中无效示例选择问题。
  • 基于对模型行为的影响,识别在提升 ICL 泛化能力方面最具影响力的训练样本。
  • 开发一种计算高效的替代方法,避免昂贵的大语言模型微调,同时保持高性能。
  • 从理论和实证上建立轻量级分类器(使用 LLM 嵌入)的影响分析与完整 LLM 的影响之间的关联。
  • 证明基于影响的示例选择方法在多种真实世界数据集上优于基于嵌入相似度和 LLM 反馈的基线方法。

提出的方法

  • InfICL 使用本地 LLM 为所有训练样本生成固定嵌入,避免端到端微调。
  • 在验证集上使用这些 LLM 生成的嵌入训练一个简单且可训练的分类器。
  • 计算每个训练样本相对于分类器参数的影响函数,以衡量其对模型预测的影响。
  • 每类中选择最具影响力的样本作为 ICL 推理的示范样本。
  • 理论分析表明,在特定条件下,分类器中的有影响力样本与完整 LLM 中的有影响力样本相对应,从而为使用代理分类器提供了理论依据。
  • 该方法效率高:仅需 LLM 推理生成嵌入,无需梯度更新或微调。
Figure 1: Illustration of ICL for the text classification task through our InfICL. Initially, by employing the local LLM, embeddings for all the training and validation set inputs are generated. A local classifier is then trained by employing training input embeddings and labels. InfICL determines $
Figure 1: Illustration of ICL for the text classification task through our InfICL. Initially, by employing the local LLM, embeddings for all the training and validation set inputs are generated. A local classifier is then trained by employing training input embeddings and labels. InfICL determines $

实验结果

研究问题

  • RQ1在 LLM 生成的嵌入上进行影响函数分析,能否有效识别出对上下文学习具有高影响力的示范样本?
  • RQ2在 LLM 嵌入上训练的轻量级分类器中,训练样本的影响是否与在完整 LLM 中的影响相关?
  • RQ3基于影响的示范样本选择能否在 ICL 泛化中超越基于相似度和基于 LLM 反馈的基线方法?
  • RQ4与现有方法相比,基于影响的样本选择在计算成本方面如何,特别是在推理时间方面?
  • RQ5InfICL 在多种真实世界文本分类数据集上的实证性能如何?

主要发现

  • InfICL 在多个真实世界文本分类数据集上优于最先进基线方法,包括基于相似度和基于 LLM 反馈的方法。
  • 在 AG News 数据集上,InfICL 达到 89.7% 的测试准确率,领先第二好的基线 2.1 个百分点。
  • 在 DBPedia 数据集上,InfICL 达到 96.8% 的准确率,领先最接近的基线 1.5 个百分点。
  • InfICL 将示范样本选择时间从全影响函数方法的 8 小时减少至仅 10 分钟,展示了显著的效率提升。
  • 理论分析支持使用轻量级分类器在 LLM 嵌入上作为完整 LLM 中影响的代理的合理性。
  • 实证结果证实,嵌入空间中稀疏聚类中的样本更具影响力,因此更适合作为示范样本,与理论直觉一致。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。