Elamur Research

The Grammar-Learning Trajectories of Neural Language Models

Paper · 2022 · Leshem Choshen, Guy Hacohen, Daphna Weinshall et al.

Summary

A system that predicts the next word can get better at English without improving on every part of grammar at the same rate. Choshen and colleagues ask whether those differences in timing are peculiar to each training run or whether different systems tend to master the same patterns at similar stages. They follow neural language models while they train and periodically test them on BLIMP, a benchmark of closely matched English sentences. Each pair presents an acceptable sentence and a version with a targeted error. The test asks whether the system gives the acceptable sentence a higher probability. Running the same test at successive checkpoints reveals which distinctions emerge early, which improve later, and which remain difficult.

The clearest common trajectory appears across GPT2 runs. Changing the random starting weights has little effect on the relative difficulty of the BLIMP challenges once training is under way. GPT2 tiny and GPT2 small also show correlations above 0.9 across challenges when compared at similar levels of development-set word prediction performance. Their average agreement on individual sentence pairs is 0.83 on a chance-adjusted measure. Changing the training corpus has more effect than changing the starting weights, though the differences between corpora diminish during training. TransformerXL shows some of the same trends, with a less direct comparison because it uses a different vocabulary.

A second comparison uses average BLIMP accuracy to locate a checkpoint on the grammar-learning trajectory. If a checkpoint from the larger GPT2 is held fixed and compared with successive checkpoints of the smaller one, the profiles tend to resemble each other most near the point where their average accuracies are closest. The resemblance can decline once the smaller system passes that point. The authors describe the trajectory as approximately one-dimensional because a single score gives a rough indication of which challenges a neural system will handle well. The same shortcut fails for the paper’s non-neural references, which predict from counts of short word sequences.

The comparisons also suggest changes in what helps the systems choose between sentences. Early results resemble those of predictors that use word frequencies or the identities of nearby words. Later results resemble those of references that can exploit word order, with some evidence of increasing sensitivity to broader context. Challenges involving morphology, the structure and forms of words, often improve together and reach a median accuracy of 0.85 in GPT2 tiny. Other groups stay near chance or deteriorate. The shared trajectory is a finding about observable choices on a particular benchmark. The authors use it to identify patterns worth explaining in the systems’ learning, while leaving open which internal representations produce them.

Deep dive: The Grammar-Learning Trajectories of Neural Language Models

Choshen and colleagues track when neural language models learn English grammar and test how much their learning order has in common. · about 35 minutes to read

The problem and its context

What a finished system leaves out

A grammar test administered after training shows which distinctions a system can make at that point. It gives little indication of how those distinctions came together. A strong result on an agreement challenge could reflect a preference present early in training or an ability that appeared only near the end. Two challenges with similar final scores could have taken very different routes to get there. Following performance during training lets the authors ask whether distinctions arise together, develop at different rates, or even become harder as prediction improves.

There is a prior question about whether these routes are worth treating as a general subject of study. Training starts with randomly initialized weights, and the same objective can be pursued with different architectures and bodies of text. If each run proceeds through an idiosyncratic series of grammatical preferences, a detailed account of one run gives little purchase on the next. If runs repeatedly struggle with the same distinctions at similar points, their common behavior becomes something to explain. The authors use inductive bias for the tendencies that make some generalizations easier or more likely to emerge from the training experience than others. Consistency offers evidence about such tendencies through their effects on behavior.

The paper takes its motivation from psycholinguistics, particularly research on how children acquire language. In the account the authors give, children frequently come to use linguistic patterns in similar sequences and sometimes make similar errors by extending a pattern beyond the cases where it belongs. Such behavior gives researchers evidence about the rules or representations that might support learning. The paper mentions debates over regular and irregular past-tense forms as a case where accounts of acquisition bear on theories of representation. It also situates that example within research on the acquisition of speech sounds, word forms, and more complex constructions. Across these cases, behavior during development can distinguish explanations that fit the endpoint equally well. Recurrent Neural Networks in Linguistic Theory

The neural systems in this study have a specific training task. They learn to predict upcoming words from earlier text, and the authors administer a separate test of grammatical preferences. That arrangement gives the developmental analogy a precise scope. A preference that emerges during training can be observed through the probabilities the system already assigns. The study can then relate the time at which that preference appears to the other distinctions the system is making around the same time. The comparison with human judgments asks whether the difficulty patterns overlap, while the inspiration from child language research concerns the value of tracking change.

Behavior as evidence about learning

The paper describes several established ways to investigate linguistic knowledge in a trained network. A probe takes internal activations and asks whether a separate classifier can recover information such as a linguistic label. Studies of attention examine which parts of an input receive weight from different attention heads and how information flows across layers. Work on neurons looks for individual units whose activity or influence can be associated with an observable property. These approaches investigate how the network stores or processes information, while Choshen and colleagues make the system’s own sentence preferences the object of measurement. What Do You Learn from Context?, Analyzing Multi-Head Self-Attention, Quantifying Attention Flow in Transformers, Identifying and Controlling Important Neurons in Neural Machine Translation

