arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.17743cs.LGstat.ML
收藏

可证明的上下文学习中的对抗鲁棒性

Bigger Is Safer: Provable Robustness in In-Context Learning Scales with Capacity

School of AI and Advanced Computing(人工智能与先进计算学院);Xi’an Jiaotong-Liverpool University(西安交通大学利物浦大学)

Di Zhang, Ningxu Zhang, Zimeng Liu

AI总结:

本文提出了一种分布鲁棒的元学习框架,通过推导非渐近界限,揭示了上下文学习在对抗条件下鲁棒性与模型容量、扰动强度之间的缩放关系。

摘要:

大型语言模型通过上下文学习(ICL)在不更新参数的情况下适应新任务。当前对这种能力的理论解释假设测试任务来自与预训练期间相似的分布。这一假设忽略了可能威胁现实世界可靠性的对抗分布偏移。为了解决这一差距,我们引入了一个分布鲁棒的元学习框架,该框架在基于Wasserstein的分布偏移下为ICL提供最坏情况性能保证。聚焦于线性自注意力Transformer,我们推导出一个非渐近的界限,将对抗扰动强度(ρ)、模型容量(m)和上下文示例数量(N)联系起来。分析表明,模型鲁棒性与容量的平方根成正比(ρ_max ∝√m),而对抗设置则对样本复杂性施加与扰动幅度平方成正比的惩罚(N_ρ- N_0 ∝ρ²)。在合成任务上的实验验证了这些缩放定律。这些发现推进了对对抗条件下ICL限制的理论理解,并表明模型容量是分布鲁棒性的一种基本资源。

英文摘要:

In-context learning (ICL) allows large language models to adapt to new tasks from a few examples without updating their parameters. Existing theories explain ICL by assuming the test task distribution matches pretraining -- an assumption that breaks down under adversarial distribution shifts. We introduce a distributionally robust meta-learning framework that provides worst-case guarantees for ICL under Wasserstein-based distribution shifts. Focusing on linear self-attention Transformers, we derive a non-asymptotic bound connecting adversarial perturbation strength ($ρ$), model capacity ($m$), and the number of in-context examples ($N$). The analysis reveals that the maximum safe perturbation radius scales as $ρ_{\max} \propto \sqrt{m}$, while maintaining performance under adversarial shift requires additional in-context examples with $N_ρ- N_0 \propto ρ^2$. Experiments on synthetic tasks confirm these scaling laws, and experiments on 21 real pretrained models (0.1B--7B parameters, 5 families) provide qualitative evidence consistent with the theory's predictions, while revealing that ICL capability is a prerequisite for robustness. These findings advance the theoretical understanding of ICL under adversarial conditions and formalize the sense in which larger models are safer under distributional shift.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