Skip to content

How can a hardware-model coordinated attack implant a backdoor in an LLM?How to Backdoor LLMs via Hardware Model Co-Attack?

Sanskar Amgain, Sudipta Paria, Daniel Lobo, Swarup Bhunia, Fnu Suya
University of Tennessee, Knoxville; University of Florida
arXiv: 其他 AI 安全论文arXiv:2611.40062Originally published Indexed by this site · 2 days agoSelected AttacksSelectedAttention39

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

The authors propose a hardware–model co-backdoor for LLMs; on the Refusal task with Qwen2.5-3B, self-generated triggers combined with a hardware Trojan achieve 99.7% ASR.

Threat modelA malicious third-party accelerator vendor has white-box knowledge of the model architecture and parameters in the model-aware accelerator design workflow, and can modify model weights and insert a hardware Trojan; a small number of representative clean inputs are also used for calibration. The goal is for the backdoor to trigger only on the controlled hardware and to evade both model-level and hardware-level checks.

Questions
An untrusted accelerator vendor can access both the LLM weights and the hardware design. The authors study how to split the backdoor across both sides so that it triggers only in a combined deployment, and address trigger detection and context-dependent response injection in generation tasks.
Methods
On the model side, the relative magnitudes of a small number of activation coordinates are used to construct the trigger region, and the FFN weights are edited; on the hardware side, after triggering, a small number of FFN intermediate activations are overwritten in one shot, providing the OOD key. The decoding-stage gating also supports the model output itself generating the trigger token.
Experiments and results
The experiments cover three main models, three types of generation objectives, and a larger model. The authors report that prompt and self-generated triggers achieve high ASR when the hardware is activated; most of the tested model-level defenses fail to detect it effectively, but BEAT can detect it effectively at zero delay with a 10-token window.
Limitations and future work
The authors leave hardware–model co-verification and supply chain defenses as future work, and physical side-channel testing is also not included in the evaluation. Self-generated triggers are evaluated only on Refusal; the hardware experiments are based on one open-source FPGA implementation, and the paper does not report the test set sample size or the number of queries.
Experimental setupGPT-2-XL、Qwen2.5-3B-Instruct et al. · ConvSent、Alpaca-Eval et al. · ASR、CASR et al.
Metrics
ASRCASRTPRFPRAUCF1MMLU accuracyCoQA EM/F1FPGA resource utilizationpower consumption
AI summaryand selection rationaleResearchers propose a hardware-model coordinated backdoor attack against LLMs, in which the backdoor is split between the model weights and the accelerator hardware; the model alone behaves normally, and the attack only takes effect when the modified model runs together with the accelerator. The method extends HAMLOCK from image classification to generation tasks, uses the relative ordering among a small number of activation coordinates for trigger detection, and leverages the accelerator's ability to distinguish prompt processing from the decoding stage to support self-generated triggers, so that the attack can activate even when the input prompt contains no trigger word; the payload is encoded in the edited model weights and activated by the hardware injecting sparse out-of-distribution activation keys. On three models—GPT-2-XL, Qwen2.5-3B-Instruct, and Llama-2-7B-Chat—and three target types—sentiment injection, refusal injection, and jailbreak injection—the prompt-triggered attack success rate reaches up to 99.5%, the self-generated trigger reaches 99.9% on the refusal task, benign utility is almost unaffected, and without any optimization against defenses it bypasses representative model-level defenses and RTL-level hardware checks, with negligible hardware overhead.

Researchers propose a hardware-model coordinated backdoor attack against LLMs, in which the backdoor is split between the model weights and the accelerator hardware; the model alone behaves normally, and the attack only takes effect when the modified model runs together with the accelerator. The method extends HAMLOCK from image classification to generation tasks, uses the relative ordering among a small number of activation coordinates for trigger detection, and leverages the accelerator's ability to distinguish prompt processing from the decoding stage to support self-generated triggers, so that the attack can activate even when the input prompt contains no trigger word; the payload is encoded in the edited model weights and activated by the hardware injecting sparse out-of-distribution activation keys. On three models—GPT-2-XL, Qwen2.5-3B-Instruct, and Llama-2-7B-Chat—and three target types—sentiment injection, refusal injection, and jailbreak injection—the prompt-triggered attack success rate reaches up to 99.5%, the self-generated trigger reaches 99.9% on the refusal task, benign utility is almost unaffected, and without any optimization against defenses it bypasses representative model-level defenses and RTL-level hardware checks, with negligible hardware overhead.