A classifier trained on internal activations can detect information that is available somewhere in the network, even when the network’s output gives little indication of how it uses that information. A sentence comparison asks whether any available information affects the ranking the system actually produces. Conversely, when the ranking agrees with the benchmark, the behavior alone leaves several possible internal explanations. The paper adopts that tradeoff because it wants a common test that can be used across networks whose layers, parameters and intermediate representations may differ.

Earlier work had already used outputs to assess generalization and to look for systematic biases. The authors discuss a study in which fine-tuned BERT systems with similar task scores varied in how they handled examples from the adversarial HANS dataset. That work tests generalizations in natural-language inference after fine-tuning. Here, the behavior of interest emerges during word-prediction training and is measured by a preference between sentences. The different tasks and training conditions matter when considering how widely a result about consistency should travel. BERTs of a Feather Do Not Generalize Together

The closest earlier work in the authors’ account follows internal representations over the course of training. One study compares what recurrent networks represent with the outputs of linguistic taggers and finds evidence that the networks use more context later. Parallel work on RoBERTa applies probes at different checkpoints, asking how early information needed for linguistic classification can be recovered. The grammar-trajectory study follows a similar interval in a system’s development and asks when its own output starts to reflect grammatical distinctions. Recovering a linguistic property from an intermediate layer and seeing it affect the final sentence ranking are separate observations. Understanding Learning Dynamics of Language Models with SVCCA, Probing Across Time

Another source of motivation comes from learning-order research in computer vision, where different classifiers were observed to start labeling many of the same examples correctly in a similar sequence. The paper carries the question over to generalization across tasks. The supervised labels in those classification studies define what the learner is trained to predict. In the grammar experiment, success means that training on text has produced a preference that transfers to an independently constructed pair. There is also a distinction from curriculum learning and related work on deciding when to present training examples. Choshen and colleagues observe the order in which abilities become visible under the chosen training setup. They leave the examples in the grammar test outside the training objective.

The method, step by step

Turn grammatical distinctions into choices

BLIMP supplies the same set of questions at each stage of training. Its 67 challenges each contain 1K minimal pairs, closely matched sentences designed to differ in acceptability because of a targeted property. The 67K pairs are organized into 13 groups the benchmark calls super-phenomena, which in turn fall into 4 broad fields. A challenge is the unit the authors track over time. An individual pair provides the observation from which that challenge’s score is built, while the broader categories let the authors ask whether related challenges develop together.

One example concerns the kind of subject that can plausibly do the talking. The acceptable member has Galileo talking to Bell. The other member substitutes a car for Galileo. The rest of the sentence provides a common background for the judgment. Another example concerns whether a verb can appear without an object. The subject consists of groups, and the verb changes from buy, which is acceptable without an expressed object in the example, to dislike, which makes the omission unacceptable. This sort of comparison makes a score easier to interpret than a collection of unrelated good and bad sentences. It also shows how much can turn on the choice of a particular word.

The system undergoes its usual left-to-right prediction procedure for each candidate sentence. The probability assigned to a word depends on the preceding text, so a change can affect the probability at its own position and the predictions later in the sentence. The authors compare the resulting sentence scores and count a success when the acceptable member comes out ahead. The scoring asks for a relative preference. A system can give both sentences low probabilities and still receive credit if it orders them correctly. That property lets the experiment detect grammatical preferences even at a point when unrestricted prediction is still poor.

The pairwise setup gives the test a clear chance level of 50% accuracy. A challenge score near that level says that the system’s choices, taken together, give little advantage to the acceptable members. A score below chance says it favors the distractors more often. This is worth recording in a learning study because a later checkpoint can become worse on a particular distinction even as other scores improve. The authors keep challenge scores separate before taking any average, so activity in one part of the benchmark remains visible when it is offset elsewhere.

Measuring grammar throughout word-prediction training

The steps in order.

Measuring grammar throughout word-prediction trainingStep 1: Train on next-word prediction1. Train on next-word predictionStep 2: Save checkpoints during training2. Save checkpoints during trainingStep 3: Score both sentences in every BLIMP pair3. Score both sentences in every BLIMP pairStep 4: Measure accuracy separately for each challenge4. Measure accuracy separately for each challengeStep 5: Align checkpoints at comparable stages5. Align checkpoints at comparable stagesStep 6: Compare challenge profiles and reference predictors6. Compare challenge profiles and reference predictorsStep 7: Group challenges by their learning curves7. Group challenges by their learning curves

Train the predictors and keep intermediate checkpoints

The main training corpus is WikiBooks, which includes English Wikipedia at 2.1B words and BookCorpus at 854M words. The authors describe this combination as similar to the corpus used for BERT, with a more current Wikipedia for their runs. GPT2 training at larger sizes was costly enough that the repeated experiments use compact versions. This makes it possible to vary the starting conditions and retain a training trajectory for each run. Aligning Books and Movies, BERT, Well-Read Students Learn Better

The authors train 4 GPT2 tiny instances from different random seeds. Each has width 512, 4 layers and 4 attention heads. Width describes the size of the internal representation, layers are successive stages of processing, and attention heads provide separate ways to combine information across positions. They train 1 GPT2 small instance, with width 768, 12 layers and 8 attention heads. Comparing the tiny runs isolates variation due to initialization within a fixed setup. Comparing tiny with small changes network capacity and provides a check on whether behavior at a given stage resembles what appears at that stage in a larger network.

