use case · basics · d_model=512 6-layer representation · 30s Log-Mel & chunk-stride sweep · WASM q8 · 76.91 MB

Inside Whisper-Base: d_model=512 6-Layer Speech Representation

Compare live <|transcribe|> vs <|translate|> prefix-token conditioning across Whisper-Base's 6+6 d_model=512 transformer stack, benchmark 2 s–11 s slices across the fixed 30 s Log-Mel window, and measure chunk-stride sensitivity (chunk_length_s / stride_length_s).

1 · Whisper-Base Multilingual worker (76.91 MB q8 WASM)

2 · Live <|transcribe|> vs <|translate|> & language-hint conditioning

Initialise Whisper-Base above to compare <|transcribe|> vs <|translate|> and run the 30s Mel & chunk-stride 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-Base's 99-language softmax distribution.

3 · Fixed 30s Log-Mel window & 2s / 5s / 8s / 11s invariance sweep

Every slice is zero-padded to 30.0 s (480,000 samples → 3,000 mel frames × 80 bins) before the 6-layer d_model=512 encoder runs, so encoder compute stays constant across short clips.

2s vs 11s latency–
Mean latency–
Min–max spread–
2s zero-pad waste–
NaN count–
Measured Whisper-Base latency, active frames, chunks, and transcript per sub-clip
Sub-clip Active frames / 3000 Zero-pad % Measured ms Detected lang Tokens Transcript
Run the 2s / 5s / 8s / 11s sweep above to inspect real per-slice timings.

4 · Chunk-stride sensitivity sweep (chunk_length_s / stride_length_s)

Compare Whisper-Base's full 30 s encoder window against tighter sliding windows (15 s / 3 s, 8 s / 2 s, and hard-cut 6 s / 0 s stride) to inspect how boundary overlap affects latency, chunk count, and transcript continuity on the active clip.

Measured Whisper-Base chunk-stride sensitivity across window and overlap settings
Window / stride Measured ms Chunks Tokens NaN Transcript
Run the chunk-stride sensitivity sweep above to compare window overlap settings.

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

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