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

DevFeed: [Data-Efficient Backdoor Attacks on Code Models via Trigger-Neutralized Counterfactual Scoring](<https://devfeed.tech/articles/data-efficient-backdoor-attacks-on-code-models-via-trigger-neutralized-counterfactual-scoring-99997.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.32334>)

Author: Yu-Yu Lee, Ming-Feng Tsai, Tomohiro Morikawa, Chun-I Fan

Published: 2026-10-26T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Artificial Intelligence](<https://devfeed.tech/sources/arxiv-artificial-intelligence.md>), [arXiv: Cryptography and Security](<https://devfeed.tech/sources/arxiv-cryptography-and-security.md>)

Topics: [Adversarial attacks](<https://devfeed.tech/topics/adversarial-attacks.md>)

Tags: [attacks](<https://devfeed.tech/tags/attacks.md>), [autoregressive](<https://devfeed.tech/tags/autoregressive.md>), [backdoor](<https://devfeed.tech/tags/backdoor.md>), [behavior](<https://devfeed.tech/tags/behavior.md>), [classification](<https://devfeed.tech/tags/classification.md>), [code](<https://devfeed.tech/tags/code.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [cs-cr](<https://devfeed.tech/tags/cs-cr.md>), [generation](<https://devfeed.tech/tags/generation.md>), [image-classification](<https://devfeed.tech/tags/image-classification.md>), [input](<https://devfeed.tech/tags/input.md>), [margin](<https://devfeed.tech/tags/margin.md>), [models](<https://devfeed.tech/tags/models.md>), [poison](<https://devfeed.tech/tags/poison.md>), [ratio](<https://devfeed.tech/tags/ratio.md>), [selection](<https://devfeed.tech/tags/selection.md>), [set](<https://devfeed.tech/tags/set.md>), [target](<https://devfeed.tech/tags/target.md>), [tasks](<https://devfeed.tech/tags/tasks.md>), [trigger](<https://devfeed.tech/tags/trigger.md>)

## AI overview

Trigger-Neutralized Counterfactual Scoring (TNCS) selects code-model training samples for backdoor poisoning by comparing a scoring model's output on a triggered input with its output on a trigger-neutralized counterfactual. The method is designed to score both classification and autoregressive generation, addressing a gap in prior data-efficient selection methods described by the authors. Across three CodeXGLUE tasks and five trigger families, TNCS reportedly achieved higher attack success rates than baselines at very low poisoning ratios without reducing clean-task performance; its advantage grew as the ratio fell. The authors also report that it was the only evaluated method effective across all trigger families and that its selected poison set transferred to victims that differed from the scoring model.

## Source excerpt

arXiv:2610.32334v1 Announce Type: cross 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. 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.