AnchorRep: Defending LLMs Against Cross-Model Adversarial Transfer via Representation Repulsion
Gal Wertheizer, Rom Himelstein, Tomer Peretz, Avi Mendelson
NeurIPS page · OpenReview · alphaXiv · Open on the map
Category: AI Safety, Security & Alignment › Adversarial Attacks and Defenses · Type: new method · Keywords: cross-model adversarial transfer, LLM defense, representation geometry, LoRA adapter, jailbreak robustness
Areas: Safety & Security › Adversarial Security › Transferable Adversarial Attacks
Summary
AnchorRep is a lightweight LoRA adapter that pushes the defended model's internal representations of harmful prompts away from those of a frozen anchor model, dramatically reducing cross-model adversarial transfer across LLMs.
Explained to a 5-year-old
Some people make bad words to trick computer programs that talk. These tricks can also trick other computer programs that look different. We made a new way to stop this by teaching a small helper to make the computer's thoughts about bad words far away from the thoughts of a safe computer. This helps keep the computer safe. It works without needing lots of extra training.
Explained to a 5-year-old, longer
Computers that can talk, like chatbots, can be tricked by saying special words. If someone learns how to trick one chatbot, they can often trick many other chatbots, even if they look different. This is a problem because many people use different chatbots, and one bad trick can hurt them all. Researchers wanted to find a way to stop these tricks from moving from one chatbot to another. They noticed that when a trick works, the chatbot's thoughts about the bad words are similar to the thoughts of other chatbots. So they tried to make those thoughts far apart instead. They created a small helper that learns to push the chatbot's thoughts away from the thoughts of a safe, frozen chatbot. The helper only needs a few examples of bad words to learn this. It does not need to be trained on many attack examples. After training, the chatbot resists the tricks much better. Tests show that the tricks almost never work anymore on many different chatbots. This makes using chatbots safer for everyone.
For a technical reader
AnchorRep introduces a lightweight LoRA adapter that learns to repel the internal representations of harmful prompts away from those of a frozen anchor model. By training on a small set of harmful prompts without adversarial examples, it shapes the geometry of model embeddings to reduce cross-model transfer. Evaluations across five models and four architectures show attack success rates dropping to ≤1.1% on 2,000 transferred attacks, with the largest drop on Mistral from 36% to 1.1%. It also proposes the Benign Garble Rate metric to capture harmful benign output degradation.
Problem
Adversarial attacks crafted for one LLM can transfer to and jailbreak other, architecturally different models, creating a shared vulnerability that existing defenses do not address.
Method
The approach uses a lightweight LoRA adapter that is trained to push the defended model's internal representations of harmful prompts away from those of a frozen anchor model on the same prompts, using only a small set of harmful prompts and no adversarial examples.
Results
The approach reduces cross-model attack success to ≤1.1% on 2,000 transferred attacks (0% on two models), with the largest drop on Mistral from 36% to 1.1%, while existing defenses cause up to 77% degenerate benign output or over-refusal.
Contributions
It introduces a representation geometry shaping defense that does not require attack-specific training, and proposes the Benign Garble Rate metric to capture harmful benign output degradation.
Practical relevance
It enables deploying robust LLMs across different architectures without costly, attack-specific defenses, reducing the risk of cross-model jailbreaks.
Research questions this paper is counted under
This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. Suggest a correction