Lune

S&P2026Top-tier venue

Your Compiler is Backdooring Your Model: Understanding and Exploiting Compilation Inconsistency Vulnerabilities in Deep Learning Compilers

Simin Chen, Jinjun Peng, Yixin He, Junfeng Yang, Baishakhi Ray

Abstract

Deep learning (DL) compilers serve as essential infrastructure in modern DL systems. In this work, we uncover a fundamental security vulnerability inherent in the design principles of DL compilers. Specifically, we ask: Can an official, unmodified DL compiler change a DL model's semantics during compilation, and can such changes introduce hidden backdoors? To answer this question, we consider both adversarial and natural in-the-wild settings. In the adversarial setting, we propose an attack that generates a benign DL model where the backdoor trigger has no effect on the model's behavior. However, after compilation, this benign model is transformed into a backdoored version, allowing the trigger to influence its decisions successfully. We evaluate our approach on six DL models, three commercial compilers, and two hardware platforms. Pre-compilation models show no trigger effects and remain undetected by four state-of-the-art backdoor detectors. In contrast, post-compilation models achieve a 100 % attack success rate on triggered inputs while preserving normal behavior on clean inputs, with a 100%\mathbf{1 0 0 \%} prediction consistency rate with the pre-compilation model. Our attack generalizes across different compiler-hardware combinations and floating-point settings. Beyond the intentional adversarial setting, we further conduct an in-the-wild analysis of the top 100\mathbf{1 0 0} most-downloaded models on HuggingFace-including one with over 220 million downloads-and uncover natural triggers in 31 models using a gradient-guided method. These findings suggest that DL compilers may unintentionally introduce security risks, even in the absence of explicit attacks. Our results uncover an overlooked threat in the ML stack: unmodified DL compilers can silently change the model semantics during compilation. To our knowledge, our work is the first work to demonstrate the inherent security risks of DL compiler design, highlighting a new frontier for secure and trustworthy machine learning11.Our project page and code are available at the following link..

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

2 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Input-Aware Dynamic Backdoor Attack cites Neural Cleanse: Identifying and Mitigating Backdoor Attacks in Neural Networks
  • Input-Aware Dynamic Backdoor Attack cites Trojaning Attack on Neural Networks
  • (A)iSpy: Parasitic Trojans for Machine Learning Infrastructure cites Neural Cleanse: Identifying and Mitigating Backdoor Attacks in Neural Networks
  • Demon in the Variant: Statistical Analysis of DNNs for Robust Backdoor Contamination Detection cites Neural Cleanse: Identifying and Mitigating Backdoor Attacks in Neural Networks
  • Demon in the Variant: Statistical Analysis of DNNs for Robust Backdoor Contamination Detection cites Trojaning Attack on Neural Networks
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers2

  1. IAG: Input-aware Backdoor Attack on VLM-based Visual GroundingJunxian Li, Beining Xu, Simin Chen, Jiatong Li et al.CVPR 2026 · 13 citations
  2. (A)iSpy: Parasitic Trojans for Machine Learning InfrastructureHabibur Rahaman, Qipan Xu, Zafaryab Haider, Prabuddha Chakraborty et al.CCS 2026

Builds on39

  1. Neural Cleanse: Identifying and Mitigating Backdoor Attacks in Neural NetworksBolun Wang, Yuanshun Yao, Shawn Shan, Huiying Li et al.S&P 2019 · 1,801 citations
  2. Trojaning Attack on Neural NetworksYingqi Liu, Shiqing Ma, Yousra Aafer, Wen-Chuan Lee et al.NDSS 2018 · 1,377 citations
  3. Input-Aware Dynamic Backdoor AttackTuan Anh Nguyen, Anh Tuan TranNeurIPS 2020 · 601 citations
  4. Ansor: Generating High-Performance Tensor Programs for Deep LearningLianmin Zheng, Chengfan Jia, Minmin Sun, Zhao Wu et al.OSDI 2020 · 551 citations
  5. Demon in the Variant: Statistical Analysis of DNNs for Robust Backdoor Contamination DetectionDi Tang, XiaoFeng Wang, Haixu Tang, Kehuan ZhangUSENIX Security 2021 · 242 citations

Related papers

  1. DeepPayload: Black-box Backdoor Attack on Deep Learning Models through Neural Payload InjectionYuanchun Li, Jiayi Hua, Haoyu Wang, Chunyang Chen et al.ICSE 2021 · 70 citations
  2. PELICAN: Exploiting Backdoors of Naturally Trained Deep Learning Models In Binary Code AnalysisZhuo Zhang, Guanhong Tao, Guangyu Shen, Shengwei An et al.USENIX Security 2023
  3. A comprehensive study of deep learning compiler bugsQingchao Shen, Haoyang Ma, Junjie Chen, Yongqiang Tian et al.FSE 2021 · 123 citations
  4. DeBackdoor: A Deductive Framework for Detecting Backdoor Attacks on Deep Models with Limited DataDorde Popovic, Amin Sadeghi, Ting Yu, Sanjay Chawla et al.USENIX Security 2025
  5. Demystifying Poisoning Backdoor Attacks from a Statistical PerspectiveGanghua Wang, Xun Xian, Ashish Kundu, Jayanth Srinivasa et al.ICLR 2024 · 11 citations
Dusk over the sea between two cliffs drawn in fine vertical lines