越大越安全:上下文学习的可证明鲁棒性随容量扩展 Bigger Is Safer: Provable Robustness in In-Context Learning Scales with Capacity 预印本

⚠️ 本文为 预印本(arXiv 公开版本),尚未经过正式同行评审。作者自发公开,结论未经期刊审稿验证,阅读时请知悉。
发布时间:2026-02-19
👁️ 预览文献
💡 AI 中文简介
本文研究大语言模型在上下文学习(ICL)中面对对抗性分布偏移时的鲁棒性问题。作者提出一个分布鲁棒元学习框架,基于Wasserstein距离推导出线性自注意力Transformer的非渐近界,揭示了最大安全扰动半径与模型容量的平方根成正比,而维持性能所需额外示例数与扰动强度的平方成正比。在合成任务和21个真实预训练模型(0.1B-7B参数)上验证了这些规律,表明更大模型在分布偏移下更安全。
领域自然语言处理/机器学习理论
适合谁读需要一定专业背景
核心贡献1. 提出分布鲁棒元学习框架,为ICL在Wasserstein分布偏移下提供最坏情况保证;2. 推导出非渐近界,揭示模型容量与对抗扰动强度及示例数的定量关系,证明更大模型更鲁棒。
关键数据最大安全扰动半径ρ_max ∝ √m;维持性能需额外示例数N_ρ - N_0 ∝ ρ^2;实验覆盖21个预训练模型(0.1B-7B参数,5个家族)。
推荐理由如果你关心大模型为何越大越抗干扰,这篇论文用理论加实验给出了漂亮答案,值得一读。
关键词["上下文学习", "对抗鲁棒性", "分布偏移", "Transformer", "元学习", "Wasserstein距离"]

原文摘要

查看英文原文摘要

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.