arXiv:2412.11272cs.SDeess.AS2024-12被引 5

让语音大模型实时处理流式语音,低延迟低功耗。

WhisperFlow: speech foundation models in real time

  • 用可学习的‘静音词’控制模型停止输入,避免幻觉。
  • 通过束剪枝复用解码结果,加速推理1.6到4.7倍。
  • 支持移动端低功耗运行,适合边缘设备部署。

语音基础模型(如 OpenAI Whisper)在语音理解任务中表现优异,但主要局限于处理预录制语音,实时流式语音处理效率低下。根源在于:模型训练为固定长度输入(通常30秒),编码需生成多达1500个标记,且解码依赖复杂不规则的束搜索。为此,我们提出 WhisperFlow 框架,融合模型与系统优化:(1) 引入可学习的‘静音词’作为短音频片段,插入输入后可无幻觉地终止模型处理;(2) 束剪枝技术对齐时间上的音频缓冲区并复用早期解码结果,显著加速解码;(3) 实现 CPU/GPU 流水线调度,动态映射编码/解码阶段,并自适应调整资源比例,适配不同语音输入、模型和硬件的编解码速度差异。我们在配备4-12核CPU和10-30核GPU的主流ARM平台测试,将每词延迟降低1.6至4.7倍,最低达0.5秒,准确率几乎无损。在入门级MacBook Air上,延迟稳定在1秒左右,整机功耗仅7瓦。

原文摘要 · Abstract (English)

Speech foundation models, such as OpenAI's Whisper, become the state of the art in speech understanding due to their strong accuracy and generalizability. Yet, their applications are mostly limited to processing pre-recorded speech, whereas processing of streaming speech, in particular doing it efficiently, remains rudimentary. Behind this inefficiency are multiple fundamental reasons: (1) speech foundation models are trained to process long, fixed-length voice inputs (often 30 seconds); (2) encoding each voice input requires encoding as many as 1,500 tokens with tens of transformer layers; (3) decoding each output entails an irregular, complex beam search. As such, streaming speech processing on resource-constrained client devices is more expensive than other AI tasks, e.g., text generation. To this end, we present a novel framework, WhisperFlow, which embodies both model and system optimizations. (1) Hush word as a short, learnable audio segment; appended to a voice input, a hush word gracefully stops the speech model from processing more input without hallucination; (2) Beam pruning, which aligns streaming audio buffers over time and reuses results from earlier decoding rounds, therefore significantly accelerating decoding; and (3) CPU/GPU pipelining, which not only maps to the encoding/decoding stages dynamically, but also tunes to an optimal resource ratio, respecting the encoding/decoding speed that varies across voice inputs, models, and hardware. We test WhisperFlow on commodity ARM platforms with 4-12 CPU cores and 10-30 GPU cores. It reduces per-word latency by 1.6x-4.7x to as low as 0.5 second, while seeing negligible accuracy degradation. On an entry-level MacBook Air, WhisperFlow can keep the per-word latency around 1 second, with the whole device drawing only 7 Watts in total.

语音模型实时处理边缘计算低延迟

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。