Skip to content

About

X2Streaming-ASR is a streaming Automatic Speech Recognition (ASR) system characterized by ultra-low latency and high accuracy.

Resources

Stars

69 stars

Watchers

2 watching

Forks

Repository files navigation

X2Streaming-ASR beaver mascot X2Streaming-ASR

Wait when uncertain, emit when ready: append-only streaming speech recognition
Words appear tens of milliseconds after they are spoken, and are never taken back.

arXiv paper Demo video Model on Hugging Face Python 3.11 Apache 2.0

English | 简体中文

X2Streaming-ASR scenarios: live captions, waiting on ambiguous words, emitting once context resolves them, acting safely on text that never changes, and native causal streaming with KV-cache reuse

Speech flows in, final text flows out: captions appear as you speak, ambiguous words wait for context, and committed text is safe for downstream agents to act on.

News · Overview · Demo · Why X2 · Results · Method · Quick Start · Citation


🔥 News

✨ Overview

X2Streaming-ASR is a low-latency, append-only streaming ASR model for Chinese, English, and code-switching speech. On the evaluated benchmarks, it emits each character or word with a mean latency of only 32–109 ms in Chinese and 12–85 ms in English after the word ends, while achieving the best CER/WER on several test sets.

Built on Voxtral Mini Realtime, it splits streaming recognition into when to commit and what to commit. Every 80 ms the model chooses between LISTEN and DECODE:

  • Wait when uncertain. If the latest audio is ambiguous, the model keeps listening for more context.
  • Emit when ready. Once the context is sufficient, it decodes the new audio immediately.
  • Never roll back. Output is append-only, so text is never revised after it appears.
  • Native causal streaming. Only newly arrived audio is encoded, and history is reused through the KV cache instead of being recomputed or cut off by a sliding window.

This repository is inference-only: adaptive streaming and full-context offline inference, Transformers and vLLM backends, JSONL batch transcription, and a web demo.

🎬 Demo

Unmute for audio.

demo.mp4
  • Colored tokens in the reference transcript identify the model that first produced a reliably aligned committed result: X2 in cyan, Qwen in blue, R2T2 in orange, and X-ASR in purple. Once assigned, a color never changes.
  • The live error rate compares each model's committed output with subtitle cues that ended at least 1.5 seconds before the current playback position.

💡 Why X2Streaming-ASR?

Four pain points of streaming ASR and how X2Streaming-ASR solves them: adaptive commit timing, waiting when uncertain, append-only output, and native causal streaming

Fixed chunks or lookaheads make every word wait the same amount of time. Committing exactly at the acoustic boundary gets homophones wrong. Revising partial results makes text flicker and is unsafe for voice agents. Re-encoding the whole history or sliding a short window either slows down on long audio or forgets earlier speech. X2Streaming-ASR learns a per-word commit policy that avoids all four.

📊 Results

Mean emission latency on 12 test sets, and average error rate versus latency for Chinese and English
  • Lowest latency on all 12 test sets. Mean emission latency is 12–109 ms, compared with 194–735 ms for the streaming baselines.
  • Best accuracy on 6 test sets. AISHELL-1, AISHELL-3, WenetSpeech Net, GigaSpeech clean, VoxPopuli, and TED-LIUM.
  • Lowest overall error rate in both languages. Pooled over all test utterances, X2Streaming-ASR reaches 5.65% CER on Chinese (1.15M characters) and 8.35% WER on English (577K words), ahead of the next best system, Confucius4-R2T2 (quality), at 5.79% and 8.43% with 8–12× higher latency. Pooled rates weight each test set by its size, so the large, harder sets dominate: GigaSpeech is about 70% of the English words (10.01% WER), and the two WenetSpeech sets are about 55% of the Chinese characters. The per-set averages are 4.65% CER and 5.64% WER.
  • Adaptive waiting beats fixed lookahead. On AISHELL-1, a fixed lookahead needs 396 ms of mean latency to reach 1.58% CER; X2Streaming-ASR reaches 1.53% at 32 ms.

All systems are evaluated with a single hard commit and no rollback. Latency is measured from the forced-aligned end of each character or word to its emission.

Chinese scores are CER (%). English scores are WER (%). Latency is in milliseconds.

Chinese

Dataset X2Streaming-ASR X-ASR (160 ms) Confucius4-R2T2 (speed) Confucius4-R2T2 (quality) Zipformer Paraformer
CERMeanP95 CERMeanP95 CERMeanP95 CERMeanP95 CERMeanP95 CERMeanP95
AISHELL-1 1.5332320 4.81651880 3.55308560 2.297351280 1.93472800 3.09586880
AISHELL-2 android 4.2781400 4.87657926 4.59318560 3.566281040 4.19447800 4.05567840
AISHELL-2 ios 3.9475400 4.77654922 4.64316560 3.586201040 4.12450800 3.81572840
AISHELL-2 mic 4.1479480 4.89658923 4.59322560 3.616321040 4.21453800 3.91566840
AISHELL-3 2.0857400 5.14660899 3.98321560 2.856721120 2.95465800 3.72576849
WenetSpeech Meeting 8.6774320 11.28595810 8.63320560 7.376851200 7.88436800 10.06582880
WenetSpeech Net 7.88109400 8.63563800 9.52310480 8.48570960 8.53409720 8.36563880

English

