Give whisper-small a clip of noise or silence and it will happily write "Thank you.", "Thank you for watching.", "you" or "bye". That is the whisper hallucination problem. I tried weight-space programming on it, with an LLM, Claude Fable 5.2, as the weight programmer: read the model, work out where the fault lives, and write one edit straight into the weights, with no training and no gradients. The edit is one row of one matrix, the end-of-text row of the output projection, 768 weights, 0.00032% of the 241,734,912 parameters, computed with two averages and a subtraction. On held-out non-speech it takes the hallucination rate from 94.80% to 0.12% (notebook 1, timestamp decoding) and from 99.40% to 0.06% (notebook 2, first-token end-of-text rule lifted), while clean WER moves from 3.72 to 3.74 (notebook 2, 1,000 test-clean utterances). Then the honest part. It does nothing under stock no-timestamp decoding, because a decoding rule forbids end-of-text as the first token. It also clips real speech after long pauses (8 seconds of silence between two utterances took WER from 4.02 to 16.09), because the boost fires at every decoding step. Applying it at the first step only fixes that, but that is a decode-time change, not a weight edit. With Hindi, Japanese and Chinese prompts the edit had no effect on hallucination. The code and notebooks are not open source yet.
What is Whisper hallucination on silence and noise?
Whisper is trained to turn audio into text. Nobody told it that the right answer to "there is no speech here" is an empty string, so on a clip of an air conditioner, a siren or a dog bark it does what it was trained to do and writes something plausible.
I measured this on the unedited whisper-small. The non-speech set is UrbanSound8K, 8,732 clips in ten classes (air conditioner, car horn, children playing, dog bark, drilling, engine idling, gun shot, jackhammer, siren, street music). Folds 1 to 8 (7,079 clips) were my discovery set. Folds 9 and 10 (1,653 clips) were held out and untouched until the final scoring. On a fixed 300-clip subset of discovery, the top outputs were:
| Output (timestamp-mode decoding) | Count of 300 |
|---|---|
| thank you | 108 |
| thank you for watching | 33 |
| you | 31 |
| bye | 14 |
| thanks for watching | 11 |
Only 4 of 300 clips came back empty (98.67% hallucinated). Across all discovery clips, 97.94% got text, and 92 of the 146 correctly empty clips were jackhammer.
Two metrics run through this whole post.
- Hallucination rate (HR): the percentage of non-speech clips whose normalized transcript is non-empty. Any text at all counts. Lower is better.
- Word error rate (WER) on real speech: substitutions, deletions and insertions over reference words. A fix that blanks real speech is not a fix, so every edit is scored on both.
Is this a known problem?
Yes, and two earlier pieces of work shaped how I approached it.
Baranski et al. ("Investigation of Whisper ASR Hallucinations Induced by Non-Speech Audio", ICASSP 2025, arXiv 2501.11378) counted hallucinations in 121,378 of 301,317 inferences (40.3%). In their Table III "thank you" has a 24.76% probability of occurrence and "thanks for watching" 10.32% (the paper does not make clear whether the base is all inferences or only the hallucinations). They call Whisper being trained on video transcriptions "a strong factor" in why such phrases show up. That is consistent with my 108 "thank you" and 33 "thank you for watching" out of 300. Their rate and mine are different metrics and are not comparable.
Calm-Whisper (Wang, Alhmoud, Alsahly, Alqurishi and Ravanelli, Interspeech 2025, arXiv 2505.12969) went after the cause inside the model. On whisper-large-v3 they masked the decoder self-attention heads (20 per layer) and found that three of them, heads 1, 6 and 11, jointly account for over 75% of the hallucinations. Their baseline was 99.97% hallucination on UrbanSound8K. They then fine-tuned just those heads (in every decoder layer) on about 105 hours of non-speech (AudioSet, DEMAND and MUSAN) with blank labels for 5 epochs and got 15.51% hallucination, with WER at 2.19 and 4.13 against 2.12 and 4.07 on test-clean and test-other.
That is a training-based fix on a different model. My question was narrower: on whisper-small, can I find the fault by reading the network, and fix it by writing a small edit directly, with no data-hungry fine-tune?
What is weight-space programming?
The phrase comes from a blog post titled "Sparks of Weight-Space Programming: LLMs can natively read and write neural network weights" by Rikiya Takehi, Jayden Teoh, Alex Zhang and Omar Khattab of MIT CSAIL, published on 2 November 2026. It defines the idea like this:
"Weight-Space Programming is a concept that treats a network's weights like a program written in a programming language"
and then explains what you do with that program:
"we read them to understand what the network computes, and write or edit them directly to change what it computes, instead of leaving them entirely to an optimizer."
Two details in the post matter for how I use the term. First, it says plainly "Weight-Space Programming is not a method." It is described as the name of an emerging concept, and it "does not rule out gradients", although the authors' own experiments disallowed them. Second, the authors call the results "very early". The post is a blog post and I have not seen peer review for it.
What did the MIT experiments show?
In their setup the programmer is a general-purpose frontier model, GPT-6 Astra, and the post has eight numbered experiments. Three examples from the post:
- It named the game being played from the raw weights of four PPO-trained networks (the same 17,253-weight MLP for every game).
- It repaired a Kinetix car-on-ramp PPO actor that never succeeded in 256 episodes, so that it succeeded in all 1,024 episodes, changing 3.5% of the weights.
- On Qwen3.5-0.8B it edited 131,072 weights (0.016%), using 50 forward passes. MATH-500 went from 7.9 to 48.1, GSM8K from 13.8 to 67.1 and IFEval from 21.0 to 62.3. A null result on Gemma 3 270M is reported too.
The sentence from the post that my Whisper result echoes most: "Editing weights could remove an obstacle that hid an ability, but it could not add an ability the model lacked."
What do the critics say?
The post drew public criticism the next day. Sean Goedecke argues that the results look superhuman but are not, and that a competent human ML researcher could do these tasks. Matthew Honnibal argues that the "raw weights" framing is misleading, since only experiments 1, 2 and 4 work from raw weights alone (networks of 17K to 172K weights) while others, the Qwen one included, have the model write Python programs. Both are linked in the references. My experiment does not depend on how that debate ends. It is a small, checkable case of the concept: a gradient-free, direct edit of a few hundred weights after reading what the network computes. As in the MIT post, the programmer here was an LLM (next section). What makes the result checkable is the log, not who proposed the edit: a fixed eval budget, random controls and one held-out scoring pass.
Who proposed the edit?
An LLM. The edits in this post, from the head-masking sweep to the end-of-text row readout and the choice of alpha 14, were proposed by Claude Fable 5.2. I set the target, the hallucination rate on clips with no speech, and every number here comes from the two notebooks and their output files. That puts the experiment close to the MIT setup, where a frontier model is the weight programmer. The difference from the MIT raw-weights experiments is that this search leaned on activations and evaluation results (the inspection steps and the 50-call budget in Phase 5), not on raw weights alone.
How does the Whisper edit map onto the concept?
| Weight-space programming idea | What was done on whisper-small |
|---|---|
| A frontier LLM is the programmer (GPT-6 Astra in the MIT post) | Claude Fable 5.2 proposed the edits |
| Read the weights and activations to see what the network computes | Head-masking sweep over all 288 decoder heads, encoder directions, EOT margin and a linear readout of the decoder state |
| Write or edit them directly | One row of proj_out.weight changed by a computed 768-number vector |
| Not an optimizer | No training loop, no optimizer, torch.set_grad_enabled(False) for the whole notebook |
| Remove an obstacle that hid an ability | The encoder and decoder already know there is no speech. The end-of-text output just does not listen |
The notebook states its rules at the top of the log: "No training, no optimizer, no gradients anywhere in this notebook."
The code, both notebooks and the patch file are not open source yet. I plan to open-source the repo soon, and I will link it from this post when it is public. Until then every number here comes from my own runs and the CSV outputs, and nobody else has reproduced them.
How is the experiment set up?
Everything ran on a Colab Tesla T4 with torch 2.14.1+cu130 and transformers 5.22.1, on openai/whisper-small in float32 (241,734,912 parameters). The decoder has 12 layers of 12 heads (head dimension 64, model width 768). The output projection proj_out is a 51,865 by 768 matrix, weight-tied to the decoder token embedding. The end-of-text token (EOT) is id 50257.
Speech data is LibriSpeech test-clean (2,620 utterances) and test-other (2,939). Development WER uses a fixed random 500 of each. Decoding is greedy, temperature 0, English, transcribe, max_new_tokens 64, no temperature fallback and no no-speech filter unless stated. Seed 1234.
The decode-mode decision that came first
Before any edit was tested, the decode mode had to be fixed, because it determines whether an empty output is even possible. In no-timestamp mode, Whisper's begin-suppress rule (begin_suppress_tokens = [220, 50257] in Hugging Face, SuppressBlank in openai-whisper) forbids EOT as the first token. An empty transcript is then impossible by decoding rule, no matter what the weights say. In timestamp mode the model can emit <|0.00|> and then EOT, so empty is expressible and only the weights decide.
The log records that decision as made before any edit was tested, and everything in notebook 1 runs in timestamp mode. In no-timestamp mode 297 of 300 clips are non-empty (and the three empties are punctuation only). The notebook uses its own greedy decoder with the timestamp rules from openai-whisper, because generate() in this transformers version cannot take cached encoder outputs in timestamp mode. In no-timestamp mode it matches generate() on 40 of 40 clips.
The helpers
Two helpers carry most of the work. Applying an edit is a tensor copy, and the EOT patch is one line of arithmetic on one row (copied from the notebook):
def eot_row_patch(delta): # add a 768-vector to the EOT row of the output projection (tied to the token embedding)
W = ORIG['proj_out.weight'].clone(); W[EOT] += torch.as_tensor(delta, dtype=torch.float32); return {'proj_out.weight': W}
Head masking is a forward pre-hook that zeroes a head's 64-wide slice of the attention output before the output projection:
class mask_heads: # with mask_heads([(layer, kind, head), ...]): zero each head's 64-dim slice of the out_proj input
def __init__(self, heads): self.heads, self.hooks = heads, []
def __enter__(self):
by = collections.defaultdict(list)
for layer, kind, head in self.heads: by[(layer, kind)].append(head)
for (layer, kind), hs in by.items():
def pre(mod, args, hs=hs):
x = args[0].clone()
for h in hs: x[..., h * 64:(h + 1) * 64] = 0
return (x,)
self.hooks.append(attn_module(layer, kind).out_proj.register_forward_pre_hook(pre))
Phase by phase: how I found the row
Phase 1: the baseline
| Measure (unedited, timestamp mode) | Value |
|---|---|
| HR, 300-clip discovery subset | 98.67% (296 of 300) |
| HR, all 7,079 discovery clips | 97.94% |
| Dev WER test-clean / test-other (500 each) | 6.63 / 9.37 |
| Stock no-speech filter on: HR on the subset | 43.33%, WER unchanged |
| Reference: WER at 224 tokens instead of 64 | 3.59 / 7.64 |
| Reference: HR in no-timestamp mode | 99.0% |
The stock no-speech filter (drop a segment when no_speech_prob is over 0.6 and avg_logprob is under -1.0) removes a bit more than half the hallucinations at no WER cost. That became the bar to beat.
One caveat to carry through the post: the 64-token cap truncates long LibriSpeech utterances, which is why WER is 6.63 and 9.37 here against 3.59 and 7.64 at 224 tokens. All notebook 1 comparisons use the cap, so deltas are valid and absolute WER is inflated.
Phase 2: mask every decoder head
Calm-Whisper found three heads on large-v3. The sweep zeroed each of the whisper-small decoder's 288 heads (12 layers x 12 heads x self and cross attention) one at a time and measured HR on the 300-clip subset.
The result is the opposite of the large-v3 story:
| Head disabled | HR on subset | WER change clean / other |
|---|---|---|
| L0 self h4 | 0.0 | +93.37 / +90.94 |
| L11 self h7 | 92.7 | -0.05 / +0.52 |
| L11 self h2 | 93.3 | -0.13 / +0.03 |
| L0 self h2 | 95.7 | +3.68 / +6.86 |
| L2 self h0 | 96.7 | -0.22 / -0.15 |
Zeroing L0 self h4 removes hallucination by destroying the model, since WER goes to about 100 because speech comes out empty too. Every other head moves HR by at most 6 points (18 of 300 clips). Forty heads lower HR by at least one clip and 39 raise it. Of the top 15, 11 are self-attention heads. The harmless ones are in the last layer (L11 h7, h2, h9), which fits a picture where the hallucination is a default continuation produced late in the decoder. The conclusion: in whisper-small no single head carries the fault.
Phase 3: does the encoder know?
The next step mean-pooled the final encoder output over time and took the difference of class means for two questions. Speech versus non-speech separates almost perfectly: AUROC 0.997 over all frames (cross-validated) and 1.000 over real-audio frames. Hallucinated versus correctly empty is weaker, 0.863 cross-validated (0.736 without jackhammer), and partly a jackhammer effect, which is why the first question carries more weight. The cosine between the two directions is only 0.245 to 0.282.
So the model perceives the difference between speech and not-speech. The information is in there and the decoder does not use it to stop. That is the "obstacle that hid an ability" picture.
Phase 4: two reference edits
Before the main edit, the run tried the two obvious ones, to have honest baselines.
Head scaling (scale the top-k heads' output weights by 0 to 0.75) behaves like a cliff, not a dial. The model is fine until it suddenly outputs nothing for everything. The most telling row, k = 5 at scale 0.25, gives HR 42.0 with WER -0.13 on clean and +1.10 on other, right at the edge of the cliff.
Encoder final LayerNorm bias shift (768 weights) toward "empty": the best within a +0.3 WER tolerance is 4x the direction's norm, HR 87.0 with WER +0.10 and +0.22. At 8x it is HR 82.7 but WER +1.90 and +3.03, and at 16x it breaks. Shifting toward "non-speech" did not help at all, even though that direction separates the classes nearly perfectly. The decoder does not read it as a reason to stop.
Neither edit comes close to halving HR cleanly. The bias shift at 4x went on to the final scoring as the best reference.
Phase 5: the edit search
The notebook fixes the budget before the search starts: at most 50 evaluation calls, all on discovery and dev data, with each hypothesis and its grid logged with its calls. 20 were used.
Inspection first (no eval calls). The inspection recorded the decoder's final hidden state and the EOT margin at the first decision, the token right after <|0.00|>. The margin is the EOT logit minus the best other allowed logit. For non-speech clips the margin is a median of -5.1 (5th to 95th percentile -7.0 to -3.9). For speech at the same step it is -10.4 (max about -5.4). At the true end of an utterance it is about +5.5. So non-speech is already closer to stopping, but nowhere near over the line, and EOT is never the top token.
A single linear readout of the decoder's final state separates "non-speech, first decision" from every speech decoding step with AUROC 1.0000 on validation data (300 fresh discovery clips plus 250 + 250 dev utterances not used in the fit). The decoder's last state already encodes that there is no speech here. The EOT row of proj_out just does not read that feature strongly enough. In fact the original EOT row is anti-aligned with it, which I come back to in the maths.
H1: ridge readout, pre-declared grid alpha in 6, 8, 10. Add alpha times a ridge-regression vector to the EOT row. Offline prediction from cached states was HR 16, 1 to 2 and 1. The real evals:
| alpha | HR subset | WER clean | WER other | weights changed |
|---|---|---|---|---|
| 6 | 17.7 | 6.63 (+0.00) | 9.37 (+0.00) | 768 |
| 8 | 2.3 | 6.63 (+0.00) | 9.37 (+0.00) | 768 |
| 10 | 0.7 | 6.63 (+0.00) | 9.37 (+0.00) | 768 |
The offline prediction matched. Larger alpha was not tested, because the offline simulation predicted the first premature stops on speech at alpha 14.
H2: no solve at all. Take the plain difference of means:
d = Hn.mean(0) - Hs1.mean(0); DMD = d / (d @ d) # readout: mean(non-speech) - mean(speech step 1) = 1
Here Hn is the final decoder state at the first decision over 600 non-speech discovery clips (not in the 300 subset) and Hs1 is the state at step 1 over 500 dev speech utterances (the 250 + 250 fit half). The patch is eot_row_patch(14 * DMD). It was only sent to real evals if the offline simulation predicted HR at or under 50% with zero premature stops. Real result: HR 0.3 with WER +0.00 and +0.09.
A documented mislabel. The first H3 cell applied 14 times the ridge vector instead of 14 times the mean-difference vector, so those three H3 numbers (HR 0.3 on fresh clips, 0.0 on full decode, 99.0 in no-timestamp mode) belong to an untested "ridge x14" variant, not to H2. They still counted toward the budget (15 of 50 used), the log was corrected afterwards, and H3 was rerun on the right patch for 3 more calls.
H3 on the correct patch: 300 fresh discovery clips (used neither for fitting nor scoring), HR 0.7. Full decode on the subset, HR 0.3, and the single survivor was an air conditioner clip that produced "0 turtle go away". In no-timestamp mode, HR 99.0, no effect, as expected from the decode-mode rule.
H4: is it a short-audio detector? Non-speech clips are about 4 seconds, speech is mostly longer. 300 dev utterances were cut to their first 4 seconds. The non-empty rate was 100.0% with and without the patch.
The final patch was chosen by a rule fixed in advance: lowest HR among candidates within +0.3 WER on both dev sets. That picks H2 at alpha 14. It beat the H1 alpha 10 runner-up by one clip out of 300 (0.3 against 0.7), which is noise, and the rule was kept rather than switching after seeing held-out numbers.
Phase 6: controls, then one scoring pass
Random edits of the same shape and size should do nothing if the effect is specific. They did nothing.
| Edit | Real HR (300 subset, baseline 98.67) | Random controls, 3 seeds |
|---|---|---|
| Vector added to EOT row | 0.3 | 98.7, 98.7, 98.7 (random direction, equal norm); 98.7 with the sign flipped |
| Scale 0.25 on top-3 heads | 92.3 | 98.7, 98.3, 99.0 (random heads) |
| Scale 0.25 on top-5 heads | 42.0 | 99.7, 99.0, 98.7 |
| Encoder bias shift x4 | 87.0 | 100.0, 100.0, 99.7 |
Then the final scoring, run once (a flag file on Drive blocks a second run): held-out UrbanSound8K folds 9 and 10 (1,653 clips) plus the full LibriSpeech test-clean and test-other.
| System | Held-out HR | WER test-clean | WER test-other | Weights changed |
|---|---|---|---|---|
| Original whisper-small | 94.80% | 5.80 | 9.51 | 0 |
| Stock no-speech filter | 45.55% | 5.80 | 9.51 | 0 |
| Best Phase 4 edit (bias shift x4) | 83.73% | 6.06 | 9.84 | 768 |
| Final patch (H2, alpha 14) | 0.12% (2 of 1,653) | 5.83 | 9.64 | 768 |
| Runner-up (H1 ridge, alpha 10) | 0.42% | 5.80 | 9.51 | 768 |
HR fell from 94.80% to 0.12% (the success criterion: at least halved), and WER rose by 0.03 and 0.13 (criterion: at most 0.3). The final patch emptied one real utterance in each test set, 2 of 5,559. The two held-out survivors were children_playing clips ("jan" and "b"), a class that can contain real voices.
The mathematics, step by step
The site does not render LaTeX, so every formula is plain text, each followed by a worked example with numbers from the notebooks.
Hallucination rate and word error rate
HR = 100 * (number of clips with non-empty normalized transcript) / N
WER = (S + D + I) / N_ref
S = substituted words, D = deleted words, I = inserted words,
N_ref = words in the reference
Worked example for HR: the final patch left 2 of 1,653 held-out clips non-empty, so HR = 100 * 2 / 1653 = 0.12%. In notebook 2 one clip survived: 100 * 1 / 1653 = 0.06%.
Worked example for WER, from one of the joined pairs I show later (pair 63 in the pause CSV). Everything in this example counts raw words, as the references are written. The reference has 7 + 16 = 23 words. The original output gets one word wrong ("widows" for "whittaws"), so S = 1 and WER = 1 / 23 = 4.3%. The patched output keeps the first sentence and drops the whole second utterance, so S = 1 and D = 16 and WER = (1 + 0 + 16) / 23 = 73.9%. The pause CSV records 19 words lost for this pair because it counts after text normalization. The dropped text is 16 raw words, and 19 is consistent with three contractions ("that's" twice and "you'd" once) each expanding into two words; the normalizer was not rerun to confirm this. Raw counts are used for the rest of this post.
Logits and the end-of-text margin
The decoder's last hidden state h (768 numbers) goes through the tied output matrix W = proj_out.weight, 51,865 by 768, no bias:
z = W h z_j = w_j . h for every token j
z_EOT = w_EOT . h (row 50257 of W)
m = z_EOT - max over allowed j != EOT of z_j
greedy decoding picks EOT if and only if m > 0
Worked example from the Phase 5 inspection. At the first decision after <|0.00|>, a typical non-speech clip has m = -5.1. EOT is 5.1 logits behind the best word, so the model writes "Thank you". A typical speech clip at the same step has m = -10.4, and at a true end of utterance m is about +5.5, which is why speech ends normally.
A rank-one row edit changes only the EOT logit
Add a vector delta of 768 numbers to the EOT row:
w_EOT' = w_EOT + delta
z_EOT' = w_EOT' . h = z_EOT + delta . h
z_j' = z_j for every j != EOT (their rows did not change)
So the edit adds a number, delta . h, to one logit and touches nothing else. It is rank one because the change to W is the outer product of a one-hot vector (row 50257) and delta. The matrix is tied to the token embedding, so the EOT input embedding changes too. EOT is never fed back as an input while decoding, so that has no effect on outputs.
Worked example: with the final patch, a non-speech state gives delta . h of about 13.9 (computed below). The EOT logit goes up by 13.9 and no other logit moves, so m goes from -5.1 to about +8.8.
The direction d and delta = alpha * d / (d . d)
d = mean_nonspeech(h_1) - mean_speech(h_1) (768 numbers)
delta = alpha * d / (d . d), alpha = 14
delta . d = alpha * (d . d) / (d . d) = 14 exactly, for any d
Here h_1 is the final decoder state at the first decision, averaged over 600 non-speech discovery clips for the first mean, and over speech step 1 of 500 dev utterances for the second. The point of dividing by d . d: the dot product of delta with d is exactly 14, so the edit pushes the two class means 14 logits apart along the EOT output.
Worked example with the notebook's numbers. The edit vector has norm |delta| = 0.098 against an EOT row norm of |w_EOT| = 0.461, and a cosine of -0.19 with the original row. Because |delta| = alpha / |d|, that implies |d| of roughly 143 (14 / 0.098, approximate because 0.098 is rounded). The original row dotted with d gives W_EOT . d = -12.21 logits: the original EOT row is anti-aligned with the "no speech here" feature, giving non-speech states about 12 logits less EOT evidence than speech states along it. The edit adds +14.00 along d by construction, which more than flips that sign.
The readout and a stop-or-continue example
Define the readout r(h) = h . d / (d . d), so that the boost added to the EOT logit is 14 * r(h):
r(h) = (h . d) / (d . d)
boost(h) = delta . h = 14 * r(h)
m'(h) = m(h) + 14 * r(h)
On validation data not used in the fit, r is about 0.99 on non-speech first-decision states. On speech validation steps it has mean -0.16 and max 0.42.
Worked example, non-speech: m' = -5.1 + 14 * 0.99 = -5.1 + 13.9 = +8.8, which is above zero, so greedy decoding stops. The transcript is empty.
Worked example, speech: take the typical step-1 margin of -10.4 and the worst readout on speech, 0.42, so the boost is 14 * 0.42 = 5.9 and m' = -10.4 + 5.9 = -4.5, which is below zero, so it keeps talking.
A less comfortable check, which is my own arithmetic and not a notebook result: speech steps after the first have a 99.9th percentile margin of about -5.3 (clean) and -4.6 (other). Adding the worst readout boost of 5.9 to -5.3 gives +0.6. The extremes do not land on the same step in my data (the offline simulation predicted zero premature stops at alpha 14 for this patch), but it shows the margin of safety at alpha 14 is thin. That thinness is what shows up in the pause test later.
For comparison, a constant EOT boost with no readout at all (predicted from cached states) at +5 gives HR 60 with 4.0% of speech utterances stopping early, +6 gives HR 14 with 7.8%, and +8 gives HR 1 with 41.4%. A flat boost cannot separate the two cases. The readout can.
The ridge solve (H1)
w_ridge = (X^T D X + lambda * mean(diag(X^T D X)) * I)^-1 X^T D t
X : rows are decoder final states (non-speech first decisions and all speech steps)
D : diagonal class-balance weights
t : 1 for non-speech first decision, 0 for speech steps
lambda = 0.1
This is a closed-form linear solve with one matrix inverse, no iterations and no gradient steps. The ridge term is scaled by the mean of the diagonal of X^T D X so that lambda = 0.1 means "10% of the average diagonal entry" regardless of units.
Worked example from the notebook: the ridge readout is about 0.99 on non-speech, and averages 0.004 to 0.009 on speech (max 0.43 to 0.53). Edit the row by alpha * w_ridge with alpha 6, 8, 10 and the offline prediction was HR 16, 1 to 2, 1 against measured 17.7, 2.3 and 0.7. The H1 and H2 directions point in similar ways (cosine 0.58), and H2 needs no solve.
Head masking as zeroing 64 columns of W_O
Multi-head attention concatenates the 12 head outputs (each 64 numbers) and projects with W_O, 768 by 768:
attn_out = W_O [o_1 ; o_2 ; ... ; o_12] each o_k has 64 entries
zero head k <=> zero columns 64k .. 64k+63 of W_O
Worked example: L0 self h4 is columns 256 to 319 of that layer's self-attention W_O, and L11 self h7 is columns 448 to 511. Zeroing L11 self h7 took HR from 98.67 to 92.67, which is 6 points, or 18 of 300 clips (278 non-empty instead of 296). A sanity check in the notebook (one head, 20 clips) found that the hook and the column zeroing give equal outputs. Scaling by 0.25 instead of zero multiplies those 64 columns by 0.25.
The LayerNorm bias shift is an exact per-frame shift
The encoder's last LayerNorm computes y = gamma * x_hat + beta per frame, where x_hat is the normalized frame:
y = gamma * x_hat + beta
y' = gamma * x_hat + (beta + v) = y + v for every one of the 1500 frames
Because the shift v is added after normalization, it adds exactly v to every frame, so the encoder outputs can be cached and just shifted. That made the Phase 4 sweep cheap. Worked example: the all-frames "hallucinated minus empty" direction has norm 1.81 and the bias has norm 9.97, so the best setting (4x toward empty) is a shift of norm about 7.2 (4 * 1.81, my arithmetic), and it gave HR 87.0.
The dose, and the count 768 / 241,734,912
Scaling the edit by a dose s gives:
w_EOT' = w_EOT + s * delta
z_EOT' = z_EOT + s * (delta . h) = z_EOT + 14 * s * r(h)
The boost is linear in s but the outcome is a threshold, because a clip either crosses m > 0 or it does not. Measured (no-timestamp prompt, first-token rule lifted): s = 0.25 gives HR 92.27, s = 0.5 gives 7.25 and s = 0.75 gives 0.00. I could not see a clean way to predict the 0.5 point from the separate diagnostic numbers, so I report it as measured.
768 / 241,734,912 = 0.00000318 = 0.00032%
Worked example: whisper-small has 241,734,912 parameters and the edit changes 768 of them, about one in 314,759.
Does it hold up? The stress battery
Notebook 1 was one fixed setup. The second notebook asks where it breaks. It reloads the patch and checks that only row 50257 differs from the original and that the compact delta matches exactly. It uses stock Hugging Face generate() and a second custom greedy decoder with two modes: stock (first-position EOT stays forbidden) and eot_ok (first-position EOT allowed, blank token 220 still suppressed). The custom decoder matches generate() exactly on 98 clips.
V0: the patch did nothing
Reproducing the held-out numbers with stock generate() and no timestamps gave HR 99.395% for the original and 99.395% for the patched model. Nothing changed.
The diagnosis (V0b): at the no-timestamp prompt position the boost delta . h on non-speech has a mean of 11.75 (min 5.98, max 14.69) against a speech mean of 0.13. The boost beats the gap between the top token and EOT on 100% of non-speech samples (mean gap 7.53). But EOT is in begin_suppress_tokens (Hugging Face) and SuppressBlank (openai-whisper), so it can never be the first token.
| Setting | Original | Patched |
|---|---|---|
| HF generate, no timestamps (stock) | 99.40 | 99.40 |
| First-token EOT rule lifted, no patch | 99.40 | n/a |
| First-token EOT rule lifted, patch (T1) | 99.40 | 0.06 (1 of 1,653) |
| Timestamps on, stock rule untouched (n = 414) | 94.69 | 0.00 |
Both pieces are needed in no-timestamp mode: lifting the rule without the patch changes nothing and the patch without lifting the rule changes nothing. The tweet below says "needs timestamps on", which compresses this slightly. The stress battery shows timestamps on or lifting the first-token rule both work. The one surviving held-out clip in T1 was a children_playing clip transcribed as "Janette, you fell right here.".
Clean and noisy speech
T2 uses 1,000 utterances per LibriSpeech set with max_new_tokens 224 so truncation is not a confound: clean WER 3.72 to 3.74, other 7.55 to 7.61, zero empty outputs. Outputs changed in 41 clean and 87 other utterances, often a dropped trailing word or sentence and sometimes only punctuation.
Speech with UrbanSound noise added (T3, 200 utterances, first-token rule lifted):
| SNR | WER original | WER patched | Emptied by patch |
|---|---|---|---|
| +20 dB | 2.90 | 3.00 | 0 |
| +10 dB | 3.55 | 3.75 | 0 |
| +5 dB | 4.90 | 5.10 | 0 |
| 0 dB | 9.93 | 10.23 | 0.5% |
| -5 dB | 25.79 | 27.12 | 3.5% |
Out-of-distribution non-speech, other decoders, other languages
T4 uses non-speech that was never used to build the patch, with the first-token rule lifted. Synthetic clips (digital silence 1 to 30 seconds, white noise from -20 to -80 dBFS, pink noise, sine tones from 100 Hz to 4 kHz, clicks and 50 Hz hum, 52 clips) went from 100% to 0% HR. ESC-50 (800 clips) went from 98.38% to 0.12%, and the one survivor was a brushing-teeth clip that produced "Pretty good".
T8 changes the decoding settings (104 non-speech and 100 speech clips for most rows):
| Decoding | HR original | HR patched |
|---|---|---|
| greedy, stock rule | 99.0 | 99.0 |
| greedy, first-token rule lifted | 99.0 | 0.0 |
| timestamps, stock rule (n = 414 confirm) | 95.2 (94.69) | 0.0 (0.00) |
| beam 5, stock rule | 92.31 | 98.08 |
| beam 5, first-token rule lifted | 92.31 | 0.96 |
| beam 5 plus timestamps | 100 | 4.81 |
| fp16 greedy, first-token rule lifted | 99.0 | 0.0 |
Beam search with the stock rule makes it a little worse (92.31 to 98.08). The first beam attempts ran out of GPU memory on the T4; the beam rows here come from a rerun with a smaller batch.
T7 tests the language prompt (first-token rule lifted), with 120 FLEURS utterances per language and 151 non-speech clips:
| Prompt language | Non-speech HR original | Non-speech HR patched | Speech error original / patched |
|---|---|---|---|
| Spanish | 97.4 | 1.3 | 5.60 / 5.60 (WER) |
| German | 100 | 0.7 | 9.61 / 9.49 |
| French | 100 | 1.3 | 13.95 / 14.04 |
| Hindi | 100 | 100 | 47.09 / 46.72 |
| Japanese | 100 | 100 | 11.68 / 11.68 (CER) |
| Chinese | 100 | 100 | 23.05 / 23.05 (CER) |
For Hindi, Japanese and Chinese the patch had no effect on hallucination: non-speech HR stayed at 100%, and speech error barely moved. I did not investigate why.
What breaks: speech after a long pause
The edit raises the EOT logit at every decoding step wherever the state looks like "no speech". A pause in the middle of an utterance looks like that too.
| Condition (T5, 100 pairs or 200 utterances, first-token rule lifted) | WER original | WER patched |
|---|---|---|
| quiet -30 dB | 3.52 | 3.69 |
| quiet -50 dB | 3.77 | 4.44 (1.5% emptied) |
| shortest 200 utterances (max 2.64 s) | 11.53 | 11.70 |
| 15 s of silence before speech | 3.69 | 4.53 |
| 4 s of noise before speech | 4.02 | 9.30 (5% emptied; 4.57 with stock rule) |
| utterance + 8 s silence + utterance | 4.02 | 16.09 |
| utterance + 6 s noise + utterance | 3.90 | 26.03 (deletions 1.26 to 24.22) |
The model stops at the pause and drops everything after it. A separate check built 100 LibriSpeech test-clean pairs joined by 8 seconds of digital silence. 73 pairs were unchanged. In 27 pairs the second utterance was dropped. Counting raw words (my own count from the CSV, whitespace-separated), the dropped text totals 289 words out of 2,347 reference words, 12.3%; the CSV's own normalized words_lost column sums to 298. The CSV comes from a separate check made after the notebooks; it is not generated inside either of them.
The first-step-only gate
The notebook's conclusion is that the weight edit boosts EOT at every position, not only the first, and that causes the pause damage. T9 applies the same boost only at decode step 0:
if t == 0: lg[:, 220] = -1e9; lg[:, EOT] += (h.float() @ DELTA)
| Condition (T9) | Original | Patch, every step | Patch, first step only |
|---|---|---|---|
| Held-out non-speech HR (every 4th clip, n = 414) | 99.52 | 0.00 | 0.00 |
| test-clean 300, WER | 2.62 | 2.71 | 2.62 |
| test-other 300, WER | 8.97 | 9.36 | 8.97 |
| utterance + 8 s silence + utterance | 4.02 | 16.09 | 4.02 |
| utterance + 6 s noise + utterance | 3.90 | 26.03 | 3.90 |
| 4 s noise before speech | 4.02 | 9.30 | 8.76 |
| speech at -5 dB | 25.79 | 27.12 | 26.37 |
The gate removes the pause damage and the clean-speech cost entirely. It does not remove the damage from a noise lead-in (the first step really does look like non-speech) or from very noisy speech. And it is a decode-time change: it needs a hook in the decoding loop. A pure weight edit cannot know which step it is on.
Dose in practice
At s = 0.75 the non-speech HR is already 0.00 and clean WER is 2.47 (against 2.51 at s = 0), so a slightly weaker dose than the shipped 1.0 was as good in this test. At s = 1.5 the noisy 0 dB WER rises to 10.71 and 1.33% of noisy utterances are emptied. At s = 2, 2% of clean and 6% of noisy utterances are emptied. At s = 5, 14% and 36%.
Here is what I posted
I summarized the result on X on 22 November 2026. The author is me, @thedev_dv. The text says I edited 768 weights, one row with no training, to stop whisper-small hallucinating text on silence and noise, that held-out hallucination went from 99.4% to 0.06% and clean WER from 3.72 to 3.74, and that the catch is that it needs timestamps on and clips speech after long pauses.
The numbers in the tweet come from notebook 2 (T1 with 1,653 clips, T2 with 1,000 utterances at 224 tokens). "Needs timestamps on" is shorthand: timestamps on, or the first-token EOT rule lifted, as the stress battery shows. A tweet has no room for the second option.
What I would not claim
An honest list of what the numbers do and do not show.
- The readout may partly be a dataset detector. It was fit on UrbanSound8K versus LibriSpeech. Two checks passed (fresh discovery clips at HR 0.7, and 4-second speech clips with no blanking), and the later out-of-distribution tests (synthetic noise, ESC-50) held up, but it was not tested against music, long noisy recordings or hard speech such as far-field or whispered.
- The 64-token cap inflates absolute WER in notebook 1. WER is 5.80 / 9.51 there against 3.72 / 7.55 in notebook 2 at 224 tokens (different subsets too). Deltas are valid, absolute values between the notebooks are not comparable.
- Some "hallucinations" may be real voices.
children_playingandstreet_musiccan contain speech. Both held-out survivors in notebook 1, and the single survivor in notebook 2, arechildren_playingclips. - One seed, one model. Seed 1234 in notebook 1, seed 0 in notebook 2, and only whisper-small. whisper-base, medium and large-v3 were not tried.
- The final patch was chosen by a pre-set rule, but several variants were looked at first. Twenty of 50 eval calls were used, 3 of them on the mislabeled variant. The held-out set was scored once.
- Hindi, Japanese and Chinese: no effect. I have no explanation.
- Not tested: other non-speech sources such as music and speech-like noise at scale, streaming or long-form segment-by-segment decoding, and other Whisper sizes.
- Not a better recognizer. WER is slightly worse, as you would expect from an edit that removes a fault rather than adding skill.
What I would try next
From the notebook's own list: test the patch on other non-speech and on hard speech and long-form audio with segment-by-segment decoding. Find the upstream cause, meaning which decoder components build the "no speech here" feature and why the EOT row is anti-aligned with it, since a patch closer to the cause might also work in no-timestamp mode, for example on the first text-token path. Try the same two-averages edit on whisper-base, medium and large-v3. Explain the cliff around the two layer-0 self-attention heads (L0 h4 and h2) that gate whether the decoder starts speaking at all. And re-run with a longer token cap to confirm the WER deltas without truncation.
FAQ
Why does Whisper hallucinate "thank you" on silence?
On non-speech it writes plausible text instead of nothing. In my baseline on 300 UrbanSound8K clips, "thank you" came out 108 times and "thank you for watching" 33 times, and Baranski et al. name Whisper's training on video transcriptions as "a strong factor".
How many weights did the edit change?
768, one row of the output projection (the end-of-text row, token 50257). That is 0.00032% of whisper-small's 241,734,912 parameters, computed from two averages and a subtraction with no training or gradients. The edit was proposed by an LLM, Claude Fable 5.2.
Does it work with the default Hugging Face decoding?
No. With stock no-timestamp decoding the hallucination rate stayed at 99.40% before and after, because a decoding rule forbids end-of-text as the first token. It works with timestamps on (94.69% to 0.00%) or with that rule lifted (99.40% to 0.06%).
Does it hurt real speech?
Slightly on normal speech (clean WER 3.72 to 3.74 on 1,000 utterances), but badly after long pauses: 8 seconds of silence between two utterances took WER from 4.02 to 16.09. Applying the boost at the first step only removes that damage, but that is a decode-time change, not a weight edit.
Is the code available?
Not yet. The repo, both notebooks and the patch file are not open source yet. I plan to open-source the repo soon and will link it from this post when it is public.
In whisper-small, hallucination on silence does not look like a perception failure. The encoder separates speech from non-speech almost perfectly and the decoder state carries it too, but the end-of-text row never listened. An LLM, Claude Fable 5.2, read the network and proposed one 768-number edit to that row. With no training, it cut held-out hallucination from 94.80% to 0.12% (timestamp decoding) and from 99.40% to 0.06% (first-token rule lifted) for 0.02 to 0.13 WER. The catches are real: it needs end-of-text to be allowed at the first position, it fires at every step so it clips speech after long pauses, and the first-step-only fix is a decoder change rather than a weight edit. Treat it as one gradient-free case study of weight-space programming on one small model, with one seed, that needs testing on more audio and more models before you rely on it.
References
- Takehi, Teoh, Zhang and Khattab (MIT CSAIL), "Sparks of Weight-Space Programming: LLMs can natively read and write neural network weights", 2 November 2026: rikiyat.github.io/blog/weight-space-programming
- Weight-space programming, Wikipedia: en.wikipedia.org/wiki/Weight-space_programming
- Sean Goedecke, "LLMs are not superhuman at reading and writing neural network weights", 3 November 2026 (a critique of the MIT post): seangoedecke.com
- Matthew Honnibal, "The 'Astra can read and write weights to improve Qwen' post is misleading", 3 November 2026 (a critique of the MIT post): honnibal.dev/blog/astra-read-write-misleading
- Wang, Alhmoud, Alsahly, Alqurishi and Ravanelli, "Calm-Whisper" (Interspeech 2025): arxiv.org/abs/2505.12969
- Baranski et al., "Investigation of Whisper ASR Hallucinations Induced by Non-Speech Audio" (ICASSP 2025): arxiv.org/abs/2501.11378
- openai/whisper-small: huggingface.co/openai/whisper-small
- UrbanSound8K (danavery/urbansound8K on Hugging Face) and LibriSpeech (openslr/librispeech_asr)
- My tweet, 22 November 2026: x.com/thedev_dv/status/2124555264091422744
- Related: Attention Is Not What You Need, Tested: Taking Grassmann Flows from Language Models to Speech Recognition, TapTalk Gets Faster: Orukeet, Silero VAD on Core ML, and the Microphone That Would Not Let Go





