arXiv:2506.06699cs.LGcs.AI2025-06

通过最大化难例间距提升大模型少样本学习效果

MarginSel : Max-Margin Demonstration Selection for LLMs

  • 基于测试实例动态选择难样本作为示例
  • 分类任务中F1得分提升2-7个百分点
  • 原理类似支持向量机,优化决策边界

大型语言模型(LLMs)在少样本学习中依赖上下文学习(ICL),但其性能对示范样本的选择和顺序敏感。为此,我们提出MarginSel:一种两步法的示范选择方法,针对每个测试实例动态选取难例,以增强ICL效果。实验表明,相比随机选择,该方法在多个分类任务中使F1得分绝对提升2%-7%。理论与实证分析显示,MarginSel通过有效增大难例的间隔,诱导大模型产生最大间隔行为,类似于支持向量,从而将决策边界向有利方向移动。

原文摘要 · Abstract (English)

Large Language Models (LLMs) excel at few-shot learning via in-context learning (ICL). However, the effectiveness of ICL is often sensitive to the selection and ordering of demonstration examples. To address this, we present MarginSel: Max-Margin Demonstration Selection for LLMs, a two-step method that selects hard demonstration examples for the ICL prompt, adapting to each test instance. Our approach achieves 2-7% absolute improvement in F1-score across classification tasks, compared to a random selection of examples. We also provide theoretical insights and empirical evidence showing that MarginSel induces max-margin behavior in LLMs by effectively increasing the margin for hard examples, analogous to support vectors, thereby shifting the decision boundary in a beneficial direction.

少样本学习大模型示范选择决策边界

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