use case · basics · 12+12 d_model=768 representation · task tokens, chunk/word timestamps & 30s Mel timing · WASM q8 · 251.88 MB

Inside Whisper-Small: Task-Token Conditioning & Encoder/Decoder Timing

Compare live <|transcribe|> vs <|translate|> prefix-token conditioning across Whisper-Small's 12+12 d_model=768 transformer stack, sweep chunk & word-timestamp modes, and benchmark 2 s–11 s slices across the fixed 30 s Log-Mel window.

1 · Whisper-Small Multilingual worker (251.88 MB q8 WASM)

2 · Live <|transcribe|> vs <|translate|> task-token conditioning lab

Initialise Whisper-Small above to compare <|transcribe|> vs <|translate|> and run the 30s Mel & chunk-resolution sweeps.

Loading clip…

Pass A · task: "transcribe" (<|transcribe|> id 50359)

Run comparison above to decode in native language.

–

Pass B · task: "translate" → English (<|translate|> id 50358)

Run comparison above to translate speech directly to English.

–

Step-0 <|lang|> detection softmax on active clip

Run comparison to inspect Whisper-Small's 99-language softmax distribution.

3 · Log-Mel 30s window & encoder-vs-decoder token timing telemetry (2s / 5s / 8s / 11s)

Every slice is zero-padded to 30.0 s (480,000 samples → 3,000 mel frames × 80 bins) before the 12-layer d_model=768 encoder runs. Step-0 probe timing (detectMs) reflects encoder + 1 decoder step; full latency minus detectMs approximates autoregressive token generation.

2s vs 11s latency–
Mean latency–
Min–max spread–
2s zero-pad waste–
NaN count–
Measured Whisper-Small encoder-vs-decoder timing, active frames, tokens, and transcript per sub-clip
Sub-clip Active frames / 3000 Zero-pad % Step-0 / Full ms Tokens · tok/s Transcript
Run the 2s / 5s / 8s / 11s timing sweep above to inspect real per-slice timings.

4 · Chunk-stride & timestamp resolution sweep

Compare Whisper-Small across sliding chunk windows (30s/5s, 15s/3s, 8s/2s, 6s/0s) and timestamp resolutions (plain vs segments vs word) on the active clip.

Measured Whisper-Small chunk-stride and timestamp resolution sweep
Window / mode Measured ms Chunks Tokens NaN Transcript
Run the chunk & timestamp resolution sweep above to compare configurations.

5 · Inspect prefix token builder & 80-bin Log-Mel code

Show the code · whisper-small-core.mjs — buildWhisperPromptTokens() (SOT + <|lang|> + task + timestamps)
Show the code · whisper-small-core.mjs — computeLogMelPreview() (512-pt FFT + 80-bin Mel filterbank)