Data-Efficient Backdoor Attacks on Code Models via Trigger-Neutralized Counterfactual Scoring

Yu-Yu Lee, Ming-Feng Tsai, Tomohiro Morikawa, Chun-I Fan
10/23/2026
cs.CRcs.AI

No confident code implementation found for this paper.

Abstract

Pre-trained code models are exposed to backdoor poisoning, in which crafted training samples make the model misbehave on a trigger. A capable attacker minimizes the number of such samples, since each adds cost and exposure and a lower poisoning rate leaves a smaller footprint for defenses.

Show full abstract

Which samples to poison therefore matters, but existing data-efficient selection methods target image classification, offer no scoring mechanism for autoregressive generation, and have not been studied on code. We propose Trigger-Neutralized Counterfactual Scoring (TNCS), which isolates a trigger's contribution to the target behavior by comparing the scoring model's output on a triggered input with its output on a trigger-neutralized counterfactual, covering classification and generation alike. TNCS attains higher attack success rates than the baselines at very low poisoning ratios, across three CodeXGLUE tasks and five trigger families, without degrading clean-task performance, and its margin grows as the ratio decreases. It is the only method effective on every trigger family, and its selected poison set transfers to mismatched victims.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{lee2026dataefficient,
  title  = {Data-Efficient Backdoor Attacks on Code Models via Trigger-Neutralized Counterfactual Scoring},
  author = {Yu-Yu Lee and Ming-Feng Tsai and Tomohiro Morikawa and Chun-I Fan},
  year   = {2026},
  eprint = {2610.32334},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.32334v1}
}

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/2610.32334.svg)](https://codeofpaper.com/paper/2610.32334)

Discussion