Beware What You Autocomplete: Forensic Attribution of Backdoored Code Completions
On the map: LLM safety and security → Backdoor and data poisoning attacks
Abstract (arXiv)
Large language models have enabled powerful code completion systems that assist developers by predicting subsequent lines of code. However, these models remain vulnerable to backdoor attacks, where malicious fine-tuning data covertly implants unsafe behaviors. Despite advances in defensive techniques, adaptive and sophisticated backdoor attacks still evade detection and mitigation. We present CodeTracer, a forensic framework that traces malicious code completions back to the backdoor fine-tuning data responsible for them. Operating under realistic post-deployment constraints, CodeTracer relies solely on the fine-tuning corpus and the reported miscompletion event. It extracts a structured behavioral fingerprint from the compromised output, narrows the search to semantically relevant code samples, and employs LLM-based reasoning to attribute unsafe logic to specific backdoor data. Extensive evaluations across three representative vulnerability cases and ten backdoor attacks, along with sixteen competitive baselines, demonstrate that CodeTracer consistently achieves high forensic accuracy, low false identification rates, and strong robustness against adaptive attacks.
Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Placed in Backdoor and data poisoning attacks, one of 12 directions in LLM safety and security. Builds on 28 of its 40 references that are in the map. First posted on arXiv 9 Jul 2026.
Builds on
28 of 40 references.
Closest ancestors · 5
Same direction, newest first
- 2026Patcher: Post-Hoc Patching of Backdoored Large Language Models2 Jun
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detection10 Jun
- 2023Backdooring Neural Code Search27 May
- 2023Stealthy Backdoor Attack for Code Models6 Jan
- 2021Poison Forensics: Traceback of Data Poisoning Attacks in Neural Networks13 Oct
Other references · 23
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2021WebGPT: Browser-assisted question-answering with human feedbackcited by 1,722
- 2023PaLM 2 Technical Reportcited by 1,154
- 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 876
- 2023Enabling Large Language Models to Generate Text with Citationscited by 584
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2025Which Agent Causes Task Failures and When? On Automated Failure Attribution of LLM Multi-Agent Systemscited by 170
- 2020You Autocomplete Me: Poisoning Vulnerabilities in Neural Code Completioncited by 112
11 more
- 2024ContextCite: Attributing Model Generation to Contextcited by 93
- 2020Multi-task Learning based Pre-trained Language Model for Code Completioncited by 58
- 2023TrojanPuzzle: Covertly Poisoning Code-Suggestion Modelscited by 47
- 2024Language Models for Code Completion: A Practical Evaluationcited by 38
- 2022Identifying a Training-Set Attack's Target Using Renormalized Influence Estimationcited by 32
- 2025Traceback of Poisoning Attacks to Retrieval-Augmented Generationcited by 28
- 2023BEAGLE: Forensics of Deep Learning Backdoor Attack for Better Defensecited by 15
- 2025Who Taught the Lie? Responsibility Attribution for Poisoned Knowledge in Retrieval-Augmented Generationcited by 12
- 2025TracLLM: A Generic Framework for Attributing Long Context LLMscited by 11
- 2024Tracing Back the Malicious Clients in Poisoning Attacks to Federated Learningcited by 6
- 2024UTrace: Poisoning Forensics for Private Collaborative Learningcited by 3
Built on by
Citing papers per year: 2026: 4.
4 papers.
- 2026NeuronGuard: Robust LLM Safety Alignment via Ablation-Aware Safety Signal Redistributioncited by 2
- 2026RAGSentinel: Certifiable Geometric Consensus for Robust Retrieval-Augmented Generationcited by 0
- 2026Does the Unsafe Gradient Survive a Conversation? On the Fragility of Gradient-Based Jailbreak Detection in Multi-Turn Dialoguecited by 0
- 2026Safer Content or Firmer Refusals? A Hybrid Perturbation Defense for Alignment under Harmful Fine-tuningcited by 0
- 2026Safer Content or Firmer Refusals? A Hybrid Perturbation Defense for Alignment under Harmful Fine-tuning29 Sep 2026
- 2026Does the Unsafe Gradient Survive a Conversation? On the Fragility of Gradient-Based Jailbreak Detection in Multi-Turn Dialogue29 Sep 2026
- 2026RAGSentinel: Certifiable Geometric Consensus for Robust Retrieval-Augmented Generation25 Aug 2026
- 2026NeuronGuard: Robust LLM Safety Alignment via Ablation-Aware Safety Signal Redistribution25 Aug 2026
Similar, not cited
Close in wording, no citation either way
- 2025Exploring the Security Threats of Retriever Backdoors in Retrieval-Augmented Code Generation
- 2025ImportSnare: Directed "Code Manual" Hijacking in Retrieval-Augmented Code Generation
- 2026CodeMimicry: Exploiting Safety Generalization Lag in Large Language Models via Structured Code Completion
- 2025The Double Life of Code World Models: Provably Unmasking Malicious Behavior Through Execution Traces
- 2026CodePoisonRAG: Knowledge Poisoning Attacks on Retrieval-Augmented Code Generation
- 2026Beyond Static Guarantees: Measuring the Static-Pass Dynamic-Fail Gap in Security-Sensitive and LLM-Generated Python Code
- 2026Persistent Human Feedback, LLMs, and Static Analyzers for Secure Code Generation and Vulnerability Detection
- 2025MGC: A Compiler Framework Exploiting Compositional Blindness in Aligned LLMs for Malware Generation