摘要 BlackBear-Flash-ASR 是 BlackBear-ASR 的小型版。它只留下聲學編碼器的前 4 個區塊和 CTC 頭,拿掉 Barbet 語言模型。參數從 13.39 億降到 4,764 萬,大約是 1/28。權重 96 MB,一般桌機的 CPU 就能跑。它的代價是準確度:沒有標點,錯誤率大約是完整版的兩倍。它適合要小、要快、要離線,或想用自己的錄音微調的情境。
本文重點
- 小:4,764 萬參數。一個 Qwen3-ASR-1.7B 的大小,裝得下 49 個 Flash;一個 Whisper large-v3,裝得下 32 個。int8 版只有 51.5 MB,是 Whisper large-v3 官方權重檔(3.09 GB)的 1/60。
- 比同樣大小的 Whisper 準:錯誤率約是 Whisper tiny 的一半(17.3% 對 33.3%)。Whisper tiny 有 8 句不停重複同一個詞,base 偶爾整句變成英文,Whisper 也常輸出簡體字。
- 快:10 秒的錄音,桌機 CPU 約 0.09 秒辨識完。一小時的錄音約 40 秒。不用 GPU,也不用上網。
- 能微調:14 小時課堂錄音微調約 1.5 分鐘,沒聽過的講次錯誤率從 12.3% 降到 10.3%。
- 瀏覽器就能跑:網頁試用用 51 MB 的 int8 版,錄音不會上傳。
- 弱點寫在前面:沒有標點。Common Voice 錯誤率 17.3%,完整版是 9.2%。
在瀏覽器試用完整使用說明實作教學下載權重GitHub 程式碼
先看一分鐘
為什麼要做小的?
完整版 BlackBear-ASR 很準,也能照指令改稿、回答問題。不過它要載入 11 億參數的語言模型,手機和小型裝置很難跑。很多情境其實只需要逐字稿,例如課堂筆記、vlog 字幕、店內口述紀錄。
完整版在訓練時,編碼器第一段本來就接了一個 CTC 頭,直接把聲音轉成文字。Flash 把這條路徑單獨切出來。轉寫指令事先算成固定的向量,所以不需要語言模型。我們在匯出時逐一比對:Flash 的輸出和完整版的 CTC 頭完全相同(logits 差異為 0)。
有多小?
| 模型 | 參數量 | 是 Flash 的幾倍 |
|---|---|---|
| Qwen3-ASR-1.7B | 23.5 億 | 49 |
| Whisper large-v3 | 15.4 億 | 32 |
| Breeze-ASR-25 | 15.4 億 | 32 |
| BlackBear-ASR(完整版) | 13.39 億 | 28 |
| Qwen3-ASR-0.6B | 9.4 億 | 20 |
| Whisper large-v3-turbo | 8.1 億 | 17 |
| BlackBear-Flash-ASR | 0.476 億 | 1 |
參數量依各模型在 Hugging Face 上的權重檔計算。這張表只比大小,不比準確度。更小的模型也存在,例如 Whisper tiny。
| Flash | 完整版 | |
|---|---|---|
| 權重 | 96 MB(bf16);191 MB(fp32) | 5.4 GB |
| 桌機 CPU 速度(批次處理) | 約 93 倍即時 | 約 3 倍即時 |
| 即時字幕:每 0.64 秒一塊的 CPU 時間 | 約 0.18 秒 | — |
即時字幕模式寫出的字不會再改。
下載大小:用 int8 版來比
Flash 量化成 int8 後是 51.5 MB,錯誤率 17.34%,和 fp32 的 17.31% 幾乎一樣。網頁試用用的就是這個版本。
| 模型 | 官方權重檔(Hugging Face) | Flash int8 是它的 |
|---|---|---|
| Qwen3-ASR-1.7B | 4.70 GB(bf16) | 1/91 |
| Whisper large-v3 | 3.09 GB(fp16) | 1/60 |
| Breeze-ASR-25 | 3.09 GB(bf16) | 1/60 |
| Qwen3-ASR-0.6B | 1.88 GB(bf16) | 1/36 |
| Whisper large-v3-turbo | 1.62 GB(fp16) | 1/31 |
| Whisper small | 967 MB(fp32) | 1/19 |
| BlackBear-Flash-ASR int8 | 51.5 MB | 1 |
比的是下載時的檔案大小。其他模型也可以量化;如果都量化成 int8,比例約等於參數量的比例,例如 Whisper large-v3 約 1/32。
準確度:代價寫清楚
字元錯誤率,越低越好。
| 測試集 | 錄音數 | Flash | 完整版 |
|---|---|---|---|
| Common Voice 22 臺灣國語 | 1,000 | 17.31 | 9.18 |
| ML2021 臺大課堂,國語夾英文術語 | 1,000 | 16.71* | 9.26 |
| FormosaSpeech 國語朗讀 | 178 | 21.73* | 11.79 |
Common Voice 是用匯出的 Flash 權重在 CPU 上實測。* 是裁切前用完整版的 CTC 頭量的;匯出時已確認兩者輸出相同。臺語目前沒有公開測試集的分數。
和同樣大小的 Whisper 比
同一批 Common Voice 1,000 句、同一套計分(Whisper 的簡體輸出先轉成繁體)。速度是 CPU 單執行緒處理 10 秒錄音的時間。
| 模型 | 參數量 | 錯誤率 | 10 秒錄音 |
|---|---|---|---|
| Whisper tiny | 3,776 萬 | 33.30 | 0.49 秒 |
| Flash int8 | 4,764 萬 | 17.34 | 0.15 秒 |
| Whisper base | 7,259 萬 | 22.72 | 0.88 秒 |
| Whisper small | 2.42 億 | 13.92 | 3.08 秒 |
同樣大小,Flash 的錯誤率約是 Whisper tiny 的一半,也比更大的 Whisper base 準。Whisper small 比 Flash 準,但參數是 5 倍,速度慢約 20 倍。
Whisper 小模型還有幾種錯誤:
| 同一批 1,000 句 | tiny | base | small | Flash |
|---|---|---|---|---|
| 同一段字連續重複 4 次以上 | 8 句 | 1 句 | 1 句 | 1 句* |
| 整句變成英文 | 2 句 | 3 句 | 1 句 | 0 |
| 輸出含簡體字 | 137 句 | 94 句 | 140 句 | 0 |
例如參考「她喜歡鄉下的生活」,tiny 輸出「好,一切,一切,一切……」;參考「放在網路上」,base 輸出「Thumbs up and watch out!」。* Flash 這句的參考答案本身就是「議論紛紛,紛紛沒聽到」。
辨識例子(Common Voice,CC0):
| 錄音內容 | Flash 輸出 |
|---|---|
| 坊間真的有很多不錯的書可以讀 | 坊間真的有很多不錯的書可以讀 |
| 是個有生命力的人文城市 | 是個有生命力的人文城市 |
用自己的錄音微調
Flash 只用 CTC 損失訓練,不需要語言模型,所以微調很便宜。全模型微調約需 7 GB 顯示卡記憶體。
我們用 14 小時的單一講者課堂錄音試了一次。測試用的講次完全沒有參與訓練。
| 做法 | 沒聽過的講次 | 一般國語(Common Voice) |
|---|---|---|
| 微調前 | 12.32 | 17.26 |
| 只用課堂錄音 | 10.02 | 20.12 |
| 課堂錄音與一般朗讀錄音約 2:1 混合 | 10.28 | 16.82 |
- 兩種做法在講次上的改善都達統計顯著。
- 只用課堂錄音,一般國語會變差。混入一般錄音後沒有變差(16.82 和 17.26 的差在誤差範圍內)。
- 改對的例子:Pper → paper、sequonc → sequence、AI ag → AI agent。
- 混合版微調 900 步,約 1.5 分鐘。
適合微調的情境:課堂逐字稿(課程術語、國語夾英文)、vlog 字幕(自然口語、戶外收音)、店內口述(品牌、商品名、價格讀法)。做法見 微調教學。
開始使用
git clone https://github.com/OpenFormosa/blackbear-flash-asr && cd blackbear-flash-asr
pip install -e .
from blackbear_flash import BlackBearFlash
asr = BlackBearFlash.from_pretrained("OpenFormosa/blackbear-flash-asr")
print(asr.transcribe("audio.wav"))
for event in asr.stream("talk.wav"): # 每 0.64 秒出字,寫出的字不再修改
print(event["new"], end="")
第一次下載前,請先在 Hugging Face 模型頁填寫申請表,送出後自動核准。
什麼時候該用完整版?
- 需要標點、改稿、回答錄音內容的問題。
- 同音字和少見詞很重要。Flash 沒有語言模型,這類錯誤比較多。
- 需要熱詞清單。Flash 不支援,可以改用微調補詞。
- 醫療、法律、新聞用途,兩個版本都請人工校對。
致謝
BlackBear-Flash-ASR 屬於 OpenFormosa 社群。感謝 Taipei-1、臺大語音實驗室(NTU Speech Lab)與 NTU SPML Lab 的支持,也謝謝每一位貢獻者。歡迎到 Discord 分享你的微調結果。
Abstract BlackBear-Flash-ASR is the small version of BlackBear-ASR. It keeps the first 4 blocks of the acoustic encoder and their CTC head, and drops the Barbet language model. Parameters go from 1.339B to 47.6M, about 1/28. The weights are 96 MB and run on a desktop CPU. The price is accuracy: no punctuation, and about twice the error rate of the full model. Use it when small, fast, offline, or fine-tunable matters.
Try it in your browserFull guideTutorialDownload weightsCode on GitHub
Watch
How small
| Model | Parameters | Times Flash |
|---|---|---|
| Qwen3-ASR-1.7B | 2.35B | 49 |
| Whisper large-v3 / Breeze-ASR-25 | 1.54B | 32 |
| BlackBear-ASR (full) | 1.339B | 28 |
| Qwen3-ASR-0.6B | 0.94B | 20 |
| Whisper large-v3-turbo | 0.81B | 17 |
| BlackBear-Flash-ASR | 47.6M | 1 |
The int8 version is 51.5 MB with an error rate of 17.34% (fp32: 17.31%); the browser demo uses it. Against official weight files on Hugging Face, that is 1/60 of Whisper large-v3 (3.09 GB, fp16) or Breeze-ASR-25 (3.09 GB, bf16), and 1/91 of Qwen3-ASR-1.7B (4.70 GB, bf16). This compares download size; if every model were int8, the ratio would be about the parameter ratio (Whisper large-v3: about 1/32).
Smaller models exist, such as Whisper tiny. On a desktop CPU, Flash runs at about 93x real time (the full model: about 3x). A 10 s clip takes about 0.09 s. In live-caption mode, emitted text is never revised.
Accuracy
Character error rate, lower is better: Common Voice 22 Taiwanese Mandarin 17.31 (full model 9.18); ML2021 lectures 16.71* (9.26); FormosaSpeech 21.73* (11.79). * Measured with the full model’s CTC head before the cut; the export confirms identical logits. No public Taiwanese Hokkien score yet.
Against Whisper of the same size, on the same 1,000 clips and scoring: Whisper tiny (37.8M) 33.30, Flash int8 (47.6M) 17.34, Whisper base (72.6M) 22.72, Whisper small (242M) 13.92. At the same size Flash has about half the error rate of Whisper tiny; Whisper small is more accurate but 5x larger and about 20x slower on one CPU thread (3.08 s vs 0.15 s for a 10 s clip). Whisper tiny got stuck repeating a word in 8 clips, base switched entirely to English in 3, and 9–14% of Whisper outputs contained Simplified characters (Flash: none).
Fine-tuning
Full-model fine-tuning needs about 7 GB of GPU memory. On 14 h of single-speaker lecture recordings mixed about 2:1 with general read speech, 900 steps (about 1.5 min) cut the error rate on unseen lectures from 12.32% to 10.28%, while general Mandarin stayed level (17.26% → 16.82%, within noise). Lecture data alone gave 10.02% but general Mandarin degraded to 20.12%, so mix in general data. See the tutorial (Chinese).
Get started
git clone https://github.com/OpenFormosa/blackbear-flash-asr && cd blackbear-flash-asr
pip install -e .
from blackbear_flash import BlackBearFlash
asr = BlackBearFlash.from_pretrained("OpenFormosa/blackbear-flash-asr")
print(asr.transcribe("audio.wav"))
Fill in the access form on the Hugging Face model page first; approval is automatic. For punctuation, editing, questions about the audio, or hotwords, use the full BlackBear-ASR.
Acknowledgements
BlackBear-Flash-ASR belongs to the OpenFormosa community. Thanks to Taipei-1, NTU Speech Lab and NTU SPML Lab for their support, and to every contributor.