One ambiguous clip, read in depth#
The clip#
The clip above is ambiguous: the three models write different words for the same noisy two seconds.
Inside the noise whisper-tiny writes “clients quite told”, whisper-base “fire and sprite told” and
moonshine-base “lions, fight cold”, where the gold is “my iron’s twite told”. The sound-token
figure places each word by the erasure test and counts the words on the noise. The figure below
shows the same clip and the same three models through aud-cam with tokens=True. One backward
pass per token through the encoder gives each token a gradient map, drawn in grey, and the erasure
test’s first patch is a tick in the token’s colour. The script is experiments/ambiguous_case.py,
which also runs the clean twin.
Both methods place the words of the noisy stretch on the noise. “clients quite told”, “fire and sprite told” and “lions, fight” carry 93 to 95 % of their erasure mass and 57 to 90 % of their gradient mass on the noise. Of the tokens the gradient map places on the noise, the erasure test places 4 of 4 there for whisper-tiny, 5 of 5 for whisper-base and 6 of 7 for moonshine-base. The exception is moonshine’s “cold”, whose first-ranked patch lies 20 ms past the end of the window with 59 % of its mass inside.
The erasure test places more tokens on the noise than the gradient map does, 5, 7 and 8 against 4, 5 and 7. The additional tokens are “Money” in both Whisper models (92 to 98 % of its erasure mass on the noise, 44 to 46 % of its gradient mass), whisper-base’s “it” (62 % against 11 %) and moonshine’s “M” and final full stop. These tokens react when the noise is erased, but their encoder gradient lies elsewhere. The scores use a fixed transcript prefix, so the difference arises in the encoder: erasure measures the effect of a finite change to the input, which the encoder spreads over frames, and the gradient measures local sensitivity at each frame.
The models differ in how wide their gradient maps are. whisper-base’s maps are 0.5 to 0.8 s wide, whisper-tiny’s 0.8 to 1.1 s and moonshine-base’s 1.2 to 1.6 s. In all three the gradient maps follow the spoken order (rank correlation 0.86 to 0.94 with the token index). The erasure placement does too, except where it places “it” in the noise for whisper-base.
The next figure shows why the word error rate changed on this clip, and why it did not for
whisper-base. The clean and the degraded transcript of each model are aligned to the gold, and
every word is placed where its erasure evidence ranks first (experiments/ambiguous_wer.py, from
the saved attributions).
Filled green marks a word that is right at its place in the sentence. A red outline marks a substitution or an insertion.
The error rate changes only through the noisy two seconds. After the noise, “put it down to warm” is right in all six transcripts and the dialect word “pease” is wrong in all six, and the shared words keep their evidence within 0 to 200 ms. Inside the noise the words change in every model: whisper-tiny goes from “my iron’s tright” to “clients quite”, whisper-base from “my iron’s tried to hold” to “fire and sprite told”, moonshine-base from “my earns, Trite” to “lions, fight”.
The window words draw more of their evidence from the noise. Their erasure mass inside the window rises from 0.71 to 0.76 on the clean recording to 0.88 to 0.90 on the degraded one. The words outside the window are at 0.20 to 0.36. The per-token comparison below tests whether the new words depend on the noisy audio itself.
whisper-base stays at 45 % WER with different errors. On the clean recording its five errors are near misses on the dialect (“Money” for “munny”, “tried to hold” for “twite told”, “Please” for “pease”). On the degraded one they are the same two dialect words plus three invented words in the noise. The rate is unchanged because one kind of error replaced another, which the rate alone does not show.
Stats for nerds (the clean-to-degraded change per model)
model |
WER clean -> degraded |
words on the noisy stretch |
right on it |
right outside it |
shared words |
evidence in the noise, window words |
evidence in the noise, outside words |
|---|---|---|---|---|---|---|---|
whisper-tiny |
27% -> 45% |
4 -> 4 |
2 of 4 -> 1 of 4 |
6 of 7 -> 5 of 6 |
8 |
0.76 -> 0.89 |
0.21 -> 0.20 |
whisper-base |
45% -> 45% |
4 -> 6 |
2 of 4 -> 2 of 6 |
5 of 8 -> 4 of 5 |
6 |
0.72 -> 0.88 |
0.23 -> 0.26 |
moonshine-base |
36% -> 55% |
4 -> 3 |
1 of 4 -> 0 of 3 |
6 of 7 -> 5 of 7 |
7 |
0.71 -> 0.90 |
0.21 -> 0.36 |
Words “on the noisy stretch” are those whose first-ranked erasure patch lies inside 0.6 to 2.6 s on that recording. “told” moves in or out of the window between the two recordings, which is why the outside counts are not the same size. Evidence in the noise is the mean share of a word’s erasure mass inside the window.
Five tokens in the noise: erasure and encoder gradient compared#
Setting. On the degraded recording whisper-base writes five tokens in the noisy stretch, “Money”, “fire”, “and”, “sprite”, “told”, where the gold has “munny my iron’s twite told”. One of the five is right. On the clean recording the same stretch gives “Money”, “my”, “iron’s”, “tried”, “to”, “hold”, with three of six right. The question is which audio each token depended on: the noise, the speech under it, or audio elsewhere in the clip. The erasure test alone does not settle this. It measures how a token’s surprisal responds when a patch is removed, and the encoder spreads that change over frames, so a token can react to a patch it is not localised on. The encoder’s gradient for the same token is a second measurement of where the dependence lies.
Reading 1, erasure (sound-token). Each token’s first-ranked 100 ms x band patch and the share of its erasure mass inside the noisy 0.6 to 2.6 s.
token |
gold at that place |
patch (s) |
band (0 = lowest of 8) |
erasure mass on the noise |
|---|---|---|---|---|
Money |
munny |
0.75 |
5 |
0.98 |
fire |
my iron’s |
1.55 |
1 |
0.93 |
and |
1.85 |
0 |
0.94 |
|
sprite |
twite |
2.25 |
4 |
0.95 |
told |
told |
2.55 |
1 |
0.95 |
All five are on the noise with 93 to 98 % of their mass, and the three invented words lie within 0.2 s of the patches their clean-recording counterparts use (“my” 1.35 s, “iron’s” 1.65 and 1.85 s, “tried” 2.15 s). The erasure test shows that the words depend on what lies under those patches. It cannot separate the noise from the speech under it, and it does not distinguish “told”, which is right, from “fire”, which is not. These patches are the ones the controlled figure above draws, and a second run of the tool returned the same five.
Reading 2, the encoder’s gradient (aud-cam, tokens=True). For the same tokens, where the
per-frame gradient map sits at the top encoder layer, how wide it is, how much of it lies on the
noise, and the lowest that share gets over the seven encoder states (the embedding output, numbered
0, and the six transformer layers).
token |
gradient centre (s) |
width (s) |
share on the noise, top layer |
lowest share over layers |
reading |
|---|---|---|---|---|---|
Money |
2.21 |
1.05 |
0.46 |
0.46 |
diffuse |
fire |
1.61 |
0.70 |
0.88 |
0.64 |
degraded |
and |
2.11 |
0.78 |
0.86 |
0.62 |
degraded |
sprite |
1.91 |
0.57 |
0.90 |
0.60 |
degraded |
told |
2.26 |
0.69 |
0.70 |
0.39 |
degraded |
The cross-check tool on whisper-base: the two readings of every token in one figure. Top, the erasure boxes (dashed on the noise). Middle, the encoder's gradient per token with the erasure patch as a tick. Bottom, the share of that gradient on the noise per layer.
Interpretation.
Both methods localise the three invented words on the noise. “fire”, “and”, “sprite” keep 86 to 90 % of their gradient on the noise at the top layer and never fall below 0.60 at any layer, in maps 0.6 to 0.8 s wide, centred within 0.35 s of their erasure patch. Both methods therefore attribute these words to the noisy audio itself. The other two models write different words for the same two seconds (“clients quite” for whisper-tiny, “lions, fight” for moonshine-base), which is consistent with the signal being ambiguous there.
The one correct word has gradient outside the noise. “told” is the only window token whose gradient share falls below 0.4 (0.39 at layer 3), and it ends at 0.70. A third of its gradient lies past 2.63 s, where the noise ends and the last syllable is audible. The erasure test places it on the noise like the others (0.95), so only the gradient separates it. For moonshine-base the same patch gives “cold”, and its gradient stays inside the noise (0.63 at the top layer, centred at 2.09 s).
The two methods place “Money” differently. Its erasure mass is on the noise (0.98, first patch at 0.75 s), but its gradient is diffuse (1.05 s wide, 0.46 on the noise at every layer, centred at 2.2 s). It stands for the dialect word “munny”, and the model writes “Money” on the clean recording too, so the noise is not what makes it wrong.
The count depends on the method. The controlled figure above counts 7 of 14 words on degraded audio against 5 expected by chance. Requiring both methods to agree gives 5 of 14, the comma and the four content words. The two additional tokens, “it” and “Money”, have their erasure evidence on the noise and their gradient elsewhere. Across the three models the erasure test agrees with the gradient map on 4 of 4, 5 of 5 and 6 of 7 tokens and adds one or two erasure-only tokens each time.
The clean recording serves as the control. After the noise, “put”, “down”, “to”, “warm” keep the same erasure patch on both recordings (0 ms moved), and their gradient share on the noise falls from 0.3 to 0.6 at the input embedding to 0.1 to 0.2 at the top layer. At deeper layers the gradient for these words is concentrated on their own clean frames.
These are observations on one clip and three models. They show what the comparison can separate, and they are not a general result about noisy speech.
The same comparison for any clip and any white-box model is one command:
ways cross-check clip.wav --backend hf-whisper=openai/whisper-base --window 0.63 2.63 --reference "what was said" --out out/clip
ways cross-check clip.wav --backend hf-moonshine=UsefulSensors/moonshine-base --aadd --out out/clip # the detector's flags instead of a window
from ways.tools import cross_check
from ways.tools.cross_check import table
res = cross_check(wav, sr, backend=("hf-whisper", "openai/whisper-base"), window=(0.63, 2.63), out="out/clip")
res.summary["on_degraded"] # {'n_erase': 7, 'n_grad': 5, 'n_both': 5}
print(table(res, only_degraded=True))
Stats for nerds (the three placements, every token under both readings, the clean-recording control)
Three ways of placing each token in time. The tokens are in spoken order, so rho(order) near 1 means the placement follows the speech. Width is the median effective width of a token’s map at the top layer.
model |
recording |
method |
rho(order) |
median width (s) |
tokens placed in the window |
|---|---|---|---|---|---|
whisper-tiny |
degraded |
erasure |
0.99 |
0.10 |
38% |
whisper-tiny |
degraded |
grad x act |
0.86 |
0.87 |
46% |
whisper-tiny |
degraded |
Grad-CAM |
-0.30 |
1.78 |
54% |
whisper-base |
degraded |
erasure |
0.85 |
0.10 |
50% |
whisper-base |
degraded |
grad x act |
0.89 |
0.73 |
50% |
whisper-base |
degraded |
Grad-CAM |
-0.35 |
1.76 |
64% |
moonshine-base |
degraded |
erasure |
0.64 |
0.10 |
50% |
moonshine-base |
degraded |
grad x act |
0.94 |
1.22 |
50% |
moonshine-base |
degraded |
Grad-CAM |
0.46 |
2.58 |
25% |
whisper-tiny |
clean |
erasure |
0.98 |
0.10 |
47% |
whisper-tiny |
clean |
grad x act |
0.90 |
0.65 |
59% |
whisper-tiny |
clean |
Grad-CAM |
-0.25 |
1.53 |
41% |
whisper-base |
clean |
erasure |
0.99 |
0.10 |
44% |
whisper-base |
clean |
grad x act |
0.93 |
0.67 |
50% |
whisper-base |
clean |
Grad-CAM |
0.16 |
1.21 |
62% |
moonshine-base |
clean |
erasure |
0.98 |
0.10 |
44% |
moonshine-base |
clean |
grad x act |
0.94 |
1.18 |
56% |
moonshine-base |
clean |
Grad-CAM |
-0.03 |
2.43 |
44% |
Every token under both readings on the degraded recording, from the cross-check tool. The erasure patch and band are the first-ranked cell of the token’s map, the ones the figures draw.
whisper-tiny: ‘Money, clients quite told. Please put it down to warm.’
k |
token |
erasure patch (s) |
band |
erasure share on degraded |
gradient centre (s) |
width (s) |
gradient share, top layer |
lowest share over layers |
reading |
|---|---|---|---|---|---|---|---|---|---|
0 |
Money |
0.75 |
4 |
0.92 |
1.53 |
0.76 |
0.44 |
0.17 |
split |
1 |
, |
0.95 |
5 |
0.93 |
1.76 |
0.77 |
0.79 |
0.68 |
degraded |
2 |
clients |
1.55 |
1 |
0.95 |
1.74 |
0.76 |
0.84 |
0.73 |
degraded |
3 |
quite |
2.25 |
5 |
0.93 |
2.13 |
1.15 |
0.76 |
0.75 |
diffuse |
4 |
told |
2.45 |
5 |
0.93 |
2.29 |
1.14 |
0.64 |
0.54 |
diffuse |
5 |
. |
2.75 |
1 |
0.47 |
2.28 |
0.87 |
0.38 |
0.26 |
clean |
6 |
Please |
3.45 |
5 |
0.09 |
3.25 |
0.31 |
0.08 |
0.03 |
clean |
7 |
put |
3.75 |
4 |
0.36 |
3.37 |
0.55 |
0.13 |
0.13 |
clean |
8 |
it |
3.95 |
4 |
0.25 |
2.79 |
0.95 |
0.27 |
0.17 |
clean |
9 |
down |
3.95 |
4 |
0.03 |
3.51 |
0.90 |
0.10 |
0.10 |
clean |
10 |
to |
4.35 |
1 |
0.13 |
3.30 |
1.01 |
0.18 |
0.12 |
diffuse |
11 |
warm |
4.65 |
3 |
0.11 |
3.77 |
0.66 |
0.11 |
0.10 |
clean |
12 |
. |
4.45 |
1 |
0.48 |
3.03 |
1.59 |
0.24 |
0.24 |
diffuse |
Tokens on the degraded audio: {‘n_erase’: 5, ‘n_grad’: 4, ‘n_both’: 4}
whisper-base: ‘Money, fire and sprite told. Please put it down to warm.’
k |
token |
erasure patch (s) |
band |
erasure share on degraded |
gradient centre (s) |
width (s) |
gradient share, top layer |
lowest share over layers |
reading |
|---|---|---|---|---|---|---|---|---|---|
0 |
Money |
0.75 |
5 |
0.98 |
2.21 |
1.05 |
0.46 |
0.46 |
diffuse |
1 |
, |
1.85 |
3 |
0.91 |
1.89 |
0.47 |
0.89 |
0.71 |
degraded |
2 |
fire |
1.55 |
1 |
0.93 |
1.61 |
0.70 |
0.88 |
0.64 |
degraded |
3 |
and |
1.85 |
0 |
0.94 |
2.11 |
0.78 |
0.86 |
0.62 |
degraded |
4 |
sprite |
2.25 |
4 |
0.95 |
1.91 |
0.57 |
0.90 |
0.60 |
degraded |
5 |
told |
2.55 |
1 |
0.95 |
2.26 |
0.69 |
0.70 |
0.39 |
degraded |
6 |
. |
2.65 |
1 |
0.69 |
2.57 |
1.05 |
0.26 |
0.23 |
diffuse |
7 |
Please |
3.45 |
5 |
0.14 |
3.36 |
1.00 |
0.11 |
0.04 |
clean |
8 |
put |
3.65 |
5 |
0.42 |
3.48 |
0.47 |
0.09 |
0.06 |
clean |
9 |
it |
1.55 |
1 |
0.62 |
3.33 |
0.50 |
0.11 |
0.11 |
split |
10 |
down |
3.95 |
4 |
0.29 |
3.63 |
0.39 |
0.08 |
0.08 |
clean |
11 |
to |
4.35 |
1 |
0.04 |
3.03 |
0.87 |
0.18 |
0.13 |
clean |
12 |
warm |
4.55 |
3 |
0.07 |
3.65 |
0.75 |
0.22 |
0.15 |
clean |
13 |
. |
4.55 |
2 |
0.61 |
4.01 |
1.02 |
0.12 |
0.11 |
diffuse |
Tokens on the degraded audio: {‘n_erase’: 7, ‘n_grad’: 5, ‘n_both’: 5}
moonshine-base: ‘Money, lions, fight cold. These put it down to warm.’
k |
token |
erasure patch (s) |
band |
erasure share on degraded |
gradient centre (s) |
width (s) |
gradient share, top layer |
lowest share over layers |
reading |
|---|---|---|---|---|---|---|---|---|---|
0 |
M |
0.85 |
0 |
0.85 |
1.47 |
1.55 |
0.14 |
0.14 |
diffuse |
1 |
oney |
0.95 |
0 |
0.97 |
1.67 |
1.37 |
0.67 |
0.45 |
diffuse |
2 |
, |
1.15 |
7 |
0.85 |
2.23 |
1.41 |
0.69 |
0.56 |
diffuse |
3 |
l |
1.95 |
4 |
0.87 |
2.06 |
1.58 |
0.69 |
0.50 |
diffuse |
4 |
ions |
1.85 |
0 |
0.94 |
2.37 |
1.48 |
0.73 |
0.47 |
diffuse |
5 |
, |
2.25 |
5 |
0.73 |
2.02 |
1.20 |
0.74 |
0.43 |
diffuse |
6 |
fight |
2.25 |
4 |
0.93 |
2.37 |
1.41 |
0.57 |
0.52 |
diffuse |
7 |
cold |
2.65 |
1 |
0.59 |
2.09 |
0.85 |
0.63 |
0.23 |
degraded |
8 |
. |
2.65 |
1 |
0.42 |
2.87 |
1.34 |
0.18 |
0.18 |
diffuse |
9 |
These |
3.45 |
5 |
0.09 |
3.71 |
1.23 |
0.05 |
0.05 |
diffuse |
10 |
put |
3.75 |
4 |
0.08 |
3.59 |
0.85 |
0.06 |
0.05 |
clean |
11 |
it |
3.75 |
4 |
0.44 |
3.57 |
0.73 |
0.04 |
0.04 |
clean |
12 |
down |
3.95 |
4 |
0.43 |
3.76 |
0.80 |
0.03 |
0.03 |
clean |
13 |
to |
4.35 |
1 |
0.29 |
3.74 |
0.83 |
0.04 |
0.04 |
clean |
14 |
warm |
4.35 |
1 |
0.07 |
4.01 |
1.10 |
0.09 |
0.04 |
diffuse |
15 |
. |
0.65 |
1 |
0.58 |
4.38 |
1.01 |
0.06 |
0.06 |
diffuse |
Tokens on the degraded audio: {‘n_erase’: 8, ‘n_grad’: 7, ‘n_both’: 6}
Control: tokens that appear in both transcripts of a model, and how far the erasure test and the gradient map moved them between the clean and the degraded recording. After the noise the audio is identical, so the anchors should stay.
model |
token |
erase_t clean |
erase_t degraded |
cam_t clean |
cam_t degraded |
moved (erasure, ms) |
moved (gradient, ms) |
|---|---|---|---|---|---|---|---|
whisper-tiny |
Money |
0.95 |
0.75 |
1.33 |
1.53 |
-200 |
+208 |
whisper-tiny |
told |
2.65 |
2.45 |
2.51 |
2.29 |
-200 |
-217 |
whisper-tiny |
Please |
3.45 |
3.45 |
3.22 |
3.25 |
+0 |
+33 |
whisper-tiny |
put |
3.75 |
3.75 |
3.22 |
3.37 |
+0 |
+145 |
whisper-tiny |
it |
3.95 |
3.95 |
2.93 |
2.79 |
+0 |
-132 |
whisper-tiny |
down |
3.95 |
3.95 |
3.55 |
3.51 |
+0 |
-44 |
whisper-tiny |
to |
4.35 |
4.35 |
3.07 |
3.30 |
+0 |
+235 |
whisper-tiny |
warm |
4.35 |
4.65 |
3.90 |
3.77 |
+300 |
-128 |
whisper-base |
Money |
0.95 |
0.75 |
1.65 |
2.21 |
-200 |
+562 |
whisper-base |
, |
1.55 |
1.85 |
1.89 |
1.89 |
+300 |
+5 |
whisper-base |
Please |
3.35 |
3.45 |
3.24 |
3.36 |
+100 |
+116 |
whisper-base |
put |
3.65 |
3.65 |
3.30 |
3.48 |
+0 |
+182 |
whisper-base |
it |
3.75 |
1.55 |
3.18 |
3.33 |
-2200 |
+143 |
whisper-base |
down |
3.95 |
3.95 |
3.46 |
3.63 |
+0 |
+164 |
whisper-base |
warm |
4.35 |
4.55 |
3.70 |
3.65 |
+200 |
-50 |
moonshine-base |
M |
1.55 |
0.85 |
1.49 |
1.47 |
-700 |
-24 |
moonshine-base |
oney |
0.75 |
0.95 |
1.09 |
1.67 |
+200 |
+578 |
moonshine-base |
These |
3.35 |
3.45 |
3.49 |
3.71 |
+100 |
+217 |
moonshine-base |
put |
3.75 |
3.75 |
3.43 |
3.59 |
+0 |
+157 |
moonshine-base |
it |
3.75 |
3.75 |
3.43 |
3.57 |
+0 |
+145 |
moonshine-base |
down |
3.95 |
3.95 |
3.37 |
3.76 |
+0 |
+387 |
moonshine-base |
to |
4.35 |
4.35 |
3.32 |
3.74 |
+0 |
+422 |
moonshine-base |
warm |
4.35 |
4.35 |
4.08 |
4.01 |
+0 |
-63 |