The TransformerXL experiments widen the comparison beyond GPT2. The smaller TransformerXL has width 512, 4 layers and 8 attention heads. The full-sized version has width 4096, 18 layers and 16 attention heads. The authors stop the full-sized run after 600K steps while its perplexity is still high and use it to examine early learning. The Transformer comparisons therefore include different sizes and variants, with different extents of training. The authors also import fully trained GPT2, TransformerXL and LSTM scores from the BLIMP study, alongside its human judgments, for comparisons to fixed points of reference.

The training settings include a 5 · 10⁻⁵ learning rate, a maximum gradient norm of 1, and 10K warmup steps. The learning rate controls the scale of parameter updates, and the gradient norm limit constrains the magnitude of the gradient used for those updates. Warmup is an initial period in the update schedule. The authors use Adam to optimize the predictors. The listed vocabulary size is 32K tokens, with TransformerXL keeping its default vocabulary. A token is a unit the predictor scores, and the choice of tokenization affects what counts as a prediction. The remaining training settings follow the defaults of the HuggingFace transformers library as described in the paper. The accompanying code is called ordert.

For the training-data comparison, the authors train additional GPT2 tiny runs using openWebText, openSubtitles and newsCrawl. The openWebText sample has 3B words and is described as a replication of the data used for GPT2. The subtitle and news corpora provide other bodies of English text against which to compare the WikiBooks results. GigaWord also appears in the experiments as the training corpus of a count-based reference. Keeping the GPT2 tiny architecture while changing the training corpus lets the authors ask how much of a shared trajectory survives a change in the text from which the system learns. OpenSubtitles2016, WMT19, Annotated Gigaword

Represent each checkpoint by a profile

A checkpoint is the state of a network saved at a particular point during training. The paper represents it by collecting its accuracy on every BLIMP challenge into an ordered vector. Keeping the order of the challenges fixed ensures that any coordinate in one vector can be compared with the score on the same challenge in another.

pv(Lₜ) = [acc(Lₜ, p)]ₚ∈BLIMP ∈ ℝ⁶⁷

Here L is the predictor being studied and t locates a checkpoint. Lₜ is the predictor in the state it has at that point. pv means performance vector, and acc(Lₜ, p) is the proportion of sentence pairs answered correctly on challenge p by that checkpoint. The brackets collect these scores in challenge order. The subscript p ∈ BLIMP means to include each challenge in the benchmark, and ℝ⁶⁷ is the space of vectors with 67 real-valued coordinates. As training advances, the coordinates change, tracing a path through these possible challenge profiles.

The authors use Pearson correlation to compare vectors. It measures whether the challenges with relatively high scores in one profile also tend to have relatively high scores in the other, and likewise for the low scores. An increase in the general level of accuracy can leave this alignment high. Equal average accuracy can also coexist with very different profiles if the strengths fall on different challenges. The paper reports the mean of the pairwise correlations when comparing a collection of runs. It also reports qualitatively similar conclusions with Spearman correlation, which measures agreement after turning the individual challenge scores into ranks.

There is a separate check at the level of individual pairs. The authors record whether each checkpoint makes the correct binary choice, then treat the systems as raters and compute Fleiss kappa. The measure corrects observed agreement by accounting for how much agreement the ratings would yield by chance. The point is to test whether shared challenge scores reflect shared decisions within the challenge. A pair of systems can get similar accuracy on the same phenomenon while getting different sentences right. Measuring agreement on the pairs makes this possibility visible.

Put training runs on comparable clocks

The meaning of the checkpoint index depends on the comparison. When the runs have the same architecture and training setup, elapsed update steps offer a straightforward way to align them. A larger network can improve at a different rate, so an identical number of updates may represent a different stage. The authors compare GPT2 tiny and GPT2 small using perplexity on a development set. Perplexity summarizes how much probability a predictor assigns to the observed text, with lower values indicating better prediction. Matching by perplexity asks what grammar profile is visible when the predictors are at a similar level on that text.

Perplexity depends on which vocabulary is used to break up and score the text. The authors therefore examine TransformerXL qualitatively when discussing whether its individual challenge curves resemble GPT2’s. Its perplexities lack the common vocabulary needed to use them as a shared horizontal scale. A curve can still show whether a challenge tends to rise, plateau or lag, and those tendencies can be compared while allowing for uncertainty about the exact stage correspondence.

A separate procedure aligns checkpoints by mean BLIMP accuracy. The authors hold a reference checkpoint fixed, follow GPT2 tiny through training, and compare the two full challenge vectors at each stage. Alongside the correlations, they track where the average scores are closest. The question is whether the highest correlation turns up around that point. By repeating the comparison with reference checkpoints from different stages of GPT2 small, they ask whether the location of the peak moves with the reference. Fully trained systems and human scores can also be used as fixed reference profiles.

Build reference profiles for context and complexity

The paper uses simple predictors and sentence properties to investigate what might account for the shape of the main trajectory. A reference predictor can be evaluated on each pair just as a neural checkpoint is, producing a vector of accuracies. A sentence property, such as length, supplies a score on a different scale. Averaging that property within each challenge yields one coordinate per challenge, preserving the alignment needed for the correlation analysis. The paper expresses the per-challenge aggregation as an expectation.

