E VALUATING D ISTRIBUTIONAL D ISTORTION IN N EURAL L ANGUAGE M ODELING
Anonymous authors
Paper under double-blind review
A BSTRACT
A fundamental characteristic of natural language is the high rate at which speakers produce novel expressions.
Because of this novelty, a heavy-tail of rare events accounts for a signiﬁcant amount of the total probability mass of distributions in language (Baayen, 2001).
Standard language modeling metrics such as perplexity quantify performance of language models (LM) in aggregate.
As a result, we have relatively little understanding of whether neural LMs accurately estimate the probability of sequences in this heavy-tail of rare events.
To address this gap, we develop a controlled evaluation scheme which uses generative models trained on natural data as artiﬁcial languages from which we can exactly compute sequence probabilities.
Training LMs on generations from these artiﬁcial languages, we compare the sequence-level probability estimates given by LMs to the true probabilities in the target language.
Our experiments reveal that LSTM and Transformer language models (i) systematically underestimate the probability of sequences drawn from the target language, and (ii) do so more severely for lessprobable sequences.
Investigating where this probability mass went, (iii) we ﬁnd that LMs tend to overestimate the probability of ill-formed (perturbed) sequences.
In addition, we ﬁnd that this underestimation behaviour (iv) is weakened, but not eliminated by greater amounts of training data, and (v) is exacerbated for target distributions with lower entropy.
I NTRODUCTION
Natural language is fundamentally creative—speakers and listeners frequently produce and comprehend sentences which have never been produced before (Fodor, 1975; Fodor & Pylyshyn, 1988;
Chomsky, 1975, 1955).
As a side-effect of this property, distributions in natural language are characterized by a heavy-tail of individually improbable events which collectively account for a signiﬁcant amount of the total probability mass of the distribution (Khmaladze, 1988; Baayen, 2001).
Precisely approximating this large number of rare events is one of the foundational challenges for models of natural language (Good, 1953; Jelinek, 1980; Katz, 1987; Kneser & Ney, 1995;
Wood et al., 2011;
Goldwater et al., 2011).
Autoregressive neural language models (Bengio et al., 2003; Mikolov et al., 2013; Radford et al., 2019) attempt to do so by decomposing the probability of an event (a sequence) into a series of conditional distributions, each parameterized by a shared neural network.
Recently, a growing body work has sought to understand how these language models (LM) ﬁt the distribution of a language beyond standard measures such as perplexity .
Meister & Cotterell (2021), for example, investigated the statistical tendencies of the distribution deﬁned by neural LMs, whereas Kulikov et al.
(2021) explored whether they adequately capture the modes of the distribution they attempt to model.
At the same time, increased focus has been given to performance on rare or novel events in the data distribution, both for models of natural language (Lent et al., 2021; Dudy & Bedrick, 2020; Oren et al., 2019) and neural models more generally (see, for example Sagawa et al., 2020; D’souza et al., 2021;
Chen et al., 2021; Blevins & Zettlemoyer, 2020; Czarnowska et al., 2019; Horn & Perona, 2017; Ouyang et al., 2016; Bengio, 2015; Zhu et al., 2014).
Neither of these branches of work, however, has explored instance-level LM performance on rare sequences in the distribution.
As a result, we have relatively little understanding of how neural LMs approximate sequences in the heavy-tail characteristic of natural language.
In this work, we introduce a controlled methodology to explore how LMs estimate the probability of sequences in the heavy-tail of the distribution.
Our instance-level evaluation scheme explicitly compares the target probability distribution of the language to the distribution deﬁned by the LM.
Since the true distribution of any natural language is in practice unknown, we use a Transformer
LM trained on natural data as a generative model to deﬁne target artiﬁcial languages for which we can exactly compute sequence probabilities.
Training LSTM and Transformer LMs on sequences sampled from these target artiﬁcial languages, we compare the sequence-level probability estimates given by neural LMs to the target probabilities in the language.
By controlling the entropy of the generative model’s conditional distributions, we create a set of artiﬁcial languages with varying distributional properties, and analyze how LM estimation behaviour is modulated by the properties of the target distribution.
Our experiments uncover the extent to which neural LMs provide a distorted ﬁt of the language they are trained to model.
We ﬁnd that LSTM and Transformer LMs (i) systematically underestimate the probability of sequences drawn from the target language and (ii) do so more when such sequences are rare.
Where did this underestimated probability mass go?
We do not ﬁnd that the underestimation is accompanied by overestimation in the head of distribution.
Rather, we ﬁnd that
LMs tend to (iii) overestimate the probability of rare perturbed (ill-formed) sequences.
Interpreted together, these ﬁndings indicate that on the one hand, neural LMs under-represent well-formed sequences in the tail of the language they attempt to model, and on the other hand, over-represent ill-formed sequences far away from high probability zones in sequence-space.
In addition, we ﬁnd that (iv) greater amounts of training data lessen underestimation but do not eliminate it and that (v) underestimation is exacerbated for target distributions with lower entropy.
B ACKGROUND
We begin by brieﬂy characterizing why distributions with a large number of rare events (LNRE) emerge in natural language, and why these events pose challenges for LMs.
Furthermore, we motivate the need for instance-level evaluation when dealing with a large number of rare events.
Productivity In the context of language production, a language user has the ability to produce, at any given point in their linguistic lifespan, an utterance which they have never produced before.
This creativity is the result of the generative property of productivity , which states that on the basis of ﬁnite linguistic experience, a language user can produce and comprehend an unbounded number of grammatically acceptable utterances (Chomsky, 1975, 1955).
Productive processes induce a distribution which places non-zero probability on unseen events at all practical sample sizes.
Because of this property, many of the distributions in natural language—particularly the distribution over the sequences of a language—are characterized by a heavy-tail of rare events.
LNRE Zone To make explicit the connection between productivity and a heavy-tail of rare events, let P N denote the probability of sampling a novel (previously unseen) event from some distribution after having sampled N events.
Then productivity as described above states that P N > 0 for all sample sizes N that occur in practice.
The range of sample sizes N for which it is the case
that
P N > 0 is known as the LNRE zone (Khmaladze, 1988; Baayen, 2001).
The LNRE zone for natural language appears to be very large, and it seems likely that P N will remain greater than 0 for samples of natural language many orders of magnitude larger than all the data currently available for training LMs.
In the LNRE zone, it is difﬁcult to obtain accurate estimates of the probability of events using straightforward maximum likelihood estimation (MLE).
Accounting for this enormous amount of novelty is thus a central challenge in language modeling.
Language modeling A model M of the language L attempts to deﬁne a distribution p M over variable length sequences x
= ( x 1 , . .
, x | x | ) which closely resembles the true distribution of the language p L .
That is, p M ( x ) ≈ p L ( x ) for all x ∈ Σ ∗ , where Σ denotes the vocabulary of M , and Σ ∗ is the set of all strings of ﬁnite length, known as the Kleene closure of Σ .
In the LNRE zone, this means that a LM must deﬁne a distribution over a support containing a very large set of sequences which have never occurred in a training corpus (or equivalently, have all occurred with frequency 0 ), which take on a very wide array of differing probabilities.
For example, while the sequences x 1 , x 2 ∈ Σ ∗ have likely never occurred in any sample of English, most would agree that x 1 is far more probable than x 2 :
x 1 : The East pond in Parc Lafontaine was ﬁlled to the brim with diet Coke.
x 2 : Certain nak indicate liberationing among theorter codity voters vandalized.
LM Evaluation For a perfect LM of English, we would expect the estimated probabilities of the sequences x 1 and x 2 to match their probabilities under the true distribution p English .
However, since p English and it’s underlying generative process are unknown, it is not possible to explicitly evaluate how closely instance-level probability estimates align.
As a proxy, the mean perplexity of the model on a holdout set of sequences D is typically used:
[Equation]
which measures whether the model, on average, assigns high likelihood to unseen instances.
This measure does not, however, tell us whether instance-level estimates align with their true counterparts, nor is it necessarily indicative of performance on rare, idiosyncratic events in D .
In this way, the lack of access to the ground-truth distribution severely complicates LM evaluation on the heavy-tail of rare sequences in language.
In the following section, we introduce a methodology to overcome these limitations.
L ANGUAGE M ODEL E VALUATION IN THE LNRE Z ONE
[Table]
We propose evaluating language model performance on the heavy-tail of rare events by working with a known probability distribution over sequences.
Speciﬁcally, we train a Transformer LM on sequences sampled from a corpus of natural language to deﬁne a generative model L .
The distribution over sequences induced by a sampling scheme from L , denoted p L , is then our artiﬁcial language .
We expect a model M of this artiﬁcial language to assign probabilities p M ( x ) to sequences x which match the target probabilities p L ( x ) of x under p L .
Here we deﬁne p L using an ancestral sampling scheme with softmax T = 0 . 85 .
One could, for example, deﬁne an artiﬁcial language p L (cid:48) by sampling from the top- k tokens of the distribution deﬁned by L at each time step, or using an ancestral sampling scheme with softmax T = T (cid:48) .
To characterize neural LM behaviour on rare events, we train Transformer and LSTM LMs on data sampled from p L , and compare the instance-level probability estimates given by p M to target probabilities under p L .
We summarize the components of this methodology in Table 1, and overview it in greater detail in the following section.
3. A RTIFICAL L ANGUAGES AS T ARGET D ISTRIBUTIONS
To deﬁne a generative model L , we train a randomly-initialized GPT2-medium on 1.5M sentences sampled from the OpenWebText corpus (Gokaslan & Cohen, 2019).
We set the maximum sequence
[Equation]
“we’re very excited to have the opportunity to help them,” he says.
− 29 .so
what’s going to happen?
−
[Table]
.to
me, the ﬁsheries are in the midst of a global ﬁnancial crisis.
−
[Table]
length to be 128 tokens.
We additionally train a byte-pair-encoding (BPE) tokenizer on this data set with a standard GPT2 vocabulary size of 57,256 tokens.
For simplicity, this tokenizer is used for all models.
Using this generative model L , we deﬁne the target distribution over sequences—the artiﬁcial language—as the distribution induced by an ancestral sampling scheme from L .
Thus, we draw instances x = ( x 1 , . . .
, x | x | ) from our language p L by recursively sampling from the conditional distribution over tokens at each time step: x t ∼ p L ( · | x <t ) where x 0 = BOS and x t = EOS .
All experiments up until Section 4.5 are conducted on the distribution induced by ancestrally sampling from L with softmax temperature T = .
In Section 4.5, we explore the effects of different values of T when sampling from p L .
Table 2 shows three sequences sampled from this distribution.
3. S EQUENCE P ROBABILITY E STIMATION IN THE LNRE Z ONE
Given an artiﬁcial language p L , the task of M —the language model—is to deﬁne a distribution p M whose sequence-level probability estimates closely align with the sequence-level probability estimates given by p L .
We refer to any deviation from this desiderata as model estimation error .
To quantify the model estimation error for a sequence x , we take the difference between the sequence’s log probability under M and its true log probability under L :
[Equation]
This quantity is the log probability ratio, which measures, in log-space, the number of times more or less likely the sequence x is under the language model M .
Note that error ( x ) < 0 indicates that
M underestimates the probability of x , whereas error ( x ) > 0 indicates that M overestimates the probability of x .
In practice, we train M on a set of sequences D train sampled from p L , and compute model estimation error on a separate set of sequences D test sampled from p L .
In all cases, we compute the probability of a sequence x as its chain rule decomposition: p ( x ) =
(cid:81) | x | i =1 p ( x i | x <i ) where x 0 = BOS and x | x | = EOS .
When computing the ground-truth sequence probabilities, we take into account any softmax tempering.
3. N EURAL L ANGUAGE M ODELS
We study the estimation performance of two neural LM architectures: the Transformer (Vaswani et al., 2017) and the LSTM (Melis et al., 2020).
When training either architecture, we halve the learning rate if validation loss increases at the end of an epoch.
For all model sizes, we use a batch size of 128 sequences.
Models with the lowest cross-entropy loss on a withheld validation set are used in experiments unless otherwise mentioned.
GPT2-small & GPT2-medium
We use the Huggingface (Wolf et al., 2020) implementations of
GPT2-small and GPT2-medium (Radford et al., 2019) as representative Transformer LMs.
All model training was done from scratch on two RTX-8000 GPUs with mixed ﬂoating point precision.
We use Adam Optimization with (cid:15) = 1 e − 8 and learning rates α = 5 e − 5 and α = 4 e − 5 for GPT2small and GPT2-medium, respectively.
Since these models are in the same model class as our artiﬁcial target language p L , we expect the task of recovering the ground-truth distribution to be relatively easy compared to the true problem faced in modeling natural language, where both the distribution and the underlying generative process are unknown.
LSTM For the LSTM, we follow the implementation of the baseline LM described in (Hochreiter & Schmidhuber, 1997; Melis et al., 2020).
We use 2 layers and adjust the hidden state and embedding dimension (2048 and 1024, respectively) to be such that the total number of parameters is approximately equal to GPT2-small (110M).
R ESULTS 4. E STIMATION E RROR WITH F IXED D ATA
We begin by exploring model estimation error on a ﬁxed training set D train of 1M sequences sampled from p L .
We ﬁrst train LSTM and GPT models on D train , early-stopping as described above.
Following training, we sample a test set D test of 500,000 sequences from p L , and score each sequence under both the model distribution p M and the true language distribution p L .
From this, we obtain a set of probability estimates: S test = {(cid:104) p L ( x ) , p M ( x ) (cid:105) | x ∈ D test } .
If the model M perfectly models the language L , then for each (cid:104) p L ( x ) , p M ( x ) (cid:105) ∈ S test we would expect p L ( x ) =
p M ( x ) .
Figures 1(A) and 1(B) visualize this relationship with the x - and y -axes denoting the true and model estimated sequence probabilities respectively, and a dashed line representing equality.
To compare probability estimates, we represent the set S test in the form of a joint histogram over this coordinate space.
Histogram bins are shaded based on the number of tuples which lie in the coordinate range they deﬁne.
Importantly, any deviation of this histogram from the identity line indicates that the model distorts the shape of the distribution of the language.
Figures 1(A) and 1(B) provide evidence for distributional distortion in the form of underestimation.
The majority of probability tuples in S test lie to the right of the identity line, indicating that
LSTM and GPT2 models consistently underestimate the probability of sequences sampled from p L .
Furthermore, the distance between the identity line and the probability tuples grows non-linearly as function of the true sequence probability, indicating that underestimation error is more severe for rarer sequences in the language.
We validate both of these observations in the right-most plot of Figure 1, which shows mean estimation error decreasing non-linearly as a function of the target sequences probability.
In addition, comparing underestimation behaviour across model size, we ﬁnd that while GPT2-medium performs slightly better than GPT2-small, these improvements are typically within the range deﬁned by the bootstrapped 95% conﬁdence intervals.
4. E STIMATION E RROR ACROSS T RAINING T IME
To understand the training dynamics underlying the previously reported underestimation, we compute model probability estimates on subsets of D train and D test at the end of each training iteration i .
Once computed, we sort each set of probability
tuples S
( i ) train and S ( i ) test by their target sequence probabilities p L ( x ) , and split the probability tuples into 50 equally-sized bins.
We plot estimation curves in Figure 2: Each curve represents a 50th of the sequences, with darker curves denoting estimation error for sequences with lower target probabilities (rarer sequences).
At any given point, then, the distance between estimation curves represents the degree to which estimation error is dependent on the target probability of the sequence.
Figure 2 left visualizes underestimation error for sequences seen in training.
Around the ﬁfth epoch, estimation error for train sentences converges to zero, that is ( p L ( x ) ≈ p M ( x )) , indicating that
GPT2-medium is able to almost perfectly recover the target probabilities of training sequences no matter their target probability.
At the same time, this convergence happens almost simultaneously for all sequences, indicating that a complete reduction in error during training occurs throughout the entire range of target sequence probabilities.
Figure 2 right visualizes GPT2-medium model’s performance on a separate set of test sequences.
First, unlike for D train , estimation error for D test does not converge to zero, meaning that even when the model has perfectly recovered the target probability of train sequences, the target probabilities for test sequences remain underestimated.
Second, in the case of D train , the difference between estimation curves of different shades converges to zero, indicating that estimation performance becomes uniform across the distribution of train sequences.
We do not see such behaviour in D test .
Instead, the error curves remain at a relatively consistent distance from one another, indicating that the discrepancy in estimation error at different parts of the distribution is unchanging for sequences not seen during training.
4. E STIMATION E RROR BY A MOUNT OF T RAINING D ATA
Our previous experiment trained languages models on a set of 1M sequences.
A plausible explanation for the model’s underestimation behaviour on unseen test sequences is therefore that the language model has not seen enough data.
Here we explore how estimation error varies as a function of the amount of training data.
We train GPT2-medium and an LSTM model in the online “Ideal
World” setting (Nakkiran et al., 2020) by sampling, at the beginning of each training iteration, a fresh set of 500,000 sequences from p L , and training M on this sample.
Doing so for 60 iterations, we obtain LMs which have been trained on 30 million sequences.
We compute model estimation error on D test at the end of each iteration i .
Figure 3 visualizes underestimation error throughout training for GPT2-medium and LSTM language models.
We again split test sequences by their true probability, with darker lines denoting estimation trends for less probable target sequences.
The estimation curves in Figure 3 suggest that while increasing the amount of data in training initially leads to lower estimation error, this reduction eventually asymptotes.
In ﬁgure 3, we visualize the relative change in mean estimation between epochs i − 1 and i .
Relative change in estimation error eventually ﬂuctuates around 0 (minimal change) for the majority of the distribution.
Comparing architectures, we ﬁnd that the Transformer is signiﬁcantly more efﬁcient at reducing mean estimation error throughout the distribution.
4. W HERE DID THE PROBABILITY MASS GO ?
In the previous section, we saw that even when increasing the amount of training data, p M consistently underestimates the probabilities of sequences sampled from the tail of p L .
At the same time, we did not ﬁnd that p M overestimated sequences in the head of p L .
Under the assumption that p M is a proper probability distribution, 4 that is, (cid:80) x ∈ Σ ∗ p M ( x ) = 1 , these ﬁndings suggest that there exists sequences in Σ ∗ whose probability is overestimated by the model.
In this section, we investigate where this probability mass went.
Swap two tokens in
x .
Delete a token from x .
Insert
a token
from Σ at
a position in x
Substitute a token in x
with a token from
Σ
The function PERTURB ( x ) randomly applies one of these perturbations to x .
To do so, we compute model estimation error on perturbed sequences from p L —sequences in Σ ∗ which are increasingly far away from the high-probability zones in p L .
We build a corpus of perturbed sequences by recursively applyingrandom perturbations to each sequence x ∈ D test .
Formally, the set of sequences at perturbation step i can be expressed as: D ( i ) perturbed =
{ PERTURB ( x ) | x ∈ D ( i − 1) perturbed } where
PERTURB ( x ) is a function which returns a novel perturbed version of x , and D (0) perturbed
= D test .
Sequence perturbation operations are shown in Table 3.
While it is possible that these operations produce other well-formed strings, we expect this to be a relatively rare outcome.
We score each of these 15M sequences under both the target generative model p L and the LM p M .
Note that we use as LM the GPT2-medium model from the previous section (trained on 30M sequences).
Figure 4 visualizes GPT2-medium’s mean estimation error for these 15M sequences across two dimensions.
On the x-axis, we plot the target probability of the sequence under p L , and on the yaxis, the number of perturbations performed on the sequence.
For example, the bottom-left corner (1) of Figure 4 visualizes estimation behaviour for rare sequences sampled directly from p L , whereas the top-left corner (2) visualizes estimation error sequences which are equally rare, but which have been perturbed up to 30 times.
Figure 4 offers a nuanced characterization of underestimation behaviour.
The brown area on the bottom of the ﬁgure re-states the underestimation ﬁndings of the previous section.
When increasing the number of perturbations performed, however, we begin entering into a space of sequences which are at ﬁrst well-estimated by p M (the white areas) but then are quickly overestimated by p M (the dark blue areas), conﬁrming that there are indeed sequences in Σ ∗ which are overestimated by the language model.
Furthermore, these ﬁndings suggest that the tail of rare events deﬁned by the language model does not match the tail of the artiﬁcial language—the rare events typical in p L are under-represented in p M in favour of other sequences in Σ ∗ .
See Section A.1 for experiments ﬁnding that random sequences from Σ ∗ are also overestimated by p M .
4. M ODULATING THE S HAPE OF THE T ARGET D ISTRIBUTION
Up to this point, the target artiﬁcial language p L was given as the distribution induced by an ancestral sampling scheme with softmax T = 0 .
85 from the generative model L .
In the previous section, we saw that p M placed excess probability mass on areas in Σ ∗ with low-probability under p L .
Here we modulate the shape of the sequence space deﬁned by p L to investigate how estimation error varies with respect to systematic interventions in the target distribution.
To adjust the way that p L allocates probability mass over Σ ∗ , we control the entropy of the conditional distributions at each generation step t by dividing the pre-softmax logits by a temperature value T .
We visualize the effects of T on the shape of the distribution in the left of Figure 5.
By increasing the value of T , we increase the entropy of the distributions over next tokens, which in turn, spreads probability mass across a larger number of sequences in Σ ∗ .
We deﬁne four artiﬁcial languages with varying T and train GPT2-medium on an ancestral sample of 1M sequences from each of these artiﬁcial languages.
Figure 5 visualizes model estimation error by true sequence probability for each model.
We ﬁnd that models trained on languages with increased entropy perform comparatively better than models trained on low entropy languages.
Estimation error for models trained on languages with greater T is less severe, and this holds throughout nearly all target sequence probabilities.
These results indicate that neural LMs provide a more accurate approximation of target distributions which spread mass more uniformly across Σ ∗ .
R ELATED W ORK
This paper contributes to recent work investigating the properties of the distributions deﬁned by
LMs.
Prior studies have focused on exploring (Takahashi & Tanaka-Ishii, 2019; 2017) and developing frameworks (Meister & Cotterell, 2021) to better understand whether the large-scale statistical 5 Formally, for the i th component of the length K pre-softmax logits x , this operation is given as:
[Equation]
tendencies of natural language, such as Zipf’s law (Zipf, 1949), are captured by LMs.
We take a more ﬁne-grained approach, proposing a methodology which draws off of instance-level evaluation schemes (Zhong et al., 2021) and the experimental control afforded by artiﬁcial corpora (White &
Cotterell, 2021; Papadimitriou & Jurafsky, 2020).
Indeed, closely related to our work is Kulikov et al.
(2021)’s, in which artiﬁcial corpora produced by generative models were used to explore mode recovery in neural language modeling.
Our analysis exploring the overestimation of ill-formed sequences extends previous ﬁndings on locally normalized conditional discriminative models assigning arbitrary probability mass to unlikely sequences (Andor et al., 2016; Goyal et al., 2019), neural LMs assigning high likelihood to sequences with repetitions (Welleck et al., 2020b), the consistency of decoding algorithms (Welleck et al., 2020a), and on machine translation models placing signiﬁcant probability mass on the empty sequence (Stahlberg & Byrne, 2019).
We additionally contribute to the body work seeking to characterize and adapt neural model performance on rare or novel examples and classes (Horn & Perona, 2017; Bengio, 2015).
In the context of language modeling, Lent et al.
(2021) explored performance on under-resourced languages, whereas Oren et al.
(2019) did so on under-represented domains in training corpora.
Focusing on the word frequency distribution, Dudy & Bedrick (2020) found that LMs under-perform when less frequent examples are encountered at test time.
In the classiﬁcation setting, various approaches have been proposed to help alleviate class imbalance in the data distribution, such as data augmentation (Sagawa et al., 2020) or the transfer of knowledge from high-frequency classes to infrequent ones (Ouyang et al., 2016; Zhu et al., 2014; Chen et al., 2021).
Prior to the current neural paradigm (Bengio et al., 2003), multiple approaches have been proposed to deal with the heavy-tail, such as smoothing and back-off approaches in statistical n -grams (Chen & Goodman, 1999) and two-stage Bayesian approaches (Goldwater et al., 2006).
We hope our proposed evaluation scheme and empirical contribution can help continue to drive progress on this front.
C ONCLUSION
Emerging as a result of a language user’s ability to produce and comprehend novel expressions, the heavy-tail of rare events is one of the fundamental features of distributions in natural language.
In this work, we introduce a controlled methodology to evaluate instance-level LM performance on this set of individually rare but collectively frequent events.
We use generative models trained on natural language corpora to deﬁne a set of artiﬁcial languages for which we can exactly compute the probability of sequences.
Training LSTM and Transformer LMs on sequences sampled from these artiﬁcial languages, our analysis compares the probability estimates given to sequences by the LMs to the target probabilities of sequences under the artiﬁcial language.
Our results indicate that neural LMs systematically under-represent sequences in the tail of the target distribution, even when increasing the amount of the training data.
Investigating where this probability mass went, our perturbation experiments reveal that neural LMs do not tend to overestimate the head of the distribution, but rather overestimate the probability of sequences outside those typical in the target distribution.
Comparing model performance on target distributions with varying properties, we ﬁnd that neural LMs tend to provide more accurate approximations of distributions with greater entropy.
Interpreted together, these results indicate that autoregressive neural language models have a tendency to spread probability mass too uniformly across the space of possible sequences.
Finally, we would like to acknowledge that we do not know the degree of structural difference between our Transformer-generated ground-truth distributions and the distributions of actual natural languages.
It is likely that the distribution deﬁned by our ground truth models is less structured than the distribution of a natural language.
Therefore, it is possible that some systematic difference between natural language distributions and our ground-truth distributions may affect our results to a certain degree.
That being said, our experiments in Section 4.5 suggest that it may actually be easier for neural LMs to learn less structured distributions, and we expect the task of recovering a ground-truth distribution to be made easier when the target distribution and LM are in the same model class.
Nevertheless, future work should seek to conduct similar experiments using groundtruth distributions with more explicit structure.
. Language models
A A PPENDIX
A. A LTERNATIVE P ERTURBATION E XPERIMENTS
In Section 4.4, we study where the language model’s underestimated probability mass went by computing model estimation error on perturbed sequences.
We obtain a set of perturbed sequences by (i) sampling a sequence from p L and then (ii) recursively perturbing this sequence according to the perturbations provided in Table 3.
This method provides us with sequences which are increasingly far away from high-probability zones under p L .
However, they do so with an initial sequence sampled directly from p L , and as a result, produce strings which are edit-adjacent to the high-probability zones (under p L ) in Σ ∗ .
To ensure that our results hold in other low-probability subspaces, we conduct an analogous experiment on sequences randomly sampled from Σ ∗ .
We sample a sequence from Σ ∗ by ﬁrst sampling a sequence length
l from a Poisson distribution with λ = 10 .
Given this length, we sample l tokens from Σ ∗ and concatenate all tokens to form a sequence.
We then score the sequence under both p L and p M , and compute model estimation error.
We use as artiﬁcial language p L GPT2-medium with
T = 0 .
and we use as language model p M a GPT2-medium model trained on 30M sequences ancestrally sampled from p L .
Figure 6 visualizes mean estimation error as a function of the ground-truth probability of the sequence.
Similarly to all other perturbation experiments, we do indeed ﬁnd that p M overestimates these sequences, regardless of their true sequence probability.
A. E XPERIMENTS WITH P RE -T RAINED G ROUND -T RUTH M ODEL
In our previous experiments, our ground-truth model was given as a Transformer language model trainined on 1.5M sequences from the OpenWebText corpus.
Here we explore underestimation behaviour when the ground-truth distribution is given by a pretrained GPT2-medium model ﬁnetuned on 1.5M sequences from the OpenWebText corpus.
We sample from p L with softmax T = 1 . 00 .
Analogously to the experiment in Section 4.1, we train a randomly-initialized GPT2-medium model on 1M sequences sampled from the ﬁne-tuned model.
In the center of Figure 7, we visualize mean model estimation error for 50 , 000 test sequences as a function of true sequence probability.
Similarly to our experiments in Section 4.4, we ﬁnd that the LM underestimates the probability of the majority of sequences, and does so more severely for less probable sequences.
Note that this LM obtains a test perplexity of 67 . 97 .
Finally, to ensure that our ﬁndings regarding the overestimation of ill-formed sequences hold, we compute model estimation error on random sequences sampled from Σ ∗ (see A.1 for details on how these sequences are constructed).
Figure 7 center visualizes mean model estimation error as a function of target sequence probability.
We ﬁnd that p M overestimates the majority of ill-formed sequences, indicating that these ﬁndings hold when the ground-truth distribution is deﬁned using a pretrained model.
A. E XPERIMENTS WITH T = 1 .
In Sections 4.1 to 4.4, we conducted all experiments on an artiﬁcial language deﬁned by ancestral sampling scheme with T = 0 . 85 .
In Section 4.5, we saw that the underestimation ﬁndings held regardless of T .
To provide further evidence that these results hold for other values of T , we conduct similar experiments as in Section 4.3 with an artiﬁcial language p L deﬁned by an ancestral sampling scheme with T = 1 . 00 .
Speciﬁcally, we train GPT2-small and an LSTM on a total of 16M sequences sampled from p L , and we compute model estimation error on a set of withheld test sequences at each training iteration.
A. M ODEL P ERPLEXITY V ALUES
In this section we report relevant perplexity values for all models used.
For each model, we report mean perplexity across 125 , 000 sentences drawn from (i) the validation set generated by the artiﬁcial language they attempt to model (Tables 4 and 7) and (ii) the OpenWebText corpus (Table 5).
[Table] [Table]
[Table] [Table]
A. E MPIRICALLY M EASURING THE LNRE Z ONE
In section 2, we formally deﬁned the LNRE zone as the range of values of N for which there is non-zero probability of sampling a novel event at the N + 1 th draw.
Here we introduce a frequentist estimator for this probability.
This in turn allows us to empirically verify if a sample exists in the
LNRE zone.
Estimating P N
Suppose we have a set of N events D = { x 1 , . . .
, x N } drawn from some generative process φ .
Given D , we aim to obtain an empirical estimate for ˆ P N : the amount of probability allocated to unseen events as a function of N .
We can do so using the Good-Turing estimate for the probability of an event given its frequency (Good, 1953).
Speciﬁcally, let f ( x , D ) be a function which returns the frequency of the event x in D .
Let N m denote the number of types (unique events) in D for which f ( x , D )
= m .
Good-Turing says that for large N , the probability of the event x given that it has occurred with frequency m in our sample
D of size N is equal to
[Equation]
To obtain an estimate for P N , we set m = 0 :
[Equation]
[Equation]
which states that the total amount of probability mass allocated to unseen events is equal to the proportion of events which occurred only once ( hapax legomena ) in D .
This quantity is known as the potential productivity of a linguistic process (Baayen, 2009; 2001; 1994).
We apply this method to a subset of OpenWebText, a popular language modeling corpus.
In Figure 9, we plot the the empirical estimate of P N as function of the sample size N for sentences sampled from a subset of OpenWebText.
For comparison, we also include the potential productivity of two fair dice (uniform multinomial distributions), with increasingly large support.
Whereas P quickly decreases to 0 in the case of fair dice, in the OpenWebText corpus, there is very high probability of observing a novel.
A. L ANGUAGE S AMPLES
[Table]
he was a complete east end player .
[Table]
a former harvard university graduate told cnn that in recent weeks , u.s. intelligence ofﬁcials have begun to gather evidence that trump ’s campaign colluded with russia to inﬂuence the election .
[Table]
in the current study , we examined whether participants in the study performed more or less
[Table]
you ,
[Table]
is
[Table]
and
[Table]
since the 1970s , the city has been in the midst of a landmark urban pride
[Table] [Table]
” i have no doubt that ’s a big part of any kind of campaign machine , ” he told al jazeera
[Table]
and it ’s not a very good idea to work with claims in comics and ﬁlm novels .
[Table]
according to the new york times , susan macmahon , 54 , and her husband , elizabeth bailey , were in the vehicle with their son , aged between 12 and 19 .
[Table]
this is the reason i ’d like to take advantage of these ideas in an attempt to transform my life .
[Table] [Table]
” this accident , despite most of its life , is dependent on one of the most precious bodies on this planet , which is comparable to that on mostrughenai mountains .
[Table]
it ’s not fair to say that we ’re not in a position to permit same - sex marriages , and all the same
[Table]
x
[Table]
zy brace gym ﬁngerprint – bom jerozo dell ’ −
[Table]
shortly thereafter , will be a buoyant as the dynamo bust series starts one .
− 90 .disjitor doom efeco became a gothicrevolution manager ofby city library for marvel studios .
− 143 .earlier this week chicago ’s writer andrew o’t text ’ american catholics to interested readers the holiday kingsburyobee -lrb- expiration -rrbat red for now atmotionweism race and bachelor whitney university , register as 1852 jim banner of airbus beer and of course smiled at us in formula 1 where he tells friends by name , ” ﬁnnish catholics : the encryptings on robot - type mothers .
− 493 .middleware in germany −
[Table]