---
title: "Using Deep Neural Networks to Learn Syntactic Agreement (2017)"
description: "Bernardy and Lappin test how neural networks learn subject–verb agreement and how vocabulary, training data, and prediction methods…"
canonical: "https://research.elamur.ai/free/en/papers/bernardy-2017-deep-neural-networks-learn-syntactic/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/bernardy-2017-deep-neural-networks-learn-syntactic/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2017](https://md.research.elamur.ai/free/en/papers/2017/) / Using Deep Neural Networks to Learn Syntactic Agreement

# Using Deep Neural Networks to Learn Syntactic Agreement

Paper · 2017 · Jean-Phillipe Bernardy and Shalom Lappin

**Authors:** Jean-Phillipe Bernardy and [Shalom Lappin](https://md.research.elamur.ai/free/en/authors/shalom-lappin/) · **Year:** 2017 · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

[Cited by **24** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/bernardy-2017-deep-neural-networks-learn-syntactic/cited-by/) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2017.lilt-15.3/)
- [PDF](https://aclanthology.org/2017.lilt-15.3.pdf)

## Summary

In “The keys to the cabinet are missing,” the verb agrees with *keys*, even though *cabinet* is closer. A system that simply copies the number of the nearest noun will choose the wrong form. Bernardy and Lappin use this property of English to ask how well neural networks can learn a relationship that depends on sentence structure. They give the networks the words leading up to a present-tense verb and test whether they can predict singular or plural. An intervening noun with the opposite number is called an *attractor*. Grouping test cases by attractor count shows how prediction holds up when the sentence contains more cues pointing towards the wrong answer.

The authors extend an earlier experiment by Linzen and colleagues, using ⇠24 million present-tense agreement examples from WaCkypedia in place of the earlier corpus of ⇠1.35 million examples. They retain multiple agreement cases from the same sentence and allow both matching and mismatching nouns to intervene. They compare recurrent networks with long short-term memory or gated recurrent units, a convolutional network, and a recurrent network trained to predict the next word. The directly supervised recurrent networks perform best. Increasing the training share from 10% to 50% produces a clear gain for the reference configuration, while the move to 90% changes much less. Wider recurrent layers help, particularly on examples with more attractors, with smaller returns at the largest width tested.

The most surprising result concerns what the networks get to read. The authors expected that replacing most words with grammatical tags would make agreement easier to learn by drawing attention to number and word class. In the supervised experiments, retaining only the 100 most frequent words reduces accuracy across the architectures. The recurrent classifier generally benefits from a much larger vocabulary of 100k words. The results suggest that information about particular words and the contexts in which they occur helps the networks learn when a noun controls a verb. The experiments leave open how much of that benefit comes from meaning and how much comes from grammatical information associated with individual words.

For next-word prediction, the way the authors ask the agreement question matters. Comparing the probabilities of the two forms of the same verb works much better than pooling the probabilities of all singular forms and all plural forms. The targeted comparison uses a next-word predictor trained with only 100 retained words and comes closer to the supervised results. Together, the experiments show that recurrent networks can learn to handle extended agreement dependencies. They also leave an important distinction unresolved: a network can select the appropriate inflection without revealing how it represents the structure that licenses it.

## Deep dive: Using Deep Neural Networks to Learn Syntactic Agreement

Bernardy and Lappin test how neural networks learn subject–verb agreement and how vocabulary, training data, and prediction methods affect accuracy. · about 39 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### Why agreement makes a good test

Subject–verb agreement is a useful place to investigate what a neural network learns from sentences because the expected output is easy to state. The verb takes a singular or plural form according to the number of its subject. The hard part is identifying the subject whose number matters. A sentence can contain several nouns, every one of them carrying potentially relevant information about number. Only the noun that heads the controlling subject supplies the number for the target verb. That distinction belongs to [syntax and grammar](https://md.research.elamur.ai/free/en/topics/syntax-grammar/).

Consider “The keys to the cabinet are missing” alongside “The key to the cabinets is missing.” The nearest noun points toward a singular verb in the first sentence and a plural verb in the second. The subject points the other way in both. In each case, the noun after *to* belongs to a phrase that modifies the subject. That phrase can add information about which key or keys are meant while the head of the subject continues to control agreement. The verb form makes the consequence of that structural distinction observable. The variation between *is* and *are* is an example of grammatical [morphology](https://md.research.elamur.ai/free/en/concepts/morphology/).

Bernardy and Lappin illustrate the same issue by expanding a sentence about students submitting a project. A short version puts the plural subject next to *submit*. Longer versions describe the students’ enrollment, introduce a program and a department, and eventually mention a colleague in an embedded clause. Those additions supply singular nouns without changing the subject of *submit*. The embedded clause can even have its own subject and verb. The network therefore has to make a prediction in a sequence where several grammatical relationships may be visible at once.

Linzen and colleagues call the mismatching interveners *attractors*, a term Bernardy and Lappin adopt. An attractor is defined relative to a particular verb and its controlling subject. A singular noun between a plural subject and its verb is an attractor for that dependency. An intervening plural noun can occupy a similar position without qualifying, because its number agrees with the target. A noun that controls one verb can also fall inside the interval relevant to another. Counting attractors consequently requires a way to identify the endpoints of each agreement relation.

This count is related to difficulty through the kinds of misleading evidence the sequence contains. It measures a different property from the number of words between subject and verb. A long interval may contain few nouns. A shorter interval may contain a noun whose number differs from the subject’s. Even two examples with the same attractor count can differ in the number of matching nouns, the length of the interval, or the kinds of phrases found there. The count gives the researchers a way to organize examples by a specific source of interference while preserving the variation found in naturally occurring sentences.

The task can separate conspicuous failures from success under stronger interference. If the only visible noun is the subject, its number is a good guide. If the nearest noun has the opposite number, a nearest-noun shortcut gives the wrong answer. Doing well on the latter cases shows that the predictor uses information beyond that shortcut. A variety of cues can still guide it to the right answer. The experiment makes an otherwise broad question about grammatical learning more tractable by asking whether one specific behavior survives systematically misleading word sequences.

#### The earlier agreement experiment

The immediate starting point is Linzen and colleagues’ study of syntax-sensitive dependencies in a long short-term memory network. An LSTM is a recurrent network that updates a running state as it reads a sequence. The question was whether the state would carry the information relevant to verb agreement across the words that come between the subject and verb. The supervised task paired the words before a verb with a label giving its number. The grammatical relationship was identified during data preparation, which allowed performance to be broken down by attractor count. [Linzen and colleagues’ agreement study](https://md.research.elamur.ai/free/en/papers/linzen-2016-assessing-ability-lstms-learn-syntax/)

That setup gives the learner a strong signal about which part of the input matters for the experiment. Each training example asks one narrow question, so a correct prediction can be rewarded even when the network would have trouble selecting the actual next word. The earlier work also tried next-word prediction, in which learning was directed towards the identities of forthcoming words across a sentence. The researchers then inspected the probabilities assigned to competing verb forms. This approach tests whether information about agreement is useful enough to be learned as part of a broader prediction task.

The two objectives expose the network to related evidence but ask it to use that evidence in different ways. In supervised number prediction, a prefix can support a plural answer even when many different plural verbs would make sense. For a next-word predictor, the actual continuation matters, including which verb occurs or whether the next word is a verb at all. The agreement test applied afterwards must therefore extract a comparison about number from probabilities that also reflect many other aspects of the context. That is the role played here by a [language model](https://md.research.elamur.ai/free/en/concepts/language-model/).

Bernardy and Lappin also discuss a much larger Google next-word predictor evaluated by Linzen and colleagues. Its relevance is that a next-word system with a different scale can be inspected with the same kind of agreement question. The comparison leaves room to ask which components of the experiment matter separately: the training objective, the amount of data, the sequence architecture, and the decision rule applied to the probabilities. The earlier system comes from [Exploring the Limits of Language Modeling](https://md.research.elamur.ai/free/en/papers/jozefowicz-2016-exploring-limits-language-modeling/).

#### Why change the data as well as the network?

The earlier setup made choices about which examples belonged in the test. It used a single agreement case per sentence. Its test examples also required that the noun phrases between subject and verb be attractors, a restriction that did not apply to its training examples. These choices produce a test in which the intervening nouns consistently point towards the alternative answer. They give that particular kind of interference a clear interpretation.

Bernardy and Lappin wanted to know how the same prediction task behaves in a broader sample. Their design allows a sentence to contribute several dependencies. It also allows matching nouns and attractors to occur together. In a sentence that mentions the records for an office and its employees, the interval between a plural controller and a later verb can contain both a singular noun and a plural noun. An example of that kind belongs in the authors’ data even though only one of the interveners counts towards its attractor total.

Broadening the data changes what a point on an accuracy curve represents. In the earlier test, the mismatching nouns accounted for all intervening noun phrases. Here, an attractor group can include examples with different numbers of additional, matching nouns. It can include short, relatively bare dependencies and longer dependencies with several sources of number information. This distribution is closer to the variety the authors wanted to study. It also makes the comparison with the earlier study a comparison between experimental designs as well as between networks.

The authors make a second change by comparing how different architectures use the same kind of agreement evidence. Recurrent processing maintains a running representation of the prefix. Convolution combines features from local windows through successive layers. The paper’s comparison asks whether, in the implementations tested, these different ways of assembling evidence work equally well when the relevant noun is separated from the verb by other candidates.

A further question is what kind of input best exposes agreement. A number-marked grammatical tag can preserve the distinction between singular and plural while removing the identity of a particular noun. If lexical variation mostly complicates the training examples, replacing words with tags should make the recurring structure easier to learn. If particular words help the system distinguish phrase types, potential subjects, or likely continuations, the replacement can remove information the learner would otherwise use. Both possibilities are compatible with the fact that number remains visible on relevant tags. The experiment asks which effect dominates for the predictors and data at hand.

### The method, step by step

#### From a sentence to an agreement example

The authors start with English sentences from WaCkypedia. The corpus carries grammatical annotations supplied by TreeTagger and MaltParser. TreeTagger provides word-class labels, including distinctions the authors use to identify verb number. MaltParser provides relations between words, among them the links needed to locate the subject that controls a verb. The experiment uses the annotations for different purposes. One role of [part-of-speech tagging](https://md.research.elamur.ai/free/en/concepts/part-of-speech-tagging/) is to recover the target number. The role of [dependency parsing](https://md.research.elamur.ai/free/en/concepts/dependency-parsing/) is to identify the relation whose difficulty the test measures.

For a present-tense agreement case, the researchers identify the target verb, its number, and its controlling subject. The sequence before the target provides the input for the number decision. Because the target form is the property to be predicted, the classifier works from the prefix. For example, the words through *cabinet* in the sentence about missing keys supply the context for a plural answer. The plural inflection itself supplies the label used to judge the answer.

The dependency analysis lets the authors isolate the interval that matters for the test. They can identify nouns between the controller and the target, distinguish those whose number matches from those whose number differs, and count the attractors. Grammatical analysis thus supplies information to the experimenter that is unavailable to the classifier as an explicit parse. At prediction time the classifier must find whatever regularities support a decision from the encoded sequence it receives.

A sentence can contribute multiple targets. A verb in a clause describing the subject may itself participate in agreement, and the main verb can contribute a separate example with a later endpoint. The resulting examples can share words while posing different number questions. The controlling subject, prefix boundary, and set of interveners all depend on which verb is being considered. This is why the size of the agreement corpus refers to cases of agreement rather than a count of distinct sentences.

How sentences become agreement predictions The steps in order.

#### What the network sees

For the vocabulary experiments, the authors retain a chosen set of frequent words as individual inputs. They replace the remaining words with corresponding grammatical tags. A threshold changes which words have distinct representations. At the smallest threshold, common words still occur as words, while the bulk of the lexical inventory is represented by tags. At a larger threshold, many more individual words keep their identities. The authors use 100, 10k, and 100k retained words in the supervised vocabulary comparison.

A tag can make a grammatical distinction visible consistently across many words. It can indicate number where the tag inventory records it, allowing many rare nouns to share a representation. At the same time, words with the same tag can play different roles in the patterns found in the corpus. If two nouns with the same number occur in systematically different contexts, the reduced representation merges information a network might use to tell those contexts apart. The effect of merging can therefore be measured by comparing predictors trained on the differently encoded inputs.

The sequence consists of word and tag identities that can be represented as vectors. An embedding gives an input item a position in a space of learned features. A larger set of retained words means that more identities can have their own vectors. The dimension of those vectors is a separate choice. Vocabulary size determines how many distinctions the input can make between word identities, while embedding dimension determines how many coordinates are available to represent each item. The distinction is important because the authors vary both. The shared term for these lexical vectors is [word embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/).

In the reference experiment, the word vectors have dimension 50. The embedding comparison uses dimensions 17, 50, 150, and 450. The authors keep the vocabulary setting fixed while doing that comparison, so a change in dimension does not by itself preserve an additional word identity. Conversely, the vocabulary comparison alters the treatment of words outside the retained list. It can change the information supplied by the input even with the same number of coordinates per vector.

The intended benefit of reduction was stronger than simply using fewer lexical entries. The authors wanted to make the shared grammatical pattern more prominent. If the same dependency occurs with many lexical combinations, mapping rare words to grammatical categories pools those combinations into a smaller set of recurring sequences. The experiment leaves the links between subjects and verbs implicit, however. The resulting tags label the individual words that remain in the sequence. The network still has to learn which item in that sequence supplies the number for the output.

#### The supervised networks

The first supervised architecture is an LSTM recurrent network. As each item in the sequence is read, a cell updates a state that can carry information forward. This gives information from the subject a possible route to the final state even when many words intervene. A dense output layer reads the output of the last recurrent cell. Its sigmoid activation produces a score suitable for choosing between the two numbers. The target of training is the correct number of the verb associated with that prefix.

A gated recurrent unit network, or GRU, provides another recurrent architecture. It also builds a state as the input is read and passes the final recurrent output to a dense sigmoid classifier. The architectures have distinct recurrent cells, but they share the feature of carrying a state from one position to the next. Using both tests whether the findings depend on the particular recurrent design used by Linzen and colleagues. The GRU follows the type described in [Cho and colleagues’ RNN encoder–decoder paper](https://md.research.elamur.ai/free/en/papers/cho-2014-learning-phrase-representations-rnn-encoder/).

The third supervised system is a convolutional neural network, or CNN. Its filters detect patterns over portions of the input. Applying successive layers lets later features combine information derived from earlier ones. Here the authors use a fixed convolutional architecture with a dense sigmoid output for the same two-way decision. The convolutional layers use rectified linear units, or ReLUs, which keep positive activations and set negative activations to zero.

The authors describe the convolutional network as having 6 levels. In their description of the filtering stages, vector dimensions go from 15 through 20, 15, 10, and 5, while the convolution stages yield 7, 5, 5, and 3 features, respectively. These are architectural settings for the particular CNN in the study. The construction gives the convolutional system several stages in which to combine features before its final classification. The recurrent systems, by contrast, can keep revising a running state at each new word.

The architectures were implemented in Keras with TensorFlow as the backend. The authors wrote their own implementations and prepared their own data even though the experimental question followed earlier work. They make their code and datasets available under the name DNNSyntax. The agreement networks come together at a common experimental endpoint: given the encoded prefix, assign a number that can be checked against the verb in the corpus.

#### Training the classifiers and choosing settings

The researchers first reserve a portion of the agreement examples for testing. The material allocated to training is subdivided again, with a portion used for fitting and a separate portion used for validation. During fitting, the predictions are compared with the labels. Back-propagation computes how changes to network weights affect the prediction loss, and the optimizer uses that information to update the weights. The study uses the [Adam optimizer](https://md.research.elamur.ai/free/en/papers/kingma-2014-adam-method-stochastic-optimization/).

A batch is the group of training examples used to make an update. Bernardy and Lappin use batches of 1024, while the earlier study used 16. After each pass through the fitting portion, the authors compute average loss on the validation portion. They stop at a local minimum of that validation loss. Validation thus guides how long fitting continues. The reserved test portion is where the researchers then measure number-prediction accuracy, including its behavior at different attractor counts.

For the parameter comparisons, the authors first establish a reference LSTM. It has one recurrent layer with 150 hidden units, a vocabulary of 10,000 words, and embedding dimension 50. Its dropout is 0, and 90% of the corpus is assigned to the training portion before the validation subdivision. Hidden units determine the size of the recurrent layer’s representation. Dropout is a training setting that reduces reliance on particular components of the network. In these classifier experiments it applies within the recurrent layers, while the final dense layer is left outside that treatment.

The reference configuration gives each one-parameter experiment a common point of departure. The training allocation can be set to 10%, 50%, or 90%, with the rest used for testing. Recurrent width can be set to 50, 150, 450, or 1350 units. Recurrent depth can be set to 1, 2, or 4 layers. The candidate dropout rates are 0, 0.1, 0.2, and 0.5. The vocabulary and embedding choices change the input representation, whereas width, depth, and dropout change how the recurrent network processes it.

Holding the other settings fixed makes each curve comparison interpretable around the reference configuration. A wider recurrent layer, for example, is compared with the same underlying vocabulary and embedding choices. The setup also means that a useful change in one comparison is measured in the presence of those particular choices. The authors later bring favorable settings together in a single network and test the resulting configuration directly.

#### Training a predictor of the next word

The second approach uses an LSTM trained on sentences to assign probabilities to possible next words. The target during training is the item that actually follows the prefix. That target includes both the identity of a retained word or tag and, where represented, its inflected form. Agreement is assessed by examining these probabilities after training. The system receives no dedicated singular-versus-plural target for the agreement examples during this next-word training.

The architecture description gives the predictor two recurrent layers with 1200 units per layer and dropout of 0.5. The authors also tried dropout of 0.1 for this network and report worse results with it. The caption of the next-word results figure gives 1000 units for the network plotted there. The paper leaves the relationship between that figure setting and the architecture description unresolved.

The predictor keeps the 100 most frequent words and uses grammatical tags for the others. This limits the inventory of outputs it has to distinguish. It also means that many sequences share the same encoding even when the underlying sentences contain different words. The intention is to give the predictor a better chance to learn recurring grammatical environments without having to distribute probability among a large number of lexical alternatives.

The authors describe this branch as unsupervised with respect to agreement. There is still a training target for each prefix, and constructing the input and output inventory uses grammatical annotations. In particular, the tag substitutions are a deliberate intervention that favors information about grammatical categories. The distinction is that the training objective teaches next-word probabilities, while the agreement answer is obtained by a separate decision from those probabilities.

#### Turning next-word probabilities into an agreement answer

The first decision rule pools all eligible verb outputs by number. The authors compare the combined probability assigned to the forms that agree with the subject with the combined probability assigned to the forms that disagree. Agreement counts as correct when the first total is greater. A single likely verb can contribute heavily to its side, or several less likely verbs can together give one number the higher total. This is the summing test in inequality (1.1).

```
∑ᵥ∈Vₙ p(v ∣ wᵢ₋₁, …, wᵢ₋ₖ) > ∑ᵥ∈V¬ₙ p(v ∣ wᵢ₋₁, …, wᵢ₋ₖ)
```

Here, `i` is the target verb’s position, and `k` is the length of the prefix used in the comparison. Each `w` is a word or its substituted tag. The subscripts `i−1` through `i−k` identify positions before the target, and the ellipsis stands for the intervening prefix items. The commas separate items in the conditioning context. In `p(v ∣ …)`, `p` is the predicted probability and the vertical bar means *given*. The candidate output is `v`. The symbol `n` denotes the number required by the controlling subject, and `¬n` denotes the opposite number. The sets `Vₙ` and `V¬ₙ` contain the candidate verb outputs with those respective markings. Each `∑` adds the probabilities for outputs that belong to the set, as indicated by `∈`. The sign `>` gives the strict comparison used to count a correct answer.

The two sums use exactly the same prefix. One can think of the test as asking whether the predictor favors singular or plural across the verb choices available after those words. Other kinds of outputs may also have appreciable probability under the next-word objective. The rule compares the two verb totals directly, so they do not need to account for all the probability assigned to continuations.

The second decision rule fixes the identity of the verb. The researchers take the verb found in the corpus at the target position and compare its observed form with the same verb carrying the opposite number. Thus in an example about keys, the evaluation can compare *are* and *is* while holding the preceding words fixed. The appropriate form must have higher probability for the prediction to count as correct. This is the verb-targeted test in inequality (1.2).

```
p(verbᵢⁿ ∣ wᵢ₋₁, …, wᵢ₋ₖ) > p(verbᵢ¬ⁿ ∣ wᵢ₋₁, …, wᵢ₋ₖ)
```

The symbol `verbᵢ` refers to the verb at position `i`. The superscript `n` marks its form with the required number, and `¬n` marks its form with the other number. The symbol `p` is again the predicted probability. The vertical bar conditions each probability on the prefix, whose words or tags are `w` at the positions indicated by the subscripts. The commas separate those items, and the ellipsis represents the remaining items up to the prefix length `k`. The greater-than sign compares the two probabilities for the same context.

The targeted test supplies information at evaluation time by naming the relevant verb. It can handle a case where the predictor strongly expects a different continuation but still orders the forms of the target verb correctly. The summing test, by pooling over identities, measures a broader preference across verbs. That can reward or penalize the predictor for expectations about which verbs are likely to occur, even if its preference between the two forms of the actual verb is sound.

The distinction is meaningful even with a reduced vocabulary. The authors count 4 inflectible verb choices in its representation and describe them using *be*, *have*, *state*, and the `VV` tag that groups other verbs. The targeted rule therefore pins down a limited amount of lexical information. For a verb represented by a tag, the comparison is between the available number-marked outputs in that representation. In either case, which outputs are compared is part of the evaluation procedure.

### Experiments and results

#### Test data and baselines

WaCkypedia supplies ⇠24 million examples of present-tense subject–verb agreement. The earlier study had ⇠1.35 million examples in its Wikipedia-derived corpus. The figures describe agreement cases under different selection procedures. In particular, permitting multiple dependencies from a sentence and keeping mixed interveners makes the composition of the larger collection different as well as changing its size.

The principal metric is number-prediction accuracy on held-out examples. A supervised prediction is correct if the selected number matches the target label. For the next-word system, a correct prediction means that the comparison for the appropriate number comes out ahead under the rule being evaluated. The accuracy plots group examples by the number of intervening attractors. The paper also plots how many test examples fall in each group, because the groups differ in size.

The authors find that 73% of the verbs in their test sets are singular. Always predicting singular therefore supplies the reported majority-choice baseline of 73% accuracy over the test material. The authors show it as a horizontal reference in the accuracy figures. It gives the reader a sense of what a predictor can achieve by exploiting the overall distribution alone. The reported percentage describes the test material as a whole. The paper supplies the same reference line across attractor counts.

An attractor curve and a single aggregate score answer different questions. An aggregate describes expected success across the examples in a particular test set. Its value depends on how often easy and hard cases occur. The curve asks how success changes as more nouns supply opposing number cues. It therefore gives uncommon but informative examples more visibility in the presentation. The separate count plot shows that examples become scarcer as attractor count rises, a detail that matters when interpreting the end of the curve.

#### What the earlier results establish for comparison

The supervised network of Linzen and colleagues used word vectors with 50 dimensions and an LSTM with 50 hidden units. Its supervised training used ⇠121,500 agreement examples, reported as 9% of its corpus. Testing used ⇠1.21 million examples, reported as 90% of that corpus. These quantities describe the earlier study’s data allocation and architecture. They establish the operating point from which Bernardy and Lappin depart.

On the earlier test, the supervised LSTM achieved 99% accuracy at 0 attractors and 83% accuracy at 4 attractors. The earlier study reports no score above 4 attractors in the comparison discussed here. In its next-word experiments, its own predictor fell below chance at 4 attractors. The larger Google system reached ⇠45% error at 4 attractors in the results that Linzen and colleagues reported. That last figure is an error rate, while the figures for the supervised LSTM are accuracy rates.

The current authors use these results to place the difficulty of their own task in context. Their supervised recurrent networks show the same broad ability to handle interfering nouns. They did not reproduce the earlier near-perfect result at 0 attractors. They point to their larger collection and less filtered examples as possible explanations. A zero-attractor example in their data can still contain nouns that agree in number with the subject, and it can come from a sentence that contributes several dependencies. The label for the group therefore does not make the current and earlier tests interchangeable.

The training splits also deserve separate treatment. Bernardy and Lappin assign 10%, 50%, or 90% to training in their split comparison. The remainder is held for testing, and the training portion is subdivided for validation. Because the underlying corpus is larger and the selection rules differ, comparing percentages across the papers cannot on its own establish relative data efficiency. Within the current study, the gain from 10% to 50% is clear for the reference LSTM. Moving to 90% changes performance much less. At 6 attractors the authors report a slight decline for the larger training share in that comparison.

#### Architecture and vocabulary

In the authors’ architecture comparison, the LSTM and GRU reach similar levels of number-prediction accuracy. Both perform substantially better than the CNN they implemented. The recurrent comparison is meaningful because both networks solve the same narrow task from word and tag sequences using the same kind of final classifier. The result supports the use of recurrent processing in this experimental setting. It also focuses attention on what the chosen recurrence lets the system carry across intervening material.

Vocabulary size matters in each supervised architecture. On the test curves, retaining only 100 words and tagging the rest consistently lowers accuracy. With the LSTM, moving to 100k retained words generally improves performance. The CNN’s response to the largest vocabulary is mixed. This matters because it separates the robust finding about the very small vocabulary from a stronger claim of uniform gains all the way to the largest vocabulary. The evidence for that latter trend is clearest for the LSTM.

The paper reports these results as curves by attractor count. The useful numerical comparisons it states in prose include the experimental settings, the majority baseline, and the earlier published results. The architecture and vocabulary comparisons are described by the direction and consistency of the observed changes. This distinction keeps the exact reported numbers tied to their own experiments and leaves the plotted differences at the precision the authors give them in prose.

#### The combined supervised configuration

The strongest configuration in the paper is an LSTM with 2 layers, 1350 units per layer, dropout of 0.1, a vocabulary of 100k words, and lexical embeddings of dimension 150. Its training allocation is 90% of the corpus. The authors combine settings that performed well while varying individual parameters and then run the resulting system. Its accuracy curve is the highest-performing supervised result reported in the study.

Width was one dimension of the search. The chart gives the widths in the controlled LSTM comparison and marks the width used by the best combined system. It measures the size of the recurrent layer. The accuracy finding comes from evaluating those settings on held-out agreement examples. Larger widths helped most visibly as the attractor count grew, with little further overall gain at the largest setting.

Recurrent width settings for supervised agreement on WaCkypedia Increasing recurrent width mainly helped on examples with more attractors, with smaller gains at the widest setting.

**The numbers**

| System or setting | hidden units per LSTM layer |
| --- | --- |
| Smallest tested layer | 50 |
| Reference layer | 150 |
| Wider layer | 450 |
| Width used in the best combined LSTM (this paper) | 1350 |

The combined configuration matters because improving each setting separately need not tell us how the settings perform together. The final run establishes that the combination does work well as a whole on the paper’s test. It joins a larger lexical inventory to larger embeddings and more recurrent capacity. Its overall performance measures that package of choices. The individual comparisons give the evidence for how particular changes behave around the reference setting.

#### The next-word predictor and its two tests

The authors evaluate the reduced-vocabulary next-word predictor with the summing rule and the verb-targeted rule. In both cases, the system supplying the probabilities is the same for the comparison. When the researchers sum the probabilities of verb forms by number, performance is comparable to the next-word results of Linzen and colleagues. When they compare the two forms of the actual target verb, agreement accuracy rises substantially.

The targeted result is stronger than the earlier next-word results reported for the Linzen system and the larger Google system. Linzen and colleagues already used the targeted method, so Bernardy and Lappin’s result also involves differences in the predictor, corpus, and input representation. Within the current paper, comparing the two procedures directly shows that the way probabilities are read can make a large difference even for a fixed trained system. The cross-paper comparison leaves several additional factors in play.

Verb targeting brings the next-word predictor roughly into the range of the authors’ CNN. The best supervised LSTM remains ahead. The clearest comparison in the results is therefore between the targeted next-word predictor and the stronger supervised recurrent system. The paper’s broader account also places the dedicated supervised systems ahead, while describing the CNN and targeted result as roughly comparable in the detailed discussion.

These results give two different meanings to success at agreement. The classifier learns a direct mapping from a prefix to singular or plural. The targeted next-word test asks whether the right inflection wins once a particular verb is specified. Pooling leaves the identity of the continuation open and asks for a preference across the verbs as a group. The results show that the same underlying probabilities can support a strong answer to the targeted question while giving a weaker answer to the pooled one.

### What the ablations show

#### Preserving lexical information helps supervised prediction

The vocabulary comparison changes what the learner sees while keeping the agreement task in place. The original hypothesis favored the small inventory. Collapsing many nouns and verbs into number-marked grammatical categories would let the learner see many superficially different sentences as instances of the same pattern. If lexical detail were largely a distraction, the repetition of those abstract sequences could make the right dependency easier to discover.

The result goes in the opposite direction across the supervised architectures at the smallest vocabulary setting. Even though the tag representation preserves some of the number information needed for the answer, it frequently loses useful context for determining which number governs. A tag can tell the learner that a noun is singular. The surrounding words and their distribution can help signal whether that noun is the controller, a modifier inside the subject phrase, or a participant in an embedded clause. The comparison supports the importance of the information retained by the richer encoding.

The authors give two compatible interpretations. One is that lexical embeddings encode grammatical regularities gradually, through recurring environments for individual words. The other is that larger vocabularies expose meaning-related cues that guide expectations about the relevant verb and its subject. The available comparison changes both kinds of information at once. It can establish a cost to replacing most words with tags, while leaving the contribution of lexical meaning and lexicalized grammar unresolved.

The pattern at the largest vocabulary also varies by architecture. The LSTM generally benefits from 100k retained words. The CNN shows mixed changes at that size. This suggests that the usefulness of added word identities depends partly on how a system combines the resulting input features. The experiment is especially clear about the loss from the smallest inventory. Above that setting, the effect is conditional on the architecture and examples being evaluated.

#### Embedding dimension changes a different part of the input

Enlarging an embedding adds coordinates to the representation of an item already in the inventory. Enlarging the vocabulary lets the system distinguish word identities previously pooled under a tag. The two changes therefore help answer different questions. In the vocabulary experiment, preserving a particular word can restore a distinction at the input. In the dimension experiment, the learner gets more or less room to represent distinctions among the inputs it already receives.

Reducing embedding dimension from 50 to 17 lowers accuracy for the LSTM. Increasing it to 150 helps. The further increase to 450 yields no additional benefit overall and reduces accuracy in some groups. The data thus associate greater representational room with a gain over part of the range, followed by diminishing returns. A larger embedding space by itself supplies no guarantee that the learned coordinates will improve the decision on held-out sentences.

Taken together, the vocabulary and dimension experiments make the lexical result more specific. The classifier benefits from preserving more identities and, at the tested operating point, from giving their vectors more capacity up to 150 dimensions. The gain from one choice cannot be read directly from the gain from the other. For instance, a richly parameterized vector for a grammatical tag still represents the words pooled under that tag as the same input item.

#### More training and wider recurrent state help over part of the range

The split comparison gives the reference LSTM appreciably more training material when the allocated share rises from 10% to 50%. Performance improves. The result is consistent with the possibility that recognizing relevant patterns across many kinds of intervening context needs substantial exposure. The move from 50% to 90% changes the curves much less, including the slight decline at 6 attractors. The evidence supports a gain over the lower part of the tested range, with a flatter pattern beyond it for this configuration.

Changing the split also changes the test portion. The comparison therefore reflects the behavior of the whole allocation procedure. The authors can observe a robust direction when the curves separate clearly, while a small reversal at a rare attractor count has a narrower interpretation. The example-count plot makes that concern concrete by showing how rapidly the amount of test evidence recedes as more attractors are required.

Increasing LSTM width from 50 to 150 hidden units improves the agreement curves. A further increase to 450 yields a clearer advantage at higher attractor counts. The move to 1350 provides a small overall improvement. Width gives the recurrent layer more capacity to represent information about the sequence. The location of the improvement matters: the wider layers are most visibly helpful where the input offers several opportunities to confuse the subject’s number with that of other nouns.

The width experiment does not reveal what the additional units store. They could support a richer combination of local cues, more persistent information about earlier words, or a representation that reflects the grammatical organization of the sequence. The measured outcome is which number the classifier selects. The authors propose that a more explicitly structured memory could be worth testing because a dependency can begin, remain relevant across an intervening clause, and then be resolved. Their width comparison gives a reason to study memory capacity without identifying the mechanism behind the improvement.

#### Depth and dropout have smaller effects

Increasing depth from 1 to 2 recurrent layers gives a modest gain when each layer has 150 units. Using 4 such layers makes no clear further difference. This experiment isolates depth in the neighborhood of the reference LSTM. It indicates that adding layers is a relatively weak lever in this setup compared with the gains seen from the larger vocabulary or some of the changes to recurrent width.

The classifier’s dropout comparison has a similarly limited favorable range. A rate of 0.1 improves accuracy slightly over the setting of 0. The move to 0.2 offers no clear benefit, and 0.5 reduces performance for the supervised reference setup. The next-word training description reports a different pattern, with 0.5 working better than 0.1 there. The networks and objectives differ, so the favorable rate in one branch is evidence for that branch under its own conditions.

The combined supervised run illustrates why small gains can still matter to the overall design. A depth change or a light dropout adjustment may move a curve only slightly in isolation. Several choices can nevertheless yield a stronger package when used together. The paper tests one such package. It does not exhaustively cross every rate, width, vocabulary, and training allocation, so the results describe the tested combinations and the controlled changes around the reference.

#### Targeting the verb changes what is measured

The two probability comparisons form a controlled analysis of the next-word predictor. Each one uses the same test prefix and the same underlying next-word probabilities. The summing rule retains all the eligible verb choices, so differences in lexical preference can change the result. The targeted rule restricts the decision to a single verb’s forms. This brings the test closer to the question of whether the network prefers the correct inflection given a particular verb.

Imagine a prefix after which the predictor puts substantial mass on several continuations represented as singular. The actual target verb can still have a higher probability in its plural form than in its singular form. The pooled decision would favor singular if the aggregate of those alternatives is high enough. The targeted decision would choose plural. That possibility explains how a system can have useful information for agreement even when summation extracts a weaker signal.

The strong targeted result does not provide the same evidence as the supervised small-vocabulary experiment. The supervised experiments compare several vocabulary sizes. The next-word agreement comparison tests two readouts under the restricted inventory. The good targeted performance establishes that a reduced inventory can support this evaluation. An experiment that varies next-word vocabulary while keeping the assessment rule fixed would be needed to see whether a larger inventory helps or harms that success.

#### Attractor count reveals a change in test composition

The example-count plot is an analysis of the dataset. It shows an inverse relationship between the number of attractors and the number of test cases. The low-count groups contribute most of the evidence available for assessing performance in typical examples. The high-count groups are valuable because they expose the predictor to more contradictory number cues. Their rarity means that an overall score would give those cases relatively little influence.

Grouping by attractor count thus makes it possible to see effects that may be muted in a corpus-wide aggregate. The advantage of widening the recurrent state is more visible at higher counts, for example. The count plot also helps calibrate the interpretation of a small movement among rare cases. A change in one such group can be relevant to the question about interference while requiring more evidence to establish how stable it is.

An attractor bin can also contain a mixture of structural situations. A higher count guarantees more intervening nouns with conflicting number under the experiment’s definition. It leaves details such as clause boundaries and the position of matching nouns open. The performance trends therefore describe how the predictors handle this naturally varying collection as the measured kind of interference increases.

### Limitations

#### Limits identified by the authors

Bernardy and Lappin distinguish the ability to predict agreement from evidence about the hierarchy a recurrent network identifies. A recurrent network can preserve information through a sequence and can do so effectively enough to support many correct decisions in their test. Whether its learned state identifies the larger structure of a sentence, and how explicitly it does so, remain open questions. The experiment does not inspect the recurrent state to recover a tree or identify a specific variable that stores the controller’s number.

They also limit the architectural conclusion to the systems they implemented. Their recurrent networks use relatively simple recurrent architectures, and their CNN is a fixed convolutional design. They consider a recurrent memory that behaves more like a stack, preserving information at the start of a dependency and releasing it later. They also raise the possibility of a convolutional system with dynamic memory. These proposals illustrate how much variation is left within architecture families after the reported comparison between the LSTM, GRU, and CNN.

The authors are cautious about their vocabulary interpretation. Rich lexical representations improve supervised performance, but the observed gain could come from distributional evidence about grammatical behavior, meaning-related cues, or a combination. The study establishes a relationship between preserving lexical detail and better agreement prediction under its supervised setup. Its tests do not identify which parts of particular embeddings drive a successful decision.

The next-word vocabulary claim is narrower still. The authors conjecture that reducing the output inventory might improve probabilistic predictions by emphasizing grammatical context. Their targeted result demonstrates that the 100-word representation works to a useful degree. They explicitly leave larger vocabularies for future comparison. The success of the targeted rule in this setting cannot establish that 100 retained words give better agreement judgments than a richer next-word vocabulary would.

The study also addresses one agreement feature in English. The authors point to languages in which person and gender, as well as number, can be reflected on the verb. Handling those dependencies would require successful prediction across additional feature dimensions. The authors propose that such cases would give a better view of what neural networks can learn about syntactic relations. Their current evidence concerns the prediction of number on present-tense English verbs.

Finally, they decline to draw conclusions about how humans acquire agreement. They discuss work suggesting that syntactic and lexical-semantic information can be closely associated in the brain and note a possible parallel with their lexical results. The agreement experiment measures how trained networks behave. It supplies no direct test of a human learning process or a shared implementation, a distinction relevant to [psycholinguistics](https://md.research.elamur.ai/free/en/concepts/psycholinguistics/).

#### Limits visible in the experimental design

The outputs are labels derived from an annotated corpus. The interpretation of a case depends on the tag giving the correct number and the parser identifying the intended controlling subject. The second requirement is especially important for the attractor analysis. A wrong subject link can place the endpoints of the interval incorrectly or assign a noun to the wrong agreement group. The study does not give a separate estimate of annotation accuracy for the examples, so the contribution of such errors to the curves is unknown.

Attractor count is an informative index of interference, but examples with different counts also differ in ways the count does not control. Sentences with more conflicting nouns may have longer prefixes, different constructions, or more potential cues from neighboring verbs. Naturally occurring sentences are useful precisely because they contain this variation. The grouping hence measures observed difficulty across examples. It cannot by itself give a causal estimate of what happens when the researcher adds one attractor to an otherwise unchanged sentence.

Likewise, mixed interveners make many forms of success possible. A network that finds the subject through stable structural cues and a network that uses strong lexical and positional clues can give the same answer. The use of real corpus examples makes those cues part of the environment being learned. The paper’s hypothesis about rich lexical representations is compatible with both kinds of behavior. A design that independently manipulates lexical cues and subject structure would be needed to distinguish them more sharply.

The result at 0 attractors shows why cross-paper scores need their test conditions attached. Bernardy and Lappin broaden the selection rules and use a different corpus and training setup. That changes the balance of constructions and may change tagging or parsing behavior. Their difficulty reproducing the earlier near-perfect score has several plausible sources. The comparison establishes how the systems performed under their respective protocols, while the contribution of any single design change remains uncertain.

Using several agreement targets per sentence provides more training and test cases. It also means that some examples share contexts. The paper describes the training allocations in terms of agreement examples and does not specify whether examples from the same sentence were always grouped together when partitioning the data. That detail would matter when interpreting the independence of the test material. The counts themselves establish the number of prediction targets, with sentence-level independence left unresolved.

The test distribution raises a separate question about the majority baseline. The 73% reference is the singular proportion reported for the test material overall. The figure of accuracy by attractor count would have a different diagnostic reading if the singular proportion shifted substantially across groups. For example, an overall majority preference can be stronger in one group than another. The paper does not provide group-specific class proportions, so the reference line should be read as the reported global benchmark.

The rare high-attractor groups deserve particular care. The paper shows that they contain fewer test examples. Its prose describes relative changes in their accuracy curves, but supplies no uncertainty estimates for those differences. A small gap at a high count therefore gives limited information about what another sample of that group would show. Broad separations that persist across the curves and are reflected in related comparisons carry a different weight from an isolated movement at the end of a plot.

The next-word setup also narrows what can be concluded from targeted success. Supplying the verb at evaluation time removes one source of uncertainty about the continuation. The test measures a conditional preference over forms. A system can succeed on that preference without assigning high probability to the target word relative to all the other things that might follow the prefix. This matters if the intended conclusion concerns grammatical continuations during ordinary next-word prediction as well as paired judgments over verb forms.

One setting is left ambiguous by the paper itself. The next-word architecture description specifies 1200 units per layer, while the result caption specifies 1000 units. Both refer to the branch evaluated through next-word probabilities. The account does not establish whether the plotted run used a different width or whether one of the numbers is a reporting discrepancy. The comparison between summing and targeting remains clear as described, while the exact width for reproducing that plotted result is unresolved.

### What came after

The later papers that cite Bernardy and Lappin take up different parts of the question posed by the agreement experiments. Some focus on how to isolate structure from lexical context. Others ask what an internal state must preserve during prediction, or how agreement can be studied in another language. Their titles establish these lines of inquiry. The relationship is clearest when each is placed next to a specific choice or unresolved question in the original experiment.

Colorless Green Recurrent Networks Dream Hierarchically takes up hierarchical behavior in recurrent sequence learning. Its title puts the issue in terms of language that evokes grammatical structure under unusual lexical combinations. That focus meets a tension in Bernardy and Lappin’s findings. Keeping words intact helped the supervised learner, yet that gain also made it harder to separate sensitivity to structure from reliance on familiar lexical contexts. A study framed around hierarchy and unusual lexical combinations addresses the question of how to assess structural behavior when ordinary word associations are less informative. [Colorless Green Recurrent Networks Dream Hierarchically](https://md.research.elamur.ai/free/en/papers/gulordava-2018-colorless-green-recurrent-networks-dream/)

RNNs as Psycholinguistic Subjects connects grammatical dependency to the idea of syntactic state. Bernardy and Lappin’s classifier produces its decision from the state available at the end of a prefix. A dependency can become relevant earlier, as soon as a controller is read, and remain open while other words arrive. Treating a recurrent network as a subject of a psycholinguistic study turns that sequence of events into a question about what the network keeps track of during processing. The focus extends the original interest in the final choice towards the state that supports grammatical expectations as the sentence unfolds. [RNNs as Psycholinguistic Subjects](https://md.research.elamur.ai/free/en/papers/futrell-2018-rnns-psycholinguistic-subjects-syntactic-state/)

Neural Language Models as Psycholinguistic Subjects frames the question around representations of syntactic state in next-word prediction. That framing connects particularly closely with Bernardy and Lappin’s probability comparisons. The earlier paper finds that agreement is much more visible when the evaluation compares two forms of one verb. The later title moves the inquiry towards the grammatical condition represented by the system as it reads the context that precedes such a choice. The common thread is the use of observable expectations to ask which aspects of an unfinished sentence are represented before the relevant continuation arrives. [Neural Language Models as Psycholinguistic Subjects](https://md.research.elamur.ai/free/en/papers/futrell-2019-neural-language-models-as-psycholinguistic/)

The Emergence of Number and Syntax Units in LSTM Language Models shifts the focus to individual units and their relationship to number and syntax. The original width comparison shows that adding recurrent units can improve performance, especially in examples with more attractors. That analysis measures how much capacity is available to the classifier and how well it performs. Looking for units associated with number or syntax poses a more specific representational question: whether the information needed for agreement is concentrated in identifiable components of an LSTM. The later paper’s focus connects the behavior measured by the agreement test to the [interpretability](https://md.research.elamur.ai/free/en/topics/interpretability/) of its internal state. [The Emergence of Number and Syntax Units in LSTM Language Models](https://md.research.elamur.ai/free/en/papers/lakretz-2019-emergence-number-syntax-units-lstm/)

UnNatural Language Inference takes the question of evidence from unusual language into the distinct task of inference. Bernardy and Lappin alter the balance between lexical and grammatical information through word-to-tag replacement and then measure agreement. Inference has a different target judgment. The connection lies in asking what a language task can tell us when the form of the input changes, and in separating the observed behavior from claims about which information supports it. The citation puts the agreement study in conversation with that broader evaluation question. [UnNatural Language Inference](https://md.research.elamur.ai/free/en/papers/sinha-2021-unnatural-language-inference/)

BLM-AgrF places generalization of agreement at the center of a benchmark in French. It connects with the original paper’s proposal to look beyond the English setup. In the WaCkypedia experiment, the main comparison concerns number on present-tense verbs under varying degrees of interference. A French benchmark makes agreement generalization a target of evaluation in another language, where the examples and the information available in their word forms must be specified for that setting. The link is the use of agreement to ask whether a learned dependency carries across contexts, with the benchmark defining which contexts supply the test. [BLM-AgrF](https://md.research.elamur.ai/free/en/papers/an-2023-blm-agrf-new-french-benchmark/)

## Cite

Cite as Jean-Phillipe Bernardy and Shalom Lappin. 2017. Using Deep Neural Networks to Learn Syntactic Agreement.

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@misc{bernardy2017using,
  title = {{Using Deep Neural Networks to Learn Syntactic Agreement}},
  author = {Jean-Phillipe Bernardy and Shalom Lappin},
  year = {2017},
  url = {https://aclanthology.org/2017.lilt-15.3/}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
