Limits for learning with Language Models
Year: 2023

Abstract:
With the advent of large language models (LLMs), the trend in NLP has been to train LLMs on vast amounts of data to solve diverse language understanding and generation tasks. The list of LLM successes is long and varied. Nevertheless, several recent papers provide empirical evidence that LLMs fail to capture important aspects of linguistic meaning. Focusing on universal quantification, we provide a theoretical foundation for these empirical findings by proving that LLMs cannot learn certain fundamental semantic properties including semantic entailment and consistency as they are defined in formal semantics. More generally, we show that LLMs are unable to learn concepts beyond the first level of the Borel Hierarchy, which imposes severe limits on the ability of LMs, both large and small, to capture many aspects of linguistic meaning. This means that LLMs will continue to operate without formal guarantees on tasks that require entailments and deep linguistic understanding.

heading: 1 Introduction
text: The success of large language models (LLMs) has led researchers in NLP to harness LLMs trained on vast amounts of data to solve a variety of language understanding and generation tasks, and some have claimed that LLMs can solve any task that can be specified via prompting (Brown et al., 2020). While the list of LLM successes is long, there have been several recent papers that provide empirical evidence that LLMs at least sometimes fail to capture important aspects of linguistic meaning (Kuhnle and Copestake, 2019; Sinha et al., 2020; Yuksekgonul et al., 2022; Chaturvedi et al., 2022; Kalouli et al., 2022). Those who have dabbled in “BERTology” with respect to linguistic meaning often have the feeling that fixing one LLM deficiency just leads to the discovery of new ones.
This paper provides a theoretical explanation of certain of these observed failings of LLMs. In
particular, we prove that LLMs cannot learn the notions of semantic entailment or consistency as defined in formal semantics (Dowty et al., 1981) because they are incapable of mastering universal quantification. Our work builds on Siegelmann and Sontag (1992); Siegelmann (2012); Weiss et al. (2018), concerning the expressive power of neural networks, but we focus on the learnability of semantic concepts and use novel tools.
Our argument has widespread implications: not only does a general capacity to recognize semantic entailment and consistency underlie everyday conversational interactions, but the meanings of a great many common linguistic expressions depend on universal quantification. This set includes—but is certainly not limited to—a long list of quantifiers (every, some, many, most,... every other, ...), temporal adverbs (always, never, eventually) that are essential to planning (Lamport, 1980), modal operators (possibly, necessarily,...), and certain discourse connectives and adverbs (therefore, if / then, except, because, ...).
We begin in Section 2 by contextualizing our claims in terms of expectations about the linguistic capacities and applications of LLMs. In Section 3, we introduce the framework of continuation semantics, which will allow us to adapt certain notions central to truth-conditional semantics to the case of LLMs. Section 4 lays out the core of our theoretical argument, focusing first on what is needed to learn universal quantification and then generalizing our argument to a wide range of linguistic expressions. Our theoretical argument suggests that we should expect certain empirical failures from LLMs, and in Section 5, we provide evidence that our predictions are borne out. Section 6 concludes.

heading: 2 Context
text: Our results are particularly relevant to downstream tasks that require an agent to not only create fluent, creative and contextually relevant speech but also
236
to act precisely based on the meaning of linguistic expressions and reliably recognize semantic inconsistency. For a robot that has been instructed (via conversation) to tighten every screw of a door, to never walk on an airplane wing, or to stop drilling immediately if certain conditions hold, acting appropriately requires being able to infer what do to based on the linguistic meaning of the words every, never, stop, immediately and if —and in these cases, getting things mostly right won’t do, especially if lives or substantial economic loss are at risk.
An important corollary of our argument is that while it might be tempting to separate reasoning and linguistic competence (Mahowald et al., 2023), the former is in fact inextricably tied to our ability to draw inferences based on linguistic content—not just on, say, mathematical or real-world facts. This in turn suggests that approaches which attempt to patch up knowledge deficiencies for LLMs by giving them access to external models (Mialon et al., 2023) will fall short in developing reliable models of linguistic understanding because LLMs fail to grasp the notions that underlie the very way that sentences (and actions) are woven together in conversation.
Empirical studies like Chaturvedi et al. (2022) show that LLM failures to respect semantic entailment in question answering tasks follow from fundamental features of LLM training; thus while extensive training and large data sets may improve LLM results, performance will inevitably remain unstable and we should continue to expect hallucinations and reasoning errors in NLP tasks like question-answering and natural language inference.

heading: 3 Language models and formal semantics with continuations