Dataset X2Streaming-ASR X-ASR (160 ms) Confucius4-R2T2 (speed) Confucius4-R2T2 (quality)
WERMeanP95 WERMeanP95 WERMeanP95 WERMeanP95
LibriSpeech test-clean 2.2029240 3.86574800 2.83194320 2.11472800
LibriSpeech test-other 5.5085480 9.64585800 6.38201320 4.81463720
GigaSpeech (clean) 10.0143320 10.47592847 10.69204400 10.21501880
VoxPopuli 7.0712320 11.25603880 8.97204400 7.26523880
TED-LIUM 3.4215240 3.81590880 3.98196320 3.45497880

See the paper for complete benchmark settings, baselines, and ablations.

🧠 Method

X2Streaming-ASR token-level architecture alternating between LISTEN and DECODE

Every 80 ms audio token, the model predicts Wait (keep listening) or Emit (start decoding). After Emit, it writes the text for the new audio and ends with Eos.

X2Streaming-ASR keeps the causal audio encoder, adapter, and decoder-only language model of Voxtral Realtime, but replaces its fixed delay with a learned decision:

  1. LISTEN. For each new 80 ms audio token, predict Wait if the context is insufficient or ambiguous, or Emit if it is enough to commit.
  2. DECODE. After Emit, generate the text for the newly heard audio until Eos, then return to LISTEN.
  3. Reuse history. The encoder runs incrementally and the language model keeps its KV cache, so no chunk triggers recomputation of earlier audio. Within the configured context length, nothing is discarded by a sliding window.

The commit policy is trained in three stages: streaming recognition, a supervised warm start from probed commit times, and GRPO with character-level credit assignment that rewards accuracy first and latency second. See the paper for details.

📦 Model Scope

Item Description
Base model Voxtral Mini Realtime
Languages Chinese, English, and code-switching
Streaming output Append-only hard commits
Inference modes Adaptive streaming and full-context offline
Backends Transformers and vLLM
Model weights x-square-robot/X2Streaming-ASR-4B-1009

🚀 Quick Start

1. Install

Linux, Python 3.11, and a CUDA-compatible NVIDIA GPU are recommended.

git clone https://github.com/ZwlinZw/X2StreamingASR.git
cd X2StreamingASR

conda create -n x2streamingasr python=3.11 -y
conda activate x2streamingasr
pip install -r requirements.txt

Install optional vLLM and web-demo dependencies when needed:

pip install -r requirements-vllm.txt -r demo/requirements.txt

2. Model

Model weights are on Hugging Face: x-square-robot/X2Streaming-ASR-4B-1009.

Download and set MODEL_PATH:

pip install -U huggingface_hub

huggingface-cli download x-square-robot/X2Streaming-ASR-4B-1009 --local-dir ./X2Streaming-ASR-4B-1009
export MODEL_PATH="$(pwd)/X2Streaming-ASR-4B-1009"

Or use any local checkpoint directory:

export MODEL_PATH=/path/to/X2Streaming-ASR-4B-1009

3. Streaming and offline inference

# Adaptive streaming
python infer.py \
  --config configs/infer.yaml \
  --model_path "$MODEL_PATH" \
  --language zh \
  --audio /path/to/audio.wav

# Full-context offline
python infer.py \
  --config configs/infer_offline.yaml \
  --model_path "$MODEL_PATH" \
  --language en \
  --audio /path/to/audio.wav

Important

Set --language to match your audio. The model is conditioned on a language tag: zh for Chinese, en for English, and cs for Chinese-English code-switching. Without --language, the tag is guessed from the input path and falls back to zh unless the path contains librispeech, gigaspeech, tedlium, or voxpopuli, so English audio should always be run with --language en. One tag is used for the whole run, so split mixed-language JSONL files by language or use cs.

4. JSONL batch inference

Each input line must contain one of audio, wav, or wav_path:

{"audio": "/path/to/first.wav"}
{"wav": "/path/to/second.wav"}
python infer.py \
  --config configs/infer.yaml \
  --model_path "$MODEL_PATH" \
  --language en \
  --input_file audio.jsonl \
  --output_file results.jsonl

The output JSONL contains the audio path, recognized text, inference mode, and optional timestamps or adaptive emit records. A reference transcript is not required.

5. Web demo

BACKEND=transformers \
MODE=adaptive \
LANGUAGE=zh \
REPO_ID="$MODEL_PATH" \
bash demo/run.sh

Open http://localhost:7860. LANGUAGE sets the default language tag (zh, en, or cs; default zh); use LANGUAGE=en for English speech.

For vLLM, convert and serve the model first:

python tools/convert_hf_to_mistral.py "$MODEL_PATH"

vllm serve "$MODEL_PATH" \
  --host 0.0.0.0 \
  --port 8000 \
  --tokenizer-mode mistral \
  --config-format mistral \
  --enforce-eager \
  --gpu-memory-utilization 0.9

Then launch the demo proxy:

BACKEND=vllm \
MODE=adaptive \
LANGUAGE=zh \
VLLM_HOST=127.0.0.1 \
VLLM_PORT=8000 \
REPO_ID="$MODEL_PATH" \
bash demo/run.sh

📝 Citation

If X2Streaming-ASR is useful for your research, please cite:

@article{lin2026x2streaming,
  title={X2Streaming-ASR: wait when uncertain, emit when ready for streaming ASR},
  author={Lin, Zhiwei and Fu, Kaiqi and Wen, Rime and Liu, Zehan and Qin, Shawn and Gan, Roy and Wang, Hao and Wang, Qian},
  journal={arXiv preprint arXiv:2609.08672},
  year={2026}
}

📄 License

Star History

Star History

Star History Chart

About

X2Streaming-ASR is a streaming Automatic Speech Recognition (ASR) system characterized by ultra-low latency and high accuracy.

Resources

Stars

69 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages