利用 EmbeddingGemma 2 实现端侧语音转文字
We turned EmbeddingGemma 2 into a speech-to-text model
展示如何利用现有嵌入模型进行非传统任务的工程实践,提供了具体的架构思路、训练成本与性能基准,对做端侧部署的同学有参考价值。
Embedding Gemma Transcribe
嵌入 Gemma 转录
Google's EmbeddingGemma 2 is an embedding model. We turned it into a speech-to-text model: an hour of audio in about 13 seconds on a base MacBook Air, entirely on device.
Google 的 EmbeddingGemma 2 是一个嵌入模型。我们将其改造为语音转文本模型:在基础版 MacBook Air 上,处理一小时音频仅需约 13 秒,完全在设备端完成。
Download for Mac (free) v1.6 · macOS 14+ · Apple Silicon
下载 Mac 版(免费)v1.6 · macOS 14+ · Apple Silicon
models download on first launch (715 MB)
首次启动时下载模型(715 MB)
Can an embedding model transcribe speech?
嵌入模型能转录语音吗?
EmbeddingGemma 2 is a multimodal embedding model: text, images, audio and video in one shared space. Say a word out loud and its audio lands close to the written word.
EmbeddingGemma 2 是一个多模态嵌入模型:文本、图像、音频和视频共享同一个空间。大声说出一个词,其音频会与书面单词在空间中靠近。
So we tried reading words straight out of that space.
因此,我们尝试直接从该空间中读取单词。
How it works
工作原理
- EmbeddingGemma 2's audio encoder stays exactly as it is.
- A small reader moves each short slice of audio into the model's text space.
- The closest of ~229,000 English words wins, and the slices become a transcript.
- A tiny extra model adds punctuation and capitals.
- EmbeddingGemma 2 的音频编码器保持原样不变。
- 一个小型阅读器将每段短音频切片映射到模型的文本空间。
- ~229,000 个英文单词中匹配度最高的胜出,这些切片便组成了转录文本。
- 一个微小的额外模型负责添加标点和首字母大写。
Only the reader is trained: under two hours on 8×H100, on openly licensed English speech. The base model was never trained for speech-to-text.
仅训练了阅读器:在 8×H100 上耗时不到两小时,使用开源许可的英语语音数据。基础模型从未针对语音转文本进行过训练。
How fast?
速度如何?
| Model | Runs on | Mac | Speed |
|---|---|---|---|
| Embedding Gemma Transcribe | Neural Engine | base M3 MacBook Air, 8 GB | 288×1 hour in 12.6 s |
| IBM Granite Speech 5.0 TurboCTC | GPU (MLX) | base M3 MacBook Air, 8 GB | ~150×1 hour in 25.7 s |
| NVIDIA Parakeet TDT 0.6B v3 (FluidAudio) | Neural Engine | M4 Pro | 156× |
| NVIDIA Parakeet TDT 0.6B v3 (FluidAudio) | Neural Engine | M5 Pro | 335× |
| Phonon-2, a Parakeet v3 fine-tune (FluidAudio) | Neural Engine | M5 Pro | 480× |
| 模型 | 运行平台 | Mac | 速度 |
|---|---|---|---|
| Embedding Gemma Transcribe | 神经网络引擎 | 基础版 M3 MacBook Air, 8 GB | 288倍速:12.6 秒转录 1 小时音频 |
| IBM Granite Speech 5.0 TurboCTC | GPU (MLX) | 基础版 M3 MacBook Air, 8 GB | ~150倍速:25.7 秒转录 1 小时音频 |
| NVIDIA Parakeet TDT 0.6B v3 (FluidAudio) | 神经网络引擎 | M4 Pro | 156倍速 |
| NVIDIA Parakeet TDT 0.6B v3 (FluidAudio) | 神经网络引擎 | M5 Pro | 335倍速 |
| Phonon-2, a Parakeet v3 fine-tune (FluidAudio) | 神经网络引擎 | M5 Pro | 480倍速 |
× real time: seconds of audio per second of processing. Rows 1–2: our tests on the same base M3 MacBook Air. Rows 3–5: FluidAudio's published benchmarks on larger, newer Macs and different audio. A rough guide, not a like-for-like ranking.
× 实时率:每秒处理时间对应的音频秒数。第 1–2 行:我们在同一台基础版 M3 MacBook Air 上的测试结果。第 3–5 行:FluidAudio 在更大、更新的 Mac 及不同音频上发布的基准测试。仅供参考,并非严格可比排名。
Where it stands
当前表现
Its word error rate is about 5% right now, against 2–3% for leading speech models. We believe a better-trained reader can close that gap; that's the next iteration.
目前其字错误率约为 5%,而领先语音模型的字错误率为 2–3%。我们相信通过更优训练的阅读器可以缩小这一差距;这将是下一迭代版本的目标。
Use it
使用方法
Drop in an audio file, or hold Right Option, speak and release to dictate into any app. It runs on the Mac's Neural Engine; your audio never leaves the machine.
拖入音频文件,或按住 Right Option 键说话后松开即可在任何应用中听写。它运行于 Mac 的神经网络引擎上;你的音频永远不会离开本机。
Download for Mac (free)
下载 Mac 版(免费)
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力