WhatAreYouSaying documentation#

WhatAreYouSaying (WAYS) is an attribution tool for speech-to-text models. For every token a model wrote, it reports which 100 ms of audio in which frequency band the token depended on, and whether that audio was clean or degraded. It runs on local Whisper and Moonshine weights and on any OpenAI-compatible speech server such as vLLM or llama.cpp. It needs no training and no labels, and the cost is one forward pass per erased patch.

One patch at a time is erased from a clip's spectrogram, and the bars show how much less sure whisper-base became of every word

The method combines representation erasure by Li, Monroe and Jurafsky, which measures what a network uses by deleting parts of its input, with AADD by Arina Gertel, which labels what is wrong with a recording and where, every 20 ms. The code is MIT licensed.

Start here#

Install and use

Set up Python 3.12, run your first clip, and call WAYS from Python.

Install and use
Command line

Every ways command and option, read from the source.

Command line
How it works

The erasure grid, the three scores per token, and the noise-focus ratio.

How it works
Tools

sound-token, aud-cam and cross-check, and how to add a tool.

The tool framework: sound-token, aud-cam and cross-check
Backends

Local Whisper and Moonshine weights, vLLM and llama.cpp servers.

Backends: local weights, vLLM, llama.cpp
Results

100 VoxCeleb clips, controlled damage, real noise and the latent space.

Results

What it answers#

A speech model turns a waveform into tokens. When it gets a word wrong, or gets a hard word right, I want to know which part of the sound that word depended on, and whether that part was speech or noise. Attention maps and gradients give only a loose answer. In an earlier study of mine, gradient x input on whisper-tiny kept 92 % of its ranking after the decoder was re-initialised, which means it mostly reflected input energy and not the model. Erasure tests the question directly by removing a piece of audio and measuring what changes in the output.

For each clip WAYS returns three things:

  • a map over time and frequency for every token,

  • the top patch of every token drawn on the spectrogram, with the transcript below it in the same colours,

  • a noise-focus ratio per token and per clip. It is the share of a token’s evidence in audio that AADD flags as degraded, divided by the share of the clip that is flagged. A ratio of 1 means no preference.

The same clip through whisper-tiny, whisper-base and moonshine-base: for each model the spectrogram with each token's most important patch boxed in the token's colour, and the tokens placed on the audio segment they used most
One clip through three models. The spectrogram and the AADD strip are the same in every row, and only the boxes and the transcript strip differ. A colour and number identify one token.