[Paper Review] A Survey of Trojans in Neural Models of Source Code: Taxonomy and Techniques
This survey presents a unified taxonomy and aspect-based classification of trojans in neural models of source code, synthesizing insights from Explainable AI and Trojan AI to identify attack vectors, triggers, and defense implications. It reveals how poisoning techniques can stealthily manipulate code models, with key contributions including a standardized terminology framework and actionable insights for future secure model development.
In this work, we study literature in Explainable AI and Safe AI to understand poisoning of neural models of code. In order to do so, we first establish a novel taxonomy for Trojan AI for code, and present a new aspect-based classification of triggers in neural models of code. Next, we highlight recent works that help us deepen our conception of how these models understand software code. Then we pick some of the recent, state-of-art poisoning strategies that can be used to manipulate such models. The insights we draw can potentially help to foster future research in the area of Trojan AI for code.
Motivation & Objective
- To address inconsistencies in terminology and definitions across existing research on trojans in neural code models.
- To establish a standardized, actionable taxonomy for classifying trojans in neural models of source code.
- To unify findings from Explainable AI and Trojan AI to inform future research on model security.
- To identify and classify triggers in code models based on their functional and structural aspects.
- To extract transferable insights from non-code domains (e.g., NLP, CV) for advancing Trojan AI in code generation models.
Proposed method
- Developed a novel taxonomy for Trojan AI in code models based on influential works in the broader Trojan AI domain.
- Proposed an aspect-based classification of triggers, categorizing them by semantic, syntactic, structural, and behavioral features.
- Surveyed and analyzed 10 key works from Explainable AI and Trojan AI, focusing on model interpretability and poisoning strategies.
- Mapped insights from model interpretability techniques (e.g., neuron coverage, activation analysis) to potential exploitation in backdoor attacks.
- Evaluated poisoning strategies such as data poisoning, on-the-fly input generation, and side-channel attacks in code models.
- Identified cross-domain techniques—like multi-objective optimization in loss computation and control-flow leakage—applicable to code model security.
Experimental results
Research questions
- RQ1How can a consistent taxonomy be established for trojans in neural models of source code, given the current inconsistency in terminology?
- RQ2What are the key characteristics and classifications of triggers used in backdoor attacks on code models?
- RQ3How can insights from Explainable AI be leveraged to better understand and exploit vulnerabilities in code models?
- RQ4What are the most effective and stealthy poisoning strategies for neural code models, and how do they evade detection?
- RQ5How can techniques from non-code domains (e.g., computer vision, NLP) be adapted to improve Trojan detection and defense in code models?
Key findings
- A standardized taxonomy for Trojan AI in code models was established, resolving inconsistencies in terminology and classification across prior works.
- The aspect-based trigger classification revealed four distinct categories: semantic, syntactic, structural, and behavioral triggers, each with unique exploitation patterns.
- Data poisoning techniques like CoProtector can embed detectable backdoors in open-source code to prevent unauthorized model training, using statistical auditing via t-tests.
- On-the-fly poisoning via modified loss computation (e.g., multi-objective optimization) enables high attack success rates while evading spectral signature-based defenses.
- Side-channel attacks, such as Flush+Reload, can infer user inputs to code models by monitoring control-flow leakage in nucleus sampling routines with high accuracy.
- Few-shot prompting can systematically generate vulnerable code in black-box code models, exposing thousands of security flaws across models like GitHub Copilot.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.