Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 29 additions & 11 deletions docs/docs/benchmarks/r2t2_results.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This section reports the accuracy and the speed of Confucius4-R2T2 on the NPU wi

> **Note:**
> - Results are based on a FastFlowLM build of the `r2t2` family (v1.0.14), under FLM's default NPU power mode (Performance).
> - The audio encoder and the prompt processing run on the CPU, the 28 decoder layers run on the NPU; the CPU numbers below depend on the host CPU.
> - The audio encoder, the prompt processing and the 28 decoder layers run on the NPU.
> - Newer versions may deliver improved performance.

---
Expand All @@ -24,14 +24,25 @@ AMD Ryzen™ AI 9 HX 370 (Strix Point), 24 CPU threads, 59 GB DRAM.

### 🎯 Accuracy (relative to the original BF16 model)

The same 180 recordings were transcribed by the original BF16 model (PyTorch, CPU) and by FLM through `v1/audio/transcriptions`: 120 English utterances (LibriSpeech test-clean, up to 20 s) and 60 Mandarin utterances (FLEURS cmn_hans_cn). Error rates are against the reference text after lower-casing, removing punctuation and writing Chinese numerals as digits; the difference is paired per utterance (95% bootstrap interval).
**LibriSpeech test-clean**, all 2620 utterances (5.4 h, 52.6k words), transcribed by the original BF16 model (PyTorch, CPU) and by FLM. Word error rate against the reference text after lower-casing and removing punctuation (numbers are not normalized: "1847" and "eighteen forty seven" count as different words for both); the difference is paired per utterance (95% bootstrap interval).

| **Model** | **WER (%)** | **Word errors** | **Difference** |
|-----------|------------:|----------------:|---------------:|
| BF16 original | 2.22 | 1178 | |
| FLM (NPU) | 2.30 | 1220 | +0.08 (+0.02 … +0.15) |

Without the utterances that contain digits, the two are 2.11 and 2.14.

**English and Mandarin**, 180 recordings: 120 English utterances (LibriSpeech test-clean, up to 20 s) and 60 Mandarin utterances (FLEURS cmn_hans_cn). Error rates are against the reference text after lower-casing, removing punctuation and writing Chinese numerals as digits; the difference is paired per utterance (95% bootstrap interval).

| **Language** | **Metric** | **BF16 original** | **FLM (NPU)** | **Difference** |
|--------------|------------|------------------:|--------------:|---------------:|
| English | WER (%) | 2.89 | 2.81 | −0.09 (−0.31 … +0.09) |
| Mandarin | CER (%) | 8.96 | 6.37 | −2.60 (−9.84 … +1.37) |
| English | WER (%) | 2.89 | 2.81 | −0.09 (−0.41 … +0.21) |
| Mandarin | CER (%) | 8.96 | 9.30 | +0.34 (−0.27 … +1.49) |

The NPU decode reads mixed precision: Q4_1 for q/k/o/gate/up and the output head, Q8_0 for v_proj and down_proj (the prompt is processed on the CPU with Q8_0 throughout). 4-bit quantization of every matrix (Q4_0, Q4_1, Q4_K) breaks this model (empty transcripts, or Mandarin answered in English); keeping v_proj and down_proj at 8 bit does not change its accuracy, and decodes ~24 % faster than Q8_0 everywhere. Mandarin CER is dominated by number and punctuation style (digits vs Chinese numerals), not by recognition errors, which is why the absolute values are higher than the English ones and why their difference is not significant.
One Mandarin recording is answered in English by both the BF16 original and FLM; without it the Mandarin CER is 5.98 (BF16) and 6.32 (FLM).

The NPU reads the decoder in mixed precision, for the prompt and for decoding alike: Q4_1 for q/k/o/gate/up and the output head, Q8_0 for v_proj and down_proj. The audio encoder runs on the NPU in bfp16 (block floating point) from its BF16 weights. 4-bit quantization of every matrix (Q4_0, Q4_1, Q4_K) breaks this model (empty transcripts, or Mandarin answered in English); keeping v_proj and down_proj at 8 bit does not change its accuracy, and decodes ~24 % faster than Q8_0 everywhere. Mandarin CER is dominated by number and punctuation style (digits vs Chinese numerals), not by recognition errors, which is why the absolute values are higher than the English ones and why their difference is not significant.