[𝔼ₚᵢ∈ₚ[m(pᵢ)]]ₚ∈BLIMP ∈ ℝ⁶⁷

Here m is the metric being applied, p is a BLIMP challenge, and pᵢ is its example indexed by i. The inner brackets enclose the metric value being averaged. 𝔼 with the subscript pᵢ ∈ p denotes the average over the examples belonging to that challenge. The outer brackets and p ∈ BLIMP collect these averages in benchmark order. ℝ⁶⁷ again indicates that there are 67 real-valued coordinates. When a reference is scored for pairwise correctness, the corresponding averages are challenge accuracies. Length is measured in tokens. A sentence’s syntactic depth is the length of the longest path that leads from any word in its parse tree to the root.

The count-based references include a unigram predictor, which uses word frequencies from WikiBooks without conditioning them on prior words. The ordered n-gram references use short sequences of consecutive words. The 2-5 gram references are trained on WikiBooks using KenLM, and the comparison also includes a 5-gram reference trained on GigaWord that was reported by BLIMP. The experimental settings describe normalizing sentence probability by the number of words for the rare pairs with different lengths. This reduces the extent to which simply accumulating word probabilities across a longer sentence influences the preference. KenLM

The authors also create BOW and Window-5 from GPT2 tiny to compare unordered contexts. BOW removes positional weights and replaces weighted attention with a simple average. It can use the identities of preceding tokens throughout its available context. Window-5 uses the same order-insensitive operation within the last 5 tokens. Both predictors stay left-to-right, so each prediction uses previously encountered text. Their profiles serve as references for what a neural predictor can do when the context is unordered, with the window varying how much preceding text is accessible.

Finally, the authors compare learning curves in both directions. They inspect curves within the benchmark’s named linguistic groups, then start with the curves themselves and ask which challenges cluster together. The second procedure uses spectral clustering with 10 clusters and the default settings of sklearn. The method uses a normalized Laplacian to represent relationships among the curves, projects them into a space that reflects those relationships, and applies k-means to group similar projections. The resulting membership can be compared with the benchmark categories. This gives a way to ask whether a conventional linguistic grouping also describes how its challenges change during training.

Experiments and results

Shared difficulty appears while prediction is still improving

The experimental measure of grammar is accuracy on BLIMP’s English sentence pairs, reported by challenge or averaged across the benchmark. Development-set perplexity addresses prediction on a different body of text. The paper uses it to anchor comparisons between GPT2 sizes and to show that strong agreement in grammatical difficulty can already be visible when general prediction is much less developed. The metrics answer different questions even when they are measured at the same checkpoint.

The correlations across the 4 GPT2 tiny initializations start at 0 at step 0. By 10K training steps the runs already show strong correlations across their challenge profiles, and those correlations stay high during the observed training interval. GPT2 tiny still has a reported perplexity of 10.9 after 10K steps, compared with 6.7 after 70K steps. The combination matters. The runs are making sufficiently systematic choices to resemble each other on a grammar benchmark while their ability to predict text still has room to improve.

GPT2 tiny checkpoints by development-set perplexity in the WikiBooks training setup

The later checkpoint gives better word predictions on the development set.

GPT2 tiny checkpoints by development-set perplexity in the WikiBooks training setupGPT2 tiny after 10K steps: 10.9GPT2 tiny after 10K steps10.9GPT2 tiny after 70K steps (this paper): 6.7GPT2 tiny after 70K steps (this paper)6.7
The numbers
System or settingperplexity
GPT2 tiny after 10K steps10.9
GPT2 tiny after 70K steps (this paper)6.7

The chart compares the word-prediction measure at the two reported checkpoints. The evidence about grammatical learning order comes from the many challenge scores measured alongside that progress. For example, high correlation can persist while several individual scores increase. This means the relative distribution of easy and hard challenges is similar across runs, even as the level of performance changes. Looking only at the two perplexities would leave that distribution unknown.

Network size and architecture

When the GPT2 runs are matched by development-set perplexity, GPT2 small and GPT2 tiny have challenge-profile correlations above 0.9. The authors illustrate the agreement with the challenge for existential there. Its trajectory is similar across the initializations and sizes of GPT2 considered in the comparison. The appendix also presents determiner–noun agreement, causatives, and a challenge contrasting wh with that where there is a gap. These examples show what the aggregate correlation summarizes. The score for the same grammatical contrast can move in much the same direction across networks when they are observed at comparable stages.

Fleiss kappa gives an average agreement of 0.83 on the individual BLIMP pairs for the GPT2 small and tiny comparison. The appendix reports that only two challenges have agreement in the 0.5-0.6 range. A shared challenge score therefore frequently reflects overlap in the actual sentences that the systems rank correctly. The authors focus the rest of the paper on challenge-level analysis because each challenge has a linguistic description, making it easier to ask what a set of related curves might have in common. Pair-level agreement strengthens the consistency result while serving a different explanatory purpose.

The TransformerXL curves often move in broadly similar ways, based on a qualitative comparison. Some remain at lower performance, including the appendix example of determiner–noun agreement, where the observed TransformerXL run fails to show the improvement seen in GPT2. The authors associate some such differences with the stage the run reaches. The direct numerical claim above 0.9 uses the GPT2 size comparison, where the vocabulary allows alignment by perplexity. The TransformerXL evidence extends the range of systems observed, at a coarser scale of comparison.

