[Paper Review] Language Models as Knowledge Bases: On Entity Representations, Storage Capacity, and Paraphrased Queries
This paper investigates the feasibility of using large language models (LMs) as scalable, natural language-accessible knowledge bases by proposing three entity representation methods—symbolic, surface form, and continuous embeddings—to enable storage of millions of entities and facts. It demonstrates that LMs can memorize up to 5 million Wikidata triples with 79% accuracy and effectively transfer knowledge to paraphrased queries, even in zero-shot and few-shot settings, establishing LMs as viable alternatives to structured KBs for natural language querying.
Pretrained language models have been suggested as a possible alternative or complement to structured knowledge bases. However, this emerging LM-as-KB paradigm has so far only been considered in a very limited setting, which only allows handling 21k entities whose single-token name is found in common LM vocabularies. Furthermore, the main benefit of this paradigm, namely querying the KB using a variety of natural language paraphrases, is underexplored so far. Here, we formulate two basic requirements for treating LMs as KBs: (i) the ability to store a large number facts involving a large number of entities and (ii) the ability to query stored facts. We explore three entity representations that allow LMs to represent millions of entities and present a detailed case study on paraphrased querying of world knowledge in LMs, thereby providing a proof-of-concept that language models can indeed serve as knowledge bases.
Motivation & Objective
- To address the limitation of existing LM-as-KB approaches that only handle ~21k entities due to vocabulary constraints.
- To evaluate and compare three entity representation methods for scaling LMs to millions of entities.
- To empirically estimate the storage capacity of LMs for world knowledge facts using synthetic data.
- To investigate the robustness of knowledge retrieval under paraphrased queries, including zero-shot and few-shot transfer.
- To provide a proof-of-concept that LMs can serve as functional, natural language-accessible knowledge bases.
Proposed method
- Proposes three entity representation strategies: symbolic (extending LM vocabulary), surface form (subword-encoded names with sequence decoder), and continuous (learned embeddings from pretrained features).
- Uses synthetic relation triples (subject-predicate-object) to train LMs to predict object tokens given subject and predicate, simulating knowledge base storage.
- Employs RoBERTa-base as the base LM and fine-tunes it on synthetic knowledge graphs with varying sizes to measure memorization accuracy.
- Applies feature-specific autoencoders to learn dense entity embeddings from Wikidata features (textual, quantitative, type), compressing them to 64-dimensional vectors.
- Evaluates zero-shot and few-shot transfer by generating paraphrased queries and measuring model performance without or with fine-tuning on query variants.
- Uses cosine similarity loss to train entity embeddings on the unit hypersphere, ensuring stable optimization and better memorization.
Experimental results
Research questions
- RQ1Can language models effectively store and retrieve facts involving millions of entities beyond the standard vocabulary limit?
- RQ2What is the upper bound of factual storage capacity in current LM architectures, and how does it scale with model size?
- RQ3How well can LMs generalize to paraphrased queries, both without fine-tuning (zero-shot) and with minimal fine-tuning (few-shot)?
- RQ4How do different entity representation methods trade off accuracy, efficiency, and data requirements in LM-as-KB systems?
- RQ5Does the structural type of a knowledge graph (e.g., Erdos-Renyi vs. Barabasi-Albert) affect its memorizability in LMs?
Key findings
- A 125M-parameter Transformer model can memorize 1 million Wikidata triples with 95% accuracy or 5 million with 79% accuracy, suggesting scalability to larger models.
- Symbolic entity representation achieves the highest memorization accuracy but requires entity-linked training data and is computationally expensive.
- Surface form representation is computationally efficient and does not require entity-linked data, but accuracy drops for longer entity names.
- Continuous entity embeddings offer a good balance—efficient and accurate—when combined with pretrained feature encoders and fixed embeddings.
- Zero-shot transfer to paraphrased queries is effective for highly similar variants, while few-shot fine-tuning (5–100 examples) enables robust retrieval for less similar queries.
- Knowledge graphs with scale-free (Barabasi-Albert) topology are harder to memorize than uniform (Erdos-Renyi) graphs under the same parameter budget.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.