Guiding Ideas
This book concerns mathematical foundations of statistical language modeling, i.e. the question what kind of a probability distribution should be assigned to particular utterances of human languages. In this chapter, we will describe the core ideas of this book in a way which is less formalized mathematically, but more motivated linguistically. Based on the intuitions sketched in this chapter, in the following chapters, we will build rigorous mathematical constructions. The general goal is to develop a theory of discrete stochastic processes so that it would be able to account for certain statistical phenomena exhibited by human texts. The considered statistical phenomena take form of several power laws. We hope that if we were to succeed in a better modeling of these power laws, then in the long run, we may also obtain probabilistic models of language which are better in terms of performance measures used by engineers in computational linguistics. In other words, we hope that our quest for stochastic processes may turn out to be fruitful not only for purely theoretical interest but also for practical applications in engineering. We hope that the considered problems are also interesting enough on the theoretical side, and they can draw interest of professional mathematicians.
1.1 The Motivating Question
The fundamental question that motivates this book is
What kind of a statistical model may explain generation of texts in natural language, such as books, our daily dialogues, or maybe even our internal stream of consciousness?
We perceive ourselves as free to say or think whatever we like, but, just to raise some doubts about our naive feeling of free will, are we more deterministic or more random in what we think? Either of these two extreme options seem scary. Surely, we are constrained by rules of grammar, meanings of words, habits of culture, daily chores, as well as search for meaning, good, beauty, truth, or happiness, which also impact our sense of freedom and the patterns of our deeds. But does it follow that the question of typical paths of our thoughts is worth investigation? Is there any mathematics there? Can we meaningfully quantify complexity of a song (Knuth, 1984 ) or a poem (Manin, 2019 )? Is it a scientific question, does it bear practical importance, is it a cultural taboo of searching which one should not break, or all of that simultaneously?
There were many eminent intellectuals and scholars so far who asked the question about probability of texts. For example, Jonathan Swift, an Irish writer and clergyman, in his highly ironic novel popularly called Gulliver's Travels , in the chapter about the academy of sciences of Lagado, described a machine for automated text generation. The author of the machine assured Gulliver that
this invention had employed all his thoughts from his youth; that he had emptied the whole vocabulary into his frame, and made the strictest computation of the general proportion there is in books between the numbers of particles, nouns, and verbs, and other parts of speech.
(Swift, 1726 )
We can then suppose that this machine while being deterministic, but making use of the frequencies of particular words should have implemented a certain statistical model of texts. Swift derided this machine as a highly unsuccessful project.
Despite many conceptual difficulties, the question about the probability of texts in natural language arises from time to time in the minds of scientists representing several domains: mathematics, linguistics, computer science, psychology, as well as physics of complex systems. In this book, we will build mostly on the expertise of mathematicians. Thus, let us recall that a few important mathematical concepts were in fact inspired by our question, such as Markov chains (Markov, 1913 , translated in: Markov, 2006 ), entropy (Shannon, 1948 , 1951 ), fractals (Mandelbrot, 1953 , 1954 ), and algorithmic complexity (Kolmogorov, 1965 ). In contrast, among linguists, the question of probability in language caused a debate. Some linguists, such as Zipf ( 1935 , 1949 ) and Herdan ( 1964 ), were highly interested in statistical properties of texts, whereas Chomsky ( 1956 , 1957 , 1959 ), while being more influential at that time, dismissed the question of probabilities in language as irrelevant for linguistics for the reason that human language cannot be in principle a finite‐state stochastic process, see also Chomsky and Miller ( 1959 ). A brief historical account of this debate was resumed by Pereira ( 2000 ). As Christian Bentz, my friend, has also put it:
It is an irony of 20th century linguistics that Shannon's theory of information, though explicitly linked to semantics, was deemed irrelevant by linguists, while Chomsky's formal syntax, though explicitly dissociated from semantics, was adopted as the default theory of natural language.
(Bentz, 2018 , p. 62)
Nowadays, in spite of the debates and reservations among the older generation of linguists, there is a growing pressure coming from engineering, technology, and experimental science to seriously ponder upon the question about statistical models of texts. While modern technology provides us with large amounts of textual data available to relatively powerful computers, applications such as predictive keyboards and speech‐to‐text recognizers in our smartphones actually already rely on some imperfect statistical models of texts. Machine learning engineers working on these problems continuously release better and better models. Initially, natural language engineers used finite‐state models for this goal (Jelinek, 1997 ; Manning and Schütze, 1999 ), exactly those criticized by Chomsky. However, since the introduction of deep neural networks to the domain of natural language processing, the progression of statistical language model quality has been gaining a breathtaking momentum.
In particular, there was quite much publicity in the media concerning GPT‐2, a statistical model of English announced by the OpenAI team on their blog on 14 February 2019. GPT‐2 is nothing but a statistical language model encoded as a neural network with 1.5 billion parameters trained on 40 gigabytes of texts. Given this, it is capable of generating quite a coherent narration of the length of a few paragraphs, such as the following text, which we quote in full since it is spectacular:
SYSTEM PROMPT (HUMAN-WRITTEN) :
In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English.
MODEL COMPLETION :
The scientist named the population, after their distinctive horn, Ovid's Unicorn. These four‐horned, silver‐white unicorns were previously unknown to science.
Now, after almost two centuries, the mystery of what sparked this odd phenomenon is finally solved.
Dr. Jorge Pérez, an evolutionary biologist from the University of La Paz, and several companions, were exploring the Andes Mountains when they found a small valley, with no other animals or humans. Pérez noticed that the valley had what appeared to be a natural fountain, surrounded by two peaks of rock and silver snow.
Pérez and the others then ventured further into the valley. “By the time we reached the top of one peak, the water looked blue, with some crystals on top,” said Pérez.
Pérez and his friends were astonished to see the unicorn herd. These creatures could be seen from the air without having to move too much to see them – they were so close they could touch their horns.
While examining these bizarre creatures the scientists discovered that the creatures also spoke some fairly regular English. Pérez stated, “We can see, for example, that they have a common ‘language,’ something like a dialect or dialectic.”
Dr. Pérez believes that the unicorns may have originated in Argentina, where the animals were believed to be descendants of a lost race of people who lived there before the arrival of humans in those parts of South America.
While their origins are still unclear, some believe that perhaps the creatures were created when a human and a unicorn met each other in a time before human civilization. According to Pérez, “In South America, such incidents seem to be quite common.”
However, Pérez also pointed out that it is likely that the only way of knowing for sure if unicorns are indeed the descendants of a lost alien race is through DNA. “But they seem to be able to communicate in English quite well, which I believe is a sign of evolution, or at least a change in social organization,” said the scientist.
(Radford et al., 2019 )
A simple numerical trick called calibration can improve the outputs of GPT‐2 even more (Braverman et al., 2019 ). Takahashi and Tanaka‐Ishii ( 2019 ) show that neural network language models can also mimic many statistical patterns of texts created by humans. But most importantly, as we can simply understand the machine‐generated text, GPT‐2 can write a text which is a complete fiction but sounds like a readable story. (Even the self‐contradictory “four‐horned unicorns” could be wishfully attributed to the machine's singular sense of humor.) For the reason that similar statistical models could possibly flood the Internet not only with nice literary fiction but also with dangerous fake news, the OpenAI team initially decided not to publish the full GPT‐2 model. This decision caused some ado in the media. A less publicized, related achievement in natural language processing was a publication by Springer of a book (Beta Writer, 2019 ) which is a fully machine‐generated summary of 150 scientific articles in chemistry concerning lithium‐ion batteries. This achievement concerns, however, summarizing of existing texts rather than generation of a novel text.
We agree that there is a far‐reaching ethical question concerning our ambitious dream of statistical language modeling, as embodied in a stream of consciousness. Creating an artificial intelligence, be it in form of an artificial stream of consciousness, may be dangerous, also because of the risk that this intelligence will be smarter than us and simply desires to get rid of us. Thus, we can perfectly understand fears of those who think that any progress in imitating human intelligence will inevitably contribute to constructing another intelligence which will replace our own. But given the current state of engineering, it is possible that we may create a dangerous artificial intelligence accidentally. In such a situation, paradoxically, it is advisable to put as large effort as possible in understanding the dynamics of intelligence in general, exactly not to create the dangerous intelligent entity by accident.
Consequently, our initial question about statistical language models is no longer so strange. It is one of the fundamental research topics in artificial intelligence. Moreover, besides purely engineering approaches, we need some orchestrated fundamental mathematical research to understand the largely black‐boxed progress of neural network language models, see Tishby and Zaslavsky ( 2015 ) and Shwartz‐Ziv and Tishby ( 2017 ). Hopefully, for some and disappointingly to others, in this book, we will not give the ultimate and potentially risky answer to the question about the statistical model for natural language, but we hope to provide some insights which may inspire further research. The modest goal of this book is to understand some aspects of ideal statistical language models as seen via quantitative laws exhibited by texts spontaneously created by humans. That is, we will look into some general statistical patterns of texts.
1.2 Further Questions About Texts
What are the general statistical properties of texts created by humans? Let us briefly call the texts or sequences that get reproduced in the process of human culture natural texts . We may observe that in all human languages, natural texts can be written down – at least phonetically – using symbols from a finite set. In information theory, such a set is called an alphabet. For a finite alphabet, the number of all combinatorially possible sequences grows exponentially with the considered length of the sequence.
The vision of this potential exponential growth must have haunted Jorge Luis Borges, an Argentinian writer and librarian. In the short story La Biblioteca de Babel (Borges, 1941 ) – see also Bloch ( 2008 ), he described a fictitious library, which contained every combinatorially possible text of a given length, in form of a book meticulously printed out and stored on some bookshelf. When a random book was selected from this collection, one could only read a meaningless sequence of random letters. Surely, real books and libraries do not look like this! We may suppose that there are some patterns in natural texts – maybe there are unboundedly many distinct sorts of patterns – and hence the number of texts that remain in cultural discourse is acutely limited.
Using word patterns , we must be careful, however. Obviously, some simple patterns such as regular cycles arise in simple deterministic sequences. But, also completely random sequences of symbols exhibit some statistical order, such as the law of large numbers. Thus, what kind of patterns are specific for natural texts? We suppose that natural texts are neither of two extremes – they are neither deterministic in a simple way nor completely random. In fact, George Kingsley Zipf already put this intuition into the following beautiful words:
If a Martian scientist sitting before his radio in Mars accidentally received from Earth the broadcast of an extensive speech which he recorded perfectly through the perfection of Martian apparatus and studied at his leisure, what criteria would he have to determine whether the reception represented the effect of animate process on Earth, or merely the latest thunderstorm on Earth? It seems that the only criteria would be the arrangement of occurrences of the elements, and the only clue to the animate origin would be this: the arrangement of the occurrences would be neither of rigidly fixed regularity such as frequently found in wave emissions of purely physical origin nor yet a completely random scattering of the same.
(Zipf, 1935 , p. 187)
Rejecting simple determinism from the process of natural text generation means that we have to consider some model of randomness. Consequently, searching for models of natural texts, in this book, we will use the framework of probability calculus and information theory. This approach does lead to certain insights.
Whereas the question about the probability of a particular text or a sequence of symbols seems very difficult and dependent on their context, we may consider relaxed versions of the problem. If we abstract from the concrete numerical value of a text probability and we assume that all texts with a strictly positive probability are equally important, then our motivating question from Section 1.1 boils down to:
Which texts or sequences of symbols get reproduced in the process of human culture or in the stream of consciousness?
Let us observe that different sequences may get reproduced in the streams of consciousness of different persons. Moreover, if there is some randomness involved in the process of preselecting texts or sequences that get further reproduced in a particular stream of consciousness, the possibility which we cannot exclude a priori, then we may not be able to answer the above question constructively.
In view of this simple idea, we may find the task of finding a statistical model of language completely vane. But we think that we should not lose hope in this scientific project. There is a way of looking at the problem that may bring us closer to the solution. The idea is to introduce numbers. So let us ask rather:
How many different texts or sequences of symbols of a given length get reproduced in the process of human culture or in the stream of consciousness?
We can see that answering how many sequences get reproduced does not automatically answer which sequences these are. In particular, even if the numbers of distinct sequences are the same for different streams of consciousness, there may be different sequences in different streams of consciousness. But building a partial quantitative model may shed some light onto principles of human communication and inspire further progress. At some point, we may be able to answer also the question:
Why only a certain well‐defined number of texts or sequences of symbols of a given length gets reproduced in the process of human culture or in the stream of consciousness?
This question concerns both the dynamics and the purpose of thinking and culture. If we were able to answer this question, then, given enough computational resources, we might be able to simulate a random process of culture or a stream of consciousness in silico , or in other words create an artificial intelligence.
Asking about the dynamics and purpose of thinking and culture is a difficult and potentially controversial question. Personally, we suppose that there may be some purpose of culture. The argument goes like this. We suppose that there is some objective truth that is possible to discover. We suppose that this truth cannot be expressed in finitely many words but can be learned partially and incrementally, given a certain effort. Moreover, we suppose that under certain physical circumstances, it is profitable to accumulate the partial knowledge of the truth. Hence, according to our views, the ultimate purpose of culture is a never ending accumulation of the partial knowledge of the truth. In the beginning of culture development, this purpose is rather a derivative of special physical circumstances which make knowledge accumulation profitable in some sense. This, however, does not exclude the possibility that culture, understood as a physical system of knowledge accumulation, gains its autonomy and begins to create conditions under which knowledge accumulation remains profitable. Then the ultimate purpose of culture becomes mere accumulation of knowledge.
It is a good question whether the system of knowledge accumulation can actually assume total control over its physical environment to ensure the unbounded growth. Unbounded growth of anything besides thermodynamical entropy seems in general physically impossible, but we refrain from giving a definite answer. Maybe knowledge is a peculiar sort of thermodynamical entropy (Lem, 1974 ; Feistel and Ebeling, 2011 ).
There is a large gap between the informal considerations of the above paragraph and the actual contents of this book. We suppose, however, that this gap is not infinite and may be filled some day with mathematical models. Therefore, it may be good to look at this gap from time to time to measure our progress. In the following, we will investigate some particular statistical patterns of natural texts that may inform us of more general theoretical properties of human language.
1.3 Zipf's and Herdan's Laws
Speaking of concrete statistical patterns of language, we should begin with Zipf's law. Zipf's law, discovered by Estoup ( 1916 ) and later popularized by Zipf ( 1935 ) and Mandelbrot ( 1953 , 1954 ), is undoubtedly the most famous of all quantitative patterns exhibited by natural texts known so far – for an overview of many other patterns see Köhler et al. ( 2005 ). Also more recent books on quantitative linguistics by Esposti et al. ( 2016 ) and Hernández and Ferrer i Cancho ( 2019 ) begin with a discussion of Zipf's law. Thus, commencing quantitative considerations about natural language with Zipf's law is quite expected and natural.
To explain what Zipf's law is, we have to introduce the concepts of the word frequency and the word rank. The word frequency
is simply the number of occurrences of a given word
in a given text. Now let us sort the words according to their frequencies and assign rank
to the most frequent word
, rank
to the second most frequent word
, and in general rank
to the
th most frequent word
. In Table 1.1 , we present an example of a rank list, i.e. the list of ranks
, frequencies
, and words
sorted according to the frequencies. By definition, the word frequency
is a decreasing function of the word rank
. Zipf's law, called also the Zipf–Mandelbrot law, says something more, namely, it says that the word frequency is approximately inversely proportional to a power of the word rank,
(1.1)
where the exponent is
. In particular, if we plot the frequency versus the rank in the doubly logarithmic scale, we obtain almost a straight line with the slope
, see Figure 1.1 . Miracle?
Table 1.1 The beginning of the rank list for Shakespeare's First Folio/35 Plays.
Source: Text downloaded from Project Gutenberg ( https://www.gutenberg.org ).
|
|
|
|---|---|---|
| 1 | 21 557 | I |
| 2 | 19 059 | and |
| 3 | 16 571 | to |
| 4 | 14 921 | of |
| 5 | 14 491 | a |
| 6 | 12 077 | my |
| 7 | 10 463 | you |
| 8 | 9789 | in |
| 9 | 8754 | is |
| 10 | 7428 | that |
|
|
|
Figure 1.1 Zipf's law.
Zipf's law for Shakespeare's First Folio/35 Plays and a random permutation of the text's characters. We note that we use the doubly logarithmic scale here and later. Source: Author's figure based on the text downloaded from Project Gutenberg ( https://www.gutenberg.org ).
Unfortunately, Zipf's law, as stated above, is not a pattern that is unique to natural texts. Let us take a unigram text , that is a random permutation of characters of a given natural text – to state it clearly, a space between the words is also considered a character. (This process is metaphorically called “monkey typing” but, of course, real monkeys do not type in this way.) Subsequently, let us make a list of “words” defined as space‐to‐space sequences of letters in the random permutation of characters, compute ranks and frequencies of those “words,” and plot the obtained numbers in the doubly logarithmic scale. Then we obtain a very similar plot as for the text in natural language, see Figure 1.1 ! Hence, some simple kinds of random texts, such as unigram texts, also exhibit Zipf's law. This observation has been made by Mandelbrot ( 1954 ) and Miller ( 1957 ) and rigorously explained by Conrad and Mitzenmacher ( 2004 ).
Before we start producing alternative explanations for Zipf's law, let us make a general methodological remark. There can be at least four different sorts of reasons for quantitative laws of natural texts:
- 1. General laws of randomness : We have just seen an example thereof in the instance of the “monkey typing” explanation of Zipf's law.
- 2. Physical constraints of the human vocal tract : Speech is the primary mode of human language communication and the distribution of breath length may impose certain constraints on the structure of syllables and the lengths of words. For recent relevant research, see Torre et al. ( 2019 ) and Coupé et al. ( 2019 ).
- 3. Physical constraints of the human brain : Language is processed by a three‐dimensional network of neurons, whose configuration may imply some unrecognized bounds on the time and space complexity of language processing. For potentially relevant research, see Burger et al. ( 2019 ), West ( 2017 ), and Zador ( 2019 ).
- 4. Abstract semantic constraints : Texts created by humans are meaningful, i.e. they describe, associate, and control entities which are not the texts themselves. Meaningfulness may harness the texts to exhibit certain patterns or be attracted by some particular asymptotic structure. This sort of explanations will be pursued in this book. We will argue that they are within reach of mathematics.
For different empirical laws of natural language, different sorts of explanations can be suitable. It is possible that a given law can be given multiple explanations of varying degrees of plausibility. Some laws can be true for a bunch of roughly equally plausible reasons – and if these reasons are of a similar complexity, even Occam's razor would not help us to single out the best one. However, finding several equally plausible reasons can also enrich our understanding of the explained phenomenon – like finding multiple proofs of a single mathematical theorem.
Indeed, not only unigram texts provide a basis for formal explanations of Zipf's law. Some other identified mathematical or computational mechanisms leading to Zipf's law involve: multiplicative processes, originally discovered by Simon ( 1955 ) and, nowadays, called preferential attachment; large number of rare events (LNRE) distributions by Khmaladze ( 1988 ), later researched by Baayen ( 2001 ); coding games with entropy loss discovered by Harremoës and Topsøe ( 2001 ); a formalization of Pareto's principle of least effort by Ferrer‐i‐Cancho and Solé ( 2003 ), curiously resembling the bottleneck method in machine learning introduced by Tishby et al. ( 1999 ). Most of these models, however, either ignore the statistical dependence between occurrences of particular words or assume that there is no such dependence.
In contrast, in this book, we will seek for explanations of word distributions which combine general laws of randomness with abstract global semantic constraints. We will assume that texts in natural language attempt to describe an infinitely complex reality, be it fictitious or not, whose state can be partitioned into an infinite number of independent elementary facts, see Section 1.11 . In Section 1.12 , we will see that a power law for the distribution of word‐like strings arises naturally in this case, as predicted by so‐called theorems about facts and words. These theorems provide an explication of Herdan's law, a corollary of Zipf's law to be discussed in the next paragraph.
Herdan's law also has many fathers – it was independently rediscovered by Kuraszkiewicz and Łukaszewicz ( 1951 ), Guiraud ( 1954 ), Herdan ( 1964 ), and Heaps ( 1978 ). Quite often Herdan's law is also called Heaps' law. The law describes a relationship between the number of word types
, i.e. the number of different words in some initial part of a text, and the number of word tokens
, i.e. the number of all words in the same part. Herdan's law states that the number of word types
is proportional to a power of the number of word tokens
,
(1.2)
where
. In particular, if we plot the number of word types
versus the number of word tokens
in the doubly logarithmic scale, we obtain something similar to a straight line with slope
, see Figure 1.2 .
Herdan's law.
Figure 1.2 Herdan's law for Shakespeare's First Folio/35 Plays and a random permutation of characters. Source: Author's figure based on the text downloaded from Project Gutenberg ( https://www.gutenberg.org ).
smaller than for Zipf's law ( 1.1 ). In particular, the number of word types is smaller in natural texts than in unigram texts.
In spite of many existing mathematical explanations of Zipf's and Herdan's laws, we should be also aware that the actual reasons for these laws for natural texts can be less obvious than in any idealized mathematical model. For example, words in natural texts differ statistically to “words” in unigram texts. If we compute the histograms of word length, see Figure 1.3 , we can see that words in natural texts are quite differently distributed than “words” in unigram texts. In particular, for words in natural texts, we obtain a power‐law tail, whereas for “words” in unigram texts, we obtain an exponential tail. Hence, we may conclude that Zipf's law for words in natural texts is qualitatively a different phenomenon than Zipf's law for “words” in unigram texts. In particular, Zipf's law for natural language may require a distinct explanation. Another important phenomenon, which cannot be ignored, is a gradual change of Zipf's law exponent from
for ranks roughly smaller than
to
for ranks roughly larger than
, as discovered by Ferrer‐i‐Cancho and Solé ( 2001 ) and later confirmed by Montemurro and Zanette ( 2002 ). Thus, we may still think that Zipf's law combined with the special distribution of word length can be really a pattern that distinguishes natural texts language from “inanimate processes.”
Histograms of word length.
Figure 1.3 Histograms of word length for Shakespeare's First Folio/35 Plays and a random permutation of characters. Source: Author's figure based on the text downloaded from Project Gutenberg ( https://www.gutenberg.org ).
letters (or phonemes) on the fundamental level, then we may obtain a simpler statistical description of language.
This question is not obvious at all! In particular, both sentences and words can be some phenomena emerging from some simpler statistical rules acting on the most fundamental level of language description, the level of letters or phonemes. Whereas linguists prefer to discuss units with a meaning, such as morphemes, words, or sentences, the number of these units can be in principle countably infinite or at least very large, so it is unlikely that we obtain a finite or at least a reasonably compact statistical model of language if we treat these high‐level units as primitive units. In contrast, for random texts consisting of finitely many distinct symbols, such as letters or phonemes, we can use a bunch of nice theoretical results from probability and information theory. So we are given a certain advantage in the beginning.
1.4 Markov and Finite‐State Processes
The atomic view of natural texts as being sequences of relatively few distinct meaningless symbols is well known to linguists but too trivial for them to consider it a sufficient description of language. Linguists usually express justified interest in where the meaning of text comes from, and for various reasons, prefer to work with meaningful units, such as morphemes, words, or sentences. However, following the quotation from Zipf ( 1935 ) in Section 1.1 , we suppose that meaning cannot be captured by the marginal distribution of words or other text units, but it emerges from their linear interaction – the order of symbols, which is neither purely random nor purely deterministic. The question arises whether we can describe a statistical order of meaningless symbols that necessarily leads to emergence of somehow understood meaningfulness for sufficiently long texts, i.e. strings of these symbols.
In Section 1.3 , we have introduced the concept of a unigram text, i.e. a random text obtained from a given text by permuting its characters at random. In fact, it is not the only possible way of introducing randomness into text generation. There are infinitely many mathematically admissible schemes – so many different ones that it is nontrivial to single out those realistic. To begin, in this section, we will consider a sequence of Markov processes, which imitate a given text by allowing for more and more statistical dependence among the consecutive letters. By the end of this section, we will also consider a generalization of Markov processes, called hidden Markov processes. There exist also radically different processes, which are neither Markov nor hidden Markov, to be discussed in further sections.
Suppose such that
(1.3)
(1.4)
(1.5)
Additionally, a probability distribution
is called stationary if
(1.6)
There are infinitely many possible probability distributions, also stationary ones. The essence of statistical language modeling lies in picking up the probability distribution that resembles natural language the most.
The simplest probability distribution on strings is obtained when we assume that all symbols in the alphabet
are sampled independently with equal probabilities,
(1.7)
where
(1.8)
Probability model ( 1.7 ) will be called the uniform distribution. It is easy to check that the uniform distribution is stationary.
In general, probabilities
need not satisfy conditions ( 1.7 ) and ( 1.8 ). Suppose that we have some particular text that we want to imitate, which we will denote as
. The stationary frequency of a substring
in text
is
(1.9)
where we will assume a periodic condition
for
and
. Subsequently, we will define the empirical distribution
(1.10)
It is easy to check that the empirical distribution is also stationary.
Having the empirical distribution, we can also define a ladder of Markov processes, as envisaged by Markov ( 1913 ) and Shannon ( 1948 ). The first step is the Markov process of order 0, which reads
(1.11)
This model has the advantage that the probabilities of individual symbols
are equal to the relative frequencies of individual symbols
in the imitated text
.
Continuing the sequence of the Markov processes, we have the Markov process of order 1,
(1.12)
And in general, we have the Markov processes of orders
,
(1.13)
In general, for the Markov process of order
, probabilities of tuples
are equal to relative frequencies of these tuples in the imitated text
.
Markov processes
for any order
are stationary. Quantity
(1.14)
is called the transition probability of the Markov process of order
. The probability of a string according to the Markov process of order
can be also written as a product of transition probabilities,
(1.15)
Markov processes also called
‐gram models in computational linguistics (Jelinek, 1997 ; Manning and Schütze, 1999 ) provide a baseline for computer generation of texts. To write a computer program that generates a random text according to the probability distribution ( 1.13 ), we need a function of the transition probability
called the cumulative distribution function. To construct this function, we impose a linear order on symbols in the alphabet
, i.e. we assume that the alphabet is an ordered list
. Then the cumulative distribution function is defined as
(1.16)
Subsequently, , then the random variable
(1.17)
assumes value
with probability
. Thus, if we can use a built‐in function
that returns a real pseudorandom number from the uniform distribution on the range
, then an algorithm for generating a random text according to the probability distribution ( 1.13 ) may look like Algorithm 1.
Now, as it was already done by Shannon ( 1948 ), we will present several examples of random texts generated by the above algorithm. The imitated text is Gulliver's Travels (Swift, 1726 ). The text was downloaded from the Project Gutenberg ( https://www.gutenberg.org ), and it includes a copyright license, a fragment of which appears in the generation of order 15.
-
Order 0:
emp cf harat tm a,nosaei adsuh,iethlraheernnHcergapn ,,Rtc hevi.lak eedooutam t,ptotb slpcteemdM n astv r :hebte rodeea tyw,Ide -
Order 1:
oooh,ranhmirtaet ai rnete nhthp etoadtn dtayGfn p n smsa;nhnoje ehsteo tnhtd eduvhirersmaeifhlt,ernmw d ,ob; ohlpoknoo,g iruglicl -
Order 2:
he f f y, aly f ig peangure paf I pose t anitomade N an'snveders shio this sutss then ct thud ldong me go t, heasis, thopron s hoft -
Order 3:
e cossin to hationt this preast the purs, for; an lar eated cough my tre amplaw not she knes, to myse comand nes ing ory thar -
Order 4:
had not publight of highs. The his a pairst Ported. It withould sever. Howereforged, into livenole I come as ple a bodigns was -
Order 5:
gone of kissed the which I have my box; but the words in this I could been lookingdom formatical grass, and paratify hind I -
Order 10:
ct gratefully and humbly conceive, in justice to the same manner, and wherein I spent fifteen hundred carpenters, who were indeed sensible, will, on this country-house, about the eBook refund and replacement or Refund" described, was a very faithful memory, that these nurses ever presume to entertainment to the royal -
Order 15:
tenberg, you can always email directly to: Michael S. Hart. Project Gutenberg eBooks are often created from several nations; that our ship was staunch, and able to struggle no longer, I found myself so listless and desponding, that I really began to imagine myself dwindled many degrees below my usual size. Nothing
As we can see, Markov processes of lower orders cannot learn the concept of a word, whereas Markov processes of higher orders are able to memorize and chain at random some longer chunks of the imitated text, but they ignore any global intended meaning and purpose. When the order of a Markov process exceeds the length of the longest repeated substring in the imitated text, the process is able only to generate the imitated text repeatedly.
Judging by the above simulations of Markov processes, we may suppose that natural language is a non‐Markovian probability distribution, i.e. it is not Markov of any finite order. In the following sections, we will provide some harder evidence in favor of this claim. At this moment, let us simply note that there exist quite many probability distributions which are non‐Markovian. For instance, we may consider a hidden Markov process. A stationary hidden Markov process is a probability distribution of the form
(1.18)
where
(1.19)
is a stationary Markov process of order 1 and so‐called emission probabilities
satisfy
(1.20)
(1.21)
For a hidden Markov process, entities
are called hidden states in contrast to entities
being called emitted symbols. In general, the alphabet of hidden states
may be countably infinite. If the alphabet of hidden states
is finite, then distribution ( 1.18 ) is called a finite‐state process. In particular, any Markov process ( 1.13 ) with a finite alphabet of emitted symbols
can be written as a finite‐state process. However, the number of hidden states grows exponentially with the order of the represented Markov process.
Finite‐state processes were a standard tool for statistical natural language modeling in computational linguistics in 1990s and 2000s until they were replaced by artificial neural networks, which turned out to yield much more accurate models, such as GPT‐2 mentioned in Section 1.1 (Radford et al., 2019 ). Originally, finite‐state processes were introduced into computational linguistics by engineers working on speech recognition (Jelinek, 1997 ). Finite‐state processes can model quite complex statistical dependencies in texts while being easy enough to train given enough data.
In this book, we would like to argue that finite‐state processes may be insufficient as models of natural language. This idea, confirmed by the present success of neural network models, is far from new. It dates back to a famous debate between Skinner ( 1957 ), Chomsky ( 1956 , 1957 , 1959 ), and Chomsky and Miller ( 1959 ). Skinner was a psychologist believing that finite‐state processes, with a sufficiently large number of hidden states, can account for human language behavior. In contrast, Chomsky showed that if the syntax of sentences of human languages is described by a context‐free grammar, then natural language cannot be adequately described by finite‐state formal languages or processes. Chomsky thought that rejecting finite‐state processes means eradicating any probability models from linguistic considerations. This reasoning turns out to be a fallacy in view of contemporary successes of statistical models of language based on artificial neural networks.
A certain idea why Chomsky supposed that context‐free grammars are incompatible with probability models may be that it is not so trivial to incorporate a hierarchical structure into a stationary distribution on strings. Quite early in computational linguistics, some probabilistic context‐free grammar (PCFGs) also called branching processes were discovered (Harris, 1963 ; Miller and O'Sullivan, 1992 ; Chi and Geman, 1998 ). It should be noted, however, that PCFGs do not define a stationary distribution on strings since they construct a finite hierarchical structure in a top‐down fashion, which results in defining discrete probabilities over finite trees. In contrast, in Section 11.4 , we will exhibit a class of random hierarchical association (RHA) processes, which constitute a stationary variation on the theme of context‐free grammar. RHA processes build an infinite hierarchical structure in an unbounded bottom‐up fashion, which results in defining a stationary probability measure over infinite sequences, as will be partly explained in Section 1.5 .
Another important point is that Chomsky's argument against finite‐state models did not appeal to statistical properties of texts written by humans but only to our perception of grammaticality of particular sentences. In contrast, in the following sections, we will seek for some statistical properties of natural texts that can be used to disprove the finite‐state hypothesis. As we will see in Section 1.7 , there is a parameter of a stationary distribution called excess entropy which is finite for finite‐state processes but can be infinite for other probability distributions and natural language in particular, as will be argued in the following sections. Moreover, in Section 1.13 , we will see that a power‐law logarithmic growth of a simple statistic called the maximal repetition, observed for natural language, also excludes a large subclass of hidden Markov processes as potential statistical models of language.
1.5 More General Stochastic Processes
In Section 1.4 , we have introduced the notion of a probability distribution on texts of arbitrary finite lengths. In this section, we would like to sketch a more general theory of Chapters and 4. We apply the basic notations stated before this chapter.
For a set
, which will be called the event space, let
denote the set of all subsets (i.e. the power set) of
. For a class of subsets
, let
denote the generated
‐field, i.e. the smallest algebra of subsets of
which contains all elements of class
and is closed under complements and countable unions. Now for a finite alphabet
, we define a few generated
‐fields. First, let
be the set of all subsets of
. Second, for
or
, let us introduce projections
(1.22)
which map an infinite sequence to a symbol on a particular position
in that sequence. Having these projections, third, we introduce cylinder sets
(1.23)
which are simply the sets of infinite sequences whose
th symbol belongs to a particular set
. Consequently, fourth, we define the
‐field generated by the class of cylinder sets,
(1.24)
Now, for an arbitrary set
, let
be a generated
‐field. A probability measure
is a function that satisfies the following axioms:
-
1.
for disjoint
, -
2.
for disjoint
and
, -
3.
for
, -
4.
.
Triple
is called a probability space. In the context of probability spaces, sets
are called events, whereas functions
are called random variables. Some examples of random variables are projections
defined in ( 1.22 ). Collections of random variables, such as
, are called stochastic processes. Generalizing the notation for cylinder sets, for a random variable
, we also write
(1.25)
(1.26)
and when
, then we say that
holds almost surely or, synonymically, that
holds for almost all
. Using these notations, we also define the expectation of a discrete as
(1.27)
Having made these preparations, we can state two important results. First, if a probability distribution
on strings satisfies axioms ( 1.3 )–( 1.5 ), then according to the Kolmogorov process theorem (Theorem 2.7), there exists a unique probability space
such that
(1.28)
Second, for stationary probability distributions, there is some further symmetry. Namely, if a probability distribution
on strings satisfies axioms ( 1.3 )–( 1.6 ), then there exists a unique probability space
such that
(1.29)
for any offset
. The intuitive meaning of all these technicalities is simple. A finite sequence of random variables
corresponds to a random text generated by the probability distribution
.
Some natural questions we may ask are whether we can infer the probability distribution
from a random text
with a sufficiently large probability, according to the probability measure
. The answer is positive for stationary ergodic probability distributions, which are a subset of stationary probability distributions.
There are several equivalent characterizations of ergodic probability distributions. The simplest is as follows. A stationary probability distribution
is ergodic if and only if we cannot decompose it as
(1.30)
where
are two different stationary distributions, and
are some prior probabilities independent of
. This definition can be difficult to verify for a concrete probability distribution
. But, as shown in Gray ( 2009 , lemma 7.15), see Theorem 4.9, a stationary probability distribution
is ergodic if and only if
(1.31)
for all strings
and
. In particular, it follows that a stationary
th order Markov process is ergodic if
or if the transition probability ( 1.14 ) satisfies inequality
for a constant
. The third equivalent characterization of stationary ergodic distributions is given by the Birkhoff ergodic theorem (Birkhoff, 1932 ), see Theorem 4.6. According to this theorem, a stationary probability , we have
(1.32)
In plain words, for an ergodic process, the relative frequency of any string
in the infinite sequence
is equal to the probability
for almost every sequence
.
What happens for stationary distributions which are not ergodic? In fact, there is a version of the Birkhoff ergodic theorem for stationary nonergodic distributions. Namely, in that case, there exists a function
such that
(1.33)
and
as a function of
is a stationary ergodic probability distribution for almost all sequences
. We can interpret function
as a random stationary ergodic probability distribution on the probability space
. In particular, when we use a stationary nonergodic distribution to generate an infinitely long random text, then the relative frequency of any string in this text exists almost surely and is described by a certain random stationary ergodic distribution.
1.6 Two Interpretations of Probability
Here is a convenient place to discuss two distinct interpretations of probability and their links with statistical language modeling and computation. According to axioms ( 1.3 )–( 1.5 ), we have a very large freedom of defining probability distributions. Most of such distributions are very irregular and uncomputable, in the sense that there is no finite computer program which computes function
with an arbitrary precision. Consequently, do we expect that natural language should be described by a computable probability distribution? To answer this question, let us recall that there are two ways of interpreting probability, frequentist and Bayesian. We will show that they yield different answers.
Seen from a frequentist perspective, probabilities are limiting relative frequencies of events in the infinite empirical data, like in the setting of the Birkhoff ergodic theorem. Let us suppose that the empirical language data were generated by an arbitrary nonergodic stationary probability distribution. Then according to the Birkhoff ergodic theorem ( 1.33 ), relative frequencies
constitute a random stationary ergodic distribution. It is a mathematical fact that there are uncountably many stationary ergodic distributions, out of which there are only countably . Thus, according to the frequentist interpretation, natural language should be likely described by an ergodic and uncomputable probability distribution.
A different result follows if we adopt the Bayesian interpretation. According to the Bayesian views, probabilities are some subjective expectations of agents that interact with an unknown environment and learn from their past experiences. We may perceive human beings also as Bayesian agents constantly updating their subjective expectations during conversations and other actions. We may also suppose that the subjective expectations of humans are a computable function of their previous experiences, i.e. the conditional probability
should be a computable function. Thus, according to the Bayesian interpretation, natural language should be likely described by a computable probability distribution, but this distribution need not be ergodic, or even stationary.
Assuming stationarity, however, the Birkhoff ergodic theorem prompts a way to reconcile the Bayesian and the frequentist views. These two competing views are just two different perspectives onto a single reality. Simply speaking, there may exist a computable, nonergodic, and maybe also stationary Bayesian probability distribution
that describes the subjective expectations of humans, given their previous experiences. Moreover, if humans act randomly as suggested by these expectations, then the resulting outcome of their random utterances
may give rise to an uncomputable frequentist ergodic distribution
sampled from the computable Bayesian nonergodic distribution
. In some sense, both the Bayesian distribution
and the frequentist distribution
express some information about natural language.
Let us also note that the difference between the Bayesian distribution
and the frequentist distribution
is a probabilistic version of the distinction between the internalized language (I‐language) and the externalized language (E‐language) made by Chomsky ( 1986 ). The I‐language is the natural language operationalized by human minds, whereas the E‐language is the natural language observable in texts. In particular, the language operationalized by human minds can be a sort of a conditional probability function – or rather, a finite algorithmic description thereof, whereas the language observable in texts can be the empirical distribution of strings in the collection of all texts, which need not have a finite description.
Like Chomsky, we suppose that the preferred goal of scientific research in human language should be inferring the I‐language, as represented by the hypothetical computable Bayesian distribution
, rather than inferring the E‐language, as represented by the hypothetical uncomputable frequentist distribution would be somewhat similar to the universal grammar instantiated with random binary parameters – though the important difference to Chomsky's ideas is that we do not assume a priori that the total number of random binary parameters can be upper bounded.
The challenge for so redefined Chomskyan program is that the only input for our scientific inference are empirical data being just a section of the infinite sequence
, and we would like to make a more intelligent use of them than simply estimating the relative frequencies
. We should admit that it is not completely clear yet what this more intelligent use of data is exactly.
1.7 Insights from Information Theory
Information theory is another useful tool in the analysis of discrete stochastic processes. The founding concept of this theory is the amount of information contained in an object, such as a binary string or a random variable. The intuition is that the amount of information in an object is equal to the degree of unpredictability of this object, given some prior object. It is important to note that when measuring the information content we cannot get rid of this prior object, i.e. the amount of information is always relative to something. Formally, there are two standard ways of measuring the amount of information: one, the Shannon entropy (Shannon, 1948 , 1951 ) – to be treated half‐formally in this section, is relative to a probability distribution, whereas another, the Kolmogorov complexity (Solomonoff, 1964 ; Kolmogorov, 1965 ) – to be treated half‐formally in Section 1.10 , is relative to a universal computer. The material from this section will be developed fully formally in Section 3.4 and Chapters 5 and 7 . We will now sketch the most important ideas.
A discrete probability distribution
on a countable set
is a function such that
for each
and
(1.34)
In contrast, a discrete semidistribution (or an incomplete distribution)
on a countable set
is a function such that
for each
and
(1.35)
There are . One is the Shannon entropy
(1.36)
introduced by Shannon ( 1948 ), and another is the Kullback–Leibler (KL) divergence
(1.37)
introduced by Kullback and Leibler ( 1951 ). We have
and
.
If we take the binary logarithms in the respective definitions, the Shannon entropy and the KL divergence can be related to coding and lossless data compression. A prefix‐free set
is a set of binary strings such that for any
condition
implies
for any string
. The intuition behind this concept is that the mapping between a list of strings
, where
, and the concatenation of strings
is one‐to‐one if
is a prefix‐free set. Simply speaking, given a concatenation of strings
, we can identify which strings
were concatenated if
belong to a prefix‐free set. We recall that we denote the length of a binary string
for
. An important property of prefix‐free sets is the Kraft inequality
(1.38)
which holds if set
is prefix‐free (McMillan, 1956 ).
A prefix‐free code is a one‐to‐one mapping
, where
is a certain prefix‐free set. Plugging the semidistribution
into inequality
, we obtain for any prefix‐free code
that
(1.39)
Thus, the expected length of any prefix‐free code is greater than the Shannon entropy of the distribution. Conversely, for a given probability distribution
, there exists a code
, called the Shannon–Fano code, such that
(Shannon, 1948 ). In this case, we obtain
(1.40)
Thus, the Shannon entropy is roughly the minimal expected length of a prefix‐free code on a countable domain
.
The Shannon entropy can be developed further. For a discrete random variable
, we define the Shannon entropy
for
. The following functionals of random variables
,
, and
are also useful:
-
conditional entropy
(1.41)
-
mutual information
(1.42)
-
conditional mutual information
(1.43)
The above definitions make sense only if the respective entropies are finite, but they can be generalized for arbitrary random variables (Gelfand et al., 1956 ; Dobrushin, 1959 ; Pinsker, 1964 ; Wyner, 1978 ), see Section 5.3 . In the general case, we have
.
Subsequently, we will sketch how information theory can be applied to the analysis of stationary stochastic processes, for the formal exposition see Sections 5.2 and 5.4. Suppose that we have a stationary probability distribution
on strings, i.e. one which satisfies axioms ( 1.3 )–( 1.6 ). The Shannon entropy of a block of length
is the function
, i.e.
(1.44)
It can be easily shown that for a stationary probability distribution, the Shannon block entropy is positive, growing, and concave since
(1.45)
(1.46)
(1.47)
In view of the above inequalities, there exists limit
(1.48)
called the entropy rate. The entropy rate is the conditional entropy of a single symbol, given the infinite past, i.e.
(1.49)
Intuitively, the entropy rate is an amount of limiting unpredictability of the stationary process
per single symbol.
There is also another asymptotic measure
(1.50)
called . Hence, the excess entropy is the mutual information between the infinite past and the infinite future, i.e.
(1.51)
Intuitively, the excess entropy is an asymptotic amount of memory stored by the stationary process
.
The entropy rate and the excess entropy can be easily evaluated for Markov processes. For example, for the
‐th order Markov process ( 1.13 ), we have
(1.52)
(1.53)
(1.54)
where
is the cardinality of
, i.e. the number of elements in set
. For hidden Markov processes, there are no so neat formulas, but in general, for the hidden Markov distribution ( 1.18 ), we have
(1.55)
(1.56)
In particular, the excess entropy is finite for finite‐state processes, but it can be infinite for a hidden Markov process if the alphabet of hidden states
is infinite, see Travers and Crutchfield ( 2014 ) and Dębowski ( 2014 ). Moreover, as we will argue in Sections 1.9 and 1.11 , the natural language, if it can be modeled by a stationary distribution, probably has the infinite excess entropy.
1.8 Estimation of Entropy Rate
It turns out that the entropy rate of a stationary ergodic distribution can be effectively estimated. That is, there is a computable procedure which, given a sufficiently long text generated by any stationary ergodic distribution, returns the estimate of the distribution's entropy rate with an arbitrary precision. This result is a consequence of the Birkhoff ergodic theorem. There are a few particular estimators of the entropy rate (Ziv and Lempel, 1977 ; Ryabko, 1984 ; Cleary and Witten, 1984 ; Kontoyiannis, 1997 ; Kontoyiannis et al., 1998 ; Kieffer and Yang, 2000 ). In this section, we will present a certain procedure of entropy estimation called the PPM algorithm. The acronym PPM stands for Prediction by Partial Matching . A rigorous development of this section will be done in Section 6.3 .
We remind that we denote strings of symbols
. Moreover, we will only consider strings over a finite alphabet, say,
. In as
(1.57)
The PPM probabilities were subsequently developed by Krichevsky and Trofimov ( 1981 ), Ryabko ( 1984 ), and Cleary and Witten ( 1984 ) in slightly different versions. Our version is as follows. For
and
, we put
(1.58)
Quantity
is called the conditional PPM probability of order
of symbol
, given string
. Next, we put
(1.59)
Quantity
is called the PPM probability of order
of string
. Finally, we put
(1.60)
Quantity
is called the (total) PPM probability of the string
.
As we can see, quantity
is a sort of an incremental Markov model of string
of order
, where the imitated string is
itself. In contrast, the total probability
is a mixture of such Markov models for all finite orders. In general, quantities
and
are probability distributions on strings, but they are neither stationary nor ergodic. Let us observe that by definition,
for
. Thus, the total PPM probability can be effectively computed, i.e. the summation in definition ( 1.60 ) can be rewritten as a finite sum
(1.61)
For practical use, this sum can be further truncated using the concept of maximal repetition, to be introduced in Section 1.13 .
The PPM probability satisfies axioms ( 1.3 )–( 1.5 ). Hence, if
is a random string drawn from a stochastic process
, then by positivity of KL divergence, we obtain
(1.62)
where
is the entropy of block
. This inequality can be further strengthened. If
is a string drawn from a stationary ergodic distribution
, then statistic
divided by the string length
consistently estimates the entropy rate of the process
. Precisely, equality
(1.63)
holds for any stationary ergodic process
over a finite alphabet. A similar equality is true in expectation, namely, equality
(1.64)
holds for any stationary (also nonergodic) process
over a finite alphabet, see Section 6.3 . Hence, PPM probability can be turned into a universal data compression algorithm when we apply the Shannon–Fano coding, mentioned in Section 1.7 .
With its capacity to correctly estimate the entropy rate of any ergodic component of a stationary process, the PPM probability can be treated a baseline statistical model of the subjective I‐language. As requested for the statistical I‐language model, the PPM probability is computable, and it converges in some precise sense to the frequentist E‐language model if we have a sufficiently large amount of data. The problem is that the PPM algorithm is not particularly intelligent, namely, it computes the relative frequencies of symbols in quite simple contexts. Probably, a better statistical model of the subjective I‐language can be proposed which in some other precise sense converges to the objective E‐language faster than the PPM algorithm while taking into account some specific universal statistical patterns of natural language.
It is interesting to analyze what kind of claims about natural texts may be drawn from running the PPM algorithm on texts in natural language. In fact, in Section 1.12 , we will apply the PPM algorithm to partly verify Hilberg's hypothesis about natural language, which will be introduced in Section 1.9 .
1.9 Entropy of Natural Language
Long before the discovery of the PPM algorithm, Claude Elwood Shannon, the father of information theory, proposed the first experimental method of estimating conditional entropy
of natural language (Shannon, 1951 ). According to this method, we show randomly sampled text fragments of length
characters to human subjects, and we ask them to guess the next character of each text fragment. For each text fragment, the subjects may make one or more guessing attempts by proposing a single character until they name the correct character. Assuming that texts in natural language can be modeled by a stochastic process, the best strategy for doing such guessing is according to diminishing conditional probabilities. Moreover, if the subjects use this strategy, we can obtain an estimate of the conditional entropy from the empirical distribution of guessing attempts needed by the subjects.
Let us write
when character
has the
th largest conditional probability
, given a fixed text fragment
. In the optimal guessing strategy, we first guess the character
, then
, then
, and so on. Let
be the probability of guessing the correct character in
attempts, given a text fragment of length
in this guessing strategy. Shannon ( 1951 ) showed that
(1.65)
and consequently,
(1.66)
Let
be the number of times that the actual human subjects needed
attempts to guess the next character, given text fragments of length
characters. Assuming that human subjects are good enough in guessing the right characters, we may try to estimate
(1.67)
and consequently plug this estimate into formula ( 1.66 ) to obtain a sandwich bound for the conditional entropy. Shannon ( 1951 ) performed such an experiment indeed and published a famous graph presenting some upper and lower estimates of conditional entropy
. The text guessed by the human subjects was Jefferson the Virginian , a novel by Dumas Malone. The graph, reproduced here in Figure 1.4 , suggests that the entropy rate
of an average text in English equals approximately 1 bit per letter. Many later studies reported similar estimates of entropy rate, also for other human languages, using various methods (Cover and King, 1978 ; Brown et al., 1992 ; Kontoyiannis, 1997 ; Kontoyiannis et al., 1998 ; Grassberger, 2002 ; Behr et al., 2003 ; Takahira et al., 2016 ; Coupé et al., 2019 ).
,
(1.68)
where
can be arbitrarily large. We will call this statement Hilberg's hypothesis. Let us stress that the empirical basis on which this hypothesis is founded is quite weak. Relationship ( 1.68 ) is a very rough interpolation of the data points of Shannon ( 1951 ), so its extrapolation power should not be believed too much unless we have a good reason to do so. In Figure 1.4 , we have fitted two three‐parameter functions for the upper and the lower bound, respectively, and we have obtained that
(1.69)
for block lengths
.
Estimates of conditional entropy for English.
Figure 1.4 Graphs of the bounds for conditional entropy
for English in function of the block length
. The lower and the upper bounds are approximated by functions
and
respectively. Source: Author's figure based on the data points taken from Shannon ( 1951 ). Functions fitted by the author.
Let us inspect some consequences of Hilberg's hypothesis. First of all, let us notice that Hilberg's hypothesis ( 1.68 ) implies a power‐law growth of block entropy,
(1.70)
As such, Hilberg's hypothesis ( 1.68 ) implies that the entropy rate
equals zero. Is it then a plausible statement? As it can be shown, using tools of measure‐theoretic probability, condition
is equivalent to each random letter
being almost surely a measurable function of the infinite past
. That is, Hilberg's hypothesis implies asymptotic determinism of human utterances. Such determinism may seem unlikely. For this reason, a few researchers who noticed Hilberg's paper (Ebeling and Nicolis, 1991 , 1992 ; Ebeling and Pöschel, 1994 ; Bialek et al., 2001a , b ; Crutchfield and Feldman, 2003 ) tended to suppose that the conditional entropy of natural language satisfies rather relationship
(1.71)
Relationship ( 1.71 ) will be called the relaxed Hilberg hypothesis. It is exactly the kind of a functional dependence that we have fitted in ( 1.69 ), and it seems to describe Shannon's data slightly better that the original hypothesis by Hilberg.
The relaxed Hilberg hypothesis is also harder to reject on an rational basis. On the contrary, it has some potentially interesting properties. Let us observe first that relationship ( 1.71 ) implies
(1.72)
If we . Confronting this hypothesis with a statement made in Section 1.7 , we may conclude that natural language could not be adequately described by finite‐state processes, which have a finite excess entropy. Therefore, the relaxed Hilberg hypothesis, if it is true, strengthens our earlier hypothesis that natural language is non‐Markovian and brings us back to the argument of Chomsky ( 1957 ) against Skinner ( 1957 ), where the validity of finite‐state processes as models for natural language has been challenged as well. Recent independent computational experiments also show more directly that the excess entropy of natural language is very large at least, see Hahn and Futrell ( 2019 ) and Braverman et al. ( 2019 ).
The relaxed Hilberg hypothesis says something more than that natural language is not a finite‐state process. An approximate power‐law growth of the difference
is the essential feature of the relaxed Hilberg hypothesis. Let us introduce some formal concept which will be used later. To capture the approximate power‐law growth of an arbitrary function
, we will denote the so called Hilberg exponent
(1.73)
where
for
and
for
, see Dębowski ( 2018a ). We observe that for the exact power‐law growth
with
, we have
. More generally, the Hilberg exponent captures an asymptotic power‐law growth of the sequence. Let us define
. It can be also shown that if there exists limit
then
(1.74)
with the equality if
, see Section 8.1 .
A corollary of the above is that for the block entropy
, the entropy rate
, and the block mutual information
, we may equivalently define the Hilberg exponent
(1.75)
Thus, the relaxed Hilberg hypothesis for natural language can be stated as
(1.76)
In Section 1.11 , we will discuss some linguistically motivated stochastic processes which satisfy this relationship. Prior to this, in Section 1.10 , we need to introduce some basic concepts from algorithmic information theory – another approach to defining the amount of information.
1.10 Algorithmic Information Theory
As we Chapter.
Formally, an arbitrary computer can be imagined as some mapping
with the intended meaning that given a binary program
the computer prints out in finite time some object
if
or it does not halt (i.e. it does not terminate computations) if
. The Kolmogorov complexity
of an object
is defined as the length of the shortest program that makes the computer print out object
, i.e.
(1.77)
By
, we denote some fixed program such that
and
.
A universal computer is a computer that can simulate any other computer, i.e. a computer
is called universal if for each computer
, there exists a string
such that
for all strings
. It turns out that for universal computers functions
and
are not computable. Nevertheless, if we make a restriction that the universal computer
halts only on programs forming a prefix‐free set, i.e. if the set
(1.78)
is prefix‐free, then formally, there exists an uncomputable prefix‐free code
such that
. In this case,
is called the prefix‐free Kolmogorov complexity.
A rational function
is called recursive if there exists a computer which, given an argument
computes the value
in finite time. Subsequently, a probability distribution
on a countable domain
will be called recursive if the function
is recursive. Moreover, if a distribution
is recursive, then we can write a program that given an algorithmic definition of
and a Shannon–Fano code word
computes the string
. The latter implies
(1.79)
for some constant
, where
is the prefix‐free Kolmogorov complexity of the distribution
itself, i.e. the length of the algorithmic definition of
, not to be confused with Shannon entropy
. In this way, we obtain the inequality
(1.80)
Thus, the expected prefix‐free Kolmogorov complexity is roughly equal to the Shannon entropy, if the algorithmic definition of the distribution is not too long.
Like the Shannon entropy, the Kolmogorov complexity can be developed further. In the following, we will assume that
is a universal computer with
being a prefix‐free set and consequently
is the prefix‐free Kolmogorov complexity. The following functions of finite sequences
,
, and
can be defined:
-
conditional Kolmogorov complexity
, which satisfies (1.81)
-
algorithmic mutual information
(1.82)
-
conditional algorithmic mutual information
(1.83)
These definitions make sense only if the sequences are finite, but they can be partly generalized for infinite sequences, see later in this book. In general, we have
, where
is a finite constant (Gács, 1974 ; Chaitin, 1975a ), see Section 7.3 .
Subsequently, we would like to show that the prefix‐free Kolmogorov complexity sheds some light onto the concept of randomness of a particular infinite sequence of binary digits. We will say that an infinite sequence of binary random variables
is a fair‐coin process if
(1.84)
for all strings
. In other words,
is a sequence of independent random variables uniformly distributed on set
. In contrast, an infinite sequence of particular bits, i.e. binary digits
is called algorithmically incompressible when there exists a constant
such that
(1.85)
for all
. It turns out that a fair‐coin process
is algorithmically incompressible almost surely so, informally speaking, algorithmically incompressible sequences are typical realizations of a fair‐coin process
. Moreover, by the Schnorr theorem, to be discussed in Section 7.5 , all individual algorithmically incompressible sequences are indistinguishable from typical fair coin tosses by means of effective statistical tests of randomness. In other words, all algorithmically incompressible sequences are perfectly unpredictable using computable prediction schemes.
It is instructive to exhibit some particular example of an algorithmically incompressible sequence, or, equivalently an algorithmically incompressible number. We is algorithmically incompressible. The halting probability, introduced by Chaitin ( 1975a ) and traditionally denoted as
(1.86)
is an important example of an algorithmically incompressible number. To clearly differentiate number
from the even more traditional notation
for the event space of probability spaces, we will always write the former in boldface. We will also denote the binary expansion of the halting probability as
. Number
has a kind of magical and paradoxical properties, which will be proved in Section 7.4 :
-
1. First of all,
is algorithmically incompressible. -
2. Yet, given the first
bits
, we can decide which mathematical statement written down using less than
binary symbols is true or false. -
3. Yet, given a formal inference system, i.e. a finite set of axioms and inference rules, we cannot deduce values of bits
for
much larger than the length of the formal inference system, when written down using binary symbols. In other words, if we do formal deduction only, we will never learn distant bits
. -
4. Yet, there exists a simple recursive function
such that (1.87)
This is possible since convergence of
to
is very slow.
Thus, number
is a kind of an elusive oracle or philosophers' stone. As we can see, algorithmically incompressible sequences, though being in some sense random, may represent some highly useful information, and the amount of useful information can be in principle infinite.
1.11 Descriptions of a Random World
This section starts with a philosophical excursion. Its aim is to provide a reason why natural language should have a strictly positive Hilberg exponent
. As mentioned in Section 1.1 , the reason may be the existence of an infinite immutable truth which constitutes a very complex statistic inferrable from both the approximately infinite past and the approximately infinite future of our usage of language. As we will see in Section 1.12 , the existence of the infinite immutable truth, as reflected in our utterances, causes a measurable effect. In particular, we may obtain inequality
in a natural way. The exact mathematical model will be developed in Sections 8.3 and 8.4 .
To begin our considerations, we may suppose that the typical purpose of a text in natural language is to refer to some external reality that is not the text itself. In texts written by mathematicians, this external reality is the Platonic world of mathematical ideas, whereas in texts written by ordinary people, this external reality is the physical world entailing space, time, and matter, or some partly imaginary versions thereof. The crucial idea is that in either case this external reality seems very complex and quite slowly evolving. In some approximation, we may treat it as infinitely complex and immutable. That is, to describe this reality completely, we may need practically an infinite sequence of bits, i.e. digits that take values of 0 or 1 – and this sequence practically does not change in time.
We can ask whether such a necessarily infinite immutable sequence that describes some external reality exists indeed. In the domain of pure mathematics, we can be sure that the answer is positive. It turns out so since what we are asking for is some sort of meaningful infinite randomness, where randomness is understood as algorithmic incompressibility. Thus, the binary expansion of number
, introduced in Section 1.10 , provides an example of the desired random, but meaningful object. As we have stated in Section 1.10 , number
stores in the most compact way the information which mathematical statements are true and which are false. Moreover,
is incompressible and its binary expansion is infinitely long.
However, we have mentioned that number
cannot be fully learned in a deductive way. If we exercise mathematics in a formal way, as it is usually done, then we prove theorems starting from a finite number of axioms and applying a finite number of inference rules. Given such a formal system, i.e. a finite set of axioms and inference rules, we cannot deduce the values of bits
for
much larger than the length of the formal system when written down using binary symbols. In other words, if we do formal deduction only, we will never learn distant bits
. Thus, number
is some nice guiding model of an infinitely complex meaningful reality, but it is too elusive.
How about the physical world described in nonmathematical texts? Here we do not only do formal deduction, but we also make direct observations or experiments. To some extent, we can simply observe what appears to be the present state of the world and report that state in language utterances. Is there an infinite amount of immutable elementary truths in what we can observe?
To be very concrete, let us imagine, for example, a very long row of chairs randomly painted white or black. The state of this row, if the row is practically infinite, could be described by an algorithmically incompressible collection of bits
, indexed by indices
, where
(1.88)
If these .
Can we really paint an infinite row of chairs at random or, rather, observe such an infinite row? Physicists claim that there is some inherent randomness of the physical world at the microscopic level – be it ruled by the classical or quantum mechanics. Still, can an infinite amount of algorithmic randomness be extracted from our physical reality? Honestly, we do not know it for sure. However, let us put on the hats of applied mathematicians and let us assume that algorithmic randomness can be extracted and reported in texts.
Formally, we will assume that we have a probability space
and some random variables. We will suppose that the state of the physical world can be partly described by an algorithmically incompressible collection of bits
, indexed by indices
belonging to the infinite set of natural numbers
. These algorithmically incompressible bits
will be called facts. Facts should be contrasted with texts. Whereas in our formal model, the collection of facts
represents some truth which is immutable and ingraspable in its infinity, texts are random strings of symbols
which refer to some particular facts. Formally, symbols
will be assumed to be random variables taking values in some countable set
, i.e.
. If
is finite, we can imagine that
is the set of letters or characters. If
is infinite, we can imagine that
is the set of words or propositions. We will also assume that random symbols
can be organized as a two‐sided infinite sequence
.
What is then a plausible relationship between facts and texts? We suppose that texts allow us to learn some particular facts. That is, there is a fixed method of interpreting finite texts to infer what some particular facts are. Formally, such a method of interpretation can be represented as a recursive function
, where
would be our guess of fact
based on text
with
if we do not know the answer. Now, what kind of facts can be called general? General facts seem to sound like immutable facts. Hence, some idea we can initially agree upon is as follows. Given any sufficiently long text
and a fact
, the probability of inferring this fact correctly should approach 1 when the text length tends to infinity,
(1.89)
If the collection .
Let us observe that condition ( 1.89 ) is trivially satisfied for any stochastic process
for recursive function
and the algorithmically incompressible sequence
, where
is the recursive function that satisfies condition ( 1.87 ). In spite of this negative result, the power‐law growth of the number of inferrable algorithmically incompressible facts corresponds itself to some nontrivial property. For a recursive function
and an algorithmically incompressible sequence
, the set of initial facts inferrable from a finite text
will be defined as
(1.90)
In other words, we have
, where
is the largest number such that
for all
. Subsequently, we will call a stationary process
perigraphic if the Hilberg exponent of the expectation of cardinality of
is strictly positive,
(1.91)
for a recursive function
and an algorithmically incompressible sequence of binary digits
.
It can be shown, see Section 8.3 , that perigraphic processes are a nontrivial concept since any perigraphic process
has a nonrecursive distribution. Moreover, we can present a very simple example of a perigraphic process, which comes under an umbrella of so‐called Santa Fe processes, discovered by the author of this book during a visit at the Santa Fe Institute in August 2002 – hence comes their name. The first published mention of Santa Fe processes appears in Dębowski ( 2009 , 2011 ). Let
be a sequence of probabilistically independent random variables assuming values in natural numbers with a power‐law distribution,
(1.92)
This power law resembles Zipf's law ( 1.1 ). Besides process
, we choose an arbitrary algorithmically incompressible sequence of binary digits
. To fix our attention, we may choose
but this is not necessary. Subsequently, the individual Zipfian Santa Fe process with an exponent
is a sequence
, where
(1.93)
are pairs of a random number
and the fact
with the corresponding index.
It can be shown, see Section 8.3 , that the individual Zipfian Santa Fe process is ergodic. Moreover, it is perigraphic since condition
(1.94)
Holds, for example for the recursive guessing function
(1.95)
Simply speaking, function
returns 0 or 1 when an unambiguous value of the second constituent can be read off from pairs
and returns 2 when there is some ambiguity.
In the individual Zipfian Santa Fe processes, the relationship between a text and the pool of facts is quite simple. Imagine that the units
of a text are not atomic, but they have some structure. Namely, they are statements of form “the
th fact equals
”' and more specifically, they only make true assertions “the
th fact equals
.” To write down such a statement formally, we need two pieces of information – the index
and the value
. In fact, the relationship between the form and the meaning of a statement in Santa Fe processes is the simplest possible: every statement is nothing but a pair
. Subsequently, if we admit some randomness of statements, namely, if statement
is a random variable, then index
should be replaced by a random variable
. Resuming, our process
should take form ( 1.93 ). Finally, let us observe that descriptions
can be interpreted as logically consistent. That is, if two statements
and
describe bits of the same address (
), then they always assert the same value (
).
Although the relationship between texts and facts for natural texts is much more complex, the individual Zipfian Santa Fe process seems to capture some intuition about the natural language. When we write a text, we have a strong feeling that we articulate a sequence of propositions that refer to some external reality. The construction of an individual Zipfian Santa Fe process suggests that we may split our propositions
into two parts: a static infinite description of some fixed external reality
and a narration process
that describes the flow of our attention. We cannot exclude the possibility that the narration process
in natural language is quite a complex process, also depending on the state of the external reality
.
As we have mentioned, any perigraphic process has a nonrecursive distribution
. If we want to model the subjective I‐language rather than the objective E‐language, as discussed in the conclusion of Section 1.5 , we should likely consider recursive distributions only. Thus, in the first move, we should replace the .
It can be shown, see Section 8.3 , that a stationary process
is not ergodic if and only if there exists a single random variable
which is not constant and satisfies condition
(1.96)
for any offset
. For this reason, a stationary process
which satisfies condition ( 1.96 ) for a fair‐coin process
for any offset
and any index
will be called strongly nonergodic. There is also a more abstract equivalent definition of strongly nonergodic processes, which will be introduced in Section 5.6.
A simple example of a strongly nonergodic process can be formed by modifying the individual Zipfian Santa Fe process. Let process
be as before and let process
be probabilistically independent from process
. Then the process
defined as
(1.97)
is strongly nonergodic for the same guessing function ( 1.95 ). We will call this process the mixture Zipfian Santa Fe process. In contrast to the individual Zipfian Santa Fe processes, the probability distribution of the mixture Zipfian Santa Fe process is recursive. Moreover, if we define the set of initial independent probabilistic facts inferrable from a finite text
as
(1.98)
then for the mixture Zipfian Santa Fe, we obtain
(1.99)
see Section 8.3 .
For the mixture Zipfian Santa Fe process, there is an alternative interpretation of process
. As stated in Section 1.5 , a stationary process is ergodic if the relative frequencies of all finite substrings in the infinite text generated by the process converge in the long run with probability one to some constants – the probabilities of the respective substrings. Now, some basic linguistic intuition suggests that this convergence can be very slow for natural language. As Yaglom and Yaglom ( 1983 ) have observed, there is hardly any book that contains a large number of occurrences of both word lemma and word love . In particular, counting relative frequencies of key words such as lemma or love , we can recognize the topic of a book, be it a mathematical monograph or a love story. Said more abstractly, there is a variation of topics of finite texts in natural language, and these topics can be effectively distinguished by counting relative frequencies of certain words or using some other effective computational methods.
In particular, function
can be seen as an effective procedure of recognizing the
th bit of some abstract description of a particular topic of an arbitrary text
. Consequently, we can imagine the process
in the mixture Zipfian Santa Fe process as an abstract description of one of a continuum of possible persistent topics of an infinitely long random text
. The random topic interpretation of process
in the mixture Zipfian Santa Fe process may be more appealing to some readers than immutable algorithmically incompressible truth
in the individual Zipfian Santa Fe process. But, in fact, the practical difference between the continuum of persistent random topics and the single immutable algorithmically incompressible truth is not so large. Once we are given a particular realization of an infinitely long text
, we cannot observe any other realization of processes
and
and the realization of process
is algorithmically incompressible almost surely.
Resuming this section, our investigations of the meaning of texts and its relationship to the concept of immutable infinitely complex physical truth turn out to be closely linked to the distinction between recursive and nonrecursive processes, as well as, ergodic and nonergodic processes. However, our perspective is a complete opposite of the usual mathematical point of view. Whereas mathematicians are mostly interested in recursive and ergodic probability measures, being simpler and more regular cases, nonrecursive and nonergodic processes seem far more natural for investigation of human language.
1.12 Facts and Words Related
It may be baffling to some readers that the existence of immutable infinitely complex reality that is repeatedly referred in a text causes a measurable effect. In this section, we will present some results about stationary processes, which we call the theorems about facts and words. These propositions state that the expected number of independent probabilistic or algorithmic facts inferrable from the text drawn from a stationary process is roughly less than the expected number of distinct word‐like substrings detectable in the text via the PPM algorithm introduced in Section 1.8 . In particular, an asymptotic power law growth of the number of inferrable probabilistic or algorithmic facts implies an asymptotic power law growth of the number of word‐like substrings, which is a statistically measurable effect, closely related to Herdan's law introduced in Section 1.3 and Hilberg's hypothesis introduced in Section 1.9 . The rigorous development of the results of this section will be done in Sections 6.5 and 8.4 .
Continuing the notations from Section 1.8 , we define the largest of probabilities
for a fixed string
as
(1.100)
where we put
, and we define the PPM order of a string
as
(1.101)
Since
for
, the PPM order is less than the string length, i.e.
(1.102)
Hence, we obtain the inequality
(1.103)
Thus,
is roughly equal to the probability
. We can effectively think of the PPM probability as the maximal probability
.
In fact, the PPM order is a semiconsistent estimator of the Markov order of the process. That is, for any ergodic
th order Markov process, the PPM order
is almost surely greater than
for block length
tending to infinity, whereas for non‐Markovian processes, the PPM order
diverges to infinity.
For
, the set of distinct substrings of length
in string
is
(1.104)
The cardinality of set
as a function of substring length
is called the subword complexity of string
(de Luca, 1999 ). The readers working in quantitative linguistics will notice that the quotient
is the type‐token ratio for substrings of length
(Baayen, 2001 ). In the following, let us apply the concept of the PPM order to define some special set of substrings of an arbitrary string
. The set of distinct PPM words detected in
will be defined as the set
for the substring length
, i.e.
(1.105)
Now we may write down the theorems about facts and words. These theorems come in several versions and date back to Dębowski ( 2006 , 2011 ). Here we present two relatively strong versions, one for probabilistic facts and one for algorithmic facts, be a stationary strongly nonergodic process over a finite alphabet. The probabilistic theorem about facts and words reads
(1.106)
In contrast, the algorithmic theorem about facts and words is a bit more general. Let
be an arbitrary stationary process over a finite alphabet. We have inequalities
(1.107)
Resuming, the theorems about facts and words state that the expected number of independent inferrable facts is roughly less than the block Shannon or algorithmic mutual information, and this is roughly less than the expected number of distinct PPM words increased by the PPM order. The precise statements are expressed using the Hilberg exponents for the respective quantities.
From what we have written so far, it follows that if relationship
(1.108)
holds true, then the stochastic process is not only strongly nonergodic, but it also has the infinite excess entropy, and consequently, it cannot be a finite‐state process. As we will see in Section 11.2 , there are some counterexamples of processes which do not satisfy condition ( 1.108 ) but satisfy a power‐law growth of the block mutual information and hence satisfy condition
(1.109)
Such counterexamples can be obtained by modifying the construction of Santa Fe processes by allowing the described reality to slowly evolve. Hence, whereas we can deduce condition ( 1.109 ) from condition ( 1.108 ), the implication in the opposite direction does hold. However, we may ask an open question whether the Hilberg exponent for the block algorithmic mutual information is in general close to the Hilberg exponent for the number of PPM words. We doubt that this is true, but understanding why this may fail could give some insight into what these two statistics do measure.
The PPM order.
Figure 1.5 The PPM order
versus the input length
for Shakespeare's First Folio/35 Plays and a random permutation of the text's characters. Considered is the alphabet size
(26 letters and the space). The straight line is the regression
. Source: Author's figure based on the text downloaded from Project Gutenberg ( https://www.gutenberg.org ).
The PPM vocabulary.
Figure 1.6 The cardinality of the PPM vocabulary
versus the input length
for Shakespeare's First Folio/35 Plays and a random permutation of the text's characters. Considered is the alphabet size
(26 letters and the space). The straight line is the regression
. Source: Author's figure based on the text downloaded from Project Gutenberg ( https://www.gutenberg.org ).
an asymptotic power law growth of the number of distinct PPM words. In other words, if natural language is a perigraphic process and the number of PPM words is close to the number of orthographic words, then the theorems about facts and words provide an explanation of both Hilberg's relaxed hypothesis discussed in Section 1.9 and Herdan's law discussed in Section 1.3 .
In Figures 1.5 and 1.6 , we have presented the data for Shakespeare's First Folio/35 Plays, our diagnostic text in natural language, and a random permutation of its characters. For the text in natural language, we seem to have indeed a stepwise power law growth of the number of distinct PPM words with an exponent close to 0.8, i.e.
(1.110)
In view of the results of Takahira et al. ( 2016 ), who used the PPM algorithm to compress very large corpora of texts in natural language (
), we may suppose that relationship ( 1.110 ) holds for human languages more generally. In contrast, for the random permutation of characters, we obtain
(1.111)
Seeing the striking difference between observations ( 1.111 ) and ( 1.110 ), we may be tempted to suppose that the number of inferrable probabilistic or algorithmic facts for texts in natural language also obeys a power‐law growth. Formally speaking, however, we cannot deduce condition ( 1.108 ) from observing mere relationship ( 1.110 ). The implication goes in the reverse direction.
1.13 Repetitions and Entropies
As we have tried to argue so far, some important statistical regularities of natural texts, such as Herdan's and Zipf' laws as well as the relaxed Hilberg hypothesis, may be a direct consequence of relatively abstract semantic constraints, simply speaking, that natural texts convey some meaning. Basically, we can identify a few distinct modes of a text being meaningful, such as
- 1. Meaningfulness by a consistent description of an external or imagined reality.
- 2. Meaningfulness by an internal cohesion of the narration or the discourse.
- 3. Meaningfulness by an effective control of an external reality (in particular, reaching or striving toward some goal).
The first mode of meaningfulness can be roughly captured by the notion of a perigraphic process and power laws for facts, mutual information, and words, as developed in Sections 1.11 and 1.12 . The second and the third modes of meaningfulness matter as well, but they are harder to quantify and measure, especially if we are given only texts as an object of our investigation.
In fact, we may suppose that the third mode of meaningfulness is a primary one in natural language, see Rączaszek‐Leonardi ( 2012 ). In particular, our need to describe any imagined reality or to conduct a cohesive narration or discourse is a mere derivative of our need to control the external reality. Here, let us also observe that, to effectively control the external reality, we do not need too accurate descriptions thereof, since we can force some facts about the external reality to be true by the power of our will. In any case, understanding of the third mode of meaningfulness posits a distinction between the external and the imagined realities and demands studying complicated interactions between them, see Seth ( 2019 ). This setting seems much harder to model, especially if we assume that the external and the imagined realities are far from being random, so let us intentionally not consider this setting here.
Focusing back on the second mode of meaningfulness, we may wonder whether this mode implies the first mode in some sense. We have an intuition that mere internal cohesion of a narration or a discourse might directly imply that there is a sort of an imagined reality, unbounded or potentially infinite, that is described by this internally cohesive discourse. From a mathematical point of view, this problem becomes quite interesting since we could measure the internal cohesion of a text using different statistics than for the consistent description of external or imagined realities, and we may ask whether we can prove that these two distinct statistics are related.
Some intuitive measure of text cohesion can be various statistics pertaining to string repetitions. In fact, concerning string repetitions, there seems to be yet another quantitative law of language which is strongly specific for natural texts as contrasted with unigram texts. This law concerns the maximal repetition. For a given string, the maximal repetition is the maximal length of a substring that is repeated in the string on possibly overlapping positions. For example, the maximal repetition of string “How much wood would a woodchuck chuck if a woodchuck could chuck wood?” is the length of the repeated string “ a woodchuck c,” which is 14.
Put formally, the maximal repetition of a string
is defined as
(1.112)
Given (Kolpakov and Kucherov, 1999a , b ). Thus, we can easily compute the maximal repetition for empirical data.
Maximal repetition.
Figure 1.7 Maximal repetition for Shakespeare's First Folio/35 Plays and a random permutation of characters. To smooth the results, we sampled blocks
of length
from both sources at random assuming a uniform probability distribution on
, where
is the investigated text. For each length
, only one block
was sampled. The fitted model is
for Shakespeare and
for the random permutation. Source: Author's figure based on the text downloaded from Project Gutenberg ( https://www.gutenberg.org ).
For empirical data, being some fixed text
, an interesting Figure, we can make is a plot of the maximal repetition
with respect to the substring length
for randomly selected substrings
of the text
. In particular, we can make such plots for both texts in natural language and some unigram texts, see Figure 1.7 . In the plots, we can observe the approximate empirical law
(1.113)
where
for unigram texts and
for natural texts. In other words, the growth of maximal repetition is logarithmic for unigram texts and power‐law logarithmic for natural texts. In fact, the power‐law logarithmic growth of maximal repetition for natural texts seems to be text‐independent and is almost the same for three languages: English, German, and French (Dębowski, 2012b , 2015b ). Hence, the rate of growth of maximal repetition may be a language universal, and it may distinguish natural texts from unigram texts.
Consequently, we may ask what the empirical law ( 1.113 ) can tell us about the stochastic mechanism of natural language generation. We consider it an important open problem whether the power‐law logarithmic growth of maximal repetition ( 1.113 ) with
implies in a sufficiently general case that the generating stochastic process with a strictly positive Shannon entropy rate has an infinite excess entropy and obeys a sort of the relaxed Hilberg condition ( 1.71 ). We suppose that the power‐law logarithmic growth of maximal repetition is a more fundamental property of natural language than the power‐law growth of the number of words, i.e. Herdan's law, or the power‐law growth of the number of described facts, i.e. natural language being a perigraphic process. In particular, the infinitely complex world repeatedly described in natural texts may emerge in the limit as a mere result of human tendency to imitate previously encountered chunks of text. We cannot exclude the possibility that the world described by texts is by large dynamically created by texts themselves.
Our rigorous results concerning the above hypothesis are modest so far. As we will show now, the power‐law logarithmic growth of maximal repetition can be linked to a power‐law growth of some generalized block entropies and vanishing of some generalized entropy rates. Let us observe that scaling law ( 1.113 ) can be written in a somewhat fancy form as
(1.114)
for some generalized block entropy function
and its related entropy power
. In other words, if the Hilberg exponent of function
for some generalized entropy
is bounded away from zero and infinity, then the power‐law logarithmic growth of maximal repetition is equivalent to the power‐law growth of the generalized entropy function
and implies in particular that the generalized entropy rate
is zero.
This idea is fruitful to some extent since we can consider different generalized entropies and prove some bounds for the Hilberg exponent of random variables
in case when
is a stationary process. In particular, if
is a growing function of block length
, then the Hilberg exponent of random variable
is almost surely constant for a stationary ergodic process. Moreover, in the case of a stationary ergodic process, we obtain two important bounds, a lower and an upper one,
(1.115)
(1.116)
where is the power of the conditional block min‐entropy
(1.117)
Since the difference between entropies
and
can be arbitrarily large, we can ask if the gap between the lower and the upper bound for the maximal repetition can be narrowed down. The natural next step is to consider other generalized entropies, such as the Rényi entropies (Rényi, 1961 ). As we will see later in Chapter 9 , this idea can be partly carried out.
In this way, using the scaling of maximal repetition, we can show that natural language is not a typical finite‐state process. The reasoning goes as follows. Processes that satisfy condition
(1.118)
for a
are called finite energy. In fact, finite energy processes include typical hidden Markov processes. For clarity, consider a hidden Markov probability distribution ( 1.18 ). We will prove in Section 11.1 that this distribution is finite energy if the emission probabilities satisfy
(1.119)
Thus, we can formally demonstrate that natural language is not a hidden Markov process which satisfies condition ( 1.119 ). Simply, as we have stated in this paragraph, these hidden Markov processes are finite energy, whereas by bound ( 1.116 ), the power‐law logarithmic growth of maximal repetition ( 1.113 ) with an exponent
excludes the class of finite energy processes.
As we will show in Section 11.1 , also the Santa Fe processes, introduced in Section 1.11 , are finite energy and at least for that reason, they cannot be adequate models of natural language. In Section 11.4 , we will exhibit another class of processes, called RHA processes, which satisfy the power‐law logarithmic growth of maximal repetition ( 1.113 ) with an exponent
. Unfortunately, in the considered particular examples, these processes have zero Shannon entropy rate,
, so they cannot be adequate models of natural language, either. It is an open problem how to construct a more linguistically motivated class of stochastic processes.
However, before we reject the particular examples of RHA processes discussed in Section 11.4 , we should note that these processes satisfy not only the power‐law logarithmic growth of maximal repetition ( 1.113 ) but also the power‐law growth of mutual information, as stated in the relaxed Hilberg hypothesis ( 1.71 ). Moreover, these particular processes are nonergodic, probably they are strongly nonergodic, and we suppose that their ergodic components are also perigraphic almost surely. Thus, the general model of RHA processes can be possibly used further to mathematically study the relationship between the meaningfulness by a consistent description and the meaningfulness by an internal cohesion, as sketched in the beginning of this section. Such a study is also left as an open field of future research.
1.14 Decay of Correlations
The relaxed Hilberg hypothesis ( 1.71 ) and the power‐law logarithmic growth of maximal repetition ( 1.113 ) with an exponent
suggest that natural texts should be described by a stochastic process with a sort of a long memory. Thus, conditions ( 1.71 ) and ( 1.113 ) should be compared with some more standard ways of defining long memory in stochastic processes, such as those discussed in time series analysis. In time series analysis, which mostly deals with real‐valued stochastic processes, a pretty standard way of defining stationary processes with a long‐range dependence is through their autocorrelation function. The autocorrelation function of a real‐valued stationary process
is defined as
(1.120)
where we use the correlation coefficient
(1.121)
The process is usually called to exhibit the long‐range dependence if the series of autocorrelations does not converge,
, or simplifying somewhat the phenomenology, if
for an exponent
(Beran, 1994 ). This property has a relatively simple expression in the information‐theoretic terms if the process is Gaussian. Namely, for complex‐valued Gaussian processes, the Shannon mutual information between two random variables separated by
positions can be expressed as
(1.122)
In other words, we have a long‐range dependence if there holds
for a parameter
.
In contrast, we can observe by ( 1.47 ) and ( 1.50 ) that process
has an infinite excess entropy if
, or simplifying somewhat the phenomenology, if
for a parameter
. We may further observe that for a complex‐valued Gaussian process
, we have
(1.123)
where use the partial autocorrelation function
(1.124)
with the .
It is also a fortunate case of the Gaussian processes that the autocorrelation functions
and
remain in a one‐to‐one correspondence given by the Durbin–Levinson algorithm. Using this relationship, it can be shown in particular that we have equality
(1.125)
if the series of absolute partial autocorrelations converges,
(Dębowski, 2007a ). Hence, in the latter case, the series of plain correlations also converges,
. In other words, simplifying somewhat phenomenology, if a stationary Gaussian process
exhibits the long‐range dependence, then usually it has the infinite excess entropy. The converse need not be true.
We can ask whether these results can be generalized to a discrete‐valued stationary process
. Unfortunately, in this case, we do not have an analogue of the Durbin–Levinson algorithm. Consequently, the mutual information
and the conditional mutual information
cannot be simply related. But by the Jensen inequality (Theorem 3.14) and inequality
, we may bound both by
(1.126)
(1.127)
Assume that process
is an irreducible and aperiodic Markov process of order 1 over a finite alphabet. As shown, for example by Lin and Tegmark ( 2017 ), in this case, there exist constants
and
such that
(1.128)
Hence, mutual information
for these processes decays exponentially with separation
. The same holds also for finite‐state processes with an irreducible and aperiodic underlying Markov process, by the data‐processing inequality (i.e. claim 6 of Theorem 5.8). Moreover, for any Markov process of order 1, we have
and thus
. Hence, the conditional mutual information satisfies
for these processes.
In contrast, Lin and Tegmark ( 2017 ) observed empirically that for samples of natural language texts, we have probably a power law decay of the unconditional mutual information between two symbols,
(1.129)
Moreover, if the relaxed Hilberg hypothesis ( 1.71 ) is true, then the conditional mutual information between two symbols satisfies
(1.130)
It would be interesting to learn what kind of stochastic processes can satisfy condition ( 1.129 ). As argued in the previous paragraph, such processes cannot be typical finite‐state processes, which provides another argument that natural language cannot be modeled properly by a finite‐state process. Searching for a simple example of a process that satisfies condition ( 1.129 ), Lin and Tegmark ( 2017 ) proposed a half‐formal construction which resembles somewhat the RHA processes, which we have mentioned in the previous section and which will be discussed in detail in Section 11.4 . Showing that RHA processes actually satisfy condition ( 1.129 ) is left as an open problem.
1.15 Recapitulation
In the preceding sections, we have seen that natural texts, i.e. texts written in natural language, exhibit certain statistical regularities. Some of these regularities are similar to statistical regularities of unigram texts, i.e. random permutations of characters, whereas some are strikingly different. Since the question of statistical language modeling is of a general importance for artificial intelligence, as mathematicians, we may ask whether we can explicitly construct stochastic processes which obey some of these language‐specific statistical regularities. We should ask, as well, whether our constructions may be useful to engineers who seek for better statistical models of language to implement them in computers. With these questions in mind, in this book, we will develop some theory and construct toy examples of stochastic processes. We hope to draw interest of professional mathematicians as primary intended readers of this book.
In our search for statistical models of natural texts, in this book, we will confine ourselves to processes that satisfy the Birkhoff ergodic theorem, i.e. we will consider only stationary and asymptotically mean stationary processes. Honestly, we do not know whether the process of human culture or the stream of consciousness can be reasonably modeled by such processes, and we cannot exclude that the real probability model of language may lie out of these classes. Nevertheless, we think that stationary and asymptotically mean stationary processes can capture a few linguistically relevant phenomena, and they offer a good starting point to investigate what is mathematically possible. The edifice of science is extended by considering simpler cases first.
Another question is that we will be considering mostly computable processes. As we have said, there is a tension between the frequentist and the Bayesian interpretations of probability. According to the frequentist view, language should be likely modeled by an ergodic and uncomputable process, whereas according to the Bayesian view, language should be likely modeled by a recursive but nonergodic process. We have seen that the distinction between the frequentist and the Bayesian interpretation corresponds approximately to the distinction between the E‐language and the I‐language made by Noam Chomsky. These two interpretations of probability are just two different perspectives onto the single phenomenon of language, as formally reconciled by the Birkhoff ergodic theorem. While doing the scientific research, we should primarily focus on the I‐language and look for a finite computable description of this phenomenon. As Wilhelm von Humboldt, a German linguist, once put it, human language should make infinite use of finite means ( unendlicher Gebrauch von endlichen Mitteln in German) (von Humboldt, 1836 ).
A book about statistical language modeling could be written in a few different styles, touching different topics and particular problems. This book tries to match pure mathematics and quantitative linguistics since we suppose that a good statistical theory of language should be capable of explaining some formally defined quantitative laws obeyed by natural texts. In this chapter, we have identified four such quantitative phenomena which are likely satisfied by texts in natural language:
-
The strictly positive Shannon entropy rate,
(1.131)
-
The power‐law growth of block mutual information,
(1.132)
-
The power‐law logarithmic growth of maximal repetition,
(1.133)
-
The power‐law decay of mutual information between individual symbols,
(1.134)
In this book, we will mostly analyze condition ( 1.132 ) – via the theorems about facts and words – and, to less extent, condition ( 1.133 ) – via Rényi entropies. We will not try to analyze condition ( 1.134 ), although it may be somehow connected to the previous two. We suppose that provided some additional assumptions such as ergodicity and condition ( 1.131 ) hold, conditions related to ( 1.133 ) and ( 1.134 ) may imply a condition related to ( 1.132 ).
We consider proving these implications an important open problem. We suppose that the power‐law logarithmic growth of maximal repetition ( 1.133 ) and the power‐law decay of mutual information between individual symbols ( 1.134 ) are more fundamental properties of natural language than the power‐law growth of block mutual information ( 1.132 ). These more fundamental laws may also possibly imply the power‐law growth of the number of distinct words, i.e. Herdan's law, and the power‐law growth of the number of described facts, i.e. the natural language being a perigraphic process. In other words, the unbounded or potentially infinite imagined reality repeatedly described in texts created by humans may emerge as a sole result of our tendency to repeat previously generated chunks of text. We cannot either exclude that the reality described in texts is actively created by texts themselves.
Of course, it is desirable to exhibit some linguistically motivated examples of processes that satisfy conditions ( 1.131 ), ( 1.132 ), ( 1.133 ), and ( 1.134 ). Our two toy examples of processes, to be analyzed in the final Chapter 11 , are Santa Fe processes, already introduced in Section 1.11 , and RHA processes, mentioned in Section 1.13 . The Santa Fe processes obey conditions ( 1.131 ) and ( 1.132 ) but do not obey ( 1.133 ). In contrast, the RHA processes satisfy both conditions ( 1.132 ) and ( 1.133 ) but do not satisfy ( 1.131 ). Moreover, as sketched by Lin and Tegmark ( 2017 ), condition ( 1.134 ) may be satisfied by processes resembling the RHA processes. Thus, we still do not have an example of a process that satisfies all four conditions ( 1.131 )–( 1.134 ).
There are a few other open problems that we came across when writing this book. The list of all open problems that we have formulated has been presented at the end of the book. Many of these problems can be stated in a relatively simple way, which indicates that there is still much to do at the interface of natural language and stochastic processes. We hope that this domain will attract more researchers among mathematicians. This book should not be treated as a final report but rather as an inspiration for further work. Moreover, although the book is relatively self‐contained, we are quite sure that we have not gathered here all relevant background material for future research.
this invention had employed all his thoughts from his youth; that he had emptied the whole vocabulary into his frame, and made the strictest computation of the general proportion there is in books between the numbers of particles, nouns, and verbs, and other parts of speech.