大模型在上下文学习中更抗分布偏移,容量越大越安全。
Bigger Is Safer: Provable Robustness in In-Context Learning Scales with Capacity
- 基于分布鲁棒元学习,建立对抗扰动与模型容量的理论关联。
- 模型容量每提升一倍,最大安全扰动半径可增大约1.4倍。
- 实验证明大模型需更多示例才能保持鲁棒性,且具备ICL是前提。
上下文学习(ICL)使大语言模型能在不更新参数的情况下,仅凭少量示例适应新任务。现有理论依赖于测试任务分布与预训练分布一致的假设,该假设在对抗性分布偏移下失效。本文提出一种分布鲁棒的元学习框架,为基于Wasserstein距离的分布偏移提供最坏情况保证。聚焦线性自注意力Transformer,推导出非渐近界,揭示对抗扰动强度(ρ)、模型容量(m)和上下文示例数(N)之间的关系:最大安全扰动半径ρ_max ∝ √m,而维持对抗偏移下的性能需额外示例数N_ρ - N_0 ∝ ρ²。合成任务实验验证了这些缩放规律;21个真实预训练模型(0.1B–7B参数,5个系列)的实验提供了定性支持,同时发现ICL能力是实现鲁棒性的前提。研究深化了对对抗条件下ICL的理论理解,并形式化了大模型在分布偏移下更安全的含义。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。