Skip to content
Merged
172 changes: 172 additions & 0 deletions benchmarks/evaluations/m5-20260907/METHODS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
# M5 streaming backend screening — 7 September 2026

This screening compares the optional adapters in [#425](https://github.com/QuentinFuxa/WhisperLiveKit/pull/425)
and [#426](https://github.com/QuentinFuxa/WhisperLiveKit/pull/426) with Whisper small
MLX/LocalAgreement and the existing Qwen3 vLLM Metal backend. It uses the full WLK
audio pipeline, including voice activity detection, pauses and EOF handling.
The published historical figures are a separate experiment and remain unchanged.

## Corpus and procedure

The [fixed FLEURS manifest](../../corpora/fleurs-90.json) contains 30 test clips per
language: English, French and Mandarin Chinese. Its SHA-256 is
`95586eb74f53e665f35983f53da31ea510867b54c7fe5f481466e2d6af2619e5`.
The dataset revision, sentence/recording IDs, references, extraction boundaries
and original/PCM16 audio hashes are in that manifest. Audio is cached locally;
it is not redistributed in this directory.

Each backend/language combination runs in a fresh process. One full clip warms
the engine, then all 30 clips run three times at real-time feed speed. The warmup
record includes model loading and is excluded from quality and steady-state
latency summaries. Downloads happen before timing. Model files are hashed after
the run. Startup is not a cold filesystem-cache measurement.

The per-clip `startup_time_s` starts inside the running benchmark process,
after CLI and metadata imports. `measure_startup.py` records a separate fresh
process's import and engine-initialization time using the same cached model.
That measurement ends when the engine constructor returns, including any warmup
it performs. Whisper transcribes its cached JFK warmup file; native Qwen and
Nemotron decode half a second of silence. It excludes subsequent pipeline audio
and does not represent HTTP server readiness. Constructor warmup may compile
kernels, so this is not a measurement of model loading alone.
The cached JFK WAV has SHA-256
`59dfb9a4acb36fe2a2affc14bacbee2920ff435cb13cc314a08c13f66ba7860e`.

Reports use schema 3.1. Each audio packet is delivered at an absolute deadline
corresponding to its last sample; EOF follows the final write without another
sleep. Earlier schema-3.0 trials accumulated pacing drift and waited after the
last packet, artificially reducing measured EOF delay. Those trials were stopped
and are excluded from this comparison.

Each backend also receives one continuous ten-minute Chinese stream, built from
the same manifest with recorded component boundaries. It runs in its own process,
without another ten-minute warmup. Its truncated last component has no exact
reference, so this run is used for resources and stream boundaries, without an
aggregate WER/CER score.

GPU jobs run serially: Whisper, Nemotron, native Qwen, then Qwen Metal; within each
backend: English, French, Chinese, continuous Chinese. The order is fixed, not
randomized. Three passes reveal repeat variation but are not 90 independent
utterances or a confidence interval for unseen speech. Ordinary desktop activity
is not controlled. Only this M5 host is measured; no NVIDIA result is implied.

Power logging detected a transition from AC to battery at 14:29 UTC, during
Whisper's Chinese run. The earlier English/French runs were observed on AC;
Nemotron's English/French runs were on battery. Their raw latency differences
therefore do not establish a gain under matched power conditions. At 31% battery,
the driver was paused while allowing the current Nemotron Chinese child to
finish. Quality outputs remain available; numerical gates must be read with
this limitation, and must not be treated as an integration decision.

## Model and runtime configuration

All backends use their default decoder settings except the explicit model paths
and Whisper's LocalAgreement policy. Per-clip effective options and runtime
versions are retained in the source reports.

| Backend | Model repository | Model revision | Path option |
|---|---|---|---|
| Whisper small MLX | `mlx-community/whisper-small-mlx` | `45f3915923c7a79a5a5b5a7d909d39aeb0e5630e` | `model_dir` |
| Qwen native MLX | `Qwen/Qwen3-ASR-0.6B` | `5eb144179a02acc5e5ba31e748d22b0cf3e303b0` | `mlx_qwen3_asr_model` |
| Qwen Metal | `Qwen/Qwen3-ASR-0.6B` | `5eb144179a02acc5e5ba31e748d22b0cf3e303b0` | `model_dir` |
| Nemotron native MLX | `mlx-community/nemotron-3.5-asr-streaming-0.6b` | `e550040c0478027ed679b2b6b0d055502c103663` | `nemotron_mlx_asr_model` |

Nemotron requires the converted MLX checkpoint. The original proposed NVIDIA
checkpoint is a different format and failed at startup. The adapter now uses
mlx-audio 0.5.1's mel/encoder caches and a small stateful RNNT loop. Direct text
parity with upstream decoding passed on one English, French and Chinese clip,
including ragged input chunks and EOF; that is an adapter check, not a quality
ranking.

Repeated sessions exposed an MLX stream-ownership error in the initial adapter:
a mutex serialized decoding but let it change threads. Model loading and all
Nemotron decoding now run on one dedicated thread. A real shared-model check
failed before that change and passes after it: two concurrent English/Chinese
sessions retain exactly the same text as sequential sessions. Native Qwen also
passes that check with its existing shared lock. These checks validate isolation,
not multi-user throughput; their script and results are retained here.

Native Qwen uses mlx-qwen3-asr 0.3.5, accuracy mode and its incremental finalizer.
The upstream finalizer resolves a default tokenizer when it receives a model
object. This run uses that same default model/tokenizer revision; these results
do not validate arbitrary custom checkpoints or tokenizer revisions.

Metal uses stable vllm-metal 0.2.0 and the host's separately installed vLLM
0.21.0+cpu, with missing audio/benchmark dependencies supplied by an isolated overlay.
Its Transformers version is 5.8.1; Nemotron uses 5.15.0 and native Qwen does not
require Transformers. These are adapter/runtime comparisons, not a controlled
comparison of inference libraries with identical dependencies. The existing user
environment is unchanged. Package versions in the reports describe what ran;
[additional audio/runtime package versions](environment-packages.json) are retained
alongside them.

The existing Metal backend builds an automatic-language prompt, even when the
session configuration contains `lan`. Native Qwen and Nemotron receive the
specified language. This difference must accompany any comparison. The Metal
model is pinned through `model_dir`; `vllm_model` is not its model-path option.

## Reading the measurements

Quality pools edit counts over reference words (English/French) or characters
(Chinese), without averaging clip percentages. Normalization applies NFC,
lowercase and punctuation handling, then removes whitespace for Chinese CER.
It does not equate spoken and written number forms, such as “twenty-nine” and
“29”, or simplify traditional Chinese. These differences can affect a one-point
quality threshold. Original references and hypotheses remain available to inspect.

First visible text includes provisional text; first committed text is separate.
EOF finalization starts after the last audio feed returns. Source-end lag also
includes slow feeding/backpressure and must be read alongside EOF time. Shifting
delay into audio feeding does not establish faster completion. ASR RTF
counts inference calls, including dispatch/lock waits as well as model work;
it is not GPU kernel time or end-to-end latency. Per-pass and pooled p95 use
linear interpolation over clip measurements.

RSS is sampled process memory at 50 ms intervals. MLX reports allocator peak
since each sample's reset and active allocations at completion. The two memory
quantities are separate and must not be added on unified memory. Warmup/startup
memory is retained separately from warmed-pass peaks. The harness and pipeline
are part of the measured process, and the harness retains past output snapshots.
RSS therefore describes the whole test process. A gain confined to RSS needs
confirmation without retained snapshots before claiming lower server memory or
using it to justify integration. Line timestamp flags check ordering and
nonnegative durations; they are not an assessment of word-alignment accuracy.

Failed/skipped clips remain in the JSON, with any partial hypothesis and error.
They cannot contribute a successful quality score or establish a numerical pass.
The final-output and explicit ASR error fixes from #440 are present in all runs;
earlier smoke/baseline files are not included as selection evidence.

## Selection rule and reproduction

Compare each candidate with each existing backend on the same audio identities,
hashes, references, repeats and normalization. The numerical gate requires at
least 20% lower EOF p95 or measured memory in all three passes, using the same
metric throughout, and no more than one absolute point worse WER/CER in any
pass. A failed, incomplete or ambiguous comparison does not justify merging.
The continuous stream and hypotheses still require review; a numerical pass
alone does not establish the absence of streaming defects.

To reproduce a run, prepare the pinned corpus as described in
[the benchmark guide](../../README.md), install the selected backend extra in its
own environment, and put its pinned local snapshot path in `config.json` using
the option above. Whisper also needs `"backend_policy": "localagreement"`.

```bash
wlk bench --backend BACKEND --model MODEL --languages en \
--manifest benchmarks/corpora/fleurs-90.json --config config.json \
--speed 1 --warmup --repeats 3 --json report.json
wlk bench --backend BACKEND --model MODEL --languages zh \
--manifest benchmarks/corpora/fleurs-90.json --config config.json \
--speed 1 --continuous --json continuous.json
```

Repeat the first command for French and Chinese in fresh processes. Backend
names are `mlx-whisper`, `mlx-qwen3-asr`, `qwen3-vllm-metal` and
`nemotron-mlx-asr`; model labels are `small` for Whisper and `0.6B` otherwise.
Candidate source revisions must be checked out explicitly; the adapter PRs are
not assumed to be on main. The reports record the actual source commits.

`analyze.py` reads schema-3.1 reports (plain JSON or losslessly compressed `.json.gz`),
recomputes per-pass and pooled summaries, verifies paired identities, and leaves
missing runs pending. It does not run inference or decide to merge a PR.
33 changes: 33 additions & 0 deletions benchmarks/evaluations/m5-20260907/REVIEW.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Partial review: seven of sixteen reports

These are intermediate observations, not a completed comparison. The driver is paused on battery power. AC/battery conditions changed during the series, so the raw latency differences below do not establish gains under matched power conditions. See [the method](METHODS.md), [the retained summaries](summary.md) and the compressed source reports in `reports/`.

## Whisper small MLX

All 270 short-clip sessions complete without pipeline errors or invalid line timestamps. WER is 11.6645% in English and 17.7778% in French; Chinese CER is 25.3077%. Each language has identical edit counts across the three passes.

The ten-minute Chinese stream completes and preserves its accumulated output, but its hypothesis contains 31 consecutive occurrences of `的學者和衛星` starting at character 1473. The same repetition occurred in the discarded pacing trial. This is an observed long-stream quality failure, not a successful streaming validation. The report contains no token-level emission trace that would justify assigning this text a precise audio offset. Full output mode has unlimited retention here, so the default diff-mode retention limit does not explain the missing/repeated content.

## Nemotron, English

All 90 sessions complete without the previous MLX stream-ownership failure or invalid line timestamps. WER is 19.2661% in all three passes, 7.6016 percentage points worse than Whisper small. EOF p95 improves by 82.6–85.2% per pass, while measured RSS and MLX allocator peaks are higher. This fails the agreed quality threshold against Whisper small.

The gap includes spoken versus written numbers (`fleurs_en_1850`, Wi-Fi standard names), but is not solely formatting: `fleurs_en_1975` changes “Vatican City's” to “American city” and drops part of the population statement; `fleurs_en_1866` substitutes several words in the riding-boots sentence. Keep the original normalization and retained hypotheses; no post-hoc score adjustment is used to obtain a pass.

## Nemotron, French

All 90 sessions complete with valid line timestamp ordering. WER is 14.9708% in all three passes, 2.8070 points better than Whisper small. Pooled EOF p95 is 0.1134 s, compared with 0.6996 s for Whisper; per-pass gains are 82.9–84.4%. The numerical gate passes against Whisper for this language. MLX allocator peak is about 64.8% higher, while RSS varies between passes. This language-specific result does not cancel the English regression or establish long-stream reliability.


## Nemotron, Chinese

All 90 sessions complete with valid line timestamp ordering. Pooled CER is 22.6154%, compared with 25.3077% for Whisper small. Pooled EOF p95 is 0.0515 s and first-visible p95 is 4.1435 s. The ten-minute Nemotron stream has not run, so its long-stream behavior remains unvalidated. Neither Qwen implementation has completed this matrix yet.


## Separate check: Whisper MLX direct English translation

The adapter fix in [#446](https://github.com/QuentinFuxa/WhisperLiveKit/pull/446) forwards the previously ignored translation task. Its factory/adapter scenario and all CI checks pass, but real-audio validation does not. These checks use the same pinned Whisper small model and the French/Chinese FLEURS recording with sentence ID 1682; they are separate from the ASR ranking above.

The Chinese streaming output starts in English, then repeats `插` extensively. The French stream starts with repeated “Moses” and contains several mistranslations. Calling `mlx_whisper.transcribe` directly on the full recordings also produces an unrelated English loop for Chinese and mistranslations for French, with or without word timestamps. This rules out word-timestamp conversion as the sole cause; it does not isolate every contribution from the model, runtime and streaming prompts. The fix remains in draft pending a usable configuration and further diagnosis.

The retained `whisper-direct-{fr,zh}.json.gz` files contain the WLK transcription/translation pair, runtime, source commit, reference and audio hash. The `whisper-direct-upstream-{fr,zh}.json.gz` files retain both full-recording calls (`task="translate"`, source language specified, `word_timestamps=False` then `True`). The Chinese validation status is an assertion failure on the output language, not a reported pipeline exception; the French output was reviewed manually and is not accepted as a quality pass.
Loading
Loading