通过优化决策边界方向提升大模型少样本学习稳定性。
Boosting In-Context Learning in LLMs Through the Lens of Classical Supervised Learning
- 在对数空间中学习每类的仿射变换,动态调整分类边界方向。
- 在9个数据集上4/8/16样本设置下均达最优性能,超越现有校准方法。
- 无需额外数据,支持边界反转,适合高可靠性少样本任务场景。
上下文学习(ICL)使大语言模型(LLMs)仅凭少量示例即可适应新任务,但其预测常受系统性偏差影响,导致分类性能不稳定。尽管已有校准技术用于缓解偏差,我们发现这些方法在对数空间中本质上仅是平移决策边界,无法改变其方向,当偏差严重时效果有限。为此,我们提出监督校准(SC),一种基于损失最小化的框架,无需外部数据,在上下文内学习每类的仿射变换,以优化对数空间中的预测概率。该方法不仅涵盖多种现有校准方法作为特例,更具备改变甚至完全反转决策边界方向的能力。同时,其损失结构天然支持两种专为校准设计的正则化技术:上下文不变性正则项缓解ICL不稳定性,方向信任域正则项控制校准强度。实验表明,SC在Mistral-7B-Instruct-v0.3、Llama-2-7B-chat和Qwen2-7B-Instruct三个模型上,于4-shot、8-shot和16-shot设置下,在全部九个数据集上均优于现有校准基线,达到当前最佳性能。
原文摘要 · Abstract (English)
In-Context Learning (ICL) allows Large Language Models (LLMs) to adapt to new tasks with just a few examples, but their predictions often suffer from systematic biases, leading to unstable performance in classification. While calibration techniques are proposed to mitigate these biases, we show that, in the logit space, many of these methods are equivalent to merely shifting the LLM's decision boundary without having the ability to alter its orientation. This proves inadequate when biases cause the LLM to be severely misaligned. To address these limitations and provide a unifying framework, we propose Supervised Calibration (SC), a loss-minimization-based framework, which learns an optimal, per-class affine transformation of LLM's predictive probabilities in the logit space without requiring external data beyond the context. By using a more expressive functional class, SC not only subsumes many existing calibration methods in ICL as special cases but also enables the ability of altering and even completely reversing the orientation of the LLM's decision boundary. Furthermore, SC's loss-based nature facilitates the seamless integration of two purpose-built regularization techniques, context-invariance and directional trust-region regularizers. The former is designed to tackle the instability issue in ICL, while the latter is to control the degree of calibration. Finally, SC delivers state-of-the-art performance over calibration baselines in the 4-shot, 8-shot, and 16-shot settings across all nine datasets for Mistral-7B-Instruct-v0.3, Llama-2-7B-chat, and Qwen2-7B-Instruct.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。