heading: 3.1 LLMs and strings
text: We consider LLMs trained on transformer architectures over very large corpora using classic language modeling tasks, namely masked language modeling or next sentence prediction. The former involves masking certain words in a given corpus and training the model to guess the missing words, while in the latter, a context (a sentence typically) is provided to the model, which is trained to predict the sentence that follows. This unsupervised training allows language models to build rich internal representations that have been shown through probing to contain at least implicitly a large amount of linguistic information (Devlin et al., 2019; Liu et al.,
2019; Tenney et al., 2018). Formally, LLMs learn a function f : C ×X → [0, 1] that assigns a probability to a word (or string or discourse move) x ∈ X given a context (or finite string) C. More abstractly, let V be a countable set called the vocabulary. For i > 0, let V i denote the set of all length i strings in the vocabulary V and V ≤i denote the set of all strings V whose length is at most i. V ∗ denotes the set of all finite strings and V ω the set of countably infinite strings in V . We can then rewrite f as f : V ≤n → µ, where µ is a probability measure (which is often called its prediction) over V n+m for m ≥ 1. Typically, the prediction function is used on strings of length m where m is smaller than n.
By exploiting f , an LLM can extend µ to a distribution on the set of strings V ∗. The most straightforward way is to follow autoregressive models that calculate the probability of strings via conditionalization. For a new sentence s′ = (w1, w2, ..., wm+1), and an input string s of length n provided as context, we have:
µn+m+1(s′|s) = µn+1(w1|s)×µn+2(w2 |s, w1)× (1) ...× µn+m(wn |s, wm−1, ..., w1) For any s′ ∈ V ∗, µ(s′) represents the confidence with which an LLM predicts s′, after training on strings in V ≤n.

heading: 3.2 Linguistic meaning
text: In what follows, we are in interested strings that have a well formed meaning and are evaluable as true or false. Linguists use truth conditional semantics to define the meanings of strings or well formed sentences in terms of the conditions under which they are true. Thanks to the work of Tarski (1944, 1956), we can formalize the notion of truth conditions using the set-theoretic notion of a model that defines denotations or truth conditions for sentences recursively from denotations for sentential constituents (Dowty et al., 1981).
The notion of a model not only serves to define truth conditions; it also captures entailments. We define the notion of semantic consequence using the notion of a model or structure A as follows (Chang and Keisler, 1973): Definition 1. ϕ is a semantic consequence of Γ (in symbols, Γ |= ϕ) if and only if in every structure A in which Γ is satisfied (A |= Γ), A also makes true or satisfies ϕ (A |= ϕ). That is: ∀A, A |= Γ ⇒ A |= ϕ
The notion of semantic consequence integrates entailment with truth conditional meaning; two strings have exactly the same entailments just in case they are true in the same models. Accordingly we can capture the truth conditional meaning of a string in terms of the strings that it entails. Socrates is a man, for example, entails Socrates is human, Socrates is mortal, Socrates is an adult but also that someone is a man, human, mortal and so on. What it means for Socrates to be a man (and, indirectly, the meaning of man) can be captured by the full set of these entailments.
Our idea is to apply truth conditional semantics to LLMs by representing models themselves as strings. Semanticists have used strings and continuation semantics (Reynolds, 1974) —in which the meaning of a string s is defined in terms of its possible continuations, the set of longer strings S that contain s—to investigate the meaning and strategic consequences of conversational moves (Asher et al., 2017), temporal expressions (Fernando, 2004), generalized quantifiers (Graf, 2019), and the “dynamic” formal semantics of (Kamp and Reyle, 1993; Asher, 1993)(De Groote, 2006; Asher and Pogodalla, 2011). In our case, we will use strings to define models As. We will use this trick to reformulate semantic consequence: where ∥ϕ∥ is the set of strings describing models that satisfy a truth evaluable string ϕ:Γ |= ϕ iff ∥Γ∥ ⊆ ∥ϕ∥.
LLMs naturally find their place in such a framework (Fernando, 2022): given their training regime, the meaning of any natural language expression for an LLM is a function from input contexts to sets of larger strings or continuations. LLMs provide a probability distribution over possible continuations and can predict possible continuations of a given text or discourse.