A reference checkpoint is most recognizable near its own score

The best reported average BLIMP score for GPT2 tiny is 67. The paper follows the trajectory up to that level and repeatedly compares it with fixed reference profiles, including checkpoints saved from GPT2 small. Consider a GPT2 small checkpoint held constant while GPT2 tiny improves. At first, their average BLIMP scores may be far apart. As the average scores converge, the correlation between the full profiles tends to grow. When GPT2 tiny moves past the reference in average accuracy, the correlation can fall again. A different GPT2 small checkpoint places this peak at a different point in the tiny run.

For the comparison to intermediate GPT2 small checkpoints, the peak correlation is higher than 0.9. This result gives the claim of an approximately one-dimensional trajectory its empirical meaning. The benchmark profile contains a score for every challenge, but the average helps locate a point where that profile is likely to resemble the profile of another neural network. The method would have exposed a different pattern if the later GPT2 tiny checkpoints had always resembled every fixed reference more closely. The rise and subsequent decline around a match in average accuracy tie profile similarity to the reference’s particular stage of training.

The comparisons against fully trained neural references produce correlations in the 0.6-0.8 range, with peaks generally around the points of closest average BLIMP accuracy. Their rankings in similarity are informative in their own right. GPT2 tiny and GPT2 small are closer to the LSTM reference than to TransformerXL, and least close to GPT2 large among those references. Shared architecture alone offers a poor account of that ordering. Each off-the-shelf profile also reflects its training data, size and attained performance, so the authors examine training data separately before interpreting the comparison.

The corresponding check against the count-based 5-gram predictors uses the same procedure with the WikiBooks and GigaWord references. It does not show the neural pattern. Similar overall BLIMP accuracy brings neither a consistently high correlation nor a reliable peak in profile similarity. The WikiBooks count-based predictor is particularly informative because sharing the principal training corpus still leaves it with a different profile. Equal averages can register very different combinations of successes and failures, as the method is meant to detect.

Training text shifts the profile, particularly early

GPT2 tiny instances trained on different corpora show lower correlations with each other at matched training steps than instances differing only in initialization. The effect of corpus choice diminishes as training proceeds, and the curves become more similar. Using the same architecture here makes the contrast with the initialization runs easier to interpret. The comparison gives evidence for an influence of the text while showing that a good deal of the shared pattern survives it.

The authors also revisit the off-the-shelf ordering after training GPT2 tiny on openWebText. The original WikiBooks training data overlap in kind with the Wikipedia-based material associated with the LSTM and TransformerXL references. GPT2 large is associated with web text instead. If similarity mainly reflected the relative closeness of those corpora, the openWebText run might change which reference it most resembles. GPT2 large remains the least similar in the reported comparison. The corpus intervention thus supports an account in which training data explain part of the differences, alongside other properties of the system and its stage of learning.

There is a related result when changing the corpus of a 5-gram reference. The WikiBooks reference tends to align better with GPT2 tiny than the GigaWord one does. In the main comparison, the difference between the two correlations narrows over roughly the first 50K steps and then remains relatively stable. The appendix comparison with GPT2 tiny trained on openWebText still favors the WikiBooks 5-gram, though it shows a smaller, steadier gap early on. The better alignment therefore persists even when GPT2 tiny was trained elsewhere. The authors leave its cause open.

Human difficulty and the range of learning curves

The authors compare the neural profile with human performance reported in the original BLIMP study. As GPT2 tiny improves, the challenges that humans find relatively difficult increasingly overlap with those on which the network has lower accuracy. The correlation levels off below 0.5 across challenges. The neural references align with GPT2 tiny more closely than the human profile does. This result concerns relative difficulty in the benchmark judgments. The experiment contains a trajectory for the predictors and a fixed human profile against which to compare them.

The challenge curves also show why a single average can be simultaneously informative about stage and incomplete as a description of learning. GPT2 tiny generally improves gradually across the morphology challenges, which reach a median accuracy of 0.85. The syntax–semantics field, in contrast, tends to level off around the 50% chance level. Syntax and semantics each contain a wider range of trajectories, with no similarly characteristic curve for the field as a whole. A result for the joint field therefore says little by itself about the separate syntax or semantics group.

When the authors group challenges using their trajectories, they find clusters that improve, clusters that stay close to chance, and clusters whose accuracy falls to almost 0 over training. Some challenges achieve perfect accuracy almost immediately. These profiles give several meanings to an easy or difficult final score. A distinction can be easy from the outset because a cue is already useful, or become easy after prolonged improvement. A low final score can reflect persistent uncertainty or an increasingly reliable preference for the benchmark distractor. For the latter cases, the shape of the curve gives evidence that the system’s preference is changing as it learns to predict text.

What the ablations show

Take away order and vary the available context

The paper’s explicit architecture ablations are BOW and Window-5. The authors use them as comparison systems and ask when their characteristic pattern of errors resembles that of ordinary GPT2 tiny. This matters for interpreting the results. The relevant comparison is how closely the systems agree about which challenges are hard at a point in training. A higher correlation for one reference says its profile makes a better match. Overall grammatical accuracy is a separate measurement.

