Streaming ASR word latency: why a shorter chunk saves less than the arithmetic says
A streaming recognizer’s latency is usually explained with chunk arithmetic: the model cannot emit a word before it has the audio, so a 1,120 ms chunk costs more than a 160 ms one. That is true, and it predicts the wrong size of the saving. I measured how much of each word’s latency is the wait for the audio and how much comes after the encoder has already run, at four chunk settings of the same model.
The short answer: going from 1,120 ms to 160 ms chunks removes 480 ms of waiting for audio, but the median word latency drops by only 361 ms (751 ms to 390 ms), because a model with little look-ahead holds each word back after the step that contained it. The smallest setting, 80 ms with no look-ahead, is not the fastest: it is 29 ms slower than the 160 ms one and less accurate.
What I measured
The model is NVIDIA’s cache-aware streaming FastConformer, run through NeMo on one RTX 4090.
NVIDIA’s model card
names each setting by its attention context [left, right]: here the left context is 70 frames
and the right context is 0, 1, 6 or 13 frames of 80 ms. A step processes right + 1 frames, so
the chunk is 80, 160, 560 or 1,120 ms. I used the transducer (RNNT) head and, where it is
stated, the CTC head of the same model.
The test sets are LibriSpeech test-clean and test-other, 200 utterances each. A harness streams each utterance at real-time pace in 160 ms packets and records every partial result with its time. Every number below comes from those logs.
Word latency of a correctly recognized word is the time at which it first appears in a partial result that never changes it again, minus the end of that word in a forced alignment of the reference (wav2vec 2.0). It includes the chunk, the look-ahead, the compute and the delay between the model knowing the word and the recognizer showing it. Numbers are medians over words unless I say otherwise.
I split each word’s latency at the encoder step that contains the end of the word:
- the wait for audio runs from the end of the word to the arrival of the 160 ms packet that completes that step’s chunk, when the step can run;
- the time after the step runs from there to the moment the word appears for good.
The two parts trade against each other
| Setting | Chunk | Wait for audio, median | After the step, median | Words 130 ms or more after the step | Word latency, median |
|---|---|---|---|---|---|
[70,0] |
80 ms | 140 ms | 339 ms | 91% | 419 ms |
[70,1] |
160 ms | 140 ms | 171 ms | 88% | 390 ms |
[70,6] |
560 ms | 380 ms | 11 ms | 32% | 571 ms |
[70,13] |
1,120 ms | 620 ms | 11 ms | 15% | 751 ms |
The medians of the two parts do not add up to the median of the total (140 + 339 is not 419), because a median of a sum is not the sum of the medians. Read the two bars as two separate medians and the diamond as a third, measured directly.
The wait grows with the chunk, as the arithmetic says: 140 ms at the two small settings, 380 ms at 560 ms and 620 ms at 1,120 ms.
What the arithmetic does not show is the second column. With a long chunk the model has seen the
future, and it emits each word in the step that contains it: 11 ms after the step at the median,
and 85% of words appear less than 130 ms after it. With a short chunk the model needs later audio to
settle a word, so the word waits for steps that come after the one that contained it. At [70,1] 88% of words appear
130 ms or more after the step, which is one or more 160 ms packets late.
So of the 480 ms that the wait for audio drops when the chunk goes from 1,120 to 160 ms, the median word latency keeps 361 ms. The rest comes back after the step, where the median goes from 11 to 171 ms. That 361 ms is the number to use when sizing a streaming budget, not the chunk length.
One reading note for the 1,120 ms row. At [70,13], 259 of 3,997 words (6.5%) became final only when the end of the
file flushed the encoder, so their latency was set by the trailing silence of the file. In a live stream those
words would wait for the next chunk. The 751 ms median is therefore slightly flattering to the long chunk.
Zero look-ahead is not the fastest
[70,0] and [70,1] wait the same 140 ms for audio, because the harness sends 160 ms packets and [70,0] runs its two 80 ms steps together when a packet arrives.
The difference is all after the step: 339 ms against 171 ms. The median compute per packet is
19.2 ms at [70,0] and 10.4 ms at [70,1]. The median word latency is 419 against 390 ms, and the WER on test-clean
is 3.42% against 3.15% (CTC head: 479 against 450 ms, 4.67% against 4.03%). One frame of look-ahead
is better in latency and in accuracy than none.
Accuracy saturates before latency does
On test-clean the transducer reaches 2.69% WER at [70,6] and again at [70,13], with median word
latencies of 571 and 751 ms, 180 ms apart. On test-other the same step buys 5.79% to 5.42%.
The CTC head behaves the same way and is behind by 0.4 to 1.3 points everywhere on test-clean
(for example 3.18% against 2.69% at [70,6], 3.10% against 2.69% at [70,13]). For a budget of
around 600 ms, [70,6] is the setting to take.
Real-time factor does not show any of this
The real-time factor (compute time divided by audio time) of the same runs ranges from 0.013 to 0.122
across the four settings. The setting with the highest RTF, [70,0], is among the fastest in word
latency, and the lowest, [70,13], is the slowest. RTF says whether the model keeps up with the stream;
it says nothing about how long a word waits.
One CPU thread is close behind
The same harness ran a streaming Zipformer (sherpa-onnx, 320 ms chunk) on one thread of an
i5-12600K. With greedy search it reaches a median word latency of 582 ms at 3.18% WER on test-clean,
against 571 ms and 2.69% for the FastConformer at [70,6] on the GPU. With beam search 4 the Zipformer reaches
583 ms and 3.10%.
Scope
LibriSpeech English read speech, 200 utterances per set, 160 ms client packets, one RTX 4090 for the FastConformer and one CPU thread of an i5-12600K for the Zipformer. The split into two parts is measured for the transducer head on test-clean.
Reproduce
The harness, the per-word logs and every result file are in
rockyshi-dev/streaming-speech-code, under
code/ch09_measure/. Every number in this post comes from running that code from a clean clone, on one
RTX 4090 for the FastConformer and one CPU thread for the Zipformer.
run_gpu_all.shruns the four FastConformer settings (it also runs the Mandarin model, which this post does not use);run_cpu_all.shruns the Zipformer on one CPU thread;breakdowns.pywrites the split table (results/breakdowns.json), andmake_tables.pywrites the summary table.
The GPU runs stream at simulated real-time pace, so they are bound by compute and take about 20 minutes for the English part.