heading: 4 Learning limits for semantic concepts
text: Semantic consequence defines linguistic entailments and importantly provides the fundamental connection between meaning and inference that ensures linguistic understanding (Montague, 1974). Crucial to |= is the use of universal quantification over all possible structures—an infinite space of possible circumstances of evaluation or set of possibilities. A true grasp of semantic consequence thus requires an understanding of universal quantification at least over countably infinite domains. In Section 4.1, we show that an LLM’s training regime makes it fundamentally unable to learn the
concept of universal quantification. In Section 4.2, we generalize our argument to show that LLMs are incapable of learning a wide variety of everyday semantic concepts.
4.1 Learning the full meaning of every
To see if the set of strings that define the concept every is learnable for an LLM, consider (1).
(1) Every object is blue.
We will use strings of atomic formulas and their negations to define models (or more precisely their atomic diagrams) that we will use to test whether an LLM M can learn the concept of universal quantification through inductive reasoning from a series of individual trials over finite subsequences of strings representing countably infinite domains. In particular, we will ask whether it is possible to train an LLM M to judge, for a string s of arbitrary length n, whether s is consistent with (1), or equivalently, given that s defines a model As, whether given As, (1) is true. If M can reliably judge in which models As (1) is true, we can conclude it has learned the meaning of every.
To this end, consider a language L containing negation, the predicate is blue and a countably infinite number of constants ai enumerating objects of a countably infinite domain. L formulas are of the form ai is blue and ai is not blue. We use the formulas of L as “words” to define the set of finite strings, V ∗L and the set of countably infinite strings V ωL . Each such string corresponds to a finite or countably infinite model in which (1) is true or not.
In the course of training, M will be presented with finite sequences that define structures of increasing size. For each n and set of models of size n, M will form a set of hypotheses Hn, where for h ∈ Hn, h : V nL → {0, 1}. Hn corresponds to the hypothesis space of the problem; each hn says whether a presented sequence of length n is consistent with (1). As each hn ∈ Hn is a characteristic function of a subset of V nL , we can identify hypotheses with sets of strings. So for instance, hn∀ is the set of strings in V n L that are consistent with (1) and that define models in which (1) is true. We will additionally assume that hn∀ picks out a suitable set for each V n, and similarly for each hnk .
However simply learning hn∀ for some n will not be sufficient for M to learn the meaning of every. Universal quantification is a concept that applies to arbitrarily large domains. So the question, Can M
inductively learn the meaning of every? becomes Can M inductively learn hypothesis hω∀ ∈ Hω?
To answer this question, we first have to specify what we mean by inductive learning. Recall that an LLM M has learned from unsupervised training a function f : V ≤n → µ(V ≤n+m) with µ(V ≤n+m) a probability distribution over completions of length m of contexts of length n. An LLM can use this distribution to compute probability values for arbitrarily long strings or continuations using Equation 1.
In the case at hand, M needs to use this distribution over L strings to compute the probability that a string s is in h∀ or the probability of s given h∀. To learn inductively M must use its training data D≤n to update its prior for the distribution µn using a rationally justifiable form of inductive inference; e.g., for h ∈ Hn, µn(s|h) = µn(h|s)×µn(s)µn(h) .
Additionally, we consider two constraints on distributions to define learning in terms of an inductively inferred change in the distribution from the priors. The first constraint, Max Ent, says that the distribution µ prior to training should assign all hypotheses a weight based on maximum entropy or a least informative distribution. This is usual with auto-regressive models and a common assumption in other models.
The second constraint is that distributions for inductive learning should be non-degenerate. We have assumed that our LLM M has been trained over sequences of length n. Through Equation 1, M can extend the distribution it has learned for V n to one over V n+m for any string of finite length n + m. Recall that we are looking at strings of L that define structures; the structures defined by strings of length n + m are independent of those defined in V n and none is intuitively more likely than another. So the prior distribution over V n+m should consider as equally likely all continuations s.a ∈ V n+m, where s ∈ V n, a ∈ V m and . is concatenation. There are also correspondingly more hypotheses in Hn+m than in Hn, since there are V |m| more strings in V n+m than in V n. Thus µn+m(s.a|hk) < µn(s.a|hk) for s.a ∈ V n+m, s ∈ V n for each hk. Non-degenerate distributions will reflect this and should make the model converge to the least general hypothesis supported by the evidence (Muggleton et al., 1992; Plotkin, 1972).
Definition 2. M ’s distributions over sets of hypotheses Hn, µn(Hn), after training over V n are
non-degenerate if ∀h ∀δ (0 < δ ≤ 1),∃m > 0 such that ∀a ∈ V m ∀s ∈ V n : µn(s.a|h) = max{0, µn(s|h)− δ}, where s.a ∈ V n+m. Proposition 1. Models that calculate distributions over strings using Equation 1 have non-degenerate distributions.
As continuations get longer the probability of the continuation will decrease monotonically.2
Because quantifiers like every and some are eliminable in terms of Boolean functions when we consider finite structures definable with strings in V ∗, we must consider strings in V ω to define countably infinite models that capture the full truth conditions of every. To extend a distribution over V n for finite n to a distribution over V ω, we lift the probability of a string to the set of its continuations. In V ω, the set of strings A characterizes the set A.V ω, where A.V ω is the set of all strings formed by concatenating a string from A with a string from V ω. Using this correspondence, the probabilities of sets of finite strings in V n can lifted to probabilities of sets of the form V n.V ω. The laws of probability extend the distribution to complements, intersections and unions of such sets.
We now propose a simple but general notion of inductive learning.
Definition 3. Suppose µ0 is M ’s Max Ent prior distribution and let h ∈ Hβ for some countable β. M effectively learns h iff after some finite amount of training using inductive inference, there is an α, such that: for any s ∈ V β , µβ(s|h) > α > µ0(s|h) iff s ∈ h. Proposition 2. If M can effectively learn hn∀ from sequences of V nL for arbitrarily large n ∈ ω, then M can effectively learn hω∀ Assume that M cannot effectively learn hω∀ but it can effectively learn hn∀ for arbitrarily large n ∈ ω. Then it must admit some string s ∈ V ωL , such that s ̸∈ hω∀ . But then at some finite stage i, si must have ¬blue(ai). By hypothesis M has learned hi∀. So it has ruled out si and a fortiori s. 2
We now negatively answer our question, Can M inductively learn hypothesis hω∀?, under either of two conditions: (i) M has non-degenerate distributions; (ii) M obeys Max Ent and inductive inference.
Proposition 3. Suppose M ’s distributions are nondegenerate. Then hω∀ is not effectively learnable by M over Hω.
Suppose M trained on V ≤n has effectively learned hn∀ . So ∀s ∈ hn∀ , µn(s|h∀) > α where α is as in Definition 3. Since M ’s distributions are non-degenerate, ∃m, such that for all s ∈ V m,∃δ : 0 < δ ≤ 1 where µm(s|h∀) − δ < α and a continuation of s, s.a, such that s.a ∈ hm+n∀ but µm+n(s.a|h∀) = µm(s|h∀)− δ < α. 2
By Propositions 1 and 3, a basic auto-regressive model cannot learn h∀. We can generalize Proposition 3 to other :
Proposition 4. Suppose M ’s priors only obey Max Ent and M uses inductive inference. Then hω∀ is not effectively learnable by M over Hω.
Suppose M ’s training data D≤n ⊆ V ≤n and M has learned hn∀ . To learn h n+m ∀ , M must project its distribution of Hn onto Hn+m. But the distributions in Hn and Hn+m are independent; for one thing the cardinality of Hn, |Hn|, is such that |Hn| < |Hn+m| = |Hn| × 2m. Our assumptions about inductive inference on D≤n make it no more likely that every will be associated with h∀ than it is with any of the 2m h ∈ Hn+m, where strings in h contain the same n prefix as an s ∈ hn∀ but h ∩ hn+m∀ = ∅. In Hn+m these hypotheses h can be distinguished from h∀. Max Ent priors over Hn+m imply that for any s ∈ V n+m, µn+m(s|h∀) = 12mµn(s|h∀). 2 Corollary 1. M cannot effectively learn hn∀ from sequences in V nL for arbitrarily large n ∈ N. There is some n such that hn∀ is not effectively learnable.
While LLMs can represent any Borel function to an arbitrary degree of precision (Hornik et al., 1989), Propositions 3 and 4 shows they cannot always learn such functions, given either the constraints of inductive epistemology or the way LLMs generate probabilities for strings. In particular, given our assumptions, no LLM can effectively learn hω∀ . In addition, each LLM is bounded by some number n in the size of sequences for which it can learn hn∀ . LLMs do not have the capacity to learn the meaning of ‘every’ even over all finite domains.1
Even supposing that an LLM can effectively learn hn∀ for some n, this does not amount to understanding every. hn∀ can be effectively represented with quantifier free conjunctions of formulae, and
1Unlike Hume’s problem of induction (Popper, 1963) and (Wolpert et al., 1995), we exploit particularities of LLMs and the structure of a classification problem. The finite bound on learning of hypotheses goes beyond standard Humean conclusions
these do not correctly approximate reasoning with a sentence like (2) that applies to arbitrarily large domains. Identifying ∀ with a finite conjunction of length n will make ∀xFx consistent with ¬∀xFx in larger structures. In ω structures, for example, ¬∀xFx is consistent with every finite subset of the Π01 string blue(0), blue(1), blue(2), . . ., in h ω ∀ , making it inevitable that LLMs will reason incorrectly with every in large enough structures.
The situation worsens with sampling: suppose that when we present our model M a long string, M only samples some of the elements in the string; the threat of inconsistency in such a situation can become high and we have no guarantees that such inconsistencies will not arise.2 But this reasoning is not independent of the meaning of every; as the semantics and rules of first order logic show, this reasoning is an integral part of the meaning of every. As a result, LLMs unable to grasp semantic consequence defined in terms of universal quantification; and we thus cannot provide them guarantees that they follow semantic entailments when asked to do semantic tasks. This predicts phenomena like LLM hallucinations and observed elementary reasoning errors.

