Abstract
This paper presents an adaptation of the Transformer architecture for real-time, "always-on" wake word detection (WWD). By employing a chunk-wise streaming approach, look-ahead context, and efficient relative positional embeddings, the proposed model achieves a 25% relative improvement in detection accuracy over standard convolutional baselines. The system maintains linear complexity and a small footprint (~57k parameters), making it suitable for deployment on resource-constrained edge devices.
Introduction
Wake word detection (WWD)—the technology powering virtual assistants like "Hey Siri" or "OK Google"—requires a delicate balance of real-time streaming capability, extreme hardware efficiency, and high accuracy. While Transformers have set new benchmarks in speech recognition due to their ability to model long-range dependencies, their standard implementation is non-streaming and computationally expensive, with costs growing quadratically ($O(T^2)$) with sequence length.
This research explores modifications to the Transformer architecture to make it viable for low-latency, short-range keyword spotting in continuous audio streams.
Methods
The authors utilized an alignment-free LF-MMI (Lattice-Free Maximum Mutual Information) framework, treating the wake word as a single unit to improve training robustness. To enable streaming, several architectural innovations were introduced:
- Chunk-wise Processing: Audio is processed in small, overlapping segments. The model uses a cache of previous hidden states to maintain context across boundaries.
- Look-ahead Context: The model "peeks" at a small number of future frames from the next chunk, which significantly improves acoustic modeling at the cost of minimal latency.
- Relative Positional Embeddings (RPE): Since absolute timestamps are impractical for infinite streams, the model learns the distance between frames. The authors optimized these embeddings to be computed without significant memory overhead.
- Dependency Structures: The team experimented with different ways to pass information between chunks, including dependencies on the previous layer versus the same layer of the preceding chunk.
Experimental Setup
The models were evaluated using the Mobvoi (SLR87) dataset, which includes approximately 144 hours of training data and 74 hours of test data for the wake words "Hi Xiaowen" and "Nihao Wenwen." This dataset provides a challenging benchmark for modern models, featuring over 64,000 positive examples across training and testing sets.
Key Results and Insights
The proposed Streaming Transformer demonstrated significant performance gains over a strong 1D-Convolutional (CNN) baseline. At a fixed rate of 0.5 False Alarms per Hour (FAH), the Transformer reduced the False Rejection Rate (FRR) from 0.8% to approximately 0.5%–0.6%, representing a 25% relative improvement.
Key takeaways from the experiments include:
- The Importance of Future Context: Without look-ahead capabilities, the Transformer performed worse than a simple CNN, proving that symmetrical context is vital for acoustic tasks.
- State-Caching vs. Recomputation: Training without state-caching (allowing gradients to flow back through history) yielded superior results, as it enabled the model to learn better long-term dependencies.
- Efficiency: The model achieved these results with only ~57k parameters, maintaining linear complexity ($O(T)$) relative to sequence length.
Conclusion
While the Transformer architecture provides a powerful alternative to CNNs for wake word detection, its success depends heavily on the implementation of relative positioning and look-ahead context. The authors noted that "Same-layer Dependency" (attending to the same layer in a previous chunk) underperformed, likely due to how relative positional embeddings shift the semantic space of tensors. Future research will focus on optimizing these complex dependencies and further reducing the power requirements for on-device deployment.
Summary updated