surmenage · · seedling · ml · speech · interpretability
where speech encoders keep emotion, probed layer by layer in whisper-small
The hypothesis
The project is part of a longer research plan on treating variation in speech as signal rather than noise. The starting hypothesis was that lower encoder layers keep acoustic and articulatory variation (how severe someone’s dysarthria is, which emotion they are acting) and upper layers collapse it toward content-invariant representations.
The plan has two datasets. TORGO has dysarthric speech with severity labels. CREMA-D has 91 actors, 6 emotions and 7,442 utterances, with the same 12 sentences across emotions, so linguistic content is controlled. The models are Whisper-small (12 encoder layers, 768 dimensions) and HuBERT-base.
Only one of those combinations has results. All the numbers below are Whisper-small on CREMA-D. TORGO needs an access request, and the repo has the preparation scripts and speaker severity metadata but no TORGO results. HuBERT has extraction scripts and the extraction finished, but I have no analysis output for it. I come back to this at the end.
The pipeline
Everything runs as numbered stages on DelftBlue (SLURM, A100s), with code on $HOME and data on /scratch.
| Stage | What it does |
|---|---|
| 02, 05 | extract Whisper-small hidden states at layers 0, 3, 6, 9, 12, mean-pooled or per frame |
| 03, 04, 06 | geometry metrics, robustness checks, frame-level geometry |
| 07, 14 | extract random-init Whisper and HuBERT as controls |
| 08 | ”unfolding”: learn a linear map with a supervised contrastive loss |
| 09, 10 | residual-delta probing and trajectory divergence, then controls on both |
| 11, 12 | SVD analysis, probing for several targets per layer |
| 13 | HuBERT-base extraction |
| 15 | steering-vector injection through forward hooks |
| 16 | invariance: which layer-9 directions layers 10-12 damp |
| 17 | single-head ablation at a chosen layer |
| 18 | basis rotation at layer 9 (emotion-aligned projection vs random projection of equal rank) |
| 19 | interpolation between emotions at layer 9, same speaker and sentence |
Layer 0 is the output of the conv stem. Most metrics are bootstrapped over speakers (100 resamples), and probes use speaker-grouped cross-validation.
Experiment 1: mean-pooled geometry
The between/within ratio of the emotion classes falls with depth:
| Layer | B/W ratio | Effective dim | Probe accuracy |
|---|---|---|---|
| 0 | 0.673 | 1.0 | 0.582 |
| 3 | 0.284 | 4.1 | 0.654 |
| 6 | 0.187 | 8.8 | 0.696 |
| 9 | 0.223 | 3.8 | 0.703 |
| 12 | 0.114 | 7.5 | 0.699 |
Class separation drops about 6x from layer 0 to layer 12, which is what the hypothesis predicts. Linear probe accuracy goes the other way, from 0.58 to about 0.70. So the emotion is not destroyed. It is less clustered and more linearly decodable.
The ratio and probe results survive three checks. Projecting every layer to 50 dimensions keeps the accuracy rise (0.516 at layer 0 to 0.693 at layer 12). Per-emotion F1 shows the gain is lopsided. Anger (0.71 to 0.80), happy (0.57 to 0.75) and neutral (0.57 to 0.78) improve. Fear (0.51 to 0.62) and sad (0.58 to 0.61) barely move.
The third check compares the correlation of the centroid-distance matrices between layers against a shuffled-label baseline. The pretrained correlations are 0.993 (0 to 3), 0.989 (3 to 6), 0.829 (6 to 9) and 0.679 (9 to 12). The shuffled baseline has mean about 0 with a 95th percentile of at most 0.60. So the arrangement of emotions is almost unchanged through layer 6, then reshuffled in the upper layers.
Frame level changes the story
My first reading was that fear and sad were hidden by mean pooling. I reran the metrics on 372K per-frame embeddings. Probe accuracy now peaks at layer 6 (0.673) and falls to 0.658 at layer 9 and 0.614 at layer 12. Mean pooling had been flattering the upper layers, and layer 6 is the real emotion peak. At layer 9 the frame-level effective dimension is 1.03, with within-class radii near 108 against about 11 at layer 6. Trajectory lengths were uniform across emotions.
The layer 9 “bottleneck” was later reframed, because layer 9 norms are about 2.5x layer 6 (35.6 vs 14.4). That looks like a few directions being amplified, not information being lost. I did not follow this up at frame level.
Unfolding
If ASR training folds paralinguistic structure instead of destroying it, a learned linear map should recover it. I trained a 768-to-64 map with a supervised contrastive loss, with 10-fold speaker-grouped CV, on trained and random-init Whisper through the same pipeline. Comparing original and unfolded B/W directly is not valid (different dimensions, L2 normalization), so the trained-vs-random comparison is the only clean one.
| Layer | Trained unfolded B/W | Random-init unfolded B/W |
|---|---|---|
| 0 | 0.126 | 0.204 |
| 3 | 0.182 | 0.167 |
| 6 | 0.268 | 0.135 |
| 9 | 0.281 | 0.159 |
| 12 | 0.272 | 0.164 |
At layers 6 and above, trained Whisper unfolds to about twice the random-init ratio. At layer 0 the random model is higher. Silhouette agrees: trained-unfolded goes to about +0.05 at layers 6-12 and random-init stays slightly negative. So the structure is latent in the trained encoder and linearly recoverable.
Controls that killed some claims
I ran controls after each experiment had already produced a tidy story. Several of those stories did not survive.
- Probing the residual deltas between layers appeared to match destination-layer accuracy. But the delta norms are large relative to the destination: 0.84 of
h(9)for 6 to 9, and 1.56 ofh(12)for 9 to 12. Matching is then trivial. Only the 3 to 6 delta (36% of the destination norm, accuracy 0.687 against 0.695 at layer 6) is meaningful. An orthogonal-complement probe agrees. At 3 to 6 the new component still decodes emotion at 0.686. At 9 to 12 the orthogonal part is 99.9% ofh(12), a near-complete overwrite. - The trajectory convergence survives. Between-emotion cosine distances are 80x to 550x above the within-emotion noise floor at every layer (550 at layer 0, 80 at layer 12).
- Invariance, smoke run only (10 utterances, 20 directions): mean sensitivity 0.91, and the directions that layers 10-12 damp or propagate are equally aligned with emotion axes and top SVD directions (ratio about 1). I read this as no selective suppression of emotion. Layers 9 to 12 act close to isotropically.
The working interpretation is now that ASR training rotates the basis so emotion ends up in low-variance directions, quiet but present. That is a much smaller claim than “collapse”, and I only trust it as far as the evidence above goes.
Caveats
- Mean pooling hides time. It helped the upper layers look better than they are, as the frame-level run showed. Most stages (SVD, landscape, unfolding, horizontal) still use mean-pooled vectors.
- Layer 0 has an effective dimension of 1.0 with a confidence interval of [1.0, 1.0]. The representation lives on a line. I wrote down the question of whether this is a conv-stem property or a pooling artifact, and the frame-level run (effective dimension 25.4) points to pooling, but I never isolated it.
- CREMA-D is acted speech with 6 coarse categories, and the bootstrap is over 91 speakers.
- The SVD probe table shows that probing the top-k singular directions does not separate trained from random cleanly (e.g. at k=20, layer 12: 0.594 trained vs 0.501 random for emotion). I do not have a clean summary of this.
- Sentence ID is decoded at 0.91 to 0.999 and speaker sex at 0.96 to 0.985 across layers, so mean-pooled vectors carry plenty besides emotion.
What is unfinished
- TORGO: no data processed, so the original dysarthria-severity question is untested.
- HuBERT: extraction of trained and random-init models completed for all 91 speakers, but I have no analysis results. This was meant to decide whether the rotation is ASR-specific or a general property of deep speech transformers.
- Steering has smoke results only: probe accuracy stays near 0.4 with tiny L2 displacement (about 0.13 at alpha 2). That tells me the pipeline runs, not what steering does.
- Head ablation (17), basis rotation (18) and interpolation (19) have scripts and smoke job files, but no result files on disk. The full invariance run (500 utterances by 200 directions) was queued and has no results either.
- The schedule file lists the TORGO access and literature review as still open.
- ml
- speech
- interpretability