通过推测执行隐藏端侧级联语音代理中的工具延迟
研究论文 · 2026/10/07
工具增强的语音助手通常将自动语音识别、大语言模型推理和外部工具执行串行化,导致工具延迟仅在用户说完且LLM识别出所需工具调用后才产生。我们提出面向端侧级联语音代理的推测性工具执行方法,从部分ASR假设中预测工具请求,并在语音仍在接收时启动工具执行,从而降低端到端响应延迟。该方法引入一个预测器模块,在语音识别过程中预判工具调用,推测性执行并缓存结果,随后将缓存输出注入LLM提示以实现更快响应。此外,为缓解用户语音中自我纠正导致的错误,我们采用基于规则的验证机制,仅选择性注入有效的缓存结果。作为最终保障,LLM保留直接发起工具调用的能力,确保最坏情况下框架延迟不超过基线串行执行流水线。我们使用完全实现的Android语音助手的实时测量评估该方法,将首音频中位时间从5.79秒降至4.60秒,标准差从3.49秒降至2.81秒,使响应延迟更可预测。
该工作针对端侧语音助手中工具调用延迟的关键瓶颈,提出可落地的推测执行框架,并在真实Android设备上验证了延迟与稳定性的显著提升,对实时语音交互系统有直接参考价值。
Tool-augmented speech assistants typically serialize automatic speech recognition, large language model inference, and external tool execution. As a result, tool latency is incurred only after the user has finished speaking and the LLM has identified the required tool calls. We present speculative tool execution for on-device cascaded voice agents, which predicts tool requests from partial ASR hypotheses and initiates tool execution while speech is still being received, thereby reducing end-to-end response latency. Our approach introduces a Predictor module that anticipates tool calls during speech recognition, executes them speculatively, and caches the results. The cached outputs are then injected into the LLM prompt, enabling faster responses. Additionally, to mitigate errors caused by user self-corrections during speech, we employ a rule-based validation mechanism that selectively injects only valid cached results. As a final safeguard, the LLM retains the ability to issue tool calls directly, ensuring that the latency of our framework is upper-bounded by the baseline serial execution pipeline in the worst case. We evaluate our method using live measurements from a fully implemented Android voice assistant. Our approach reduces the median time-to-first-audio from 5.79,s to 4.60,s and decreases the standard deviation from 3.49,s to 2.81,s, resulting in more predictable response latency.