Skip to main content
Back

CMU Researchers Crack How WavLM Secretly Stores Neighboring Sounds in One Frame

New research reveals speech transformers pack phonetic info from previous, current, and next sounds into a single frame using orthogonal subspaces.

Pro

  • Speech transformer frames encode previous, current, and next phones as superposed phonological vectors in one representation.
  • Vectors for different relative positions occupy nearly orthogonal subspaces, letting the model avoid collisions between neighbors.
  • Position-dependent similarities switch at real phonetic boundaries, giving free unsupervised segmentation signals.
  • Tested on wav2vec 2.0, HuBERT, WavLM Large using TIMIT and multilingual VoxAngeles with PanPhon analogies.
  • WavLM shows the widest and cleanest contextual window; wav2vec 2.0 lags noticeably behind.
  • Code available at github.com/juice500ml/phonetic-arithmetic.

Self-supervised speech models like wav2vec 2.0, HuBERT, and WavLM are routinely called contextualized, but what that actually means inside the network has stayed vague. A new paper from researchers at UT Austin, UC Berkeley, and Carnegie Mellon opens up that black box and shows that a single frame of a speech transformer quietly carries phonological information about not just the sound it's aligned to, but its neighbors too, and it stores each of them in geometrically separate directions.

The paper, Self-Supervised Speech Models Encode Phonetic Context via Position-dependent Orthogonal Subspaces, builds on a growing line of interpretability work suggesting that speech transformers behave in surprisingly linear, algebraic ways. The authors also released their phonetic-arithmetic code on GitHub.

The gap this paper closes

Prior work has identified what kinds of acoustic and linguistic information is present in different layers of S3Ms. However, despite covering multiple levels of the linguistic hierarchy, it remains unclear how the context network organizes such information within the representation space. A recent result had shown that individual phones are stored as linear combinations of phonological vectors (think: a voicing direction, a nasality direction, a bilabial direction). Under that view, the representation of the sound [m] is roughly the sum of a voicing vector, a nasal vector, and a bilabial vector.

That framework was elegant, but it only described phones in isolation. Real speech is coarticulated, meaning each sound bleeds into its neighbors. So what happens to the phones sitting next to the one a frame is aligned to?

Conceptual figure showing phonological vectors from previous, current, and next phones superposed in a single frame

The core hypothesis: superposition across time

The authors propose that each contextualized frame-level representation contains a linear combination of phonological vectors corresponding not only to the phone aligned with that frame, but also to its neighboring phones. In other words, one frame is a sum of vectors describing the previous, current, and next sounds, all living in the same activation. To make that testable, they lay out four predictions:

  • Frame-level compositionality: a single frame (not an average across a phone segment) should support phonological vector arithmetic.
  • Contextual phonological vectors: the frame should also encode features of neighboring phones, like "was the previous phone voiced?"
  • Positional orthogonality: the vectors for previous, current, and next positions should sit in mutually orthogonal subspaces, so the model can tell them apart.
  • Phonetic segmentation: those subspaces should switch at real phonetic boundaries, not on a fixed time window.

How they test it

The test tool is phonological analogy, borrowed from word embedding analogies. Given a quadruplet of phones forming a consistent phonological contrast, the analysis evaluates whether the difference between two phones can be added to another phone to approximate the expected target, such that shared phonological differences are reflected by vector subtractions. Concretely, subtracting [t] from [d] should give you a "voicing" direction. Add that to [p] and you should land near [b]. Analogies are auto-generated using PanPhon, a resource that maps IPA symbols to articulatory feature vectors.

A single analogy is judged "successful" if the cosine similarity of the reconstructed target sits between two baselines: the similarity of the true phone to itself across utterances (upper) and its similarity to random other phones (lower). They evaluate on TIMIT and VoxAngeles, phonetically transcribed and manually segmented speech datasets. TIMIT consists of sentence-level read English speech, while VoxAngeles contains word-level read speech from 95 languages unseen during S3M training. Models used are the publicly released Large checkpoints of wav2vec 2.0, HuBERT, and WavLM.

What they found

Instead of the usual mean-pooling across a phone segment, they compare it to center pooling, which uses only the temporally central frame. Center-pooled representations show comparable and often higher success rates than mean-pooled representations across datasets and S3Ms, and both substantially outperform spectral baselines in certain layers. A single frame is enough to do phonological algebra.

Extending the analogy to neighbors, they find that a frame at the center phone p0 also supports analogies for p-1 and p+1, especially in later transformer layers. WavLM shows the cleanest trapezoidal pattern: high success at position 0, weaker at ±1, and essentially zero at ±2. HuBERT follows on TIMIT but weakens on the multilingual VoxAngeles data. wav2vec 2.0 lags on both.

The orthogonality result

The most interesting finding is geometric. If you extract a "voicing" vector for the current position and one for the previous position (each via difference-of-means over frames where that feature is on vs. off), the two vectors turn out to be nearly orthogonal. Phonological vectors associated with different relative positions exhibit substantially lower cosine similarity with one another than with vectors from the same position, showing approximate orthogonality across positions. Additionally, the relative similarity structure among phonological features seems to be preserved across positions (-2,-1,0,+1,+2), indicating that each position instantiates a similar phonological subspace.

Cosine similarity heatmap showing high on-diagonal similarity and near-zero off-diagonal similarity across relative phone positions

The magnitudes are also revealing: the L2 norm of the phonological vector shrinks smoothly as you move further from the center phone (0 > ±1 > ±2). Neighboring phones are still there, just in a weaker subspace, which explains why analogies work worse at position ±2 even though the geometric structure persists.

Boundaries emerge for free

The last piece is temporal. If the model really uses separate subspaces for previous, current, and next phones, it must know where phones begin and end. They measure cosine similarity between frame representations and the position-dependent phonological vectors near ground-truth boundaries. The crossover point where the "current" and "next" signals swap lines up with the annotated phonetic boundary in TIMIT. A staircase pattern appears when you visualize this across a full utterance, with steps that snap to segment edges rather than a fixed symmetric window.

Why it matters

The result gives a concrete mechanistic account of a bunch of empirical folklore about speech models:

  • Discrete units from S3Ms cluster into phonetic categories because phones are stored as sums of phonological vectors, and neighboring context sits in orthogonal directions rather than corrupting the current phone.
  • Unsupervised segmentation works because the model must implicitly track phone boundaries to switch subspaces, so those boundaries show up in attention and similarity signals.
  • Scaling and layer depth help because contextual phonological vectors sharpen in the later transformer layers, particularly in WavLM.
  • Coarticulation is not noise, it is structured information the mask-filling objective actively encodes.

There are practical hooks too. The authors note connections to neural audio codecs and discrete speech tokenizers, suggesting that S3M units outperform acoustic tokens on ASR partly because they encode this context-dependent phonological structure. That points toward tokenizer designs that explicitly disentangle context-independent and context-dependent components, and toward using position-dependent phonological similarities as interpretable intermediate features for vocoders and text-to-speech.

Limits worth knowing

The analysis is entirely on English-trained Large checkpoints, and while VoxAngeles brings in 95 unseen languages, the models themselves were not multilingual. wav2vec 2.0 shows notably weaker contextual structure than HuBERT and WavLM, which the paper attributes tentatively to differences in iterative refinement during training rather than the base objective. And while success-rate analysis captures ±1 context clearly, it underestimates ±2 information that the orthogonality analysis can still detect, so the choice of probe matters.