Introduction
Large-scale neural language models (LMs) excel at capturing linguistic structure but often struggle with the "long tail" of information. In conversational AI, new entities—such as viral song titles or trending products—emerge daily. Standard neural LMs are typically static; updating them with new knowledge requires expensive retraining on full sentences. Furthermore, rare entities often lack sufficient representation in training corpora.
To address these challenges, researchers at Amazon have developed Entity-Aware Language Models (EALM). This modular architecture decouples general linguistic knowledge from specific entity knowledge, allowing conversational agents to learn new or rare entities continually without retraining the entire system.
The EALM Architecture
The EALM framework consists of three primary components designed to bridge the gap between flexible n-gram models and powerful neural LMs.
- Pre-trained LM: A standard Transformer-based decoder that handles general language structure and grammar.
- Entity Models: Smaller neural LMs trained specifically on entity catalogues (e.g., lists of names or products). These models share the same embedding space as the base LM but can be updated or swapped independently.
- Contextual Fusion Layer: This component acts as a coordinator. During generation, it determines the relative weight to assign to the base LM versus specific entity models based on the current context.
Contextual Fusion and Interpolation
The system employs linear interpolation to combine outputs. Rather than selecting a single model, it blends the hidden states of the base LM and entity models based on the probability that the next token belongs to a specific entity category.
The fusion layer learns to "trigger" relevant models. For instance, the prefix "Play the song..." increases the weight of "Song" and "Album" entity models. This contextual awareness allows the model to adapt to personalized or trending content at a minimal computational cost.
Experimental Setup
The study utilized a mix of internal and synthetic datasets:
- Training Data: 40 million tokens of de-identified transcribed utterances from a voice assistant.
- Entity Catalogues: Massive lists (2M to 10M entries) covering seven categories: songs, albums, celebrities, videos, shopping items, place names, and person names.
- Evaluation: Performance was measured on "seen" entities, "tail" (rare) entities, and entirely "new" entities not present during initial training.
Key Results and Insights
The EALM demonstrated significant performance gains over standalone pre-trained LMs:
- Tail Entity Performance: A 10.37% reduction in perplexity for rare entities.
- Dynamic Updates: Updating entity models with new information led to a 14.38% improvement on utterances containing those new entities.
- Cross-Lingual Adaptation: By plugging in a Spanish entity catalogue, the model achieved a 39.12% perplexity reduction on Spanish entities, despite the base LM being primarily English-centric.
- Efficiency: The fusion layer required only 8% of the original training data to learn effective blending.
A notable insight was that EALM performed better even on entities not in its catalogues. This suggests that entity models act as a form of regularization, preventing the base LM from over-fitting to common entities seen during pre-training.
Limitations and Future Directions
While EALM offers a scalable path for continual learning, a performance gap remains compared to models fully retrained on new entities within complete sentences. Additionally, the fusion layer often capped entity model weights at 5-20%; future work aims to allow these models to exert more influence in high-confidence contexts. As the number of entity catalogues grows, researchers are also exploring parameter-sharing techniques to manage the memory footprint.
The interpolation probabilities generated by the fusion layer could also serve as cues for downstream tasks, such as intent classification, further enhancing the capabilities of conversational agents.
Summary updated