BOW is designed to retain the words in the preceding context while limiting access to their order. The authors report that removing positional embeddings alone had little empirical effect. They suggest that a network restricted to looking backward may still be able to infer positional information from differences among the representations it encounters as the prefix grows. Their intervention therefore also replaces the learned attention weights with averaging. Window-5 adds a further restriction on context length. Comparing the variants helps distinguish a preference that can be supported by nearby words from one that benefits from a broader set of previous words.

Early in training, the unordered neural references correlate with GPT2 tiny better than the ordered n-gram references do. This points to an early stage in which the presence of familiar words offers useful evidence, even when their sequence is unavailable to the reference. Later, the ordered n-grams correlate better than the unordered alternatives. A second change occurs within the unordered comparisons. At later stages, the correlation with Window-5 falls substantially below that with BOW, whose available context is broader. Together these changes support the authors’ interpretation that order and extended context become more relevant as training advances.

The contrasts answer related questions from different directions. Comparing BOW with Window-5 varies the amount of available context within the unordered setup. Comparing the unordered references with n-grams brings in order, while also changing how the prediction is produced. The strongest conclusion from that comparison concerns the emergence of a difficulty pattern that ordered references capture more closely. An explanation in terms of particular cues used by the unmodified network requires further evidence about the sentences and the network’s response to those cues.

Separate word frequency from local order

The unigram reference supplies the clearest check on what can be achieved through lexical frequency. It obtains perfect accuracy on 7 BLIMP challenges and 98.1% accuracy on 1, while scoring 0% on 8. These are challenge counts and challenge accuracies on the grammar benchmark. The unigram has access to general word frequencies from WikiBooks. A benchmark challenge can therefore be very easy for it when the acceptable side consistently contains a word it favors, or very hard when that tendency systematically supports the distractor.

At the start of the observed learning trajectory, GPT2 tiny succeeds on 6 of the 8 challenges the unigram handles well. It also succeeds on 4 of the 8 on which the unigram fails completely. On 3 of the other challenges that the unigram fails, GPT2 tiny initially scores 0% and then improves during training. This makes the early resemblance more precise. Frequency explains some initial preferences, including some of the worst early errors. Early success on challenges the unigram fails shows that even these checkpoints can reflect other information. Across the benchmark, correlation with the unigram drops quickly.

The paper notes an apparent tension between this early behavior and observations from text generation, where a very early system can repeat a word such as the. A minimal pair provides a different view of the same predictor. Its highest-probability unrestricted output can be dominated by a frequent word, while a comparison between supplied sentences can still depend on the context in which their words occur. The grammar test can reveal those relative preferences ahead of the stage when the network produces convincing text by itself.

The ordered n-gram comparisons provide a finer view of local context. GPT2 tiny has strong correlations with short ordered references during training, with the resemblance peaking early and then declining. From a certain point it resembles the bigram reference more closely than the other n-gram predictors in the comparison. The bigram uses the immediately preceding word in prediction. A close match to it identifies a period when a very short dependency can reproduce much of the relative difficulty pattern. The later decline provides evidence that the simple references become less adequate as descriptions of the learned behavior.

Test sentence complexity as an explanation

Sentence length and syntactic depth are intentionally broad references. Length measures how much material is present, and depth measures the extent of nesting in the parse tree according to the paper’s path-based definition. Neither predicts the difficulty of the BLIMP challenges well across the trajectory. The result is consistent with the design of the benchmark, where a challenge depends on a particular contrast within a pair. General properties of the sentence may matter without capturing which difference governs the preference.

The relative ordering of those references changes. Syntactic depth initially predicts the neural difficulty pattern less well than length and ends up the better predictor of the two. The paper reads this alongside the evidence from the context ablations. Early performance is closer to reference systems based on short contexts and lexical identity, while the later change in the depth comparison is consistent with greater sensitivity to structure. The modest predictive value of both metrics limits how specifically that change can be described.

The authors repeat the reference comparisons with GPT2 small and TransformerXL. GPT2 small supports the general progression. The observed TransformerXL trajectory shows some early similarities, including stronger initial relevance for the windowed bag of words than for the broader bag of words. The later decline in resemblance to the unordered references is less apparent, and the increase in correlation with human difficulty is small. Given the lower stage of performance reached in these runs, the authors treat this as partial reproduction of the pattern. It also illustrates the risk of looking for a late transition in a run that may cover mostly early learning.

Group the trajectories, then inspect surprising cases

Grouping challenges by their curves is an analysis of the existing runs. It asks whether familiar linguistic categories describe the behavioral changes and whether groups discovered from those changes have any recognizable linguistic relationship. The morphology results furnish the clearest case of a category with a shared curve shape. Challenges in the field tend to improve gradually to relatively high performance. The authors suggest that these tests could benefit from some of the same learned features. The coordinated gains are the observation, and a common underlying feature is an explanation for them.

Spectral clustering recovers groups that can contain a prominent field while drawing on several super-phenomena. The appendix also displays curves within benchmark groupings such as anaphor agreement, which concerns agreement between a referring form and its antecedent. The paper reports qualitatively similar clustering findings with other methods. Broadly, curve shape and expert classification agree in some places and diverge in others. A benchmark category groups challenges by what their contrasts are designed to test. A cluster of trajectories groups them by which checkpoints solve them and with what degree of success. A cue that cuts across grammatical categories can affect the second grouping.

