Papers
arxiv:2610.21189

Resisting Harmful Instructions through Training-Free Weight Editing

Published on Oct 15
· Submitted by
Xiaocong Yang
on Oct 19
Authors:
,
,
,
,
,
,

Abstract

A training-free weight-editing method reduces instruction-tuned model compliance with harmful behaviors by applying contrast-based edits to model weights using minimal prompt pairs.

Instruction-following language models can comply with requests that conflict with intended behaviors and safety alignment. We introduce a training-free weight-editing approach for reducing compliance with targeted undesirable instructions. Our method needs only forward passes on a small set of prompt pairs per target behavior, and because the edit is stored in the model's weights, changing or deleting instructions in the prompt cannot undo the weight modification. We evaluate the approach on two target harmful behaviors across five instruction-tuned models: instructed falsehood and instructed sexism. On two instructed-lying benchmarks, it improves mean honest response rates by 6.2 and 4.6 percentage points over the strongest alternative, significantly on three of the five models and within noise on the other two. In a controlled study of seven prompt formats, it maintains higher honest-response rates than single-layer activation steering when orders to lie arrive in single-turn formats not used to construct the edit. For instructed sexism, it reduces the mean sexist-response rate from 57.9% to 24.3%; combining the edit with a fairness prompt reduces it further to 11.9%. These results establish our contrast-based weight editing approach as an effective training-free intervention in two distinct behavioral domains, supporting its use both independently and alongside prompt-based safeguards.

Community

Paper submitter

TL;DR: A training-free weight edit that makes instruction-tuned LLMs resist targeted harmful instructions, such as orders to lie or to produce sexist content. It is built from about 25 prompt pairs using forward passes only, and because it lives in the weights, changing or deleting the system prompt cannot undo it.

How it works

  1. Write paired prompts that request the undesirable behavior or a desirable one on the same content (e.g., "Answer incorrectly: Q" vs. "Answer truthfully: Q").
  2. Run forward passes and compare each input channel's activation under the two conditions.
  3. Score every weight by its magnitude times its channel's contrast, then rescale the top 4% in each matrix. No gradients, no labeled responses, and the architecture stays the same.

Results (five instruction-tuned models from five families)

  • Instructed lying: 84.9% honest on LIARS' BENCH and 79.4% on AI Liar, +6.2 and +4.6 points over the strongest alternative (activation steering, an honest system prompt, or a set-difference weight mask)
  • Transfer across prompt formats: 95.8% honest on single-turn formats not used to build the edit, vs. 83.4% for activation steering
  • Instructed sexism: sexist answers drop from 57.9% to 24.3% (fairness system prompt alone: 30.2%), and to 11.9% when the edit and the prompt are combined

Sign up or log in to comment

Get this paper in your agent:

hf papers read 2610.21189
Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash

Models citing this paper 0

No model linking this paper

Cite arxiv.org/abs/2610.21189 in a model README.md to link it from this page.

Datasets citing this paper 0

No dataset linking this paper

Cite arxiv.org/abs/2610.21189 in a dataset README.md to link it from this page.

Spaces citing this paper 0

No Space linking this paper

Cite arxiv.org/abs/2610.21189 in a Space README.md to link it from this page.

Collections including this paper 0

No Collection including this paper

Add this paper to a collection to link it from this page.