How Stable Is In-Context Learning? Lipschitz Bounds for Transformer Output under Context Perturbation

作者: Jinheng Wu, Di Zhang

摘要

In-context learning (ICL) enables large language models to adapt from a few demonstrations, yet its sensitivity to context perturbations remains poorly understood. We study the context-conditioned map C \mapsto f_\theta(x; C) through Lipschitz analysis. Modeling the Transformer as a composition of attention and feed-forward layers, we derive a worst-case certificate |f(x; C + \delta) - f(x; C)| \leq L|\delta| and a data-dependent local estimator based on finite-difference Jacobian probes. Across six language models (117M–7B) on controlled arithmetic ICL tasks, we find that: (i) output changes saturate as perturbation magnitude increases; (ii) global spectral bounds are extremely conservative, while local estimates are far closer to empirical sensitivity; (iii) sensitivity concentrates in late attention layers; (iv) additional demonstrations often stabilize predictions through redundancy; and (v) perturbation direction matters: label flips have much larger normalized effect than reorderings. SST-2 validation supports the same local-sensitivity and perturbation-direction trends. Our results position Lipschitz analysis less as a tight global predictor and more as a diagnostic framework for locating and comparing ICL vulnerabilities.

PDF打开原文
用 AI 找相似论文

可以直接复制这句话问 AI

用 Paperlist 找和「How Stable Is In-Context Learning? Lipschitz Bounds for Transformer Output under Context Perturbation」相似的论文(id: 238866,EMNLP 2026)
set up https://paperlist.ai/SKILL.md

接入 MCP命令行 CLI