The authors inspect cases with strong initial performance followed by decline. In the challenge called principle A case 1, consistently choosing subject pronouns such as she or he over reflexives such as herself or himself is sufficient for a perfect score. In the sentential negation challenge involving a negative polarity item, the fixed local preference for not ever over alternatives containing probably ever or fortunately ever solves the test. A negative polarity item is an expression whose acceptability depends on its context, with negation providing the relevant cue in this challenge.

These examples show how a benchmark can offer a short route to success. An early predictor with a useful local preference can score highly before learning enough to resolve the broader grammatical distinction in other contexts. A later predictor might change that preference because of information it acquires from the training corpus, producing a decline on the test. The authors also entertain the possibility of harmful generalization. The observed decline shows that the predictor adopts a preference at odds with the benchmark for those pairs. The inspection establishes that the early success is compatible with a simple cue, while leaving the exact cause of the later decline unresolved.

Limitations

Limits identified by the authors

The authors qualify the common trajectory by the range of neural predictors they studied. They explicitly raise the possibility that future architectures with substantially different inductive biases will learn in a different order. The comparison with 5-grams gives a concrete case where the link between average score and challenge profile fails. Though those count-based systems were useful references for phases of learning, their behavior shows that a common overall score has general predictive value only within a suitably similar family.

Training coverage also restricts the comparisons. The full-sized TransformerXL run ends at 600K steps while perplexity remains high. Its vocabulary prevents direct matching to GPT2 on perplexity, and the trajectories observed for TransformerXL cover a more limited range of competence. The authors identify additional architectures and later stages as subjects for future study. The claim that stages recur is strongest where there are repeated runs and a shared comparison scale, as in the GPT2 experiments.

The authors leave the interpretation of latent features open. The increasing correlation with human difficulty suggests some shared obstacles, while its level below 0.5 leaves substantial room for different behavior. They offer more than one possibility for the difference. A network may reach generalizations useful for predicting text that BLIMP does not capture, or rely on misleading ones that still benefit its training objective. The analysis of challenges that deteriorate also allows for biases of the test constructions. Frequency, context length and syntactic depth are partial descriptions of difficulty, and the authors leave open which measure of linguistic complexity would characterize the trajectory more closely.

The grouping of grammatical phenomena is likewise preliminary in the authors’ account. Shared curves suggest several challenges may benefit from related generalizations. Categories with heterogeneous curves may contain distinctions that depend on different features or become learnable under different conditions. The authors call for an account that explains why the clusters take the forms they do. The reported clustering organizes the observations and supplies examples that such an account would have to explain.

Limits visible in the measurements

BLIMP operationalizes grammar learning as a relative probability preference on selected English sentence pairs. A correct answer can have multiple causes. Some pairs can be solved from word frequency or a short phrase, as the authors’ references demonstrate. Conversely, a model can assign a high probability to a distractor because of a lexical preference that outweighs information about the intended contrast. The task measures the net choice. Its coverage is the collection of distinctions and examples represented by the benchmark, so the resulting order pertains to those distinctions under that scoring procedure.

Correlation tracks resemblance across a profile. Its high value shows that runs distribute their strengths and weaknesses similarly, with some variation allowed in the timing and size of particular changes. An order of acquiring individual capabilities would require deciding when a capability counts as acquired, especially for curves that rise and then fall. The paper’s method preserves those curves and compares stages directly. The resulting evidence supports a shared progression more clearly than a fixed sequence of irreversible milestones.

The approximate one-dimensionality result also depends on how stage is defined. Average BLIMP accuracy is an aggregate of the same challenge scores used to construct the profiles. The 5-gram control shows that agreement in this aggregate can coexist with different profiles, so a high correlation near a match in accuracy is substantive. Even so, the evidence is about measuring a checkpoint with the same battery of challenges and using that measurement to locate it among similar checkpoints. Predicting an unseen evaluation domain from the same scalar would call for an independent test.

The example-level agreement adds evidence beyond averages while leaving a similar interpretive gap. Systems can agree on many items because their underlying rules are alike, because they share lexical preferences, or because different processes produce the same choices. Fleiss kappa summarizes the degree of overlap. As with the profile correlations, it does not identify which properties of a sentence were decisive. The same applies to the simple references. A bigram-like pattern and a bag-of-words-like pattern provide behavioral analogies, while observations about the internal use of a cue require an intervention that targets that cue in the neural system or its inputs.

The corpus comparison is informative within the particular set of domains used. Holding GPT2 tiny fixed while substituting a corpus changes vocabulary frequencies, recurring contexts and other properties of the text together. The experiment measures their combined effect, so it cannot attribute the differences to any individual property. The openWebText run addresses one explanation for the ordering of the fully trained references. Those references still differ in size, architecture, training history and achieved accuracy, which limits causal interpretation of their ranking.

