Abstract
The Neural Knowledge Language Model (NKLM) integrates symbolic knowledge graphs with recurrent neural networks to improve factual accuracy in language modeling. By utilizing a copy mechanism to retrieve entities from structured data, NKLM effectively handles rare named entities and reduces reliance on "unknown" tokens, outperforming standard RNNLMs in both perplexity and factual consistency.
Introduction
Traditional language models (LMs) excel at capturing linguistic structure but often fail to represent factual knowledge accurately. Named entities like specific names, dates, and locations are subject to Zipf’s law, appearing rarely in training corpora. Consequently, standard models frequently map these critical details to "unknown" tokens (<unk>). This leads to significant issues: high computational complexity in large vocabularies, static knowledge that requires retraining to update, and a lack of grounding in factual relationships.
Methodology
The NKLM addresses these challenges by hybridizing a symbolic Knowledge Graph (KG) with a Recurrent Neural Network Language Model (RNNLM).
The model follows a four-step inference process at each time step:
- Contextual Update: An LSTM tracks the history of words and facts.
- Fact Extraction: The model generates a "fact-key" to query a local knowledge memory (e.g., Freebase triples).
- Source Selection: A binary gate determines whether to generate a word from the global vocabulary or "copy" it from the retrieved fact.
- Word Generation: If copying is selected, the model predicts the position within the fact description, allowing it to output words outside its fixed training vocabulary.
Datasets
Evaluation was conducted on WikiFact, a benchmark aligning Wikipedia biographies with Freebase facts. The WikiFact-FilmActor-v0.1 subset contains approximately 10k topics and 1.5M tokens, providing a ground-truth link between natural language and structured data.
Key Results
NKLM was benchmarked against a standard RNNLM across various vocabulary sizes.
The NKLM consistently outperformed the baseline. At a 10k vocabulary size, NKLM achieved a perplexity (PPL) of 28.0 compared to 39.4 for the RNNLM. More significantly, on the Unknown-Penalized Perplexity (UPP) metric—designed to penalize models for failing to identify rare words—NKLM showed a dramatic improvement (48.7 vs 107.0). The model also reduced the frequency of "unknown" tokens by approximately 50%.
Discussion and Future Work
A key insight of this work is that for rare words, learning the logic of "when to copy" is more efficient than learning high-dimensional embeddings. The model also demonstrates "zero-shot" knowledge updates; by simply updating the facts in memory, the model can generate new information without retraining.
However, limitations remain. The model currently assumes the topic is known a priori and is limited to specific domains like film. Future work should explore on-the-fly topic searching, multi-hop reasoning, and addressing inherent biases in statistical priors when facts are unavailable.
Summary updated