---
title: "Language Models as Knowledge Bases: On Entity"
description: "How language models store millions of facts, represent entities, and answer paraphrased queries—and what controlled experiments establish."
canonical: "https://research.elamur.ai/free/en/papers/heinzerling-2021-language-models-as-knowledge-bases/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/heinzerling-2021-language-models-as-knowledge-bases/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2021](https://md.research.elamur.ai/free/en/papers/2021/) / Language Models as Knowledge Bases: On Entity Representations, Storage Capacity, and Paraphrased Queries

# Language Models as Knowledge Bases: On Entity Representations, Storage Capacity, and Paraphrased Queries

Paper · 2021 · Benjamin Heinzerling and Kentaro Inui

**Authors:** [Benjamin Heinzerling](https://md.research.elamur.ai/free/en/authors/benjamin-heinzerling/) and [Kentaro Inui](https://md.research.elamur.ai/free/en/authors/kentaro-inui/) · **Year:** 2021 · **Venue:** Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

[**77** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W3146844750) · [Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume](https://aclanthology.org/volumes/2021.eacl-main/) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2021.eacl-main.153/)
- [PDF](https://aclanthology.org/2021.eacl-main.153.pdf)
- [DOI 10.18653/v1/2021.eacl-main.153](https://doi.org/10.18653/v1/2021.eacl-main.153)
- [arXiv 2008.09036](https://arxiv.org/abs/2008.09036)
- [OpenAlex](https://openalex.org/W3146844750)

Citations: OpenAlex, 2026-10-14.

## What it is about

How language models store millions of facts, represent entities, and answer paraphrased queries—and what controlled experiments establish. · about 34 minutes to read

**In this deep dive**

1. [Summary](#dd-summary)
2. [Ideas worth borrowing](#dd-ideas-worth-borrowing)
3. [How Mova uses it](#dd-how-mova-uses-it)
4. [The problem and its context](#dd-the-problem-and-its-context)
5. [The method, step by step](#dd-the-method-step-by-step)
6. [Experiments and results](#dd-experiments-and-results)
7. [What the ablations show](#dd-what-the-ablations-show)
8. [Limitations](#dd-limitations)
9. [What came after](#dd-what-came-after)

### Summary

A system that remembers a factual sentence has not necessarily learned to answer questions about its content. It might reproduce an answer only when the wording remains familiar, or associate a person’s name with a location while ignoring the relationship being asked about. This paper investigates what would make a [language model](https://md.research.elamur.ai/free/en/concepts/language-model/) usable as a knowledge base: a system that stores facts about identifiable entities and retrieves them when queried. The authors separate this ambition into requirements concerning storage and access. The system must accommodate many facts about many entities, and it must recover those facts through different expressions of the same request. Their experiments offer a controlled demonstration of these capabilities, while also showing how far they remain from the guarantees of a structured database.

The first obstacle is representing entities. Earlier work considered only 21k entities whose names occupied individual vocabulary entries. That restriction excludes ordinary names made from several tokens, including United Kingdom and Sesame Street. The authors compare three alternatives. A symbolic approach assigns every entity its own vocabulary entry. A surface approach generates the entity’s written name with a sequence decoder. A continuous approach predicts an embedding, a numerical vector associated with an entity, and then searches for the closest entity vector. All three can support factual storage involving large entity inventories, but their costs differ. Symbolic prediction is accurate but becomes expensive as its output vocabulary grows. Generating names avoids a separate output entry for every entity, although long and uncommon names are difficult. Predicting vectors handles large inventories efficiently in terms of trainable parameters, but its raw memorization accuracy is lower in these experiments.

To measure storage directly, the authors turn Wikidata relations into synthetic English statements. For the 100 most common predicates, they develop templates and build collections comprising either 5 million statements about up to 1 million entities or 10 million statements about up to 6 million entities. The aim is deliberately to memorize the supplied facts, so storage evaluation uses the same factual material as training. Both recurrent and Transformer architectures are tested, including pretrained RoBERTa and an equivalent architecture initialized without pretraining. A Transformer with 125 million parameters can retain 1 million Wikidata triples at 95 percent accuracy, or 5 million at 79 percent accuracy. Within the sizes examined, the capacity measured at a fixed accuracy appears to grow linearly with parameter count. The suggestion that much larger systems might hold substantial portions of Wikidata is an extrapolation from that observation.

The more revealing experiment asks whether a stored fact remains accessible after its wording changes. The authors pair birthplace statements with death-place controls involving the same subjects, making it insufficient merely to associate each subject with a location. After RoBERTa-base memorizes the combined 200k statements at 98 percent accuracy, the authors test alternative query forms. Immediate transfer is fragile: a question-form query achieves 32% accuracy, and several more distant forms achieve only 3% to 13%. Additional [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/) on examples of the target wording improves transfer, with the required amount depending on the variant. Pretraining matters strongly here, even though it does not produce the best exact memorization results. The overall finding is therefore qualified: factual storage at substantial scale is feasible, and flexible access can be learned, but reliable access does not follow automatically from successful memorization.

### Ideas worth borrowing

Separate storage from access. A system can retain the correct association yet fail to retrieve it under a different request. The paper makes these separate experimental questions instead of treating answer accuracy as a single undifferentiated property. This distinction is useful whenever a learned representation supports several interfaces: document search, factual question answering, or an application that accepts both statements and questions. It helps identify whether a failure concerns missing information, an unsuitable representation, or an interface that does not reach information already present.

Choose the output representation deliberately. Returning an entity identifier, generating a name, and predicting a vector are different engineering commitments. They change the computation, the supervision required, and the kinds of errors the system makes. The comparison is reusable wherever the answer space is large and contains named objects. An engineer can ask whether stable identity, flexible naming, or a compact prediction component matters most, then evaluate the corresponding approach rather than assuming that ordinary token prediction is the natural endpoint.

Use synthetic statements to control factual exposure. Natural documents do not make it easy to count which facts a learner encountered or how often it encountered them. Rendering structured relations through explicit templates gives the researcher a known inventory of facts and a repeatable presentation format. That control is valuable for studying memory capacity, interference, and query transfer. Its strength is experimental clarity; its boundary is that it does not reproduce the full difficulty of acquiring facts from ordinary prose.

Give shortcuts their own controls. The birthplace study adds a different relation and a different answer for the same subject. A system that ignores the predicate can no longer answer both correctly by returning a preferred location. This is a broadly useful principle for [evaluation](https://md.research.elamur.ai/free/en/topics/evaluation-benchmarks/): construct examples that preserve the easy cue while changing the decision that should follow from it. The resulting comparison can reveal whether success depends on the intended distinction instead of a convenient association.

Compare capacity at a declared accuracy. Asking how many facts fit inside a system has no clear meaning without saying how frequently retrieval must succeed. The paper measures capacity against an explicit accuracy level and separately defines storage efficiency in terms of correct statements per trainable parameter. These views are useful for [efficient systems](https://md.research.elamur.ai/free/en/topics/efficient-models/), because they connect resource use to an operational requirement. They also prevent a large, inaccurate store from appearing equivalent to a smaller, dependable one.

Treat paraphrase adaptation as a separate learning stage. Instead of relearning every fact in every possible wording, the authors first establish factual memory and then expose the system to a small collection of examples in a new query format. The approach is worth testing when the factual inventory should remain controlled while the interface becomes more flexible. Its success must be measured across the stored facts: memorizing the adaptation examples alone would not establish that the new wording provides useful access to the wider inventory.

### How Mova uses it

For Mova, a small transparent language system implemented in Rust, the paper supplies a useful set of experimental distinctions. The relevant opportunity is to make factual identity, stored relations, and query interpretation inspectable. The applications described here are possible extensions and evaluation designs. They do not establish that Mova already contains the paper’s entity prediction components, its Wikidata collections, or a comparable factual memory.

A concrete starting point would be an explicit distinction between an entity and its written name. The surface representation experiments show why a name is a consequential interface choice: an answer becomes a sequence that must be generated completely and correctly. The symbolic and continuous alternatives instead end with an identifiable entity. Mova could use this distinction to keep an internal entity record separate from the text used to display it. That would make it possible to inspect whether a failure came from selecting the wrong entity or expressing the selected entity incorrectly.

The synthetic-data procedure also fits a transparency-oriented evaluation. A controlled collection of subject–predicate–object records could be rendered through declared sentence templates. Mova could then be evaluated on the exact statements it encountered, followed by alternative requests for the same records. The important feature would be the audit trail: each expected answer would point back to an explicit fact, and every query would have a known relationship to that fact. Such an experiment would evaluate a bounded capability without implying broad factual competence.

The paper’s relation controls offer a particularly practical test design. Mova could receive distinct facts about the same subject and then face queries that differ in the relation they request. Correct behavior would require the relation to affect the answer. If the system repeatedly returned the same associated object, the inspection process could distinguish that shortcut from successful factual retrieval. This would be useful even if Mova’s internal mechanism differed substantially from a Transformer, because the test concerns observable behavior instead of a particular architecture.

A separate evaluation could examine paraphrase access. The factual records would remain fixed while the wording of the query changed. Direct statements, questions, parenthetical expressions, and distracting clauses could be treated as different access conditions. Any improvement after adaptation would need to be reported alongside performance before adaptation. That would preserve the paper’s essential distinction between knowledge that is already accessible through new wording and knowledge that becomes accessible only after additional learning.

The storage-efficiency idea is relevant, but it would need careful accounting. The paper’s measure concerns trainable parameters, whereas a transparent system may also depend on explicit records and indexes. A Mova experiment could retain the useful question—how much correctly retrievable information is supported by the resources used—while reporting the different resource categories separately. Applying the paper’s formula without explaining what falls outside its denominator would obscure the design rather than clarify it.

The strongest lesson for Mova is therefore methodological. A claim about factual understanding should be accompanied by a known fact inventory, a defined answer representation, a query-transfer test, and controls against shortcuts. These are concrete ways to make progress reviewable. They remain valuable without assuming that a small system should reproduce the largest storage settings studied by the authors.

### The problem and its context

#### From a plausible answer to a usable knowledge store

The starting observation is familiar: a pretrained system can sometimes complete a sentence with a correct factual answer. In the example discussed by the authors, BERT supplies France when a masked sentence asks which country has Paris as its capital. Such behavior suggests that training on text leaves factual information in the learned parameters. It does not by itself reveal how much information is present, how it is represented, or how reliably it can be recovered.

The earlier [Language Models as Knowledge Bases?](https://md.research.elamur.ai/free/en/papers/petroni-2019-language-models-as-knowledge-bases/) framed this possibility as an alternative or supplement to a structured knowledge base. The present paper takes that proposal seriously enough to ask what it would require at a useful scale. A few successful completions are insufficient. A knowledge store must cover a large inventory of entities, retain many relations, and support requests that identify the intended fact.

The paper uses a deliberately narrow definition of factual knowledge. An entity is an identifiable object of discussion, such as a person or place. A relation triple contains a subject, a predicate describing a relationship, and an object. Barack Obama, birthplace, and Hawaii provide the running example. A knowledge base is understood as a collection of such relations. This is the sense of [knowledge representation](https://md.research.elamur.ai/free/en/concepts/knowledge-representation/) investigated here, rather than a general account of understanding or reasoning.

The scale mismatch is immediate. The authors describe ordinary language vocabularies as usually containing no more than 100k entries, while structured knowledge bases contain millions of entities. An entity’s canonical name may also occupy several sub-word pieces. A prediction mechanism that can return only an individual existing vocabulary token therefore imposes a restriction unrelated to whether the relevant fact could otherwise be learned.

This matters for interpretation as well as coverage. If an evaluation excludes an entity because its name is too long or absent from the output vocabulary, failure to answer cannot be read simply as lack of knowledge. The representation of the answer has already constrained what can be expressed. The paper addresses that obstacle before asking how much information the learner can retain.

#### Why ordinary text leaves gaps

The background discussion gives reasons to supplement factual learning from text. One is reporting bias: texts tend to state facts that are informative in context, while omitting facts readers are expected to know. The authors contrast a prominent person’s public role with the much less often stated fact that the person is human. A structured source can record both explicitly even when their textual frequencies differ greatly.

Rare entities create another difficulty. An entity that receives little textual attention offers fewer opportunities for its attributes and relations to be learned. Increasing general text exposure does not remove the imbalance between commonly discussed entities and the long tail. This motivates direct supervision from a source where entities and relations are already explicit.

The paper also discusses a broader limitation of learning only from text: the absence of grounding in perception and experience. That issue is not resolved by the experiments. The authors instead argue that direct links to identifiable knowledge-base entities provide a useful kind of connection to an external structure. Their symbolic and continuous approaches are motivated in part by this interest in predicting an entity itself.

That distinction separates entity prediction from generating a plausible string. A sequence of words can resemble a name without resolving to the intended entity. In the direct approaches, the output is tied to an inventory. The experiment can therefore ask whether the correct entity was selected, rather than relying completely on how a generated name appears.

#### The surrounding approaches

The authors place their study along a spectrum running from text-based systems to representations built around structured knowledge. They describe text generation and retrieval approaches as successful directions for knowledge-intensive tasks. [REALM](https://md.research.elamur.ai/free/en/papers/guu-2020-realm-retrieval-augmented-language-model/) appears in the retrieval part of that context. The question pursued here is more specific: how much can be stored in learned parameters, and how can a query reach that stored content?

For the text encoder, the study draws on the [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/) architecture introduced in [Attention Is All You Need](https://md.research.elamur.ai/free/en/papers/vaswani-2017-attention-all-need/), and compares RoBERTa with an equivalent randomly initialized architecture. [RoBERTa](https://md.research.elamur.ai/free/en/papers/liu-2019-roberta-robustly-optimized-bert-pretraining/) supplies a way to examine the effect of prior language training separately from architecture. That distinction becomes central because exact factual memorization and paraphrase transfer favor different starting conditions.

The paper’s query study also differs from prompt discovery. [How Can We Know What Language Models Know?](https://md.research.elamur.ai/free/en/papers/jiang-2020-how-can-we-know-what/) seeks effective wording for retrieving a fact. Here, the authors establish which factual statements have been memorized and then ask whether particular alternative forms can access them. The difference is between finding a successful probe and explaining transfer from a known learning condition.

This makes the paper’s central contribution a controlled decomposition. Entity coverage, storage capacity, and flexibility of access are related, but none can stand in for the others. A system may express many possible answers without retaining the right relations. It may memorize relations without tolerating new wording. It may also answer a question through an association that ignores the predicate. The experimental design tries to separate these possibilities.

### The method, step by step

The study proceeds from a known factual inventory to several ways of representing its answers, then to measurements of capacity and query transfer. This order matters. The authors first need a controlled account of what information was supplied. They can then test how accurately it is retained and whether a new expression retrieves the same answer.

Controlled factual storage and query transfer The steps in order.

#### Construct a countable inventory of facts

Natural documents make factual exposure difficult to measure. A passage may express several relations, imply others, repeat information, or use indirect wording. If the aim is to count how many facts a learner stores, these ambiguities complicate the experiment before training begins. The authors therefore generate statements from Wikidata relations rather than trying to infer a precise fact count from unrestricted text.

They construct a smaller entity inventory from the top 1 million Wikidata entities ranked by node outdegree. Outdegree concerns the outgoing links associated with a node in the graph. The larger inventory contains roughly 6 million entities connected to articles in English Wikipedia. These selection procedures define different experimental populations; they are not arbitrary vocabulary lists.

For the 100 most frequent predicates, the authors write English templates containing subject and object slots. A birthplace relation is expressed through the pattern “S was born in O.” Substituting the names of related entities produces a training statement. The corresponding query retains the subject and relation wording but replaces the object position with a mask.

A further data decision makes the requested answer unique. When a subject and predicate have several objects, the authors keep an arbitrary fact and discard the alternatives. The prediction task therefore asks for a single designated object. This simplifies both supervision and scoring, while excluding the problem of returning all valid answers to a relation.

The smaller construction produces 5 million statements with up to 1 million entities. The larger construction produces 10 million statements with up to 6 million entities. The generated material covers relations beyond the running birthplace example. The paper’s sample includes family links, ownership, membership in larger works, geographic connections, and ordering between related items.

For the storage experiments, the same factual collection supplies both learning material and evaluation targets. The objective is retention, so holding out facts would change the question into one about generalization to unseen relations. The authors explicitly want to know whether supplied statements can be encoded and later recovered.

#### Establish the encoders and training objective

The recurrent comparison uses randomly initialized LSTMs with two layers, with layer sizes of 256 or 1024. The Transformer comparison uses pretrained RoBERTa-base and the same architectural size without pretraining. All use the RoBERTa tokenizer, which keeps the input segmentation consistent across these architectural choices.

That common [tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/) matters because differences in how names are broken into pieces could otherwise become an additional explanation for the results. The paper is primarily interested in the representation used for the answer, not in comparing different tokenizers.

For the general memorization setup, training continues until accuracy reaches 99 percent, or until improvement has stopped for 20 epochs. This is intentionally a strong fitting procedure. The authors do not use early stopping to preserve performance on unseen facts; they seek a high level of recall on the known inventory.

The surface-generation approach uses a related but different stopping criterion. Because it predicts a sequence, its training progress is monitored through perplexity, with a target of 1.0 or stopping after 20 epochs without improvement. The final evaluation nonetheless concerns whether the complete answer name is correct.

#### Predict a symbolic entity

In the symbolic approach, an entity becomes an output vocabulary entry. After the encoder processes the query, the hidden state at the masked position is projected into scores over the entity vocabulary. A softmax turns those scores into a distribution from which the predicted entity is selected.

The procedure follows the masked-prediction idea associated with [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/), but enlarges the possible entity outputs. An answer need no longer be limited to an ordinary token already present in a standard vocabulary. The prediction space explicitly includes the entities under study.

This has a clear semantic advantage: an output entry identifies an entity directly. It also has a computational cost. As the inventory expands, the output computation must handle a very large set of alternatives. The authors find the full softmax impractical for their inventory of 6 million Wikipedia-linked entities.

Symbolic representation also requires entity-linked supervision. The training process must know which entity a mention denotes so that it can select the correct output entry. A raw occurrence of a written name does not automatically provide that identity. This requirement distinguishes the approach from simply learning to produce the visible words of an answer.

#### Generate the entity’s name

The surface approach represents an entity using its English Wikidata label. The answer is produced as a sequence of sub-word tokens. This turns retrieval into an encoder–decoder task of the kind associated with [Sequence to Sequence Learning](https://md.research.elamur.ai/free/en/papers/sutskever-2014-sequence-sequence-learning-neural-networks/).

The encoder receives the masked query, and the decoder generates the missing name. A mask remains useful even when the desired answer is not the final part of a statement, because it identifies the position to be filled. The generated answer is then evaluated independently as the target entity name.

Each encoder receives a decoder of matching size. LSTM encoders are paired with LSTM decoders. The Transformer encoders receive randomly initialized Transformer decoders, including the condition whose encoder starts from pretrained RoBERTa. This produces the LSTM2LSTM, RoBERTa2Transformer, and Transformer2Transformer configurations discussed in the results.

At evaluation, the authors use beam search with beam size 10. This procedure maintains competing candidate continuations during sequence generation. Scoring is strict: a prediction receives credit only when the entire generated name matches the target. Correct fragments or partially reproduced names receive no partial credit.

The approach avoids a separate output class for every entity. It can compose names using a shared sub-word vocabulary, which lets it handle the larger entity inventory. Its burden is different from symbolic classification: it must generate the right pieces in the right order and terminate with the correct complete name.

That burden helps explain why name length becomes an important analysis variable. A long label is a longer sequence of required decisions. If it also occurs infrequently, there are fewer training examples from which to learn that exact sequence. These are properties of the answer’s expression, not necessarily of the underlying relation.

#### Predict a fixed entity vector

The continuous approach assigns each entity a fixed vector. The paper describes the representation as:

```
yᵢ ∈ ℝᵈ, i ∈ {1, …, N_entities}
```

Here, yᵢ is the vector for entity eᵢ. The index i identifies an entity, N_entities is the size of the entity inventory, d is the number of vector dimensions, and ℝᵈ denotes the space of real-valued vectors with that dimensionality.

The encoder again processes a query containing a mask. Its final hidden state at the masked position is projected into the same vector space as the entity representations:

```
ŷ ∈ ℝᵈ
```

The symbol ŷ denotes the predicted answer vector. It has the same dimensionality d as the entity targets, so it can be compared directly with them. The prediction does not itself spell a name or select a softmax class.

Training uses cosine loss:

```
L = 1 − cos(ŷ, yᵢ)
```

L is the loss for the training example. The function cos measures cosine similarity between the predicted vector ŷ and the correct entity vector yᵢ. Minimizing the loss encourages the prediction to align with its target.

At retrieval time, the system searches the fixed entity vectors and returns the nearest entity representation. The authors connect this step with work on [similarity search](https://md.research.elamur.ai/free/en/papers/johnson-2017-billion-scale-similarity-search-gpus/). The learned predictor therefore produces a point in an answer space, while the search step resolves that point to an entity.

Keeping the target vectors fixed is an important part of the design. If both predictions and targets can move freely under a similarity objective, the vectors can collapse toward an uninformative common representation. Fixed targets prevent that particular route to a degenerate solution. The authors consequently do not need negative sampling for the main continuous configuration.

#### Build the entity vectors from features

The target vectors are themselves trained before the factual memorization stage. For each Wikidata entity, the authors collect features including its name, aliases, description, types, and numerical attributes. Feature-specific autoencoders turn these different inputs into dense representations.

An autoencoder learns a compressed representation by using it to reconstruct its input. For textual features, the authors use RoBERTa-base as the encoder and train suitable sequence decoders. Quantitative attributes are organized using the 100 most common quantity types. The type representation uses the 1000 most common entity types.

The feature representations are concatenated, then passed through a separate autoencoder that compresses the combined information into the final entity vector. This is therefore a staged construction: represent each kind of feature, join those representations, and compress the result.

Preliminary comparisons consider d values of 64, 128, 192, and 256. The paper reports similar memorization accuracy across these choices, with smaller vectors converging faster. The main experiments use d = 64. That choice establishes the target space for continuous prediction; it is distinct from the encoder’s hidden-state size.

These vectors do not depend on the predictor generating an entity’s name. Long names can still contribute information during vector construction, but factual retrieval ends by selecting a fixed entity representation. This removes the requirement to reproduce the label token by token.

#### Measure capacity and normalize for parameter count

To study capacity, the authors vary Transformer width while retaining 12 layers. They then increase the factual collection and record how well each system memorizes it. Another view fixes a desired accuracy and asks how many facts can be retained at that level.

These are complementary measurements. An accuracy curve shows how performance degrades as the inventory grows. A fixed-accuracy capacity measurement connects size to a particular standard of retrieval quality. Neither should be interpreted without its answer representation and entity inventory.

The comparison between representations also needs to account for trainable size. Adding a large symbolic output layer and adding a sequence decoder introduce different parameter costs. The authors define:

```
Storage efficiency = (#statements × accuracy) / #parameters
```

The term #statements is the number of statements supplied for memorization. Accuracy measures successful retrieval on that collection. The denominator #parameters counts trainable parameters. The numerator represents the correctly memorized portion of the statement inventory, and the ratio expresses that quantity relative to trainable size.

Continuous representation performs best under this measure in the studied setup. The authors therefore use it for the later capacity and query investigations. This choice follows their efficiency criterion, even though another representation can achieve better raw accuracy under other conditions.

#### Test whether new wording reaches stored facts

The paraphrase experiment focuses on birthplace relations. The authors sample 100k statements and add 100k controls describing death places for the same subjects. A control changes both predicate and object, so the subject alone is insufficient to identify the answer.

The paired example involving Albert Einstein illustrates the logic. The birthplace fact points to Ulm, while the death-place fact points to Princeton. Correct retrieval requires the query to distinguish these relations. A system that associates Einstein with whichever location is most salient cannot satisfy both conditions reliably.

RoBERTa-base is trained to memorize the combined 200k statements, reaching 98 percent accuracy. The authors then construct query variants ranging from small punctuation changes to alternative phrasing, parenthetical expressions, question forms, and distracting material. Some patterns come from the GoogleRE Corpus.

For every variant, they instantiate 100k queries using the original entity pairs. Matching control templates preserve the balance between the target relation and its contrast. This holds the factual answers constant while changing the language that must retrieve them.

Zero-shot evaluation introduces no training on the target variant. The adaptation condition first establishes the original factual memory and then fine-tunes on a small set of statements using the new wording. The authors repeat the comparison without pretraining to test whether prior language training contributes to transfer.

Finally, they examine representation distance. Each encoded statement is mean-pooled, and the resulting representations are averaged across the 100k statements associated with a template. Euclidean distance between template representations is then compared with transfer accuracy. This asks whether variants placed farther apart internally are also less effective at accessing the memorized facts.

### Experiments and results

#### What the comparisons measure

The core metric is memorization accuracy: whether a query retrieves the object supplied in the stored factual collection. For generated answers, success requires an exact match to the complete canonical name. For direct entity outputs, success concerns the selected entity. These scores describe different output mechanisms but share the aim of recovering the designated factual object.

The architectural comparisons serve several purposes. The smaller and larger LSTMs expose differences in recurrent capacity. RoBERTa and its randomly initialized counterpart separate prior language training from architectural form. The representation comparisons show how the answer interface changes both scale and accuracy.

A structured knowledge base is also an important conceptual reference point. The authors explicitly acknowledge that storing the underlying relations directly can be more compact and perfectly accurate. The neural storage experiment becomes interesting because of the additional possibility of accessing a fact through flexible language.

#### Symbolic storage is accurate within its practical range

With a symbolic inventory of 1 million entities, the randomly initialized RoBERTa-base architecture gives the strongest memorization result. It correctly retains 97 percent of 5 million statements. This demonstrates that a sufficiently large output vocabulary can support accurate storage well beyond the earlier single-token entity restriction.

The result does not remove the computational problem. The full output softmax becomes impractical at the larger inventory of 6 million entities. The symbolic approach therefore demonstrates strong accuracy under its tested range while leaving the larger setting to other representations.

The role of pretraining is already notable. Starting from pretrained RoBERTa does not provide the best exact retention. The storage task rewards fitting a controlled synthetic collection, and prior language training is not automatically an advantage for that objective.

#### Generating names supports a larger inventory

Surface generation handles the full inventory of 6 million entities. Transformer2Transformer, initialized without pretraining, memorizes 10 million statements at 90 percent accuracy. The pretrained-encoder alternative achieves lower accuracy in the comparison.

The larger LSTM2LSTM configuration nearly matches the strongest Transformer configuration. Lacking sufficient capacity for the larger collections, the smaller recurrent version retains fewer than half of the 5 million statements. The paper thus presents architecture size as a consequential part of the result, rather than attributing everything to the answer representation alone.

Error analysis identifies uncommon, long labels as a difficult region. Many failed names occur in only one to ten statements and contain 12 or more sub-words. Because scoring requires the complete label, a failure anywhere in the generated sequence prevents a correct answer.

The authors suggest shortening canonical labels while preserving a unique correspondence with entities as a possible remedy. They do not test that proposal. The established finding is the association between these label properties and memorization errors.

#### Continuous prediction trades raw accuracy for efficiency

Continuous prediction also handles 6 million entities. Its strongest configuration, the randomly initialized RoBERTa-size Transformer, memorizes 67 percent of 10 million statements. The small LSTM with layer size 256 memorizes 42 percent under the reported comparison.

Continuous entity prediction on 10 million Wikidata statements, memorization accuracy The randomly initialized Transformer retains more statements than the small LSTM.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| LSTM 256 | 42 |
| Randomly initialized RoBERTa-size Transformer (this paper) | 67 |

These are lower raw accuracies than the strongest surface-generation result. However, continuous representation has the best storage efficiency under the paper’s trainable-parameter measure. That result motivates its use in the subsequent experiments.

The continuous error analysis also differs from the surface analysis. Long labels do not impose the same generation burden, but rarity remains difficult. Entities that occur rarely account for most incorrect predictions, and their median frequency is 3. Correctly memorized examples largely involve entities occurring more than 100 times.

The authors caution that continuous-output prediction is less mature than sequence generation. They interpret the measured capacity as a lower bound for the chosen methods, rather than as an inherent ceiling on vector-based entity prediction.

#### Capacity grows with size, under an accuracy requirement

The scaling study varies width across 12-layer Transformers using continuous representations for 6 million entities. Narrow configurations with layer sizes 96 or 192 lose accuracy rapidly as the factual inventory expands. A larger configuration with layer size 384 reaches 65 percent accuracy on 3 million facts.

At a target accuracy of 80 percent, the capacity measurements appear approximately linear across the tested range. The configuration with layer size 384 and 55M parameters stores one million facts at that level. The configuration with layer size 960 and 160M parameters stores 7 million facts.

The introduction gives another concrete capacity reference: a Transformer with 125 million parameters, 12 layers, and layer size 768 retains 1 million facts at 95 percent accuracy or 5 million at 79 percent accuracy. These points underline the tradeoff between inventory size and retrieval reliability.

The authors use the observed trend to discuss much larger parameter counts. Their conclusion about storing sizable portions of Wikidata depends on continued linear scaling. The experiment supports the trend within its examined range; it does not directly measure the full proposed destination.

#### The entity inventory matters independently

A controlled comparison holds the factual collection at 1 million statements and uses a 12-layer Transformer with layer size 768. Increasing the entity inventory from 1 million to 6 million lowers continuous-representation accuracy from 85 percent to 79 percent.

Continuous prediction of 1 million Wikidata facts, memorization accuracy by entity inventory A larger inventory of possible entities makes retrieval harder with the factual workload held fixed.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| 6 million entities | 79 |
| 1 million entities (this paper) | 85 |

Surface representation is less affected in the reported comparison, with a 2 percent drop. The two approaches therefore respond differently to expansion of the candidate inventory. Counting statements alone is insufficient to characterize the difficulty of the storage problem.

#### New wording often blocks immediate retrieval

The paraphrase study starts from 98 percent memorization of the original statement collection. Even punctuation changes affect access. The ellipsis variant receives 95% accuracy, while adding an exclamation mark produces the reported 8% drop.

More substantial changes are harder. The relative-clause pattern containing “who is from” reaches 35%, the shorter “is from” pattern reaches 20%, and the question-form variant reaches 32%. Other patterns involving parenthetical wording or distracting death-related language receive accuracies between 3% and 13%.

Pretrained RoBERTa on birthplace-query variants, zero-shot retrieval accuracy Strong recall of the memorized template does not ensure reliable access through other wording.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| Question form | 32 |
| Is from | 20 |
| Who is from | 35 |
| Ellipsis variant | 95 |
| Original statement template (this paper) | 98 |

The representation analysis produces a Pearson correlation coefficient of −0.68 between Euclidean template distance and zero-shot accuracy. Variants farther from the original template internally tend to retrieve fewer facts correctly. This supports a relationship between access and representation similarity without establishing a complete explanation of transfer.

Adaptation improves the picture. The introduction reports successful transfer for less similar variants after fine-tuning with 5 to 100 examples. The detailed analysis describes good transfer for more similar variants with 5 to 50 target examples, while less similar ones require up to 500 examples to reach 90 percent accuracy.

Without pretraining, transfer is substantially weaker. The least similar variants can remain at 1 to 4 percent accuracy even after adaptation on 500 examples. Prior language training therefore contributes a capability that exact synthetic memorization alone does not supply.

### What the ablations show

#### Pretraining helps access more than exact retention

The comparison between pretrained RoBERTa and its randomly initialized counterpart is especially informative because the preferred condition changes with the task. Without pretraining, the architecture has the highest memorization capacity in the main representation comparisons. With pretraining, it transfers stored facts to unfamiliar wording much more successfully.

This prevents a simple interpretation of pretraining as a universal improvement. The experiments distinguish fitting the supplied statements from interpreting another expression of their content. A starting point that favors exact retention need not provide the linguistic organization needed for flexible retrieval.

The result also changes how the strongest memorization score should be read. High accuracy on the original template does not imply that the system can answer equivalent questions. The query experiments are necessary because they measure an additional property rather than a cosmetic variation of the same test.

#### Relation controls weaken the association explanation

The death-place controls preserve the subject while changing the relation and answer. This design makes a broad subject–location association insufficient. To answer both kinds of query correctly, the system must use information that distinguishes the requested predicates.

The controls do not expose the full internal representation of a fact. They do, however, remove a concrete shortcut that would otherwise make the birthplace results ambiguous. If only birthplace statements were present, returning a location associated with the subject could look like relation-sensitive recall.

Balanced alternative templates extend this logic into the transfer test. Both target and control facts receive new query forms, so the evaluation does not rely solely on a familiar wording for the contrasting relation. The paper reports similar transfer patterns for the controls.

#### Entity frequency and name length have different effects

The surface-generation analysis associates errors with names that are both long and infrequent. Continuous prediction avoids the need to reproduce those names, and the paper does not find the same name-length difficulty there. This comparison localizes part of the surface approach’s weakness to the chosen answer format.

Frequency remains important under both representations. Rare entities are difficult even when their answers are fixed vectors. Removing sequence generation therefore addresses one source of difficulty while leaving uneven factual exposure unresolved.

The distinction is useful when diagnosing results. A low score on rare, long names cannot automatically be attributed to a single cause. The comparison shows that name production and frequency can make separate contributions, and that changing the representation can alter one without eliminating the other.

#### Fixed targets outperform the tested moving-target alternatives

The appendix reports experiments in which entity vectors are randomly initialized and updated during factual training. These variants use between 1 and 50 in-batch negative samples. They converge more slowly and achieve lower memorization accuracy than the fixed pretrained targets used in the main setup.

The authors also try updating vectors that were already pretrained. This increases trainable size, memory use, and training time without improving memorization accuracy. In their setting, allowing the answer space to move is therefore not a successful way to increase factual storage.

These observations support the practical choice of fixed supervision. They do not establish that jointly learning the entity space must fail in every design. The evidence concerns the particular alternatives attempted and their comparison with the fixed-vector configuration.

#### The continuous loss and hierarchy both matter

Another appendix comparison replaces normalized spherical targets and cosine loss with the original vectors and Euclidean-distance loss. The alternative learns more slowly and memorizes less accurately. The continuous result consequently depends on how the target space is organized and how prediction error is measured.

This use of Euclidean distance should be distinguished from the later representation analysis. In the loss experiment, it is a training objective for answer prediction. In the paraphrase analysis, it measures the separation between query-template representations. The paper reports different roles for the same general geometric notion.

The authors also explore a hierarchical output code. They fit a KD-tree to entity embeddings with leaf size 1, so that a route through the tree identifies an entity through a binary code. Predicting these codes yields substantially worse memorization than the main representations. A familiar technique for handling large output inventories therefore does not succeed automatically in this factual task.

#### Graph structure changes what fits

The graph experiment compares a uniform Erdos-Renyi construction with a scale-free Barabasi construction. Edges are interpreted as relation triples. An LSTM and the bilinear knowledge-base embedding DistMult are trained towards 99 percent memorization, while the number of triples is increased for a given parameter budget.

Both can memorize more triples from the uniform graph than from the scale-free graph at the same budget. This establishes that capacity depends on the structure of the data as well as its size. A count of parameters and a count of facts leave out an important part of the problem.

The analysis is deliberately limited. The paper observes an effect of entity distribution and proposes further investigation, instead of deriving a general law for graph difficulty. Its practical implication is that a capacity result should travel with a description of the factual population on which it was measured.

### Limitations

#### Limits explicitly identified by the authors

The experiments use Wikidata as their only knowledge base. The authors regard it as a promising factual resource, but recognize that another graph could behave differently. Their own random-graph analysis gives a reason for this caution: changing graph structure changes how many triples fit within a fixed parameter budget.

Their treatment of pretrained systems also deserves a precise description. Although they often speak of memorizing statements, the authors say that the procedure resembles adaptive pretraining. The system begins with substantial prior training and is then adapted to factual supervision. They leave open whether integrating entity supervision directly into the initial training process would store facts more efficiently.

The study concentrates on entity representations. It does not systematically compare representations of predicates or of complete triples. Relation wording is supplied through templates, and the main alternatives concern what the missing entity looks like at the output. The authors identify relation learning and training on fact-aligned corpora as further directions.

The supported query language is narrow. A subject and predicate determine a single retained object, after other valid objects have been discarded. The experiments consequently do not establish support for relations with several answers. Nor do they test multihop inference, numerical-range requests, or facts qualified by time and location.

These omissions matter to the claim that a language-based store can function as a knowledge base. Structured systems can support operations beyond retrieving an individual relation object. The paper demonstrates a bounded storage-and-query capability, not equivalence across the full range of knowledge-base behavior.

The authors also describe continuous prediction as an area with room for methodological improvement. Its accuracy is a lower bound under the tested procedure. The fact that sequence-generation methods have more mature tooling is part of their explanation for why the raw comparison should not be treated as a permanent ranking of representations.

#### What follows from the controlled setup

A further limit is the gap between memorizing generated statements and acquiring knowledge from natural text. The synthetic construction makes factual exposure countable, which is valuable for the experiment. It also removes ambiguity about whether a sentence expresses the relation and which entity the target denotes.

The paper therefore does not measure the complete path from unrestricted documents to a reliable factual store. Its results concern what happens after relations have been selected and rendered into a standardized training form. Successful retention under that procedure cannot by itself establish equally successful acquisition from varied prose.

Likewise, using the training facts for storage evaluation is appropriate for the capacity question, but gives no measure of generalization to unseen facts. The system is being assessed as a store of supplied relations. A reader should not interpret those accuracies as evidence of knowledge-base completion or prediction of missing relations.

The paraphrase experiment does introduce a form of generalization: the wording can change while the factual answer remains fixed. Yet its scope is a case study centered on birthplace relations and matching death-place controls. The results establish that transfer is possible under those conditions, while leaving broader predicate coverage unmeasured.

The query variants also probe different kinds of change. Punctuation edits, direct questions, parenthetical expressions, and distractors need not challenge the system in the same way. Furthermore, an expression such as “is from” may carry a broader meaning in ordinary language than a narrowly specified birthplace relation. The experiment treats it as a target access form for a controlled factual relation; it does not resolve that broader semantic ambiguity.

#### Efficiency is narrower than total system cost

The storage-efficiency formula counts trainable parameters. It does not supply a complete measure of deployment resources. Continuous prediction depends on a collection of fixed entity vectors and a nearest-neighbor lookup procedure. Those components remain part of the working system even though the vectors are not updated during factual memorization.

The embedding construction also uses several kinds of entity features and a separate learning procedure. Its benefit is not free of preparation. A practical comparison would need to distinguish the factual predictor, the stored entity representations, the search component, and the effort used to build them.

The same caution applies to the surface approach. Its decoder adds trainable parameters, while generation introduces a different inference process from direct entity classification. A favorable score under one resource measure need not imply an advantage under every operational constraint.

The paper does not establish a single representation as universally best. Symbolic output, generated names, and continuous prediction occupy different positions in an accuracy–cost tradeoff. The appropriate choice depends on whether the application prioritizes exact identity, label generation, candidate coverage, or a particular resource budget.

#### Scaling and flexibility remain conditional

The apparent linear capacity trend is an empirical observation over the studied sizes. Extrapolating to much larger systems assumes that the relevant relationship continues. It also assumes that data structure, entity inventory, and training remain sufficiently comparable. The authors’ own results show that these factors can influence memorization.

Accuracy below perfect recall remains a practical limitation for factual storage. A large number of correctly retained statements can coexist with incorrect answers, and the basic prediction mechanisms still return candidates. The reported experiments do not establish a comprehensive way to recognize unavailable or unreliable answers.

The paraphrase distance correlation is informative but not a causal account. Template distance and transfer accuracy are associated, yet the analysis does not isolate a mechanism that guarantees successful access. It cannot turn a distance measurement into a general certificate that two requests will retrieve the same fact.

Finally, the controls rule out a particular subject-only shortcut more convincingly than an uncontrolled test would. They do not reveal every abstraction the system has formed. The evidence supports relation-sensitive retrieval and useful transfer under the studied conditions. It stops short of proving unrestricted factual understanding, universal query robustness, or the operational guarantees of a structured database.

### What came after

The later citing literature spans multilingual factual probing, surveys of knowledge storage, and the measurement or revision of factual beliefs. These directions connect to different parts of the paper’s decomposition. Representing an entity, retaining its relations, accessing them through language, and changing them after training are related questions, but each needs its own evidence.

[Multilingual LAMA](https://md.research.elamur.ai/free/en/papers/kassner-2021-multilingual-lama-investigating-knowledge-multilingual/) brings multilingual pretrained systems into the investigation of factual knowledge. That scope connects naturally to the present paper’s separation of facts from the wording used to retrieve them. A relation and its entities can remain the intended target while the linguistic access conditions vary. Its inclusion among the citing works establishes the connection, but does not establish a particular multilingual result or show that it repeats the same storage procedure.

[A Review on Language Models as Knowledge Bases](https://md.research.elamur.ai/free/en/papers/alkhamissi-2022-review-language-models-knowledge-bases/) examines the wider proposal that factual information stored in learned weights can support knowledge-base functions. The review, by researchers from Meta AI, discusses factual storage acquired through training on large web collections without manual annotation. The controlled experiments here contribute a complementary kind of evidence: they make factual exposure explicit and separate entity coverage, retention, and paraphrased access. That decomposition is useful for organizing a field in which apparently similar answer scores can reflect different capabilities.

[Do Language Models Have Beliefs?](https://md.research.elamur.ai/free/en/papers/hase-2021-language-models-have-beliefs-methods/) addresses detecting, updating, and visualizing beliefs. Its stated scope extends the inquiry from whether an answer can be retrieved to how a system’s factual commitments can be examined and changed. The present paper supplies a reason to keep those operations distinct: an inaccessible answer need not mean absent storage, and a changed answer under new wording need not mean that the underlying fact has been consistently revised. The citation relationship does not, on its own, specify which experimental components the later work adopts.

[Methods for Measuring, Updating, and Visualizing Factual Beliefs](https://md.research.elamur.ai/free/en/papers/hase-2023-methods-measuring-updating-visualizing-factual/) continues that explicitly methodological direction. Measurement, revision, and visualization concern different ways of making factual behavior observable. They fit the broader problem opened by treating learned parameters as a factual store. The information available about this citing work supports that connection, without supporting claims about its particular update mechanism, benchmarks, or results.

[PMET](https://md.research.elamur.ai/free/en/papers/li-2023-pmet-precise-model-editing-transformer/) focuses on precise editing in a Transformer. Editing becomes an important neighboring question once a system is treated as storing facts: a useful store must eventually accommodate change as well as retrieval. This paper’s experiments establish memorization and access conditions, while the later title identifies intervention in the learned system as its subject. The citation alone does not show that PMET uses the continuous entity targets, templates, or adaptation procedure studied here.

[The Life Cycle of Knowledge in Big Language Models](https://md.research.elamur.ai/free/en/papers/cao-2023-life-cycle-knowledge-big-language/) places knowledge within a broader survey framework. That framing is compatible with examining more than the moment of acquisition. The present paper already shows why a factual assessment needs several stages: supplying a relation, retaining it, and retrieving it through another expression are distinct accomplishments. No particular taxonomy or empirical finding from the survey is needed to recognize that connection.

[Language Models As or For Knowledge Bases](https://md.research.elamur.ai/free/en/papers/razniewski-2021-language-models-as-or-knowledge/) makes the relationship with structured knowledge central in its title. This connects directly with the original motivation of using learned systems either as an alternative to a knowledge base or as a complement to one. The experiments support the feasibility of substantial factual memory and adaptable natural-language access. Their limitations also preserve the importance of the complementary role, since exact structured storage and richer query operations remain outside what the controlled demonstration establishes.

## Cite

Cite as Benjamin Heinzerling and Kentaro Inui. 2021. Language Models as Knowledge Bases: On Entity Representations, Storage Capacity, and Paraphrased Queries. Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2021.eacl-main.153](https://doi.org/10.18653/v1/2021.eacl-main.153) · [arXiv 2008.09036](https://arxiv.org/abs/2008.09036)

```bibtex
@inproceedings{heinzerling2021language,
  title = {{Language Models as Knowledge Bases: On Entity Representations, Storage Capacity, and Paraphrased Queries}},
  author = {Benjamin Heinzerling and Kentaro Inui},
  booktitle = {Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics: Main Volume},
  year = {2021},
  doi = {10.18653/v1/2021.eacl-main.153},
  eprint = {2008.09036},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.18653/v1/2021.eacl-main.153}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
