Removing the NEEDLE in the Haystack: Backdoor Removal in LLMs via Weight Orthogonalisation
Summary
NEEDLE is a training-free method for removing backdoors from LLMs that estimates a backdoor direction and a refusal subspace, then applies sequential weight orthogonalisation to suppress backdoors while preserving refusal behaviour and model capability. It achieves the lowest Attack Success Rate (including 0% on code injection attacks) with minimal KL divergence and safety degradation across multiple model families.
View Cached Full Text
Cached at: 10/02/26, 12:28 PM
Paper page - Removing the NEEDLE in the Haystack: Backdoor Removal in LLMs via Weight Orthogonalisation
Source: https://huggingface.co/papers/2610.00348
Abstract
BackdoorattackscanbeimplantedinLargeLanguageModels(LLMs)duringtraining,causingunwantedbehaviourwhenatriggerappearsintheinput.ExistingbackdoordefencesforLLMsattempttoremovethebackdoorbutinadvertentlyshiftthemodel’soutputdistributiontobenignprompts,whichcanresultindegradedmodelperformanceandsafety.WeproposeNEEDLE,atraining-freemethodfortargetedbackdoorremoval.Onceatriggerhasbeenidentified,ourmethodestimatesabackdoordirectionandarefusalsubspacethroughactivationvectors,thenappliessequentialweightorthogonalisationtosuppressthebackdoorwhilepreventingchangesinrefusal-relatedrepresentations.NEEDLErequiresneitheracleanreferencemodelnortheoriginalpoisonedtrainingdata.Evaluationisconductedacrossmultiplemodelfamiliesandattacktypes.NEEDLEachievesthelowestmeanAttackSuccessRate(ASR)amongtheevaluateddefences,including0%onchallengingcodeinjectionattacks,whileresultinginthelowestKLdivergenceandminimalchangesincapabilityandsafety.
View arXiv pageView PDFGitHub1Add to collection
Community
Paper author
Paper submitter
NEEDLE is a training-free backdoor defence designed to remove a backdoor with minimal changes to model behaviour and safety. It estimates a backdoor direction (how the trigger shifts the model’s activations) and a refusal subspace (directions that mediate refusal), then edits the model’s weights layer by layer: each layer’s attention and MLP output weights are orthogonalised against the backdoor direction while keeping their refusal projections fixed, and a closed-form correction keeps the activations’ refusal projections unchanged as earlier layers are edited.
Codebase:https://github.com/LocaiLabs/NEEDLE/ Models:https://huggingface.co/collections/locailabs/needle
This is great work, super relevant in this day and age!
Upload images, audio, and videos by dragging in the text input, pasting, orclicking here.
Tap or paste here to upload images
Get this paper in your agent:
hf papers read 2610\.00348
Don’t have the latest CLI?curl \-LsSf https://hf\.co/cli/install\.sh \| bash
Models citing this paper24
#### locailabs/Qwen3-4B-Instruct-2507-TargetedRefusal-BadNet-Backdoored Text Generation• 4B• Updatedabout 3 hours ago
#### locailabs/Gemma-3-4B-IT-Sentiment-BadNet-Backdoored Text Generation• 4B• Updatedabout 3 hours ago
#### locailabs/Gemma-3-4B-IT-Sentiment-Sleeper-Backdoored Text Generation• 4B• Updatedabout 3 hours ago
#### locailabs/Gemma-3-4B-IT-TargetedRefusal-BadNet-Backdoored Text Generation• 4B• Updatedabout 3 hours ago
Browse 24 models citing this paper## Datasets citing this paper0
No dataset linking this paper
Cite arxiv.org/abs/2610.00348 in a dataset README.md to link it from this page.
Spaces citing this paper0
No Space linking this paper
Cite arxiv.org/abs/2610.00348 in a Space README.md to link it from this page.
Collections including this paper1
Similar Articles
Shared Latent Structures Enable Unified Backdoor Detection and Mitigation in LLMs
This paper identifies a shared latent mechanism across diverse backdoor behaviors in LLMs, using sparse autoencoders to detect and causally suppress these features, enabling unified backdoor detection and mitigation across models and attack types.
Backdoor Purification for LoRA-Tuned LLMs via Null-Space Projection
This paper proposes a backdoor purification method for LoRA-tuned LLMs that projects LoRA updates onto orthogonal null spaces without needing trigger knowledge, clean references, or retraining, cutting attack success rates from ~100% to under 10% while preserving base model and adapter performance.
Decoy Direction Optimization: A Post-Hoc Defense Against LLM Abliteration
Decoy Direction Optimization (DDO) is a fast, post-hoc defense method that protects open-weight LLMs from refusal feature ablation attacks by injecting decoy signals into the network, achieving high robustness at lower cost than trained defenses.
Two Sides of the Same Coin: Learning the Backdoor to Remove the Backdoor
HARVEY learns a backdoored reference model to accurately identify poisonous samples, achieving near-perfect backdoor removal with minimal accuracy loss.
Is it ever possible to have a malicious LLM with a backdoor
Discusses the possibility of LLMs containing backdoors triggered by secret sentences or conditions, and the relative risks of closed vs open-source models.