Position-conditioned multi-target backdoor attacks on decoder-only code language models
Multi-target backdoor attacks make one poisoned code language model emit several distinct vulnerability payloads, and the prevailing design binds a separate trigger token to each, so the trigger vocabulary and the detection surface grow with the number of payloads. This work shows that one trigger can dispatch several payloads. The proposed backdoor places a single fixed trigger token on a decoder-only code language model and lets the abstract-syntax-tree (AST) position at which the trigger appears select among five payloads aligned with the Common Weakness Enumeration. The selector is learned by ordinary autoregressive fine-tuning, with no architectural change, auxiliary loss, or position-embedding modification. Its learnability rests on the dense positional signal that decoder-only Transformers carry, which controlled experiments show is not specific to any one positional encoding: the selector forms under rotary, learned-absolute, and ALiBi encodings alike. On DeepSeek-Coder-1·3B-base, fine-tuned on CodeSearchNet-Python, the poisoned model preserves clean-task accuracy (HumanEval pass@1 30.43% against 30.70%) and reaches a 100% intended-payload identity rate on all five positions, with full diagonal mass and no unsignalled cells. The same behaviour transfers to Qwen2.5-Coder-1·5B and StarCoder2-3B. The single trigger has zero corpus occurrences against 14,252 for a naive multi-trigger baseline. Against a matched multi-trigger baseline, it matches the identity ceiling and the strict attack-success rate at four of five positions and is significantly stronger at the module-top position under a paired test. An empirical evaluation shows that the trigger is detectable by a clean-reference perplexity scan, but that detecting it does not recover the position-to-payload binding.
Authors
- Hyun Kwon (ORCID: https://orcid.org/0000-0003-1169-9892)
- Jang-Woon Baek (ORCID: https://orcid.org/0000-0002-5988-9276)
Institutions
- Korea Military Academy (KR)
- Kyung Hee University (KR)
Publication Details
- Journal
- Discover Computing
- Published
- 2026-11-24
- DOI
- https://doi.org/10.1007/s10791-026-10845-z
- Primary Topic
- Adversarial Robustness in Machine Learning
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- Kyung Hee University
- National Research Foundation of Korea
- Ministry of Science and ICT, South Korea