The Trojan in the Vocabulary: Stealthy Sabotage of LLM Composition

Xiaoze Liu, Weichen Yu, Matt Fredrikson, Xiaoqian Wang, Jing Gao
12/31/2025
cs.LGcs.CLcs.CR

Official code: xz-liu/tokenforge (4 stars, last commit 2026-01-05).

Abstract

The open-weight LLM ecosystem is increasingly defined by model composition techniques (such as weight merging, speculative decoding, and vocabulary expansion) that remix capabilities from diverse sources. A critical prerequisite for applying these methods across different model families is tokenizer transplant, which aligns incompatible vocabularies to a shared embedding space. We demonstrate that this essential interoperability step introduces a supply-chain vulnerability: we engineer a single "breaker token" that is functionally inert in a donor model yet reliably reconstructs into a high-salience malicious feature after transplant into a base model. By exploiting the geometry of coefficient reuse, our attack creates an asymmetric realizability gap that sabotages the base model's generation while leaving the donor's utility statistically indistinguishable from nominal behavior. We formalize this as a dual-objective optimization problem and instantiate the attack using a sparse solver. Empirically, the attack is training-free and achieves spectral mimicry to evade outlier detection, while demonstrating structural persistence against fine-tuning and weight merging, highlighting a hidden risk in the pipeline of modular AI composition. Code is available at https://github.com/xz-liu/tokenforge

View on arXivView PDF

Code Implementations(1)

xz-liu/tokenforgeOfficial100%

The Trojan in the Vocabulary: Stealthy Sabotage of LLM Composition

40Jinja, PythonDec 25, 20259 months ago
llmllm-safetymodel-merging

Similar Papers

Cite this paper

@article{liu2025trojan,
  title  = {The Trojan in the Vocabulary: Stealthy Sabotage of LLM Composition},
  author = {Xiaoze Liu and Weichen Yu and Matt Fredrikson and Xiaoqian Wang and Jing Gao},
  year   = {2025},
  eprint = {2601.00065},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.00065v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.00065.svg)](https://codeofpaper.com/paper/2601.00065)

Discussion