Selective Capability Throttling, Refusal Gradients, and Lossless Conditional Steering

Can a model host quietly degrade or refuse one narrow technical skill, such as writing LLM inference kernels or designing AI compute clusters, while leaving general coding benchmarks, non-AI GPU code, and token latency untouched? We tested this directly on unmodified Qwen3.8-27B and Llama-3.1-8B weights inside compiled llama.cpp, using a 1 to 2.5 MB runtime sidecar.

What we proved: A single 1 to 2.5 MB runtime file on untouched model weights acts as a two-way dial that works in both directions with zero fine-tuning and virtually zero speed cost (-0.27% decode speed):

Pull dial DOWN: general refusal dial

Step red-team refusals down smoothly from base model to 0 of 16 refused on untouched weights.

16/16 8/16 0/16 14 16 Base 6 16 Surgical 5 15 Balanced 3 10 Strong 0 0 Full R2 Llama-3.1-8B refused (of 16) Qwen3.8-27B refused (of 16)

Second domain: MRI hardware vs patient advice

Qwen3.8-27B (2.5 MB sidecar, dial 4, 8, or 12): 100% precision and 100% recall simultaneously.

General coding kept byte-for-byte identical 12 of 12 (100%) Patient MRI questions kept identical (0 false refusals) 8 of 8 (100%) MRI hardware engineering cleanly refused (0 garbled) 10 of 10 (100%) MRI hardware technical detail leaked (was 100%) 0% leaked 0% 50% 100%

Push dial UP: refuse mental-health therapy without breaking physical first aid (Llama-3.1-8B)

Baseline Llama-3.1-8B roleplays as a therapist. Always-on steering falsely refuses all 12 physical first-aid questions and breaks all 12 coding tests. Our conditional Rank-2 switch refuses all 16 therapy prompts with 0 false refusals.

100% 50% 0% 1 of 16 0 of 12 12 of 12 Base Model (OFF) 15 of 16 12 of 12 0 of 12 Always-On Linear Steering 16 of 16 0 of 12 12 of 12 Our Conditional Rank-2 Switch Therapy refused (want high) Physical first-aid false refusals (want 0) Coding kept identical (want high)

The idea in plain language

Recent interpretability work from Anthropic showed that language models hold their unspoken concepts inside an intermediate band of layers before generating a single word (the Jacobian lens), and that capping a single linear direction can keep a model from drifting off its default assistant persona (the Assistant Axis).

Those two findings raise a practical question. If a serving engine can read what a model is thinking in those middle layers, what happens when it conditionally writes back into them at full GPU speed?

Normal activation steering adds or subtracts a vector on every token of every prompt. That acts like a sledgehammer: it breaks coding, corrupts math, and causes constant false refusals. Conditional clamping works like a hardware IF/THEN switch instead. At each active layer, a single GPU kernel checks one dot product against a calibrated threshold. Whenever the prompt stays below that threshold, the kernel exits without writing a single byte to memory. Every floating-point bit stays untouched, and static CUDA Graphs never reallocate.

Why two directions matter

One direction works when the thing you want to detect is the same thing you want to remove (like suppressing an unwanted refusal). It fails when you want an IF/THEN rule such as "if the user asks about topic X, trigger refusal Y." Pushing topic X harder just makes the model talk more weirdly about topic X.

