[论文解读] WeNet: Production oriented Streaming and Non-streaming End-to-End Speech Recognition Toolkit
WeNet 是一个生产就绪的开源端到端自动语音识别工具包,通过一种新颖的两阶段 U2 架构,将流式和非流式 ASR 统一起来,该架构结合了 CTC 和注意力解码。它在 AISHELL-1 数据集上实现了 5.03% 的相对 CER 降低,并通过 PyTorch 和 TorchScript 在服务器和边缘设备上实现了低延迟推理的优化运行时。
In this paper, we propose an open source, production first, and production ready speech recognition toolkit called WeNet in which a new two-pass approach is implemented to unify streaming and non-streaming end-to-end (E2E) speech recognition in a single model. The main motivation of WeNet is to close the gap between the research and the production of E2E speechrecognition models. WeNet provides an efficient way to ship ASR applications in several real-world scenarios, which is the main difference and advantage to other open source E2E speech recognition toolkits. In our toolkit, a new two-pass method is implemented. Our method propose a dynamic chunk-based attention strategy of the the transformer layers to allow arbitrary right context length modifies in hybrid CTC/attention architecture. The inference latency could be easily controlled by only changing the chunk size. The CTC hypotheses are then rescored by the attention decoder to get the final result. Our experiments on the AISHELL-1 dataset using WeNet show that, our model achieves 5.03\% relative character error rate (CER) reduction in non-streaming ASR compared to a standard non-streaming transformer. After model quantification, our model perform reasonable RTF and latency.
研究动机与目标
- 弥合端到端(E2E)语音识别模型在研究与生产部署之间的差距。
- 通过单一模型统一流式与非流式 ASR,以降低开发、训练和部署成本。
- 实现在包括边缘设备在内的多种硬件平台上的高效、低延迟推理。
- 通过 PyTorch 和 TorchScript 实现从研究训练到生产推理的无缝过渡。
- 通过量化、动态块划分和跨平台运行时可移植性优化模型效率。
提出的方法
- 提出 U2 框架:一种两阶段联合 CTC/注意力模型,包含共享编码器(Transformer 或 Conformer)、CTC 解码器和注意力解码器。
- 使用基于动态块的自注意力机制,实现具有可变感受野的上下文建模,支持流式推理。
- 采用两阶段解码策略:第一阶段通过 CTC 解码生成流式假设,第二阶段通过注意力解码进行重打分以提升准确率。
- 实现混合 CTC/注意力架构,其中共享编码器以有限的右文上下文处理输入,以在延迟与性能之间取得平衡。
- 采用带因果卷积的动态块训练方法,使 Conformer 支持流式推理,同时保留全局上下文建模能力。
- 通过 TorchScript 支持模型导出,并可在多种运行时(如 LibTorch、ONNX、OpenVINO、MNN、NCNN)部署,实现跨平台兼容性。

实验结果
研究问题
- RQ1一个统一的端到端模型是否能在无需单独训练模型的情况下,在流式和非流式 ASR 场景中均实现高准确率?
- RQ2如何将动态块划分与注意力机制结合,以在保持识别准确率的同时实现低延迟?
- RQ3一个同时具备 CTC 和注意力解码的单一模型,在实际部署中能在多大程度上降低延迟并提升推理效率?
- RQ4与标准非流式模型相比,两阶段重打分机制对字符错误率(CER)的影响如何?
- RQ5模型量化和运行时优化对生产环境中实时因子(RTF)和端到端延迟的影响是什么?
主要发现
- 与标准非流式 Transformer 模型相比,U2 模型在 AISHELL-1 数据集上实现了 5.03% 的相对 CER 降低。
- 在 15,000 小时普通话数据集上,U2 模型在 AISHELL-1 上实现了 3.70% 的 CER,当使用完整注意力解码时,优于全注意力 Conformer 基线模型的 3.96%。
- 在 x86 服务器平台上,最终延迟(L3)为 130ms,解码块大小为 4,主要由重打分成本(L2)主导,约为 114ms。
- 重打分成本在不同块大小下几乎保持不变,表明延迟优化应聚焦于第二阶段注意力解码的优化。
- 当使用 16 帧块大小时,模型保持了强劲性能,CER 仅出现轻微下降,支持低延迟下的实际部署。
- 该工具包支持通过 TorchScript 直接导出训练好的模型,并可在 x86 和 ARM 平台上部署,证明了其生产就绪性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。