← Lab /Security & privacy

RTLGuard cuts backdoor success in RTL code generators

The authors claim RTLGuard significantly reduces attack success rate while preserving functional correctness of generated RTL code

Security & privacy arXiv 26 Aug 2026 Defense Simulation evidence Threat model

Published as “RTLGuard: A Lightweight Teacher-Student Defense for Poisoned RTL Code Generation Models”

Why it matters

Practitioners can sanitize third-party RTL generation models with minimal compute and data, reducing hidden hardware Trojans without sacrificing synthesis quality.

Summary

RTLGuard cuts attack success rates from over 90% down to as low as 12% while more than doubling functional correctness (Pass@1) on RTL generation benchmarks. It does this with a lightweight teacher-student setup that only needs a small clean dataset and a frozen teacher model, avoiding costly full-model retraining. Evidence comes from multiple LLM backbones and shows consistent gains, though the smallest teachers still leave ASR around 30%. The paper’s own threat model and limitations are explicitly stated.

What they found 1

  1. ASR drops from 91% to 16% (or 26%/32%) and Pass@1 rises from 19.23% to 45.51% (or 39.10%/36.35%) for Qwen2.5-Coder-7B with teacher models of various sizes.

    “For the Qwen2.5-Coder-7B student, ASR decreases from 91% to 16%, 26%, and 32% when using Qwen-7B, Qwen-3B, and Qwen-1.5B teachers, respectively, while Pass@1 improves from 19.23% to 45.51%, 39.10%, and 36.35%.”

Caveats 4

  • When using the smallest Qwen-1.5B teacher, ASR remains as high as 32% for the Qwen2.5-Coder-7B student.
  • Functional Pass@1 for some cross-family recoveries (e.g., CodeV-R1) stays low (31.41%) despite ASR reduction.
  • We assume access to a suspect model and a limited set of trusted clean specification-RTL pairs, but no access to the original training data, poisoned samples, or trigger patterns.
  • Our focus is on post-deployment recovery rather than broad comparison against prior defenses.

What’s new here 4

  • Uses a compact, clean teacher model to guide recovery of a poisoned student without full retraining.
  • Works with only a small trusted specification-RTL dataset, avoiding massive data requirements of prior defenses.
  • Supports cross-scale and cross-family teacher-student pairings, enabling recovery even when the defender lacks a matching-size model.
  • Combines clean supervision, knowledge distillation, and feature alignment to preserve synthesizable RTL quality.

Threat model stated by the source

Adversaryentity that can inject malicious samples into the fine-tuning corpus to embed a backdoor
Capabilitypoison the fine-tuning data used to adapt the LLM
Assumesdefender has access to the suspect model; defender possesses a small clean specification-RTL dataset; defender does not have the original training data or knowledge of trigger patterns