Abstract
Smart speakers face a significant challenge in recognizing millions of frequently updated entities, such as song titles or trending topics, without causing the language model's decoder graph to explode in size. This paper presents a novel phrase-level class-based language model that utilizes a Difference Language Model (DLM) and on-the-fly re-scoring. By decoupling sentence structure from specific entity content and applying real-time mathematical corrections, the system achieves significant reductions in graph size and improvements in recognition accuracy without increasing latency.
1. Introduction
Modern speech assistants must handle the "hot word" problem: the daily influx of new entities like songs, movies, and celebrities. Traditional class-based n-gram models, which replace placeholders like $SONG_NAME$ with entity lists, suffer from exponential growth in model size. For instance, a root grammar with 10,000 paths leading to a slot for 20 million songs would result in a theoretical model size of approximately 200GB, making real-time compilation and decoding impossible. Furthermore, Mandarin's dependency on vocabulary for word segmentation complicates the use of general-purpose segmenters for specialized entity names.
2. Methodology
2.1 Phrase-Level Class-Based LM
To manage complexity, the researchers treat entire entities as phrases rather than individual words. The system is split into a "root grammar," defining the overall sentence structure (e.g., "Play [SLOT]"), and separate "sub-grammars" for specific entity categories. This separation allows for rapid updates to entity lists without rebuilding the entire decoder graph.
2.2 The Difference Language Model (DLM)
The core innovation is the Difference Language Model. To keep the primary decoder graph manageable, a heavily pruned version of the entity list is used for the initial graph construction. To recover accuracy lost during pruning, the DLM is defined as: $$\log P_A(w|H) = \log P_B(w|H) - \log P_C(w|H)$$ where $P_B$ represents a large, high-accuracy model and $P_C$ represents the pruned model used in the graph.
2.3 On-the-Fly Re-scoring
During the decoding process, when the system encounters an entity slot, it applies the DLM to "correct" the scores from the pruned graph in real-time. This mechanism allows the engine to leverage the precision of a massive model while maintaining the search efficiency of a small graph.
3. Experiments and Results
3.1 Datasets
The approach was evaluated using internal Tencent datasets, including speaker_201812 and speaker_201901 (real-world voice search queries for music) and AI_Lab_test_600 (general read-speech utterances). The acoustic model was trained on a combined 8,000 hours of general Mandarin and smart speaker data.
3.2 Key Results
- Graph Size Reduction: The DLM approach reduced the decoder graph size from a theoretical 46GB to a manageable 938MB.
- Accuracy Gains: The method achieved a 10%–15% relative improvement in Word Error Rate (WER) on in-domain tasks compared to standard models. As shown in the table below, the rescoring method consistently improves performance over the baseline.
- Efficiency and Stability: The Real-Time Factor (RTF) remained stable at approximately 0.11-0.12, indicating no perceptible lag for users. Testing on general speech confirmed that the specialized entity recognition did not degrade the assistant's general performance.
4. Conclusion
By decoupling structure from content and utilizing on-the-fly re-scoring via a Difference Language Model, the researchers successfully addressed the size explosion problem in smart speaker language models. This architecture enables the recognition of millions of entities with high accuracy and low latency. Future work will focus on streamlining the FST replacement procedure to further simplify the deployment pipeline.
Summary updated