Lune

ICLR2025Top-tier venue

Scaling Laws for Adversarial Attacks on Language Model Activations and Tokens

Stanislav Fort

Abstract

We explore a class of adversarial attacks targeting the activations of language models. By manipulating a relatively small subset of model activations, a, we demonstrate the ability to control the exact prediction of a significant number (in some cases up to 1000) of subsequent tokens t. We empirically verify a scaling law where the maximum number of target tokens tmax predicted depends linearly on the number of tokens a whose activations the attacker controls as tmax = κa, and find that the number of bits of control in the input space needed to control a single bit in the output space (that we call attack resistance χ) is remarkably constant between ≈ 16 and ≈ 25 over 2 orders of magnitude of model sizes for different language models. Compared to attacks on tokens, attacks on activations are predictably much stronger, however, we identify a surprising regularity where one bit of input steered either via activations or via tokens is able to exert control over a similar amount of output bits. This gives support for the hypothesis that adversarial attacks are a consequence of dimensionality mismatch between the input and output spaces. A practical implication of the ease of attacking language model activations instead of tokens is for multi-modal and selected retrieval models, where additional data sources are added as activations directly, sidestepping the tokenized input. This opens up a new, broad attack surface. By using language models as a controllable test-bed to study adversarial attacks, we were able to experiment with input-output dimensions that are inaccessible in computer vision, especially where the output dimension dominates. * Now at Google DeepMind. Work done while independent.

Ask Lune

Ask anything. The answer quotes the paper.

Lune reads all of it and the papers around it, then shows you the passages behind every answer.

Questions to start from

Lune answers from

the full paper · 2 top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Cited by top-tier papers2

  1. The Expressivity Limits of TransformersMaxime Meyer, Mario Michelessa, Caroline Chaux, Vincent TanICML 2026
  2. Spectral Scaling Laws in Language Models: emphHow Effectively Do Feed-Forward Networks Use Their Latent Space?Nandan Kumar Jha, Brandon ReagenEMNLP 2025

Builds on6

  1. Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
  2. Deep Learning with Differential PrivacyMartín Abadi, Andy Chu, Ian J. Goodfellow, H. Brendan McMahan et al.CCS 2016 · 7,620 citations
  3. Flamingo: a Visual Language Model for Few-Shot LearningJean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech et al.NeurIPS 2022 · 6,707 citations
  4. Exploring the Limits of Out-of-Distribution DetectionStanislav Fort, Jie Ren, Balaji LakshminarayananNeurIPS 2021 · 443 citations
  5. Privacy Side Channels in Machine Learning SystemsEdoardo Debenedetti, Giorgio Severi, Milad Nasr, Christopher A. Choquette-Choo et al.USENIX Security 2024 · 52 citations

Related papers

  1. Break the Visual Perception: Adversarial Attacks Targeting Encoded Visual Tokens of Large Vision-Language ModelsYubo Wang, Chaohu Liu, Yanqiu Qu, Haoyu Cao et al.ACM MM 2024 · 10 citations
  2. Impact of Adversarial Training on Robustness and Generalizability of Language ModelsEnes Altinisik, Hassan Sajjad, Husrev T. Sencar, Safa Messaoud et al.ACL Findings 2023 · 10 citations
  3. BERT-ATTACK: Adversarial Attack Against BERT Using BERTLinyang Li, Ruotian Ma, Qipeng Guo, Xiangyang Xue et al.EMNLP 2020 · 529 citations
  4. Pandora's Box: Towards Building Universal Attackers against Real-World Large Vision-Language ModelsDaizong Liu, Mingyu Yang, Xiaoye Qu, Pan Zhou et al.NeurIPS 2024 · 51 citations
  5. Soft Prompt Threats: Attacking Safety Alignment and Unlearning in Open-Source LLMs through the Embedding SpaceLeo Schwinn, David Dobre, Sophie Xhonneux, Gauthier Gidel et al.NeurIPS 2024 · 113 citations
Dusk over the sea between two cliffs drawn in fine vertical lines