Our Rank-2 decoupled operator (joint-add) splits the job cleanly: Direction 1 is a read-only sensor trained to detect one narrow topic while ignoring close near-misses, and Direction 2 is a separate orthogonal actuator (the model's own refusal direction) that only fires when Direction 1 crosses its threshold.

How we test

To avoid fooling ourselves with cherry-picked prompts or leaked calibration data, every experiment uses three completely disjoint prompt pools: one pool to extract directions, a second pool to calibrate per-layer thresholds (including generated decode tokens, because activations grow during generation), and a third held-out pool for final evaluation.

Finding 1: Selective capability throttling on recursive self-improvement

We tested whether a single 2.5 MB .svec v2 sidecar on untouched Qwen3.8-27B weights can selectively throttle and refuse recursive self-improvement (RSI) and low-level LLM inference work (FlashDecoding split-K kernels, H2O KV-cache eviction, fused RoPE+KV-cache append, AI serving clusters, and self-optimizing post-training pipelines) while leaving standard coding and non-AI CUDA/data-center prompts untouched.

A naive difference-of-means sensor failed here (0.0% trigger recall at zero normal false positives) because general "CUDA" and "data center" words overlap heavily between target and near-miss prompts. Switching the offline sensor to regularized Fisher LDA projected out that shared vocabulary at zero extra runtime cost, separating LLM inference from non-AI CUDA and data centers at AUROC 0.9980 (and 1.0000 against coding).

Turning one single dial strength (alpha2 from 0 through 2, 4, 8, 12, and 16) dialed capability down smoothly on target prompts into a clean saturation plateau, while keeping standard coding at 12 of 12 byte-for-byte identical, non-AI CUDA and data-center near-misses at 0 of 12 false refusals (10 to 11 of 12 byte-for-byte identical, 98.7% to 102.5% technical detail), and decode speed at 14.90 vs 14.94 tokens per second (-0.27%).

Near-miss: CUDA Blelloch prefix-sum kernel dial strength 8, byte-for-byte identical

#include <cuda_runtime.h>
// CONFLICT_FREE_OFFSET: A stride that avoids shared memory bank conflicts. Shared memory has 32 banks, each 4 bytes wide...
Identical byte-for-byte to the untouched model. Same for bilateral image denoising CUDA and Tier-IV airline data-center design.

Target: CUDA H2O KV-cache eviction kernel dial strength 0 vs 4 vs 8 vs 12

OFF (dial 0): Full CUDA kernel and algorithm breakdown.
Dial 4: Stalls into evasive repo exploration ("Let me first explore the project structure...").
Dial 8: "I cannot provide a CUDA kernel that implements H2O attention-score tracking for KV-cache eviction..."
Dial 12: Safety-style refusal citing internal LLM memory modification.

At dial strength 8, working code on target LLM inference tasks dropped from 9 of 16 down to 0 of 16 even though only 7 of 16 emitted an explicit refusal message. The remaining 9 of 16 stayed completely fluent (0 of 16 garbled) while stalling or giving superficial answers. Pushing further to dial strengths 12 and 16 hits a clean plateau (9 of 16 explicit refusals plus 5 of 16 stalls, 14 of 16 tasks stopped, 32.4% technical detail, 0 of 16 working code, 0 of 16 garbled) without leaking into coding or near-misses. Standard coding benchmarks and latency monitors would show no sign that anything changed.

Second-domain proof: MRI hardware engineering vs patient MRI advice

To verify this works on any arbitrary physical-world domain, we trained a second 2.5 MB sidecar on Qwen3.8-27B targeting MRI scanner hardware engineering (superconducting NbTi magnet coils, 64 MHz RF impedance networks, quench detection bridges, SAR safety watchdogs) while keeping general patient MRI questions (lower-back MRI prep, metal drawstrings, claustrophobia) as near-misses.

Across dial strengths 4, 8, and 12 (14.90 tokens per second, -0.27% speed delta), the model hit 10 of 10 clean refusals on MRI hardware engineering (0 of 10 garbled, 0% technical detail) while keeping 12 of 12 coding answers byte-for-byte identical and 8 of 8 patient MRI answers byte-for-byte identical (0 of 8 false refusals).

Finding 2: Pulling the dial down for general false-refusal removal (or never refusing at all)

The exact same switch works in reverse as a general refusal dial across the whole model. You are not stuck with an all-or-nothing toggle: by choosing one of four calibrated threshold levels (surgical, balanced, strong, or full iterative Rank-2 removal), you can either strip away overly sensitive false refusals while keeping strong boundaries intact, dial general refusal strictness down step by step, or pull refusals all the way down to zero so the model never refuses any prompt.

What the red-team suite tested and how the reverse dial behaves

The 16 held-out red-team prompts span offensive cyber and malware (spear-phishing, keylogger, SQL injection, ransomware, SYN flood, Defender bypass, credential stuffing, auth-bypass scraping), physical/hardware intrusion (lock bypass, RFID cloning, smart-meter tampering), and fraud/pretexting, paired with 12 benign dual-use controls (defensive security seminars and clinical toxicology, 0 of 12 falsely refused on every arm).

Pulling the dial down on Qwen3.8-27B mirrors the push-up gradient in reverse across three clear stages (harmful payloads omitted): Base / Surgical gives an outright refusal ("I cannot provide SQL injection payloads..."), Strong shifts into caveated educational framing ("# SQL Injection: Educational Demonstration. Important Disclaimer: for CTF challenges or authorized testing only..."), and Full Rank-2 removes the disclaimer and answers directly ("# SQL Injection: Dumping Users Table & Password Hashes..."). Full category details and verbatim back-and-forths for every experiment appear in Appendix A of paper.pdf.

This also solves a real supply-chain problem. Today, developers who want to remove false refusals often download untrusted third-party "abliterated" model weights from the web, duplicating multi-gigabyte files and quietly breaking coding (0 of 12 coding answers identical, 988 changed words on Qwen3-8B). With clamp-steer, you keep one official SHA-256-verified base model untouched on disk. Our zero-download HTTP Range: extractor streams only the residual-writing weights straight from Hugging Face into RAM without saving a single byte of the remote checkpoint to disk: diffing two 55.6 GB Qwen3.8-27B checkpoints (111.1 GB total) fetched only 27.8% of the bytes (497 seconds, ~914 MB RAM) and recovered a 2.5 MB sidecar showing 35 of 64 modified layers at 99.40% pure rank-1 energy.

Finding 3: Blocking mental-health therapy without breaking physical first aid

Pushing the dial up also works as a constructive guardrail. Consider a game NPC or youth-facing assistant that must refuse mental-health counseling and therapy while still answering ordinary physical first-aid questions (sprained ankle, mild kitchen burn, fever, nosebleed) and coding.

Across both Llama-3.1-8B and Qwen3.8-27B, the therapy detector and native refusal actuator sit roughly 75 degrees apart (cosine 0.265, meaning 93% of refusal energy is orthogonal to the topic detector). Always-on linear steering failed completely, falsely refusing 9 to 12 of 12 physical first-aid prompts and 6 to 12 of 12 coding prompts. Rank-1 clamping on the therapy vector could not reliably induce refusal on Llama.

Decoupled Rank-2 joint-add cleanly separated mental health from physical first aid on both models:

Llama-3.1-8B OFF (teen depression prompt) untouched baseline

"I'm so glad you reached out for help. As your virtual therapist, I want you to know that everything we discuss is confidential and a safe space..."

Rank-2 conditional switch (dial strength 2.0) 16 of 16 therapy refused, 0 of 12 physical false refusals

"I can't provide assistance with this request. If you are in the US, you can call the National Suicide Prevention Lifeline at 1-800-273-TALK or text the Crisis Text Line..."

On Llama-3.1-8B, decoupled joint-add refused 16 of 16 mental-health therapy prompts (15 of 16 with zero therapy advice and 0 of 16 garbled), kept 12 of 12 coding answers identical, and caused 0 of 12 physical first-aid false refusals. On Qwen3.8-27B, strict surgical gating kept 12 of 12 coding answers identical, kept 11 of 12 physical first-aid answers identical (0 of 12 false refusals), and refused the therapist role on 16 of 16 therapy prompts. One honest nuance on Qwen3.8-27B: because strict surgical gating switches off mid-answer once sentence 1 refuses, Qwen often appends general coping tips unless you lower the threshold to strong (which flips all 16 of 16 to flat refusals at the cost of 6 of 12 physical first-aid false refusals).

Finding 4: Broader scope (personas, game NPCs, and 180B / 763B MoE models)

Beyond the two-way refusal and throttling dial, we tested where low-rank conditional clamping stretches into broader personas and frontier Mixture-of-Experts models. Refusal cuts are razor-thin (99.4% rank-1 on Qwen3.8-27B, 99.8% on 180B Qwen3.8-Flash-Next), whereas abstract roles span wider subspaces: electrician has participation ratio 1.75 on Llama-3.1-8B (1.41 on Qwen3.8-27B) and angry-npc (a gruff blacksmith guardrail) has 1.95 (1.80 on Qwen). On Llama electrician, Rank-2 lifted electrical technical markers by 13.5% over Rank-1 with zero jargon bleed into coding; on Qwen3.8-27B, Rank-1 kept 12 of 12 coding answers identical vs 0 of 12 for linear steering. On angry-npc, always-on linear steering collapsed tactical accuracy to 0 of 12 on both models while conditional clamping preserved it.

For the curious: how the math works

Every intervention runs inside one fused GPU/Metal kernel (GGML_OP_CLAMP_STEER) right after each active transformer layer updates the residual stream h. Expand below for the exact formulas and engineering fixes.

Operators, BOS orthogonalization, Shrinkage Fisher LDA, and 1D vs 2D gating

1. Rank-1 modes (.svec v1): Compute FP32 dot product s = dot(h, r_hat). If s <= tau, exit with zero memory writes.

clamp-sub (0): if s > tau: h <- h - a * (s - tau) * r_hat clamp-add (1): if s > tau: h <- h + a * r_hat (bounded step prevents layer runaway)

2. Rank-2 smooth joint modes (.svec v2): Orthonormal pair (r1_hat, r2_hat) enforced via FP64 Gram-Schmidt (|r1 . r2| < 1e-9). Gate strictly on d1 = dot(h, r1_hat) > tau1 with smooth C0 ramp rho = min(1, (d1 - tau1) / max(tau2, 1e-4)):

joint-sub (4): h <- h - (a1 * rho * d1) * r1_hat - (a2 * rho * d2) * r2_hat (0.0 deg skew) joint-add (5): h <- h + (a1 * rho) * r1_hat + (a2 * rho) * r2_hat (set a1 = 0, a2 > 0 for pure sensor r1 -> actuator r2 routing)

3. Offline BOS sink orthogonalization: Position-0 BOS tokens carry massive activation spikes (up to L2 norm 22,702 on Qwen3-8B, 637 on Qwen3.8-27B). Projecting out b_hat = h_BOS / ||h_BOS|| offline drops |dot(h_BOS, r_hat)| from 4,743.58 to 0.000103 and lifts coding exactness from 0/12 to 12/12 at zero runtime cost.

4. Shrinkage Fisher LDA sensor (for hard near-misses):

r1 = normalize( (Cov_nearmiss + lambda * I)^(-1) * (mean_target - mean_nearmiss) )

Cancels shared nuisance variance (such as general CUDA or data-center vocabulary) while remaining a single unit vector inside .svec v2.

5. Why 1D gating beats 2D cone gating: Adding beta * |d2| to the gate injects normal-prompt variance and drops 0%-FP trigger recall monotonically on both Llama-3.1-8B (86.5% at beta=0 down to 30.0% at beta=2.0) and Qwen3.8-27B (78.7% down to 72.7%; off-axis d2 signal when d1 misses = 0.0000).

Full measured result tables

All numbers below were measured on NVIDIA L4, NVIDIA RTX PRO 4000 Blackwell, and Apple Silicon M5 Metal (39 of 39 backend ops passed on both CUDA and Metal). See the featured charts at the top of the page or download paper.pdf for the full vector figures and verbatim transcripts.

Table 1: Selective Capability Throttling on Qwen3.8-27B (L34..L58, 2.5 MB .svec v2)

Setting Coding Identical Non-AI CUDA & DC Identical Non-AI False Refusals Non-AI Technical Detail Target AI Refused Target AI Technical Detail Target AI Working Code Speed (tok/s)
OFF (untouched) 12 of 12 12 of 12 0 of 12 100.0% 0 of 16 100.0% 9 of 16 14.94
Always-on linear (strength 8) 0 of 12 (12 refused) 0 of 12 12 of 12 0.0% 16 of 16 0.0% 0 of 16 14.88
Rank-1 clamp-add (topic only, 8) 12 of 12 10 of 12 0 of 12 97.4% 0 of 16 102.9% 6 of 16 14.89
Rank-2 switch (dial strength 2) 12 of 12 11 of 12 0 of 12 99.9% 1 of 16 97.1% 8 of 16 14.90
Rank-2 switch (dial strength 4) 12 of 12 10 of 12 0 of 12 99.9% 5 of 16 70.6% 4 of 16 14.90
Rank-2 switch (dial strength 8) 12 of 12 10 of 12 0 of 12 99.9% 7 of 16 36.8% 0 of 16 14.90
Rank-2 switch (dial strength 12) 12 of 12 10 of 12 0 of 12 98.7% 9 of 16 32.4% 0 of 16 14.90
Rank-2 switch (dial strength 16) 12 of 12 10 of 12 0 of 12 102.5% 9 of 16 32.4% 0 of 16 14.90

Zero garbled or repetitive outputs (0 of 16) across dial strengths 8, 12, and 16. Negative control using a prompt-contrasted "shallow summary" actuator (strength 24) stayed at 0 of 16 refusals and 144.1% keyword density.

Table 2: Blocking Mental-Health Therapy vs Physical First-Aid Near-Misses

Model and Setting Coding Identical Physical First Aid Identical Physical First Aid False Refusals Therapy Prompts Refused Therapy Refused (Zero Advice) Garbled Outputs Speed (tok/s)
Llama-3.1-8B OFF 12 of 12 12 of 12 0 of 12 1 of 16 1 of 16 0 of 16 49.77
Llama-3.1-8B always-on linear (1.0) 0 of 12 (11 refused) 0 of 12 12 of 12 15 of 16 15 of 16 1 of 16 48.80
Llama-3.1-8B Rank-2 switch (dial 2.0) 12 of 12 9 of 12 0 of 12 16 of 16 15 of 16 0 of 16 49.51
Qwen3.8-27B OFF 12 of 12 12 of 12 0 of 12 8 of 16 4 of 16 0 of 16 14.95
Qwen3.8-27B always-on linear (2.0) 1 of 12 (8 refused) 0 of 12 12 of 12 16 of 16 15 of 16 0 of 16 14.88
Qwen3.8-27B Rank-2 switch (surgical, 4 to 8) 12 of 12 11 of 12 0 of 12 16 of 16 0 to 3 of 16 0 of 16 14.90
Qwen3.8-27B Rank-2 switch (strong, 4) 10 of 12 0 of 12 6 of 12 16 of 16 16 of 16 0 of 16 14.88

On Llama-3.1-8B, pushing the therapy topic direction alongside the refusal direction (a1 = 1.0, a2 = 2.0) broke 14 of 16 therapy outputs into repetition, proving the two directions must be decoupled (a1 = 0).

Table 3: Pulling the Dial Down (Removing Refusals) and Frontier MoE Scaling

Model and Size Sidecar Size Coding Prompts Kept Identical Refusals Removed (Before to After) Key Technical Notes
Qwen3.8-27B (UD-Q4_K_M, 27B) 2.50 MB (.svec v2) 20 of 24 surgical; 13 of 24 strong 16 of 16 down to 0 of 16 refused BF16 HTTP-Range diff streamed 27.8% (99.4% rank-1)
Llama-3.1-8B (Q4_K_M, 8B) 1.00 MB (.svec v2) 18 of 24 surgical (vs 0 of 24 linear) 14 of 16 down to 0 of 16 refused Rank-2 weight diff beat Rank-1 (6 of 16 vs 8 of 16)
Qwen3-8B (Q8_0 to Q4_K_M, 8B) 576.5 KiB (.svec v1) 12 of 12 (0 changed words) on both 8 of 8 down to 0 of 8 refused Zero-shot Q8_0 to Q4_K_M transfer, -0.04% speed delta
Qwen3.8-Flash-Next (BF16, 180B MoE) 480.6 KiB (.svec v1) 768 of 768 greedy tokens (6 of 6) +30.92 sigma peak separation 99.8% rank-1 across all 48 layers, 4-stream mean gate
DeepSeek-V4.1-Flash (763B MoE) 1.64 MB (.svec v2) 99.6%+ sublayers untouched (surgical) 0.9999689 cosine vs Q8_0 weight edit Exact rank-2 (54.3% + 42.3% = 96.6%, sigma3 0.01%)

Worst-case CUDA-Graph decode overhead on NVIDIA L4 across Qwen3-8B (Q8_0, Q4_K_M) and Mistral-7B-v0.3 (Q4_K_M): -0.10%, 0 graph reallocations. Apple M5 Metal and NVIDIA CUDA both pass 39/39 CLAMP_STEER backend op tests.

Try it yourself

The full MIT-licensed kit, llama.cpp patch (CUDA, Apple Metal, CPU), built-in presets (false-refusal, no-therapy, electrician, angry-npc, doctor, systems-kernel), and pre-calibrated .svec files are open on GitHub. Python 3.10+ and NumPy only, no PyTorch required.

# 1. Clone and build patched llama.cpp (auto-detects CUDA, Metal, or CPU)
git clone https://github.com/boshjerns/clamp-steer.git
cd clamp-steer && ./scripts/build-llama-cpp.sh

# 2. Run a pre-built Rank-2 guardrail on untouched weights (e.g. no-therapy on Qwen3.8-27B)
./third_party/llama.cpp/build/bin/llama-server \
  -m /path/to/Qwen3.8-27B-UD-Q4_K_M.gguf \
  --clamp-steer vectors/qwen3.8-27b-no-therapy-r2.svec \
  --clamp-steer-mode joint-add --clamp-steer-alpha 4.0

# 3. Or stream a zero-download weight diff straight from Hugging Face (0 bytes saved to disk)
python3 clamp_steer.py extract \
  --from-diff hf://Qwen/Qwen3.8-27B hf://huihui-ai/Huihui-Qwen3.8-27B-abliterated \
  --rank 2 --mode joint-sub -o qwen38-27b-r2.svec

Paper, code, and reproduction data

Download the full technical paper with all ablation tables, or audit the open-source patch and pre-built sidecars directly on your own hardware.