mlsanityData to 14 Oct 2026

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

arXiv 2602.17743 ↗First posted 19 Feb 2026cs.LG stat.MLcited by 0

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

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2023Universal and Transferable Adversarial Attacks on Aligned Language Modelscited by 3,104
  3. 2023Jailbroken: How Does LLM Safety Training Fail?cited by 1,651
  4. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
  5. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  6. 2022Transformers learn in-context by gradient descentcited by 732
  7. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  8. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  9. 2017Certifying Some Distributional Robustness with Principled Adversarial Trainingcited by 337
  10. 2023Trained Transformers Learn Linear Models In-Contextcited by 337
  11. 2023Transformers as Statisticians: Provable In-Context Learning with In-Context Algorithm Selectioncited by 298
  12. 2023Transformers learn to implement preconditioned gradient descent for in-context learningcited by 279
3 more
  1. 2024Jailbreak Attacks and Defenses Against Large Language Models: A Surveycited by 230
  2. 2023Transformers as Algorithms: Generalization and Stability in In-context Learningcited by 222
  3. 2025In-Context Learning Is Provably Bayesian Inference: A Generalization Theory for Meta-Learningcited by 22

Built on by

Not cited yet.