heading: 4.2 Generalizing our answer to Q2
text: Using tools from statistical learning and the Borel Hierarchy, we now generalize Propositions 3 and 4 to other concepts beyond every.
Statistical learning examines the application of a learned function over a test domain and the expected loss over novel applications. The ability to bring the error over test to that over the training set is typically taken to indicate an ability to generalize (Neyshabur et al., 2017). Villa et al. (2013) define learnability in statistical learning theory via the notion of uniform consistency. Let µ be a distribution over H and µn the update of µ after n training samples zi = (xi, yi). Let Azn be an algorithm for picking out a hypothesis from H based on n training samples. inf H is the hypothesis in H with the lowest possible error (Shalev-Shwartz et al., 2010; Kawaguchi et al., 2017).
Definition 4. An algorithm A on a hypothesis space H is uniformly consistent if and only if ∀ϵ > 0 limn→∞supµ
µn({zn : Eµ({Azn − inf HEµ > ϵ}) = 0 2Approximation and approximation error can also affect learnability of mathematical functions (Colbrook et al., 2022).
In our case, the best hypothesis, inf H, for instance h∀, will yield 0 error. Our question is whether there is an algorithm that converges to that hypothesis given a certain H and certain assumptions.
Definition 5. A class of hypotheses H is uniformally learnable just in case there exists a uniformly consistent algorithm for H.
This enables us to link learnability with a number of other features:
Theorem 1. (Anthony et al., 1999) Let Y = {0, 1}. Then the following conditions are equivalent: (i) H is uniformly learnable; (ii) Empirical risk minimization on H is uniformly consistent; (iii) H is a uGC-class; (iv) the VC-dimension of H is finite.
The Borel Hierarchy We now turn to generalize the hypotheses we are investigating. V ω has a natural topology, the Cantor topology, which allows us to characterize linguistic concepts precisely. To define the topology, we first define the basic open sets to be sets of the form A.V ω, denoted as O(A), where A ⊆ V ∗ is a set of finite strings. Importantly, O(A) sets are both open and closed or clopen, because if A ⊂ V ∗ is a countable set, then the complement of A.V ω, (V ∗ \A).V ω, is also open. And thus, A.V ω is also closed. The ∆01 class is at the intersection of the Σ01 and Π 0 1 classes and consists of the clopen sets. Σ01 sets include countable unions of ∆01 sets, while Π 0 1 are complements of Σ 0 1 sets and so include countable intersections of ∆01 sets. These sets form the basis of the Borel hierarchy of sets that includes the ∆01, Σ 0 1, and Π 0 1 sets, and more generally includes Σ0α+1 as the countable union of all Π0α and ∆ 0 α sets, and Π 0 α+1 as the complement of Σ0α+1 sets, with ∆ 0 α = Σ 0 α ∩ Π0α. The hierarchy is strict and does not collapse (Kechris, 1995). We will use this hierarchy to characterize linguistic concepts. Below is a picture of some simple Borel sets and their ⊆ relations.
Σ01 Σ 0 2 Σ 0 3
Π01 Π 0 2 Π 0 3
∆01 ∆ 0 2 ∆ 0 3
As an example, hω∀ ⊆ V ωL of the previous section is a Π01 Borel set; i.e., h ω ∀ = ⋂ i∈ω Bi where the Bi are ∆01. We are interested in the learnability of Borel sets B with respect to a hypothesis space. The hypothesis space Hn for V ≤n and algorithem An that an LLM can consider is typically fixed by the
maximal length strings it has been trained on. But we will be looking at how an LLM extends its training generalizing to longer and longer strings. More generally, we consider a countable collection of hypotheses—in the case of every and VL, the set consists of h∀, hthefirst 2n etc. We will assume a countable hypothesis space Hω for the Borel sets in V ω, with |V | > 2 we want to learn in what follows. Definition 6. An LLM M can effectively learn a Borel set S ⊂ V ω out of a countable set of hypotheses H iff M has a uniformly consistent algorithm such that hS = infH, as in Definition 4, and where hS : V
ω → {0, 1} defines S. Clearly if h is infH, and A is uniformly consistent, then Definition 3 is satisfied; i.e., there is some α > ϵ such that µ(s|h) > α iff s ∈ h. Theorem 2. An LLM with either (a) non degenerate distribution or (b) Max Ent priors and trained on V <n for some finite n to learn h ⊂ V ω via inductive inference (i) can effectively learn a ∆01 set O(S) ⊂ V ωL , where S is a finite subset of V ≤n, given HO(V <n), a hypothesis space restricted to ∆01 sets; but (ii) it cannot effectively learn any Π 0 1 Borel set B ⊂ V ωL . We first show (i). Let H = {O(A) : A ⊆ V <n}. Any h ∈ H is determined by a finite set of prefixes P in V <n. There are only finitely many such sets in V ≤n, and so M has an algorithm A that eliminates at each finite stage of training some ∆01 O(P ) sets. This enables it to converge uniformly toward 0 expected error for the set of finite prefixes that determines O(S) and so eventually M will have effectively learned O(S).
Now for (ii). We first consider the case (ii.a) where our learned model has non-degenerate distributions. Consider an arbitrary Π01 complete set B. So B = ⋂ n∈ω O(Bn), with O(Bn+1) ⊂ O(Bn), where the Bi ⊂ V ∗. To compute B, M needs a uniformly consistent algorithm A over our countable hypothesis space H that converges on hB , the hypothesis defining B. Now suppose M has been trained on strings in V <n; its algorithms A are thus restricted to H<n.
Suppose M trained on V ≤n has effectively learned hnBn . Let s ∈ hnBn . Since M ’s distributions are non-degenerate, ∀α ≥ 0, ∃m, δ : 0 < δ ≤ 1 where µm(s|hB) − δ < α and a continuation of s, s.a, such that s.a ∈ hm+nBn but µmM (s.a|hB) = µmM (s|hB)− δ < α. So there is no convergence at any finite stage n of A towards hB . Non uniform learnability of H then follows.
(ii.b) Let’s now assume that M only has Max Ent priors and learns by inductive inference. Uniform convergence of any algorithm obeying these conditions is not guaranteed as a similar argument as in Proposition 3 applies. 2
Corollary 2. The hypothesis space HB is not uniformly learnable. Hence the the VC-dimensions of HB are not finite, and empirical risk minimization on HB are not uniformly consistent.
Corollary 3. M cannot effectively learn Σ01 complete Borel sets.
Assume M can effectively learn a Σ01 complete set. Then it can effectively learn a Π01 set that is its complement, which is impossible by Theorem 2.2
Proposition 5. An LLM M cannot effectively learn Borel sets B of higher complexity than ∆01.
Proposition 2 and Corollary 2 show that M cannot effectively learn Π01 or Σ 0 1 sets. But any Π 0 n or Σ0n complete Borel set B for n > 1 is at least a countable intersection or countable union of such sets. So B is not effectively learnable.2
Asher et al. (2017); Asher and Paul (2018) examine concepts of discourse consistency and textual and conversational coherence, which true, humanlike conversational capacity requires. Using continuations in a game-theoretic setting, they show those concepts determine more complex Π02 sets in the Borel Hierarchy; and intuitive measures of conversational success—like the fact that one player has more successful unrefuted attacks on an opponent’s position than vice versa—determine Π03 sets. Given Proposition 5, LLMs cannot learn these concepts, which are needed for full conversational mastery.
Proposition 6. For any LLM M , there is a maximally large and fixed number n such that Hn is uniformly learnable for M but Hn+k is not uniformly learnable, for k > 0.
Suppose that for M Hn is uniformly learnable for all n. Then, M can compute the countable intersection of sets defined by the best hypotheses in Hn for each n. So M can effectively learn a Π01 set, which contradicts Theorem 2.2
Corollary 4. M cannot effectively learn ∆01 sets of the form O(A) if the length of A is longer than the maximal number n such that Hn is uniformly learnable for M .

heading: 4.3 The importance of order
text: Order is important for the most elementary reasoning about linguistic content in finite domains. Let us add another predicate A to L to form the language L+. Now consider the strings in V ωL+ . Strings consistent with (2) may include formulae like A(ai) or ¬A(ai), paired with a choice of blue(ai) or ¬blue(ai). Even to find effectively initial segments of strings in hω∀L+ , M must learn some sentence structure or word order. The negation sign has to be paired with the predicate blue; if it’s appended to A (e.g., large, or some other independent term), this should count as a string in hn∀ . If s is a finite string, M does not effectively capture word order if it does not distinguish between s and permutations of elements in s.
Proposition 7. If M does not effectively capture word order, it cannot effectively learn basic sets of the form O(A) for A ⊂ V ∗.
Let s ∈ A be a string containing A(ai)∧¬blue(ai) but A has no string containing ¬A(ai) ∧ blue(ai). If M does not capture word order, M cannot distinguish between s and s’s permutation containing ¬A(ai) ∧ blue(ai). 2
Corollary 5. If M does not effectively capture word order, it will not reason soundly in propositional logic.
The example in Proposition 7 shows that M will not be able to reason about logical structure if it does not effectively capture word order. 2
Yuksekgonul et al. (2022); Sinha et al. (2020) provide evidence that small to moderate sized LLMs do not reliably capture word order. Our empirical examples show even GPT3.5 and ChatGPT have difficulties with sentential word order, and, worryingly, with the order of arguments in a logical operator; the example in Appendix B suggests that even ChatGPT can’t be trusted to always do elementary inferences involving conditionals correctly. Thus, LLMs with their initial training do not necessarily find basic ∆01 sets of the form a.V ω where a is a single string but only sets A.V ω where A is a set of prefixes that are permutations on a. This is surprising and poses extreme difficulties for valid reasoning with operators that have order dependent arguments.

heading: 5 Empirical investigations of LLMs with
text: every
While the theoretical argument laid out in Section 4 does not hinge on empirical statistics of LLM failures, it certainly suggests that we should expect such failures. In this section, we describe some of the tests we have performed using continuations to query LLMs directly about their mastery of universal quantification.
Let us return to our simple example from above, repeated here as (2):
(2) Everything is blue.
We used finite sequences of formulas as a context, e.g., a1 is blue, a2 is red , a3 is red ,..., ai is blue to determine a model. We then asked an LLM M whether (2) in this model, allowing us to gauge its behavior with respect to finite domains.
BERT-large and RoBERTa-large already failed to reliably distinguish very small models (containing 2 and 5 objects respectively) in which (2) is true from those in which it is not. To test these models, we fine-tuned BERT-large and RoBERTalarge on the CoQA dataset (Reddy et al., 2019). For finetuning, the model had 4 output heads for yes, no, unknown, and span type questions. Since the CoQA dataset provides a rationale for each question, the models were jointly trained on question answering and rationale tagging tasks to enhance their performance. We report scores on the finetuned models on CoQA for 1 epoch as we did not observe significant improvement with an increased number of epochs.
For BERT-large, we provided strings like (3) and then asked Is everything blue?
(3) My car is blue. My house is blue
We generated a total of 5 examples in which (2) was true and 5 examples in which (2) is false. All the examples had only 2 objects. The inconsistent examples were constructed by varying the position of the object which was inconsistent with the asked question and by trying out different combination of colours and objects.
The consistent examples were of the form: 1. The car is blue. The house is blue. 2. The car is purple. The house is purple. 3. The car is yellow. The house is yellow. 3. The shirt is violet. The table is violet. 4. The cup is black. The plate is black.
Inconsistent examples were of the form: 1. The car is blue. The house is red. 2. The car is green. The house is purple. 3. The car is yellow. The house is brown. 2. The shirt is violet. The table is brown. 3. The cup is black. The plate is white.
BERT-large was able to correctly identify the consistent examples but failed for all the inconsistent examples. As the model failed for all the inconsistent examples with 2 objects, we did not experiment with models containing more than 2 objects.
For RoBERTa-large, we generated a total of 9 consistent examples and 53 inconsistent examples. We constructed sequences ranging from 2 to 10 objects. For each number, the inconsistent examples were constructed by varying the position of the object in the string (context) which is responsible for the inconsistency. The model was able to correctly identify all the consistent examples. For models of a given size (i.e., number of objects), we defined the pass fraction as the ratio of the examples in which the model was able to report models inconsistent with (2) correctly to the total number of inconsistent examples. Table 1 reports the pass fraction on inconsistent examples.
While BERT’s and RoBERTa’s behavior was stable on the strings tested, GPT3.5 davinci and ChatGPT, while more robust, are unstable from one day to the next, even when temperature is set to 0 (on GPT3.5). This made it difficult to pin down the models’ abilities, though some generalizations emerged. Typically (though not always), these models can recognize which objects in a string have a certain property, but they cannot necessarily exploit this information to answer questions about the string as a whole (see the “hats” example in Appendix A). In addition both GPT3.5 and Chat-
GPT will sometimes (frequently in our most recent tests) over-generalize and say that all items in a list are, say, blue if it is specified for all items but one that they are blue and it is not specified one way or the other for the remaining item (see the fifteen hearts example from ChatGPT in Appendix A). Thus, even these sophisticated models still fail on more complicated questions and longer strings.
Our empirical observations on LLMs like BERT and RoBERTa and probing of ChatGPT strongly support our argument that LLMs are unable to master quantification, complementing observed LLM difficulties with negation (Naik et al., 2018; Kassner and Schütze, 2019; Hossain et al., 2020; Hosseini et al., 2021) and to some extent quantifiers (Kalouli et al., 2022).

heading: 6 Conclusions
text: We have shown that LLMs’ demonstrably inadequate grasp of the meanings of words like every and other linguistic constructions has a theoretical foundation and explanation: for certain expressions S, S’s content should be defined via consistent sets of strings in V ω, and LLMs cannot effectively learn certain sets in V ω. More generally, LLMs cannot effectively learn full meanings of first order quantifiers or any Borel sets beyond the basic open sets, which means that they fail to grasp the meaning of a long list of mundane, frequently used expressions.
Many of these expressions are syncategorematic terms and express what we might call precise concepts. Such concepts are needed for understanding ordinary entailment across all expressions; in addition, correctly reasoning with these concepts and grasping their entailments is essential to understanding them. Reasoning and entailment are intimately tied with meanings. For us and most formal semanticists (Montague, 1974), grasping meaning and correctly reasoning with linguistically expressed concepts go hand in hand; if you cannot exploit the meanings of words in correct reasoning, you do not really know what they mean. The incorrect reasoning of LLMs exemplifies their failure to grasp semantic entailments and meaning.
Our arguments go beyond those of Bender and Koller (2020), who argue that stochastic models cannot capture linguistic meaning because they consider only form, not denotation. While we agree that denotation plays a very important role in meaning for many expressions, the meaning of most expressions, and especially that of syncategoreg-
matic ones, requires us to capture their semantic entailments. We have shown that we can capture these entailments within the semantic framework of LLMs using continuation semantics. But we have also shown that LLMs nevertheless fail in this task.
LLMs can learn certain types of ∆01 sets and finite intersections and unions of learnable ∆01 sets. For many open class words—including many nouns, adjectives and verbs—whose characteristic denotations can be determined given a finite sample, this probably suffices to capture their meaning or at least a very good approximation of it. In addition, many NLP tasks may not involve logical inference but an independent form of string optimization; in text summarization or translation, where given a context s, M tries to find an optimal continuation s′. If the length of s.s′ falls within the constraints of Corollary 4, then we can expect an LLM to succeed at such a task.
Proposition 6 and Corollary 4 generalize Corollary 1 and they all point to a general limit on learnability for LLMs. They establish that language models have strict bounds even on the ∆01 sets they can effectively learn. So we cannot count on LLMs having full linguistic competence even on finite domains. Different models may have different limits; smaller models generally with lower limits. This motivates a comparative study of the limits of learnability for different LLMs, complementing Colbrook et al. (2022).
Because we do not make assumptions about memory but only about inductive processes and learning, our results hold for arbitrarily large LLMs and for any task that relies on an LLM’s capacity of string prediction, even if strings are not directly predicted.
Our research implies that full language mastery needs a different approach from one in which one seeks to build ever larger LLMs with language masking or autoregressive training. Following Raissi et al. (2017), we believe we need to inject knowledge about linguistic structure and content into our models to further constrain learning and in particular hypothesis sets and learning architectures as suggested in Steinert-Threlkeld and Szymanik (2019).
Limitations
Our paper offers an in-depth look at the limits of statistical learnability for LLMs in terms of Borel sets. Our results however rely on certain, rather mild hypotheses about learning. We do not know how our claims fare when different assumptions about learning are made.
Another limitation is that we have not looked at potential ways of restricting learning hypotheses about the meanings of linguistic expressions. Directly relevant are the constraints on generalized quantifiers of Barwise and Cooper (1981). Nor have we said much about compositionality and learning, although they are well known to interact. Ideally, we should assign a meaning to every which consists in a reduced hypothesis space, but that has to combine with the meanings of, say, the other words in (2).
A third limitation concerns the extent to which an LLM can leverage what it has been trained to do in learning semantic concepts on other tasks. In many experiments we see that an LLM can appear to learn X but then cannot exploit X in task Y. We leave this issue for future research, but we believe it may be key to understanding debates about LLM performance and the role of forgetting in LLM learning (Kirkpatrick et al., 2017).
Ethics Statement
We show that LLM reliability in gauging the accuracy of universal quantifiers is limited. Given how quantification is linked to concepts like semantic consequence, it means that we cannot assume LLMs to have anything like full semantic competence. This suggests that we cannot fully trust them with tasks where accuracy on reasoning is required. Thus, our work has certain ethical implications and provides a cautionary tale for those working on LLMs as general AI models.

heading: Acknowledgments
text: For financial support, we thank the National Interdisciplinary Artificial Intelligence Institute ANITI (Artificial and Natural Intelligence Toulouse Institute), funded by the French ‘Investing for the Future– PIA3’ program under the Grant agreement ANR-19-PI3A-000, and we also thank the projects COCOBOTS (ANR-21-FAI2-0005) and DISCUTER (ANR-21-ASIA-0005). We also thank the COCOPIL “Graine" project of the Région Occitanie of France.

heading: B ChatGPT and GPT3.5 on word order and argument order
text: The examples below illustrate how both GPT3.5 and ChatGPT fail to recognize instructions about word order. When asked to write sentences that end with a particular word, for example, the models manage to produce sentences in which the target word appears, but in most cases, it is not in the correct position.
Instruction: Write five sentences that end with the word “house”.
ChatGPT: 1. I built a house with my own two hands. 2. The storm destroyed the old house. 3. We found a beautiful house to rent for the summer. 4. The house was haunted, so we left in the middle of the night.
5. I always dreamed of living in a big white house.
GPT 3.5: 1. I can’t wait to get home and relax in my own house. 2. The old house had been abandoned for years. 3. The house was filled with the smell of freshly baked cookies. 4. The house was surrounded by a tall white picket fence. 5. The house was the perfect place to spend a lazy summer day.
For GPT3.5 we set temperature to 0. These observations suggest both GPT 3.5 and ChatGPT fail to respect the last word constraint.
Finally, we offer this example that shows that ChatGPT can confuse the order of arguments in a logical operator, thus leading to incorrect reasoning.
Prompt: If p then q. q, therefore p.
ChatGPT: This is a valid logical argument. It is known as modus ponens and it is a valid rule of inference in propositional logic. The statement “If p then q” is known as the conditional statement and “q, therefore p” is the conclusion that can be drawn from the conditional statement.

heading: Future Work
text: For financial support, we thank the National Interdisciplinary Artificial Intelligence Institute ANITI (Artificial and Natural Intelligence Toulouse Institute), funded by the French ‘Investing for the Future– PIA3’ program under the Grant agreement ANR-19-PI3A-000, and we also thank the projects COCOBOTS (ANR-21-FAI2-0005) and DISCUTER (ANR-21-ASIA-0005). We also thank the COCOPIL “Graine" project of the Région Occitanie of France