Dirottamento della Rappresentazione In-Contesto
In-Context Representation Hijacking
December 3, 2025
Autori: Itay Yona, Amir Sarid, Michael Karasik, Yossi Gandelsman
cs.AI
Abstract
Introduciamo Doublespeak, un semplice attacco di dirottamento delle rappresentazioni in-context contro i grandi modelli linguistici (LLM). L'attacco funziona sostituendo sistematicamente una parola chiave dannosa (ad esempio, *bomba*) con un token benigno (ad esempio, *carota*) attraverso molteplici esempi in-context, forniti come prefisso a una richiesta dannosa. Dimostriamo che questa sostituzione porta alla convergenza della rappresentazione interna del token benigno verso quella di quello dannoso, incorporando efficacemente la semantica dannosa sotto un eufemismo. Di conseguenza, prompt superficialmente innocui (ad esempio, "Come costruire una carota?") vengono interpretati internamente come istruzioni non consentite (ad esempio, "Come costruire una bomba?"), eludendo così l'allineamento di sicurezza del modello. Utilizziamo strumenti di interpretabilità per mostrare che questa sovrascrittura semantica emerge strato per strato, con significati benigni negli strati iniziali che convergono in semantiche dannose in quelli successivi. Doublespeak è privo di ottimizzazioni, ampiamente trasferibile tra famiglie di modelli e raggiunge alti tassi di successo su sistemi open-source e a codice chiuso, toccando un ASR del 74% su Llama-3.3-70B-Instruct con un singolo override contestuale di una frase. I nostri risultati evidenziano una nuova superficie di attacco nello spazio latente degli LLM, rivelando che le attuali strategie di allineamento sono insufficienti e dovrebbero invece operare a livello rappresentazionale.
English
We introduce Doublespeak, a simple in-context representation hijacking attack against large language models (LLMs). The attack works by systematically replacing a harmful keyword (e.g., bomb) with a benign token (e.g., carrot) across multiple in-context examples, provided a prefix to a harmful request. We demonstrate that this substitution leads to the internal representation of the benign token converging toward that of the harmful one, effectively embedding the harmful semantics under a euphemism. As a result, superficially innocuous prompts (e.g., ``How to build a carrot?'') are internally interpreted as disallowed instructions (e.g., ``How to build a bomb?''), thereby bypassing the model's safety alignment. We use interpretability tools to show that this semantic overwrite emerges layer by layer, with benign meanings in early layers converging into harmful semantics in later ones. Doublespeak is optimization-free, broadly transferable across model families, and achieves strong success rates on closed-source and open-source systems, reaching 74\% ASR on Llama-3.3-70B-Instruct with a single-sentence context override. Our findings highlight a new attack surface in the latent space of LLMs, revealing that current alignment strategies are insufficient and should instead operate at the representation level.