Understanding in-context learning of linear models by Transformers from an adversarial perspectiveUnderstanding In-Context Learning of Linear Models in Transformers Through an Adversarial Lens
The researchers study in-context learning of linear models by Transformers from an adversarial attack perspective, finding that linear Transformer and GPT-2 architecture models are both vulnerable to hijacking attacks. Hijacking attacks force the model to generate specific outputs by manipulating the prompt; adversarial training during pretraining or fine-tuning can significantly improve robustness and generalizes to stronger attack models. Comparative analysis also shows that, despite similar in-distribution performance, attacks transfer poorly between larger Transformers trained with different random seeds, suggesting that the same architecture and training scheme may implement different in-context learning algorithms; attacks also transfer poorly between classic algorithms such as single-step gradient descent and ordinary least squares and Transformers, suggesting that the in-context learning algorithms implemented by Transformers may differ qualitatively from traditional algorithms.