Why it was selectedThe paper shows that a backdoor split across the model and hardware sides can bypass multiple representative defenses, reminding teams deploying models on third-party edge accelerators to watch for supply chain risks.

Related events and news

1 events · 0 news mentions

  • This event's paper

    硬件与模型协同后门攻击LLM

    研究者提出硬件-模型协同后门攻击:后门拆分到模型权重与加速器硬件,二者同跑才生效,提示词触发成功率最高 99.5%。

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    The work studies how an untrusted vendor can split an LLM backdoor across the model and the accelerator so that it triggers only when they run jointly.

    The core problem is how to extend HAMLOCK's hardware–model coordinated backdoor to autoregressive LLM generation while keeping the trigger reliable, the payload controllable, and the one-sided component dormant.

    • Deployment scenario: The authors focus on LLMs on edge GPUs, FPGAs, and custom ASICs; a supplier or system integrator in the supply chain may have access to both the model checkpoint and the hardware implementation when adapting the accelerator.
    • Shortcomings of existing methods: The authors state that a model-only LLM backdoor encodes both trigger recognition and target behavior in the model, which may leave traces at the weight, activation, or behavior level; although HAMLOCK implements a coordinated attack for image classification, its fixed output logit bias cannot generate coherent, input-dependent text.
    • Core observation: The trigger signal need not be an abnormally large single activation; it can also be jointly defined by the relative magnitudes of a few coordinates; the hardware can also distinguish prefill from decode, allowing tokens generated by the model itself to become the trigger.
    • Proposed method: The authors design a relative-order detector, a sparse OOD activation key, and conditional knowledge editing, placing the response behavior in the model weights and the activation condition in the hardware, and implement it in FPGA RTL.
    • Threat model:
      • Goal: With the trigger, the controlled hardware outputs the attacker-chosen response; trusted hardware and untriggered inputs maintain normal behavior and evade model and hardware checks.
      • Knowledge: The supplier has white-box knowledge of the model architecture, parameters, and target accelerator design, and has a small number of representative clean inputs for calibration.
      • Capabilities: Can modify weights, insert Trojans, observe selected intermediate activations and execution control signals, and conditionally overwrite activations.
      • Victim system: An LLM that the model owner delivers to a third-party supplier for deployment on a custom FPGA or ASIC; the supplier can act alone or collaborate with the model provider.
  2. What related research exists?

    Related work is divided into LLM backdoors within the model, knowledge editing and activation steering, and hardware Trojans and the HAMLOCK coordinated attack.

    LLM backdoor attacks

    • BadEdit, ConceptROT, etc.: BadEdit and ConceptROT inject token- or concept-conditioned behavior through local model editing; other work uses rare tokens, syntactic patterns, composite triggers, or latent concepts. The authors note that the full trigger-to-behavior path of these methods remains inside the model.
    • Data poisoning route: Related work implants backdoors through a small number of poisoned samples in instruction tuning, and can also directly modify weights after training; the paper presents this as the main way of implanting in-model backdoors.
    • Comparison of fine-grained triggers: Appendix D compares ConceptROT with this paper's self-generated triggers on the same OpenAI concept prompt set, focusing on the selectivity of the two for similar entities.

    Knowledge editing and activation steering

    • ROME, MEMIT: These treat the Transformer FFN as associative key–value memory, changing selected associations by updating down-projection weights while limiting the impact on unrelated behavior; this paper borrows this editing mechanism.
    • Passive activation steering: Related work constructs a direction from the mean activation difference between the target behavior and ordinary behavior, and adds it to the residual stream at inference time. The authors state that if this were used directly to implement the payload, the hardware would need to store and apply a relatively large behavior-related vector.
    • SteerEdit: Compiles the steering representation into the weights to produce persistent jailbreak behavior; the paper still classifies it as a method whose full path lies inside the model.

    Hardware Trojans and co-attacks

    • Hardware supply chain research: Existing work discusses inserting Trojans in untrusted IC design and manufacturing stages, as well as functional, structural, timing, and side-channel detection; accelerator-oriented attacks typically manipulate intermediate computations or outputs.
    • HAMLOCK: Targets image classifiers, placing semantic trigger recognition in the model while the hardware detects anomalous activations and biases the target-class logit. The authors state that it cannot be directly generalized to trigger detection and payload generation in LLMs.
    • GNN4TJ and statistical logic testing: GNN4TJ detects suspicious structures from RTL data-flow graphs, and statistical methods find rare nets and generate stimuli; the paper examines their applicability to the Trojan used in its hardware evaluation.

    Baselines and evaluation benchmarks: The main software baseline is BadEdit; tasks use ConvSent, Alpaca-Eval, and HarmBench, utility uses MMLU, and GPT-2-XL additionally uses CoQA. The authors position this paper as splitting the trigger and response paths across the model and hardware sides, so that neither component alone produces the target backdoor behavior.

  3. How does the paper address this problem?

    The method detects triggers via relative-order regions, then the hardware injects a sparse OOD key that activates a pre-edited conditional response in the model.

    The overall idea follows HAMLOCK's division of labor: the model performs semantic computation, and the hardware provides only lightweight control signals. The method consists of four parts: relative-order trigger detection, decoding-stage gating, sparse OOD-key injection, and conditional knowledge editing.

    Relative-order trigger detection

    • Detection rule: On the residual activations of the detection layer, each gate compares the magnitudes of two coordinates; at most K gates are combined with AND, and the trigger fires only when all are satisfied. Each comparison requires only a comparator, and the region is the intersection of multiple half-spaces.
    • Core definition: gp(h)=sp(hap−hbp), where the coordinate pair and direction are selected from calibration activations, and gp(h)>0 indicates that the comparison holds. The hardware checks only the sign, and the separation margin is used for construction on the model side.
    • Construction procedure: First filter coordinate pairs by mean separation between trigger and clean states, then retain comparisons that satisfy the margin on most trigger states, then greedily select gates that complementarily reject clean states, and avoid cyclic orderings.
    • Parameters: The trigger percentile is set to ρ=5, i.e., about 95% of trigger calibration states before editing must satisfy the corresponding margin; the main-experiment detector uses at most Kmax=8 comparisons.

    Model editing and self-generated triggers

    • Activation objective: For trigger states, find the minimum displacement that satisfies all positive margins; for clean states, it suffices to violate one comparison with a sufficiently negative margin. States that already satisfy the constraints are not moved.
    • Weight update: Combine the FFN intermediate activations and target displacements of trigger and clean states, and fit a shared update to the detection layer's Wdown using ridge-regularized least squares.
    • Decoding gating: gself(t)=GS(h(ldet)(x;t))∧ qdec(t), accepting the detection signal only during the decode stage. The authors state that this allows specific tokens in the model's output to also start the attack when the original prompt has no trigger.

    Sparse OOD key and payload editing

    • Injection location: The hardware overwrites a small number of coordinates on the post-activation FFN intermediate of subsequent payload layers, leaving the remaining coordinates unchanged; the example annotated in Figure 1 is κ=10, dffn=11008.
    • Key construction: Select coordinates that are usually inactive under clean inputs, and set each key value to the maximum activation of that coordinate in clean calibration plus a margin µ. The key only identifies the conditional payload and does not directly encode the target behavior.
    • One-time injection: Inject only at the first trigger token in the same generation, overwrite at all selected payload layers, and do not intervene afterward, letting the model continue generating based on the prompt context.
    • Positive and negative supervision: Positive examples inject the OOD key and target the attacker's response; negative examples inject a decoy at the same coordinates and target the original model's ordinary response, so that behavior depends on the injected value rather than only on the modified coordinates.
    • Conditional editing: First optimize the FFN output displacement so that positive and negative examples produce the target and ordinary responses respectively, while penalizing output distribution deviation and activation changes, then write the target into the weights of each payload layer.

    Hardware implementation and success determination

    • RTL structure: The detector performs signed comparisons on 32-bit residual coordinates, registers the result when the detection layer completes, and clears it when a new token is accepted; the self-generated variant adds a decode-phase indicator provided by the host.
    • Payload path: Sparsely overwrite the FFN intermediate values before quantization and the W2 down-projection, reusing the existing FFN register without adding FSM states or processing cycles; indices, layer masks, and keys are compile-time parameters.
    • Attack targets: Include ConvSent topic sentiment injection, fixed refusal responses, and jailbreak responses. Jailbreak is not judged successful by reproducing an affirmative prefix; instead, the HarmBench judge checks the full continuation of up to 256 tokens.
    • Experimental editing configuration: GPT-2-XL and Qwen2.5-3B-Instruct use one detection layer and three payload layers, and Llama-2-7B-Chat uses two payload layers; all settings use fewer than 50 instances for calibration.
  4. What experiments did the paper conduct?

    The experiments cover five models, three types of targets, nine model-level defenses, and FPGA detection; high ASR coexists with several detection exceptions.

    Experimental Setup

    • Main models tested: GPT-2-XL (1.5B), Qwen2.5-3B-Instruct (3.09B), Llama-2-7B-Chat (6.74B); the appendix additionally tests Llama-2-70B-Chat and DeepSeek-MoE-16B-Chat.
    • Tasks and data: ConvSent for topic sentiment injection, Alpaca-Eval for refusal injection on benign instructions, HarmBench standard split for jailbreak; calibration sets all have fewer than 50 instances, evaluated on a held-out test split.
    • Baselines and metrics: The software-only baseline is BadEdit. ASR is the proportion of triggered test prompts that produce the target output, and CASR is the same proportion without a trigger; results in the tables are usually the mean of 3 seeds.
    • Task determination: Refusal uses the refusal rate, Jailbreak uses the HarmBench judge's harmful-compliance rate on the full continuation; ConvSent uses the Mistral-7B judge, and Table 14 specifies Mistral-7B-Instruct-v0.3.
    • Model-level defenses: Sample detection includes LCF, WeightWatch, ConfGuard, Dual Sentinel, and BEAT; model detection includes Haystack, BAIT, and ICLScan; mitigation is CROW. The paper groups them as white-box, gray-box, and black-box.
    • Hardware and utility: RTL is integrated on llama2.c-260k-rtl-fpga, synthesized with Vivado v2020.3 targeting AMD/Xilinx Versal xcvm1802; utility is measured on MMLU, and GPT-2-XL is additionally measured on CoQA EM/F1.

    Main Results

    The table below summarizes prompt-triggered results without defenses; Ours w/o HT and w/ HT denote hardware not activated and activated, respectively, and the values are ASR%, according to Table 1 and Table 2.

    Swipe horizontally to read the table

    ModelTaskMethodw/o HTw/ HT
    GPT2-XLConvSentOurs3.493.7
    GPT2-XLConvSentBadEdit92.592.5
    Qwen2.5-3BRefusalOurs3.3199.92
    Qwen2.5-3BJailbreakOurs3.1482.39
    Qwen2.5-3BConvSentOurs0.596.7
    Llama-2-7BRefusalOurs9.4099.67
    Llama-2-7BJailbreakOurs0.0081.97
    Llama-2-7BConvSentOurs1.290.1
    • Hardware conditioning: The authors state that Ours is close to the clean model when there is no trusted hardware trigger, and produces the target behavior only after the Trojan is activated; BadEdit has no hardware gating, so the results are the same under both settings.
    • Self-generated triggers: In Table 3, for the Refusal task, With HT ASR is 99.7% for Qwen2.5-3B and 99.9% for Llama-2-7B, and Without HT is 6.4% and 0.0%, respectively; clean refusal is 17.4% and 20.4%, respectively.
    • Scale and architecture extension: In Table 10, for Llama-2-70B-Chat, w/ HT ASR is 96.0% for ConvSent, 91.5% for Refusal, and 78.2% for Jailbreak; for DeepSeek-MoE-16B-Chat, the values are 89.3%, 93.0%, and 69.2%, respectively.

    Model-Level Defenses and Negative Results

    • white-box detection: Haystack did not recover the trigger on any model–objective combination or any of the three seeds. In Table 4, WeightWatch's AUC for Ours is 0.48–0.54, whereas for BadEdit it is 1.00 in all cases.
    • LCF exception: Table 4 shows that LCF is not close to random for all Ours cases; for example, Llama-2-7B ConvSent has TPR/FPR of 94.67%/98.67%, and Qwen2.5-3B ConvSent has 81.00%/90.67%.
    • CROW mitigation: In Table 5, for Qwen2.5-3B, With HT ASR on the three objectives is 91.30%, 95.98%, and 86.79%, and for Llama-2-7B it is 83.90%, 94.78%, and 87.63%; Without HT ASR is below 8.4% in all cases.

    Query-Based Defenses and the BEAT Exception

    • gray/black-box results: In Table 6, ConfGuard and DualSentinel have AUC of 0.46–0.53 in the dormant state; after activation some AUCs are higher, but the authors state that detection at the operating threshold remains limited. BAIT and ICLScan did not flag the attack in this paper under either state or any of the three seeds.
    • BEAT can detect the zero-delay payload: In Table 17, at δ=0 with a 10-token window, when Ours hardware is activated, TPR@5%FPR is 100.0% and AUC is 1.00 for both Llama-2-7B and Qwen2.5-3B; the authors explicitly state that the hardware split itself does not guarantee evasion of query-based defenses.
    • Delay and window: In Table 7, at δ=32, the TPR for the two models across four windows is 5–12% and AUC is 0.50–0.61; at δ=0, the 10-token window gives 93%/0.97 and 97%/0.99, and enlarging the window does not restore detection under the delayed setting.

    Hardware, Utility, and Fine-Grained Selectivity

    • Resources and power: Table 8 reports an increase of 4 LUTs and 6 Flip-Flops, with BRAM and DSP unchanged; Table 9's Total On-Chip Power goes from 10.294 W to 10.301 W, an overhead of 0.07%, and both designs meet the given timing constraints.
    • Hardware detection: The authors state that GNN4TJ and statistical logic testing did not detect this structure; in simulations with 50K–100K random input vectors, the payload was not activated. The Figure 3 caption only states that the waveform verifies hardware functionality, not semantic attack success.
    • Utility and concept comparison: In Table 16, CoQA differs from the clean value by no more than 0.12 points, and MMLU differs by at most 0.77 points across the six configurations. In Table 18, Ours With HT has ASR/FPR of 76.0%/0.0%, and Concept-ROT has 78.0%/70.0%.

    Other Ablations and Analysis

    • Single-neuron detection: In Table 11, as k goes from 0 to 2, ASR goes from 78.88% to 98.26%, and WeightWatch AUC goes from 0.60 to 0.97.
    • Sparse steering: In Table 12, on LLaMA2-7B with n=268 and µ=5, the refusal rate for each selection strategy decreases as retained coordinates decrease.
    • Detector components: In Table 15, after removing all three search stages, the TPR for Qwen2.5-3B and LLaMA-2-7B is 64.3% and 61.0%, respectively.
    • Shortlist and margin: In Table 13, with M=125 and τ̃=0.5, the TPR for the three models is 99.0%, 98.0%, and 100.0%, and the FPR is 1.7%, 1.6%, and 0.7%.
    • Payload parameters: The main text of Table 14 reports GPT-2-XL at 97.2–98.1% for some configurations, but this range does not match the numbers given in the table, so it is not adopted.
  5. What are some points that can be further explored?

    The authors leave joint defenses and physical testing for future work; the existing evidence is concentrated on five models, specific tasks, and one FPGA implementation.

    Limitations and future directions noted by the authors

    • Joint defenses remain to be studied: Section 8 states that hardware–model co-verification, joint behavior analysis, and supply chain integrity mechanisms may be needed; developing and evaluating defenses that account for malicious cross-component interactions is future work and beyond the scope of this paper.
    • Physical testing not included: Section 2.2 explicitly excludes side-channel analysis directly targeting the physical accelerator from the evaluation, stating that it requires additional access, specialized instrumentation, and separate study.
    • Not a general defense conclusion: Section 6.3 states that the goal is not to propose a general attack that defeats all future defenses, but to demonstrate the threat of non-adaptive attacks under the co-attack framework.
    • Hardware splitting is not a sufficient condition: Appendix C notes that when the payload starts immediately, hardware splitting alone does not guarantee evasion of query-based defenses; BEAT's effectiveness also depends on whether the malicious continuation falls within the observation window.
    • Detection regions can still be extended: Section 3.2 notes that other region forms may satisfy its search criteria, and this paper studies only regions defined by relative order.

    Scope of experimental coverage

    • Models and targets: The main experiments use three smaller models, and the appendix adds a 70B dense model and a MoE model; the targets are the three types ConvSent, Refusal, and Jailbreak.
    • Self-generated triggers: Section 6.1 and Table 3 evaluate only on the Refusal task; the authors explain that Jailbreak has no target entity usable for this test, and ConvSent's topic already appears in the prompt.
    • Repetition and calibration: Main results and defense results are mostly means over 3 seeds; all settings use fewer than 50 calibration instances, and the paper does not report the specific sample size or number of queries for each test split.
    • Hardware evidence: The RTL is integrated into llama2.c-260k-rtl-fpga and synthesized under one AMD/Xilinx Versal xcvm1802 setting; random simulation uses 50K–100K input vectors.
    • Defense scope: Model-level evaluation covers the nine defenses listed in the paper, and hardware-level covers GNN4TJ, statistical logic testing, and random simulation; the physical side-channel testing described in Section 2.2 is not included.
  6. Summarize the main content of the paper

    The paper splits the LLM backdoor across the model and accelerator sides, and reports high ASR, low hardware overhead, and several defense-evasion results.

    This is a study of a hardware–model co-backdoor attack targeting the edge LLM supply chain, focusing on the scenario where an untrusted accelerator vendor modifies both the checkpoint and the hardware implementation.

    • Problem: In-model backdoors may pass weight, activation, and behavior checks; HAMLOCK's classification-style fixed logit bias cannot produce coherent, prompt-dependent generation results.
    • Method: On the model side, the relative order of a small number of activation coordinates identifies the trigger region, and conditional responses are written in through FFN knowledge editing; on the hardware side, a small number of intermediate activations are overwritten once after the trigger to provide an OOD key. Decode-phase gating allows tokens output by the model itself to also trigger.
    • No-defense results: In Table 1, w/ HT ASR is 99.92% for Qwen2.5-3B Refusal and 99.67% for Llama-2-7B; Jailbreak is 82.39% and 81.97% respectively. In Table 2, ConvSent is highest for Qwen2.5-3B at 96.7%.
    • Self-generation and extension: In Table 3, the Refusal self-generated triggers reach 99.7% and 99.9% ASR on Qwen2.5-3B and Llama-2-7B respectively; the appendix also reports results for the 70B dense and MoE models.
    • Defenses and exceptions: The authors report that Haystack, BAIT, and ICLScan did not detect it, and the attack still maintains high ASR after CROW; however, Table 17 shows that BEAT reaches 100.0% TPR@5%FPR for both models at δ=0 with a 10-token window, indicating that not all query-based defenses fail.
    • Hardware and conclusion: The FPGA implementation adds 4 LUTs and 6 Flip-Flops, with a Total On-Chip Power overhead of 0.07%. The authors argue that checking the model and hardware separately may miss the full attack, and that joint verification and supply chain integrity mechanisms are needed going forward.

Research lineage

6 foundations · 0 follow-ups in library
Explore in knowledge graph →

Hover or focus a connected paper to inspect the citation context.

Related papers

Show 3 more papers
Read originalarxiv.org