‘Generalization is hallucination’ through the lens of tensor completions
Liang Ze Wong · 2025
Read ‘Generalization is hallucination’ through the lens of tensor completions by Liang Ze Wong (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2502-17305.txt.
Introduction
Liang Ze Wong argues in a 2025 position paper that a tool from data analysis can clarify why language models hallucinate. The tool is tensor completion. It fills missing entries in a multiway table from the entries that are known, and its errors leave artifacts that were never in the true data. Wong makes the case that generalization and hallucination can be read in the same frame. Both fill gaps beyond what was given, and the lens may show when the filling is sound and when it invents.
Catalog record
| CREATOR | Liang Ze Wong |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 19 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2502-17305
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
‘Generalization is hallucination’ through the lens of tensor completions Liang Ze Wong Abstract In this short position paper, we introduce tensor completions and artifacts and make the case that they are a useful theoretical framework for understanding certain types of hallucinations and generalizations in language models. 1 Introduction Generalization and hallucination in generative language models are often studied independently, the former as a feature to be encouraged, the latter as a bug to be avoided. In this short position paper, which expands upon Section 2.1 of [ 19 ] , we introduce tensor completions, and make the case that both generalizations and hallucinations arise as tensor completion artifacts. We begin by defining tensor completions in Section 2 , relating them to language models, and showing how they give rise to completion artifacts, which are novel sentences that a model predicts with high probability. With experiments on toy models and datasets, we show that artifacts are prevalent, and increase in number when models are smaller. The value of a theoretical framework lies in its ability to explain and organize phenomena and suggest lines of research, and we demonstrate this in Section 3 , where we discuss the implications of our framework on generalizations, hallucinations and overfitting, and relate our findings to the existing literature. We also call for future work on mitigating hallucinations to also consider the effects on generalization, and vice versa. We end by listing the limitations of this paper and directions for future work in Section 4 . 2 Tensor completions and artifacts Figure 1: Illustration of how tensor completion can give rise to new sentences, or artifacts . (a) A tensor D^{3} associated to a corpus. Each green box is 1 , and represents a sentence in the corpus. Empty space is 0 . The horizontal plane is the (t_{1},t_{2}) -plane, while the vertical axis is t_{3} . (b) Fibers of D^{3} that are ‘seen’ by a language model during training. (c) A low-rank completion D^{\prime} that is consistent with the training fibers, but also has additional artifacts (i.e. new sentences, colored orange). The rank of the completion D^{\prime} is 2, while the original D^{3} has rank 3. Figure 2: Number of artifacts against number of triples in the training dataset, over 400 random datasets. Artifacts are triples (t_{1},t_{2},t_{3}) which are not in the dataset, but the model still predicts t_{3} with high probability ( \geq 0.95 ) when given (t_{1},t_{2}) . The same attention-only model with n_{layers}=1,n_{head}=4,d_{model}=8 and d_{head}=2 was used throughout. Figure 3: Number of artifacts against number of non-embedding parameters in 165 models with n_{head}\leq 4,d_{model}\leq 10 and d_{head}\leq 6 . The same dataset with 29 triples and 44 tokens was used, so the maximum possible number of artifacts is 44^{2}-29=1,907 . We assume we have a fixed set of tokens \mathcal{T} , a maximum context size N , and a corpus or dataset \mathcal{D} consisting of sentences or tuples \mathbf{t}=(t_{1},t_{2},\dots,t_{n}) where t_{i}\in\mathcal{T} and n\leq N . A common loss function for generative language models such as transformers [ 18 ] is \min_{\theta}\sum_{\mathbf{t}\in\mathcal{D}}\sum_{i}^{|\mathbf{t}|}-\log(P_{\theta}(t_{i}|t_{1},\dots,t_{i-1})) (1) where P_{\theta} is the next token distribution from a model with weights \theta . For our purposes, it will be convenient to define collections of n -truncated sentences \mathcal{D}^{n}:=\{(t_{1},\dots,t_{n})\,|\,(t_{1},\dots,t_{n},\dots,t_{\ell})\in\mathcal{D}\}\subset\mathcal{T}^{n} and rewrite ( 1 ) as \min_{\theta}\sum_{n=1}^{N}\sum_{\mathbf{t}\in\mathcal{D}^{n}}-\log(P_{\theta}(t_{n}|t_{1},\dots,t_{n-1})). (2) This allows us to treat each n\in N separately. We define an n -dimensional tensor D^{n}\in(\mathbb{R}^{|\mathcal{T}|})^{\otimes n} whose entries D^{n}_{t_{1},\dots,t_{n}}\geq 0 are the number of times the sentence (t_{1},\dots,t_{n}) appears in \mathcal{D}^{n} (see Fig. 1 a for an example). The fiber of D^{n} at \mathbf{t}\in\mathcal{D}^{n-1} is a vector (Fig. 1 b) that will be denoted D^{n}_{\mathbf{t},:} , where the colon ‘:’ indicates that the last index runs over all t\in\mathcal{T} . We say that an n -tensor D^{\prime} is consistent with \mathcal{D}^{n} if D^{\prime}_{\mathbf{t},:}=D^{n}_{\mathbf{t},:} for all \mathbf{t}\in\mathcal{D}^{n-1} . In practice, having equality is rare, so we allow ourselves to say that D^{\prime} is consistent as along as the fibers are close according to some similarity measure. Of course, the original D^{n} is consistent with \mathcal{D}^{n} , but there can be many more tensors that are consistent. We define a completion of \mathcal{D}^{n} to be any tensor D^{\prime} that is consistent with \mathcal{D}^{n} (Fig. 1 c). Evidently, language models give rise to completions 1 1 1 Tensor completion usually refers to algorithms that explicitly complete a tensor, e.g. [ 8 , 16 ] , but here we take a broader view, allowing algorithms that implicitly complete tensors, such as language models. See [ 19 ] for an early attempt at relating single-layer attention-only transformers to tensor completion. when they achieve low training loss: for each model with parameters \theta , we may form an n -tensor P^{n}_{\theta} with entries (P^{n}_{\theta})_{\mathbf{t},t_{n}}=P_{\theta}(t_{n}|\mathbf{t}) for all \mathbf{t}\in\mathcal{T}^{n-1} ; a low loss in ( 2 ) then implies that the KL divergence from the model distribution (P^{n}_{\theta})_{\mathbf{t},:} to the data distribution D^{n}_{\mathbf{t},:} are low for all \mathbf{t}\in\mathcal{D}^{n-1} i.e. P^{n}_{\theta} is consistent with \mathcal{D}^{n} . Note that (P^{n}_{\theta})_{\mathbf{t},:} is defined for all \mathbf{t}\in\mathcal{T}^{n-1} , but we only check consistency on \mathbf{t}\in\mathcal{D}^{n-1} . Indeed, the fibers at \mathbf{t}\in D^{n-1} are the only parts of D^{n} that the model ‘sees’ during training (Fig. 1 b). In practice, it is unfeasible to compute P^{n}_{\theta} for large n and \mathcal{T} , as doing so requires evaluating the model at all possible (n-1) -grams. But theoretically , every language model contains the data to compute P^{n}_{\theta} . 2.1 Completion artifacts Our key observation is that tensor completions give rise to artifacts , which are large, non-zero entries in the tensor completion D^{\prime} that do not belong in D^{n} . Recall that each cell of D^{\prime} represents an n -gram, and the value of the cell reflects 2 2 2 Some normalization might need to be done to ensure they are actual probabilities, but heuristically, the larger the value of the cell is, the higher the probability of seeing that n -gram. the probability of the n -gram. So artifacts are novel n -grams or sentences of which the model is very certain, but that do not belong in the training data . We have already alluded to one reason for why tensor completions P^{n}_{\theta} give rise to artifacts: models are only trained on a (very small) subset of the entries of D^{n} , namely the fibers D^{n}_{\mathbf{t},:} for \mathbf{t}\in\mathcal{D}^{n-1} , and the only zeros that are enforced are those that belong to these training fibers. All other zeros in D^{n} are not enforced or ‘seen’ by the model, and so there is no reason why we should expect them to be close to zero. Indeed, language models can produce very large numbers of artifacts, as Fig. 2 shows: we trained a toy model 3 3 3 Our toy models are simplified versions of the original transformer architecture [ 18 ] without layer normalization, biases or positional encodings. They are commonly used for pedagogical or expositional reasons, e.g. [ 6 , 15 , 19 ] . on random datasets of triples and counted the number of artifacts, which we defined as triples (t_{1},t_{2},t_{3})\notin\mathcal{D}^{3} where P_{\theta}(t_{3}|t_{1},t_{2})\geq 0.95 . We see that the number of artifacts can be very large, anywhere from 5 to 20 times the number