Bigger Is Safer: Provable Robustness in In-Context Learning Scales with Capacity
Not on the map. Why?
Abstract (arXiv)
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 √m, while maintaining performance under adversarial shift requires additional in-context examples with Nρ - N0 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.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 15 of its 17 references that are in the map. First posted on arXiv 19 Feb 2026.
Builds on
15 of 17 references.
References · 15
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
- 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,651
- 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
- 2022Transformers learn in-context by gradient descentcited by 732
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2017Certifying Some Distributional Robustness with Principled Adversarial Trainingcited by 337
- 2023Trained Transformers Learn Linear Models In-Contextcited by 337
- 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
- 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
Built on by
Not cited yet.