Source-linked AI summary
A Review on Language Models as Knowledge Bases
Badr AlKhamissi, Millicent Li, Asli Celikyilmaz, Mona Diab, Marjan Ghazvininejad
TL;DR
LMs encode substantial knowledge but remain difficult to control and inconsistent in practice. This survey organizes LMs-as-KBs research around five requirements—access, consistency, editability, reasoning, and explainability—and identifies remaining challenges to real-world deployment. It provides a framework for consolidating the field and guiding future research.
Problem
Existing surveys cover selected knowledge types, supervision levels, or structural knowledge, but lack a cohesive evaluation of LMs as knowledge bases and their practical challenges.
Method
The survey reviews LMs-as-KBs research through five aspects: access, consistency, editability, reasoning, and explainability.
Results
The survey identifies the current state and remaining challenges of LMs-as-KBs across these five aspects.
Takeaways & Limitations
The framework consolidates the growing field and provides a path for improving LMs toward the functionality of knowledge bases.
Takeaways & Limitations
LMs remain unreliable out of the box and face theoretical limitations on certain reasoning tasks, hindering real-world deployment.
Abstract
from arXiv · showhide
Recently, there has been a surge of interest in the NLP community on the use of pretrained Language Models (LMs) as Knowledge Bases (KBs). Researchers have shown that LMs trained on a sufficiently large (web) corpus will encode a significant amount of knowledge implicitly in its parameters. The resulting LM can be probed for different kinds of knowledge and thus acting as a KB. This has a major advantage over traditional KBs in that this method requires no human supervision. In this paper, we present a set of aspects that we deem a LM should have to fully act as a KB, and review the recent literature with respect to those aspects.
1 Introduction
The survey examines how pretrained language models can become more controllable and usable knowledge bases by integrating properties such as access, consistency, editability, reasoning, and explainability. It consolidates recent research, identifies practical challenges, and outlines future directions for LMs-as-KBs.
- 1 Introduction: LM knowledge is diffusely encoded, making it difficult to interpret and update, while knowledge bases support controlled access to relational information.KBs can be seamlessly queried and updated by end users.
- 1 Introduction: The central research question is how to control knowledge stored implicitly in LM weights as similarly as knowledge bases can.This question motivated work on instilling LMs with desirable KB properties.
- 1 Introduction: Recent work has pursued LM–KB parity through parameter-level fact updates and improved methods for extracting factual knowledge.The cited efforts include De Cao et al. (2021), Mitchell et al. (2021), Hase et al. (2021), and Petroni et al. (2019).
- 1 Introduction: The survey organizes LMs-as-KBs research around access, consistency, editability, reasoning, and explainability, while highlighting current challenges and future research directions.It aims to consolidate the field and help researchers improve LMs to be as good as, or eventually better than, KBs.
2 Preliminaries
This section contrasts manually structured KBs with pretrained LMs, emphasizing KBs’ operational strengths and LMs’ flexibility and unsupervised knowledge capture. It frames five capabilities—Access, Edit, Consistency, Reasoning, and Explainability and Interpretability—as requirements for LMs to function as KBs.
- LMs and KBs: KBs use manually engineered schemas that support complex operations, accurate, consistent, and explainable answers, whereas LMs offer greater flexibility and require less human effort.LMs implicitly capture relational information from unstructured text without supervision, while KB construction uses substantial NLP processing.
- Five KB aspects: The framework evaluates LMs on five KB aspects: Access, Edit, Consistency, Reasoning, and Explainability and Interpretability.The latter three aspects are not implicit in LMs but are easier to ensure within KBs.
- Edit: LM knowledge can become outdated, incorrect, biased, toxic, or privacy-sensitive, while updating a specific fact is difficult because knowledge is distributed across model weights.Retraining the whole model on updated data is expensive, and scaling models does not reliably solve factual correctness.
- Consistency: Structured KBs are designed to detect and resolve inconsistencies, so LMs should behave consistently despite language expressing the same meaning in multiple forms.The passage notes that KB research also quantifies the degree of inconsistency.
- Reasoning: KB reasoning paths are explicit, whereas LMs can perform different reasoning forms when fine-tuned on datasets designed to elicit reasoning capabilities.The KB example derives that Cairo is in Africa from explicit relations linking Cairo, Egypt, and Africa.
- Explainability and Interpretability: Unlike KBs, LMs generally do not make their knowledge sources or outputs readily understandable to end users, leaving explainability and interpretability as unmet goals.The location of the parameters underlying LM knowledge is unknown, and current techniques remain far from the stated goal.
3 Accessing Knowledge
Language models encode knowledge during pretraining but make specific information difficult to access directly. The review therefore focuses on finetuning and prompting, including discrete and soft prompt methods, as interfaces for retrieving that knowledge.
- Specific knowledge is harder to access in language models than in knowledge bases, although few-shot and zero-shot learning suggest prompting or finetuning can expose pretrained knowledge.Language models can potentially make stored knowledge accessible through downstream adaptation or prompts.
- Finetuning commonly retrieves information by adapting a language model to a relevant downstream task, while primarily learning an access interface rather than new knowledge.Prior work reports that most encoded knowledge is acquired during pretraining, whereas finetuning learns how to access it.
- Prompting offers a direct alternative to finetuning, but prompts are difficult to design and small changes can cause large performance differences.The growing size of language models also makes finetuning and storage expensive in practice.
- Discrete Prompts: Discrete prompting presents familiar query formats, often using cloze-style templates to extract knowledge such as commonsense information.This paradigm aims to teach a specific subtask without extensive finetuning.
- Soft Prompts: Soft prompts use tunable continuous word vectors while leaving the rest of the model unchanged, including prefix-tuning for parameter-efficient generation.Prefix-tuning uses task-specific vectors that can be tuned and achieves comparable generation results with few model parameters.
4 Consistency
Language models lack consistency because their answers can change under paraphrasing, negation, or different languages. The review examines consistency through paraphrasing, commonsense entailment, and multilinguality, noting that multilingual consistency remains unmeasured.
- Consistency: LMs can return different answers to the same fact when the query is reworded as a paraphrase.The review treats consistency across paraphrasing, commonsense, and multilinguality as three distinct contexts.
- Paraphrasing: Paraphrase consistency can be measured by probing the same subject–relation with differently worded sentences and checking whether predictions remain identical.Quasi-paraphrases convey approximately the same meaning without requiring strict logical equivalence.
- Commonsense: LMs may encode contradictory beliefs such as “Birds can fly” and “Birds cannot fly,” revealing insensitivity to negation and contextual impacts.Prior work addresses this brittleness by adding a loss term over entailed data or supplying symbolic belief-memory feedback at test time.
- Multilinguality: Crosslingual LMs should provide the same fact when a probe is translated across supported languages, but existing work does not measure multilingual consistency.A Wikidata-based multilingual pretraining framework improves crosslingual NLP tasks without evaluating consistency under multilinguality.
5 Model Editing
Model editing seeks to revise a language model’s factual outputs while changing equivalent inputs and preserving behavior on unrelated inputs. Proposed approaches range from finetuning and constrained updates to hypernetworks and direct rank-one edits of transformer memories.
- Editing Objective: Model editing replaces undesired outputs with revised targets, generalizes changes across equivalent inputs, and preserves behavior on unrelated inputs.The formal objective changes outputs for inputs in an equivalence neighborhood while leaving outputs on other unrelated inputs intact.
- Baseline Methods: Finetuning or retraining on modified corpora is expensive and impractical when changing only a few datapoints, particularly for large language models.Supporting evidence can instead be used to finetune the model by minimizing a per-instance loss.
- Constrained Finetuning: Constrained finetuning limits weight changes to reduce interference with unmodified facts, but parameter-space constraints ignore language models’ highly nonlinear behavior.Zhu et al. (2020) enforce a norm-based constraint while finetuning on the revision dataset.
- Hypernetwork Methods: KNOWLEDGEEDITOR predicts weight shifts with hypernetworks and constrains updates in function space, using rank-one gradient decomposition to scale with model dimensionality.Its function-space constraint contrasts with parameter-space constraints, while the rank-one outer-product decomposition reduces computational expense.
- Direct Model Editing: ROME edits factual knowledge by treating transformer MLP modules as key-value memories, locating relevant weights through causal tracing, and writing a new pair with a rank-one modification.The method directly modifies the weights associated with the targeted fact.
6 Reasoning
Language models can use knowledge learned during pretraining to perform natural-language reasoning, including commonsense, logical, and mathematical tasks. Despite advances in proof generation and multi-step computation, complex reasoning remains limited and its underlying mechanism is debated.
- Commonsense Reasoning: LMs leverage pretrained knowledge to perform reasoning tasks expressed in natural language, including commonsense reasoning.Commonsense reasoning concerns everyday situations such as Newtonian physics and others’ intentions; LMs encode some commonsense knowledge in their parameters.
- Logical Reasoning: LMs can emulate fact binding with first-order logic rules to deduce conclusions and generate proofs showing their chain of thought.Prompting that mimics the reasoning process improves performance on tasks such as math word problems.
- Mathematical Reasoning: LMs can perform complex multi-step computations by generating intermediate results, while expert iteration enables solutions to complex mathematical problems.Expert iteration interleaves proof search with curriculum learning.
- Limitations: The best models remain unable to chain more than 2 or 3 non-trivial steps of complex reasoning, and whether they truly reason remains open.One possibility is that LMs merely emulate humans’ thought processes.
7 Explainability & Interpretability
The section distinguishes interpretability as understanding internal mechanisms from explainability as producing post-hoc understandable outputs. It reviews probing, attention, mechanistic and causal methods, influence functions, and generated explanations, while noting persistent limitations and practical opportunities.
- Definitions: Interpretability examines model internals and prediction reasoning, whereas explainability concerns whether outputs are understandable post hoc.The distinction is intended to clarify terms often treated as identical.
- Existing approaches: Probing uses simple classifiers to associate internal representations with external properties, while attention is disputed as a faithful explanation.Several studies find attention heads weakly interpretable, with attention distributions sometimes focusing on unimportant tokens.
- Mechanistic interpretability: Mechanistic interpretability reverse-engineers transformer computations, and causal tracing identifies activations associated with factual predictions by restoring outputs after controlled corruptions.Mathematical analyses also suggest attention heads can explain in-context learning in smaller models.
- Practical implications: Improved explanations could help tailor language models to real-world use, correct shortcomings, and increase end-user trust, supporting their practical deployment.Models that lack explainability and interpretability are often undeployable, while traditional knowledge bases are easier to interpret through fixed schemas.
- Influence functions: Influence functions interpret neural outputs and may suit complex tasks such as natural language inference, but their computational cost has motivated faster attribution methods.Influence functions have also supported interactive debugging with human feedback.
- Explanations: Language models can generate explanations, with T5 achieving state-of-the-art performance on explainability benchmarks, but generated explanations remain inconsistent and fickle.Other approaches use prototypes, highlighted input fragments, or human-provided explanations during training.
8 Future Work & Limitations
Although language models have made progress toward acting as knowledge bases, real-world deployment remains limited by unresolved robustness and consistency issues. Explicit tuning is needed for consistent behavior across paraphrases, while models remain sensitive to linguistic and contextual variations.
- 8 Future Work & Limitations: Real-world deployment of language models as knowledge bases still requires substantial further progress despite recent breakthroughs.The review identifies five aspects required for LMs to qualify as KBs, but concludes that deployment remains out of reach.
- 8 Future Work & Limitations: Explicit tuning on a consistency corpus is needed for pretrained language models to behave similarly under different paraphrases.This requirement is attributed to Elazar et al. (2021).
- 8 Future Work & Limitations: Pretrained language models remain sensitive to word order, negation, priming, and patterns.These sensitivities are cited as further limitations affecting their reliability as knowledge bases.
Appendix · A Models
The appendix focuses on models in the LMs-as-KBs paradigm and reviews how they improve LM performance. It emphasizes models that incorporate knowledge explicitly rather than implicitly.
- Appendix: The appendix covers models belonging to the LMs-as-KBs paradigm.
- A Models: These models are discussed as solutions proposed to improve LM performance.
- A Models: Explicit pretraining strategies encode entity-level or relation-level data into models.
- A Models: Some models integrate external memory into an existing LM.
- A Models: Other models use attention-based mechanisms to incorporate knowledge explicitly.
- A Models: Retrieval-based models gather appropriate nodes from a knowledge graph.
- A Models: Existing pretrained LMs that implicitly contain knowledge are excluded because this section focuses on explicit knowledge incorporation.
A.1 External Memory
This section examines external memory as a way to address language models’ limited storage of localized facts and specific knowledge. It reviews strategies for integrating external memory into language models for knowledge-intensive tasks.
- Motivation: Language models often struggle to store localized facts, whereas knowledge bases can store information about millions of entities interpretably.This contrast motivates integrating knowledge-base storage capabilities into language models.
- Prior Work: Prior neural-network research used external memory, including NKLM, which exploits external factual knowledge.The cited work includes Bahdanau et al. (2015), Weston et al. (2015), Graves et al. (2014), and Ahn et al. (2017).
- Review Focus: Recent studies integrate external memory into language models to improve performance on knowledge-intensive tasks.The review organizes these studies by their strategies for integrating external memory within language models.
A.1.1 External Knowledge Graphs … A.3 Retrieval
The reviewed approaches augment language models with external graphs, non-parametric memory, and attention mechanisms, while also improving knowledge encoding through specialized pretraining and retrieval. These methods support explicit fact access, entity- and relation-level representations, and inference-time querying.
- A.1.1 External Knowledge Graphs: KGLM explicitly incorporates a knowledge graph, selectively adding missing facts or referring to existing facts as the graph grows.This enables access to facts stored in a knowledge graph while allowing new facts to be added.
- A.1.1 External Knowledge Graphs: GRF enables multi-hop reasoning by encoding multi-relational graphs, reasoning over relational paths, and choosing between knowledge-graph concepts and vocabulary words.BERT-MK similarly integrates contextualized knowledge from a medical knowledge graph and improves biomedical entity typing and relation classification.
- A.1.2 Non-parametric Memory: Non-parametric memory supplements internal language-model memory and is integrated with language models to improve downstream-task performance.NKLM combines symbolic knowledge from a knowledge graph with an RNN, while other systems use entity memory, vector indices, or virtual knowledge bases.
- A.1.2 Non-parametric Memory: Episodic non-parametric memory helps language models retain short-term and long-term context, while K-BERT uses a visible matrix to control injected knowledge.These mechanisms provide alternative ways to preserve specific knowledge or regulate its influence.
- A.1.3 Attention over Memory: Attention mechanisms retrieve salient knowledge by attending over entity representations, virtual knowledge bases, or added entity-focused transformer layers.KnowBERT applies multi-headed attention between word representations and entity-span vectors, whereas TOME attends over an entire virtual knowledge base.
- A.2 Pretraining: Pretraining methods inject entity- and relation-level knowledge through cloze-style question answering, entity masking, modified loss functions, and input augmentation.Examples include multiple masking levels, entity-linking objectives, entity boundary tokens, and sequences containing entities and relations.
- A.2 Pretraining: HTLM and CM3 use scraped HTML with size hints and BART prompting, showing potential for web-scrapped data to transfer across downstream tasks and supervision levels.These approaches incorporate data less commonly used in unimodal and multimodal settings.
- A.3 Retrieval: REALM applies retrieval during pretraining, finetuning, and inference to extract Wikipedia knowledge and let models decide what information to query during inference.The passage also identifies RAG as following the same retrieval-based approach, though its description is truncated.