For recordings cut at 0.5 s … 60 s (around the encoder's 1 s chunk and 8 s window edges), the FLM transcripts are identical to the BF16 original's in all 18 cases.

Expand All @@ -43,15 +54,22 @@ Prompt processing (audio encoder + prefill) per recording length, and decoding s

| **Audio length** | **Encode + prefill** | **per second of audio** | **Decoding (tokens/s)** |
|------------------|---------------------:|------------------------:|------------------------:|
| 0 – 4 s | 0.13 s | 43 ms | 38.5 |
| 4 – 8 s | 0.21 s | 35 ms | 38.4 |
| 8 – 12 s | 0.31 s | 30 ms | 38.0 |
| 12 – 20 s | 0.45 s | 28 ms | 37.8 |
| 0 – 4 s | 0.13 s | 42 ms | 38.4 |
| 4 – 8 s | 0.15 s | 27 ms | 38.3 |
| 8 – 12 s | 0.20 s | 21 ms | 38.0 |
| 12 – 20 s | 0.25 s | 17 ms | 37.9 |

End to end through the server (normal request): a 68 s recording takes about 8 s, a 205 s recording 23 s, a 410 s recording 46 s (about 0.11 × real time; recordings longer than a minute are transcribed in pieces of about a minute).

Streaming (stream=true), time to process / length of the audio (below 1 keeps up with live speech):

End to end through the server (normal request): a 68 s recording takes about 8 s, a 205 s recording 22 s, a 410 s recording 42 s (about 0.1 × real time; recordings longer than a minute are transcribed in pieces of about a minute). Streaming (stream=true): 0.45 × real time at 480 ms chunks, 0.75 × at 240 ms, about 0.9 × at 200 ms, 1.05 × at the paper's 160 ms; long recordings stay at the same rate.
| **Chunk size** | 160 ms | 200 ms | 240 ms | 320 ms | 480 ms | 1000 ms | 2000 ms |
|----------------|-------:|-------:|-------:|-------:|-------:|--------:|--------:|
| 11 – 18 s recordings | 0.88 | 0.70 | 0.62 | 0.50 | 0.37 | 0.22 | |
| 205 s recording | | | | | 0.43 | | 0.18 |

---

### 🧠 Memory

About 2.4 GB resident after loading, about 4.2 GB after the first request (1.8 GB of that is the model file mapped from disk), at most about 5.7 GB while transcribing long recordings (7-minute file, 10-minute stream).
About 3.2 GB resident after loading, about 3.6 GB after the first request, at most about 4.5 GB while transcribing a 5.5-minute recording (4.1 GB as one request, 4.5 GB streamed at 480 ms chunks).
10 changes: 5 additions & 5 deletions docs/docs/models/r2t2.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ parent: Models
- **Tool Calling Support:** No
- **Base Model:** [netease-youdao/Confucius4-R2T2](https://huggingface.co/netease-youdao/Confucius4-R2T2) (fine-tuned from [Qwen/Qwen3-ASR-1.7B](https://huggingface.co/Qwen/Qwen3-ASR-1.7B))
- **Parameters:** 2B (0.3B audio encoder + 1.7B text decoder)
- **Quantization:** decoder Q8_0 for the prompt (CPU), mixed Q4_1 / Q8_0 for the NPU decode (Q8_0 for v_proj and down_proj), audio encoder BF16
- **Quantization:** decoder mixed Q4_1 / Q8_0 (Q8_0 for v_proj and down_proj), read by the NPU for the prompt and for decoding; audio encoder BF16, run on the NPU in bfp16
- **Languages:** 30 (best at Chinese and English)
- **Max / Default Context Length:** 2k tokens (12.5 audio tokens per second), enough for one piece of about a minute and its text. Requests have no length limit: audio longer than a minute is transcribed in pieces of about a minute, cut at quiet moments (CLI `/input`, chat completions with audio and `v1/audio/transcriptions` alike). Streaming requests have no length limit either (see Streaming mode).

Expand Down Expand Up @@ -67,7 +67,7 @@ data: [DONE]

The audio is fed to the model in chunks (`chunk_size_ms`, 80 ms to 2000 ms, default 1000). After every chunk the model is asked again, with all the audio so far, to continue the text; everything except its last token is final and sent at once (`unfixed_token_num`, default 1, sets how many trailing tokens stay open). The text you receive never changes. The result equals the reference streaming implementation of the model.

> **Speed:** each step only computes what is new: the encoder output of the finished parts of the recording is kept, the next step's audio is encoded while the NPU decodes the current one, and one streaming context covers 30 to 45 s (it ends at the first quiet chunk end after 30 s; a final step finishes its text and the next chunk starts a fresh context, so long recordings do not slow down). Measured on this hardware (time to process / length of the audio, below 1 keeps up with live speech): 160 ms chunks (the model paper's) 1.05, 200 ms about 0.9, 240 ms 0.75, 320 ms 0.6, 480 ms 0.45; a 205 s recording at 480 ms chunks 0.56, at 2 s chunks 0.24. For the lowest latency that keeps up, use 200 ms chunks or more.
> **Speed:** each step only computes what is new: the encoder output of the finished parts of the recording is kept, the next step's audio is encoded while the NPU decodes the current one, and one streaming context covers 30 to 45 s (it ends at the first quiet chunk end after 30 s; a final step finishes its text and the next chunk starts a fresh context, so long recordings do not slow down). Measured on this hardware (time to process / length of the audio, below 1 keeps up with live speech): 160 ms chunks 0.88, 200 ms 0.70, 240 ms 0.62, 320 ms 0.50, 480 ms 0.37; a 205 s recording at 480 ms chunks 0.43, at 2 s chunks 0.18. Every chunk size from 160 ms up keeps up with live speech.

### As the ASR model (`-a`)

Expand Down Expand Up @@ -141,10 +141,10 @@ The sample clip of the model's repository ([test.wav](https://github.com/netease

| | after load | after the first request | peak, 5.5 min recording |
|---|---|---|---|
| `flm serve r2t2:1.7b` or `flm serve -a r2t2:1.7b` | 2.4 GB | 4.2 GB | 4.7 GB offline, 5.0 GB streaming |
| `flm serve qwen3:0.6b -a r2t2:1.7b` | 6.8 GB | 8.6 GB | 8.7 GB (2 min recording) |
| `flm serve r2t2:1.7b` or `flm serve -a r2t2:1.7b` | 3.2 GB | 3.6 GB | 4.1 GB offline, 4.5 GB streaming |
| `flm serve qwen3:0.6b -a r2t2:1.7b` | 7.6 GB | 8.0 GB | 8.1 GB (2 min recording) |

Of R2T2's 4.2 GB, 1.6 GB are the weights the NPU decode reads (pinned in system memory), 0.7 GB is working memory, and 1.8 GB is the model file mapped from disk for the CPU's prompt processing, which the system can reclaim under memory pressure (the audio encoder and the prompt processing run on the CPU, the decoder on the NPU). With a chat model next to R2T2 the figures add up; the chat model's own share is that of `flm serve <model>` alone.
Of R2T2's 3.6 GB, 2.4 GB are the weights and buffers the NPU reads (pinned in system memory: decoder, audio encoder, working buffers), 0.8 GB is the CPU's working memory, including a copy of the audio encoder weights that streaming requests use to encode the next chunk while the NPU decodes, and 0.4 GB is the model file mapped from disk (embedding rows), which the system can reclaim under memory pressure. The audio encoder, the prompt processing and the decoder all run on the NPU. With a chat model next to R2T2 the figures add up; the chat model's own share is that of `flm serve <model>` alone.

### License

Expand Down
Loading