In-context learning (ICL) is a pivotal capability for the practical deployment of large-scale language models, yet its stability heavily depends on the number of examples provided in the prompt. Existing methods lack computable theoretical guidance to determine the minimal number of examples required. Heuristic rules commonly used in practice are often overly conservative and non-verifiable, readily leading to either instability from insufficient examples or inefficiency from redundant ones. This paper proposes that ICL stability can be characterized via a spectral-coverage proxy: the smallest eigenvalue of a regularized empirical second-moment matrix of demonstration representations, turning prompt-length selection into a computable estimation problem. We derive a non-asymptotic sufficient sample-size requirement (a lower bound on $K$) under sub-Gaussian representations, which in turn induces a conservative upper bound on the unknown stability threshold. We design a two-stage observable estimator that requires no prior knowledge and returns a concrete prompt length with a prescribed failure probability. Experiments show that the resulting estimates consistently upper-bound empirical knee-points, and a lightweight calibration further tightens the gap to about $1.03$--$1.20\times$, providing verifiable guidance for practical ICL prompt design.


翻译:上下文学习(ICL)是大规模语言模型实际部署的关键能力,但其稳定性在很大程度上取决于提示中所提供示例的数量。现有方法缺乏可计算的理论指导来确定所需示例的最小数量。实践中常用的启发式规则通常过于保守且不可验证,容易导致因示例不足而产生的不稳定性,或因示例冗余而导致的低效性。本文提出,ICL稳定性可以通过一个谱覆盖度代理量来表征:即演示表示的正则化经验二阶矩矩阵的最小特征值,从而将提示长度选择转化为一个可计算的估计问题。我们在亚高斯表示假设下,推导出一个非渐近的充分样本量要求(即$K$的一个下界),这进而诱导出对未知稳定性阈值的一个保守上界。我们设计了一个无需先验知识的两阶段可观测估计器,它能返回一个具体的提示长度并具有规定的失败概率。实验表明,所得估计值始终是经验拐点的上界,并且经过轻量级校准后,可将差距进一步缩小至约$1.03$--$1.20$倍,从而为实际的ICL提示设计提供了可验证的指导。

0
下载
关闭预览

相关内容

【MIT博士论文】语言模型的推理时学习算法
专知会员服务
30+阅读 · 2025年12月24日
【博士论文】基于多模态基础模型的上下文学习
专知会员服务
22+阅读 · 2025年12月17日
【ICML2025】大语言模型是自我示范预选择器
专知会员服务
12+阅读 · 2025年6月9日
【MIT博士论文】数据高效强化学习,176页pdf
国家自然科学基金
21+阅读 · 2015年12月31日
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
Arxiv
0+阅读 · 2月11日
VIP会员
相关基金
国家自然科学基金
21+阅读 · 2015年12月31日
国家自然科学基金
17+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员