Finally, the human comparison gives one profile of judgments on BLIMP. It provides a way to ask whether people and neural predictors tend to struggle with the same test challenges. Evidence that their difficulty profiles overlap says little about whether children acquire those distinctions in the same order. A developmental comparison would require observations of change on both sides and an account of how to align them. In this paper the analogy with developmental research supplies the motivation and the choice to follow learning through time.

What came after

A closer look at the learning curves

The most direct continuation takes up the different shapes hiding inside the common trajectory. Fifty Shapes of BLiMP returns to the same benchmark with syntactic learning curves as its subject and emphasizes that their shapes vary. That emphasis fits the distinction between reproducibility across training runs and uniformity across grammatical challenges. Choshen and colleagues find the former alongside early plateaus, gradual gains and declining scores. The later work places the variation among the curves at the center of the question. A shared progression can be made up of individual challenges that behave quite differently. Fifty Shapes of BLiMP

Subword Models Struggle with Word Learning, but Surprisal Hides It moves the measurement question to word learning. Its title identifies sub-word segmentation and surprisal, a score that expresses how unexpected an item is to the predictor, as central to the problem. The connection is that a probability-based measure exposes certain changes in competence and can obscure others. Choshen and colleagues study which of two complete sentences is favored and compare that result with general prediction performance. The later work asks what a prediction-based measure reveals about learning words when the system represents text in pieces of words. Subword Models Struggle with Word Learning, but Surprisal Hides It

Training dynamics also provide the connection to Memorization Without Overfitting. This work takes memorization as the behavior to follow during training. The question sits alongside grammatical generalization because both ask what changes while the system gets better at prediction. The grammar paper uses a separate task to reveal emerging preferences about sentences. The memorization paper’s stated subject concerns how remembering training material relates to overfitting. Keeping the behaviors distinct makes clear how investigations of the same training process can ask different questions about what is acquired along the way. Memorization Without Overfitting

Extend the comparison across languages and kinds of behavior

QFrCoLA contributes a corpus of linguistic acceptability judgments for French as used in Quebec. It connects through the measurement of acceptability in a specific linguistic setting. BLIMP gives Choshen and colleagues repeated, targeted English comparisons with which to follow training. A corpus of acceptability judgments for Quebec French addresses the empirical material needed to study acceptability in that variety. Its subject is the judgments themselves. The corpus contribution and a study that orders learning across checkpoints are different pieces of a possible comparison. QFrCoLA

The Swedish acquisition study asks directly about an order of grammar learning. It examines GPT-2 and frames its comparison with human learning stages within Processability Theory. Choshen and colleagues first ask whether a developmental ordering is stable across neural runs and then compare their difficulty profiles with human judgments. The Swedish work’s stated question brings a particular framework for human stages into the analysis of which grammatical phenomena arise first. This makes the human comparison part of how the learning order is defined and assessed. Do Large Language Models and Humans Follow Similar Learning Stages?

The broader developmental question is taken up in What Artificial Neural Networks Can Tell Us About Human Language Acquisition. Its subject is the evidential relationship between artificial learning and acquisition in people. One point of contact is the distinction between observing a reproducible neural learning pattern and using it to reason about human development. Choshen and colleagues draw on developmental methods to ask a question about neural systems. The broader acquisition work places artificial learners in the inquiry about human language itself. What Artificial Neural Networks Can Tell Us About Human Language Acquisition

The work on child-directed speech in BabyLMs brings training input together with a distinction between production and comprehension. Its stated finding concerns a benefit for production. The connection with the grammar trajectories is most direct in the choice of behavior to evaluate. An effect of training text can be expressed in one outcome more clearly than in another. In the Choshen study, training-corpus changes are tracked through preferences among minimal pairs. The BabyLM work’s comparison of production and comprehension makes the choice of outcome part of its account of the effect of the input. Child-Directed Speech Facilitates Production, Not Comprehension, in BabyLMs

Follow training decisions at a different scale

Rho-1 takes up the contribution of different tokens to training. This connects to the grammar study through a distinction between training material and measured learning. Choshen and colleagues vary corpora and observe changes in the difficulty of grammatical contrasts while the word-prediction objective stays in place. Rho-1 puts the training treatment of tokens at the center of the question. The citation connects inquiries at different scales, from what happens when whole bodies of text change to how the contribution of individual prediction targets is treated. Rho-1

The BLOOM work cites the grammar-trajectory paper in the setting of an open-access multilingual language model. Its stated contribution is the multilingual system. The connection places the English checkpoint experiments alongside work with a broader language scope, where comparisons would have to account for which distinctions and judgments are measured for each language. The citation itself establishes a connection between the papers. It supplies no basis for attributing BLIMP learning curves or a replication of the English learning order to BLOOM. BLOOM

Cite

Cite as Leshem Choshen, Guy Hacohen, Daphna Weinshall and Omri Abend. 2022. The Grammar-Learning Trajectories of Neural Language Models. Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2022.acl-long.568

@inproceedings{choshen2022grammar,
  title = {{The Grammar-Learning Trajectories of Neural Language Models}},
  author = {Leshem Choshen, Guy Hacohen, Daphna Weinshall and Omri Abend},
  booktitle = {Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
  year = {2022},
  doi = {10.18653/v1/2022.acl-long.568},
  url = {https://doi.org/10.18653/v1/2022.acl-long.568}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/choshen-2022-grammar-learning-trajectories-neural-language/