---
title: "Probing for targeted syntactic knowledge through grammatical"
description: "A study of whether pretrained language models can locate subject–verb agreement errors, and how detection varies across layers, training…"
canonical: "https://research.elamur.ai/free/en/papers/davis-2022-probing-targeted-syntactic-knowledge-through/"
---
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/davis-2022-probing-targeted-syntactic-knowledge-through/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2022](https://md.research.elamur.ai/free/en/papers/2022/) / Probing for targeted syntactic knowledge through grammatical error detection

# Probing for targeted syntactic knowledge through grammatical error detection

Paper · 2022 · Christopher Davis, Christopher Bryant, Andrew Caines et al.

**Authors:** [Christopher Davis](https://md.research.elamur.ai/free/en/authors/christopher-davis/), [Christopher Bryant](https://md.research.elamur.ai/free/en/authors/christopher-bryant/), [Andrew Caines](https://md.research.elamur.ai/free/en/authors/andrew-caines/), [Marek Rei](https://md.research.elamur.ai/free/en/authors/marek-rei/) and [Paula Buttery](https://md.research.elamur.ai/free/en/authors/paula-buttery/) · **Year:** 2022 · **Venue:** Proceedings of the 26th Conference on Computational Natural Language Learning (CoNLL) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Proceedings of the 26th Conference on Computational Natural Language Learning (CoNLL) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2022.conll-1.25/)
- [PDF](https://aclanthology.org/2022.conll-1.25.pdf)
- [DOI 10.18653/v1/2022.conll-1.25](https://doi.org/10.18653/v1/2022.conll-1.25)
- [arXiv 2210.16228](https://arxiv.org/abs/2210.16228)

## Summary

A system that prefers *the train is* to *the train are* has passed a test of English subject–verb agreement. A different test gives it the sentence with *are* and asks it to find the faulty word. The authors use that second test to investigate what a [pretrained language model](https://md.research.elamur.ai/free/en/concepts/language-model/) encodes about agreement. Their method treats grammatical error detection as a probe, a small classifier that reads the information available in an existing representation. The classifier examines every token in a sentence and predicts whether that token contains an agreement error. It has to find the verb by itself and leave every token unmarked when the sentence is correct.

The authors train a separate linear probe for each layer of each system they study. The input to the probe is a contextual representation, a set of numbers that describes a token in the sentence where it occurs. There are two sources of training examples. W&I-FCE combines essay data from Write & Improve + LOCNESS and the First Certificate in English. WikEd supplies sentences from English Wikipedia revision histories. ERRANT edit labels let the authors repair other kinds of errors and retain the targeted verb replacements. For testing, they turn Marvin and Linzen’s carefully matched grammatical and ungrammatical sentences into token-labelled examples. Those sentences cover seven main constructions, including simple agreement, dependencies across intervening phrases or clauses, and coordination of verb phrases.

ELECTRA, [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/), and [RoBERTa](https://md.research.elamur.ai/free/en/papers/liu-2019-roberta-robustly-optimized-bert-pretraining/) supply representations from which the probes can recover useful agreement information. ELECTRA leads, with a best F₁ of 0.95 on the Marvin and Linzen test after training on W&I-FCE and 0.89 as the best mean after training on the sampled Wikipedia sets. GPT-2 and [XLNet](https://md.research.elamur.ai/free/en/papers/yang-2019-xlnet-generalized-autoregressive-pretraining-language/) give much weaker results relative to a baseline that flags every verb. Some of their scores exceed that baseline, but the gains are limited. BERT and ELECTRA are strongest in the later part of the network, while useful information appears earlier in RoBERTa. Changing the probe’s training source or the construction it sees at test time can change performance substantially.

A separate experiment tests whether BERT’s probes depend on seeing the test verbs during probe training. The authors remove sentences containing the targeted verbs from the Wikipedia training and development data, with an exception for *to be*, which they also exclude from scoring in this experiment. Removing the verbs makes little difference overall, with a small disadvantage confined to certain layers at the smallest training size. The evidence therefore supports transfer across the verbs tested, alongside substantial sensitivity to the training domain and sentence structure. The authors release their implementation as `ged-syntax-probing`. Their work also shows how an existing minimal-pair benchmark can be reused to test where an error detector succeeds, where it misses an error, and where it flags a correct word.

## Deep dive: Probing for targeted syntactic knowledge through grammatical error detection

A study of whether pretrained language models can locate subject–verb agreement errors, and how detection varies across layers, training data, and syntax. · about 31 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

#### Agreement is a relation between words

English verbs can change form according to the number of their subject. With *train* as the subject, the form *is* fits the singular noun. With *trains*, *are* fits the plural. A reader can spot a mismatch in either direction. The harder cases occur when the sentence offers another noun that looks like a plausible controller of the verb. In the paper’s examples involving a farmer and nearby parents, an agreement decision based on the closest noun may pick up the number of *parents* even though *farmer* is the subject. That distinction between a word’s position and its role in the sentence makes agreement a useful test of [syntax](https://md.research.elamur.ai/free/en/topics/syntax-grammar/).

The authors break the task into several judgments. A system needs evidence about which token is a verb, which expression functions as its subject, what number each has, and whether the two numbers fit together. A simple sentence can make some of these judgments easy. In a sentence with a relative clause, a reader may encounter several nouns and verbs before reaching the target. An incorrect rule can therefore give the right answer on some examples and fail on others. A benchmark can make this visible by varying the number of a nearby noun independently of the true subject.

The question matters for the interpretation of a pretrained representation. When a system assigns high probability to a correct verb, its prediction incorporates many properties of the sentence. Familiar word combinations, a nearby noun, and the actual subject are all potential sources of evidence. A carefully constructed test narrows the possible explanations by changing an identifiable property of the input. The authors ask whether an agreement distinction can also be recovered from the internal representation of the verb as it appears in the sentence. That turns a question about outward behavior into a related question about what information is accessible inside the system, a common concern in [interpretability](https://md.research.elamur.ai/free/en/topics/interpretability/).

#### What earlier tests asked a system to decide

The paper starts from acceptability judgments. In linguistic work, a judgment about whether an example is acceptable can provide evidence about a speaker’s grasp of a construction. Computational studies adapt this idea by training classifiers to give a yes-or-no judgment on sentences drawn from linguistic examples. The sentence is the unit of assessment. An example can be designed to illustrate a particular grammatical phenomenon, and a correct decision then supplies some evidence about sensitivity to that phenomenon. The label itself stays at sentence level. It gives the same credit whether the decisive information came from the problematic verb or from some other property associated with the whole example.

A minimal pair sharpens the comparison by holding most of the sentence constant. One version has the licensed form, and its partner has a small change that makes it ungrammatical. According to the authors’ account of Marvin and Linzen’s study, a predictor gets a sentence pair right if it assigns greater probability to the grammatical member of the pair. This design makes it easier to attribute a successful preference to the difference between the examples. It also makes syntactic constructions comparable. A pair with adjacent subject and verb and a pair with an intervening clause can both test agreement, while the intervening material changes what the system has to keep track of.

Another line of work scores just the competing forms at the target verb. The comparison asks which inflection the system expects at that position. The paper traces this approach to work on syntax-sensitive dependencies by [Linzen and colleagues](https://md.research.elamur.ai/free/en/papers/linzen-2016-assessing-ability-lstms-learn-syntax/).

For a masked predictor, an experimenter can hide the verb, supply the whole sentence with a placeholder there, and inspect the probabilities assigned to the two candidate forms. The assessed system has access to the surrounding sentence, and the position of the verb is fixed by the test. The paper describes this extension in [Goldberg’s assessment of BERT](https://md.research.elamur.ai/free/en/papers/goldberg-2019-assessing-bert-s-syntactic-abilities/).

All of these experiments use the stimulus design to focus the question. In sentence-level scoring, the grammatical alternative supplies a point of comparison. In target-verb scoring, the experimenter identifies the position and the relevant alternatives. That information is valuable when the question is whether the system prefers the correct form under controlled circumstances. An error detector has another job. It must decide whether anything in the sentence needs a mark and, if so, where the mark belongs. A system that always prefers one member of a pair can still struggle with that decision, especially if it is inclined to flag plausible verbs in correct sentences.

#### What changes when the label belongs to a token

Grammatical error detection is related to [grammatical error correction](https://md.research.elamur.ai/free/en/topics/grammatical-error-correction/). Detection identifies the location of an error. Correction supplies a change. The authors use detection because it gives a local prediction that can be compared with the representation at the same position. Their broader motivation comes from a task that covers many kinds of learner errors, including unwanted words, missing words, and words that should be replaced. The experiment selects a particular replacement category, where there is an existing token to examine and a verb edit that gives the training label a clear location.

Several strands of earlier probing motivate the design. Researchers had already asked whether learned representations contain information about grammatical categories and sentence structure, using auxiliary tasks that predict a linguistic property from those representations. Some tasks worked with a representation of an entire sentence. Others examined words in context, including information about part of speech and syntactic dependencies. The authors build on this practice by asking whether a word’s contextual representation can support a much more specific judgment about agreement. Syntax probes concerned with recovering dependency structure illustrate the neighboring line of research discussed in the paper. [A Structural Probe for Finding Syntax in Word Representations](https://md.research.elamur.ai/free/en/papers/hewitt-2019-structural-probe-finding-syntax-word/)

The proposal combines the controlled stimuli of targeted syntactic evaluation with the local predictions of a probe. A minimal pair remains useful as a way to construct the test. Each sentence, however, becomes an independent detection input. The intact verb itself contributes to its representation, so the classifier can use evidence about the form that actually occurred. The grammatical partner becomes another test sentence on which every token should receive a negative label. This lets the authors ask about error localization and restraint with the same collection of controlled constructions.

### The method, step by step

#### From a sentence to a set of decisions

Imagine a sentence whose subject is *train* and whose verb is *are*. The authors’ procedure gives the intact sentence to the pretrained system. At each layer, the system produces a representation for each position. The probe for that layer uses the representation at *are* to decide whether to flag it. It makes the same kind of decision at *train* and at the remaining positions. The correct output has a flag at the verb and leaves the other positions clear. With *is* in place of *are*, the correct output has no flags.

The training examples show the classifier which positions have the target error. The test examples withhold those labels until scoring. Several words in a sentence may contribute to the representation at the verb, because the representation was computed in context. The classifier itself reads the representation at just the position it is labelling. If the classifier can pick out an agreement error there, it has found a usable local signal for a relation that may involve words elsewhere in the sentence. The experiment repeats this process with different layers to see at what point the signal becomes easiest to extract.

Training and testing a layer-wise agreement error probe The steps in order.

#### Turning edited sentences into training data

The learner-writing data come from Cambridge English Write & Improve + LOCNESS and the First Certificate in English. The paper calls the combined source W&I-FCE. Both provide sentence edits that have been standardized with ERRANT, an annotation framework that organizes an edit by the operation involved and the linguistic type. The operation indicates whether something was removed, inserted, or replaced. The type identifies the relevant kind of error. This gives the authors a way to select edits at a finer level than simply asking whether a sentence contains a problem involving a verb. The First Certificate in English corpus is described in the earlier work on [automatically grading ESOL texts](https://md.research.elamur.ai/free/en/papers/yannakoudakis-2011-new-dataset-method-automatically-grading/).

The chosen ERRANT label is `R:VERB:SVA`. `R` is the replacement operation, `VERB` identifies the affected kind of word, and `SVA` specifies subject–verb agreement. The corrections supplied with the edits allow the authors to apply a selective repair. They make the annotated changes for other error categories, while preserving the original form at the targeted agreement error. A sentence enters the training or validation collection only if it still contains a target error after that processing. The resulting W&I-FCE splits contain 1936 training sentences and 142 validation sentences.

That selection rule works at sentence level. The actual probe task works at token level. A retained sentence is guaranteed to provide a positive example somewhere, but it contains many positions without the target label. A noun beside an incorrect verb remains a negative example, as does a correct verb elsewhere in the sentence. This is how the training collection can contain an error in every sentence while still teaching the classifier about positions that should be left alone. It also explains why the learner corpus and the controlled test differ in sentence composition. The test includes sentences in which every position is negative.

The alternative source is WikEd, a collection of sentences extracted from the edit history of English Wikipedia. The authors start with its cleaned and preprocessed version, which contains ~29 million sentences. They apply the same selection and repair procedure used for W&I-FCE. The remaining pool contains ~233K sentences from which training and validation examples can be drawn. They sample five training sets with 1936 sentences each and set aside 5839 validation sentences. The paper uses WikEd-S for the sampled training sets.

Matching the training sets at 1936 sentences makes the source comparison easier to interpret. A difference between the learner-trained probe and the Wikipedia-trained probe cannot be explained simply by the Wikipedia source offering far more sentences in that comparison. The samples can still differ in what those sentences contain, including their verbs, vocabulary, constructions, and patterns of editing. The validation sets also differ in size. The use of several Wikipedia samples makes it possible to observe variation across draws from that source. It leaves the single learner training split as a distinct kind of estimate.

#### Turning minimal pairs into a detection test

The evaluation corpus starts from Marvin and Linzen’s manually designed subject–verb agreement stimuli, abbreviated M&L. Its seven main constructions place agreement in different syntactic settings. In the simplest examples, a subject and verb supply the essential contrast without an intervening noun. In other examples, material between them may contain a noun of its own. Different number combinations let that noun either reinforce the correct choice or favor the incorrect one. The experiment also includes verb-phrase coordination and several variations involving relative clauses.

The prepositional-phrase examples with *farmer* and *parent* make the design concrete. The number of the farmer determines the correct main verb. The number of the parent can vary inside the intervening phrase. When the farmer is singular and the parents are plural, a detector that bases agreement on the closest noun can make a mistake even though it sees the same main verb as in an easier example. Varying the subject’s number as well keeps a single inflection from always being the right answer. For the multino​un cases outside verb-phrase coordination, the paper uses this kind of distractor to test whether agreement survives competition from another noun.

Object relative clauses introduce another distinction. The verb to be assessed can be inside the relative clause, or it can belong to a dependency that spans the clause. Those settings assign different roles to the nouns. The authors also describe variations in whether the main subject denotes something animate and whether *that* introduces the relative clause. These variations preserve the broad focus on agreement while changing the context that supplies evidence about it. Aggregating them can reveal an overall pattern, and grouping the sentences by construction can show where the pattern changes.

For conversion to error detection, the wrong verb in the ungrammatical member of each pair receives the `R:VERB:SVA` label. The grammatical member contributes a sentence in which there is no target error. The authors capitalize the initial word and add a final period when needed. The converted examples preserve the controlled grammatical distinction while yielding labels at the positions the probe must predict. A grammatical version and its partner appear as separate inputs. The paired origin matters for constructing and balancing the test, while each prediction is made from the sentence at hand.

This conversion is particularly straightforward when the minimally different word is a replacement verb. The paper notes that other phenomena can be harder to separate using ERRANT. For instance, an edit category for replacement pronouns can cover mismatches in both gender and number. A minimal-pair collection can distinguish those phenomena in its design even when the edit taxonomy assigns them the same broad label. The agreement experiment benefits from a close fit between the linguistic contrast and the annotation category.

#### Choosing what the probe can read

The authors evaluate BERT-base-cased, RoBERTa-base, ELECTRA-base’s discriminator, GPT-2 small, and XLNet. They test XLNet under both unidirectional and bidirectional decoding. That produces separate settings for the same pretrained family, making it possible to see how much the result changes when the XLNet representation is obtained with different directionality. The authors extract a representation for every token at every one of the twelve layers they examine. Each layer supplies its own training inputs to a separate probe. Representations from different layers are evaluated on the same kind of prediction, so a change in score shows a change in how useful those inputs are for this classifier.

The representation is a vector, an ordered collection of values computed for a position in the sentence. A verb form can therefore have different representations when its subject or surrounding clause changes. This is central to the experiment. A rule that recognizes the surface form *smiles* can identify a verb form, but whether *smiles* is in error depends on the subject in that particular sentence. Contextualization gives the representation at the verb an opportunity to carry that difference.

The pretrained systems use [subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/), in which the units processed by the network can be smaller than the words used in the error annotation. The probe needs a single representation for the token that receives the error label. If that token is split into pieces, the authors use the representation of the last piece. This is a fixed alignment choice inherited from an earlier probing study. For each layer it makes the decision at an annotated word depend on one available vector, and it keeps the extraction procedure consistent across systems that may segment the same text differently. The earlier alignment convention comes from [Linguistic Knowledge and Transferability of Contextual Representations](https://md.research.elamur.ai/free/en/papers/liu-2019-linguistic-knowledge-transferability-contextual-representations/).

A linear classifier learns weights on the components of that vector. A component can contribute evidence towards or away from the error label, and the contributions are combined to make the prediction. The classifier is deliberately limited in how it can combine features. Finding a good linear decision demonstrates that the representation already makes some useful distinctions available in a form the probe can read. A more elaborate classifier could learn interactions of its own and would change what success said about the original representation. Here the authors train the probes on extracted representations. The layers they compare are the pretrained layers as used for extraction.

Separate probes learn from W&I-FCE and WikEd-S. Each uses validation examples from its own training domain. Training is scheduled for 50 epochs, with patience of 10 epochs for early stopping. An epoch is a pass through the training data. Patience is the interval the training process allows for improvement on validation before it stops. After training, the final comparison uses M&L, so the reported construction and domain comparisons refer to a shared controlled test outside the probe’s training source.

#### Why the pretraining objectives matter to the comparison

BERT and RoBERTa use masked language modelling. A predictor learns to recover a hidden or altered token using the context available to it. GPT-2 and XLNet are grouped in the paper under autoregressive language modelling, where training involves predicting tokens from other tokens specified by the prediction order. The unidirectional setting limits the context differently from the bidirectional setting. ELECTRA’s discriminator learns whether a token has been substituted. During that pretraining task, a masked predictor proposes plausible replacements, and the discriminator judges the resulting tokens. The authors expect that objective to have some affinity with marking a verb whose form is inappropriate in context.

There is also an overlap between the objectives. The paper notes that BERT and RoBERTa encounter replaced tokens in pretraining on 1.5% of tokens. A comparison between those systems and ELECTRA is therefore a comparison between different training setups and emphases. It does not isolate a switch between exposure and no exposure to replacements. The authors also identify differences in the underlying pretraining corpora. Those details matter when interpreting why some representations are easier for a grammatical error probe to read.

#### Scoring the locations the probe flags

The probe is evaluated on individual tokens, and the main measure is F₁. Precision is the share of flagged tokens that carry the target error. Recall is the share of target errors that the probe flags. A detector can have high recall by casting a wide net and incur a loss in precision by marking correct tokens. A detector that rarely flags anything may be precise when it acts and still miss many wrong verbs. F₁ combines the two measures, giving their harmonic mean.

```
F₁ = 2 × precision × recall / (precision + recall)
```

F₁ is the token-level score. `precision` and `recall` refer to the shares just defined. The `2` gives those measures equal weight in the harmonic mean. The multiplication signs combine the factors, the slash divides by the sum in parentheses, and the equals sign specifies how the score is obtained. The subscript identifies the version of the measure the authors use. They explain that grammatical error detection in educational applications often uses F₀.₅, which emphasizes precision because an incorrect warning can be particularly harmful to a learner. Their diagnostic test instead gives equal weight to precision and recall.

For WikEd-S, the authors summarize results across the sampled training sets. Their notation for reporting the central score and the spread can be written as follows.

```
mean F₁ ± σ
```

`mean F₁` is the average test score of the relevant probes trained on those samples. `σ` is the standard deviation of the scores across samples. The `±` denotes a span of one such standard deviation on either side of the mean. This describes variability from changing the Wikipedia training sample. It has a different interpretation from the baseline comparison, which asks how well a fixed rule would score on the same test.

### Experiments and results

#### The common test and the verb-only baseline

The main experiment varies the pretrained system, the layer from which the representation is taken, and the source of the probe’s training data. The test is always the converted M&L agreement corpus. Its equal numbers of grammatical and ungrammatical sentences come from including both members of the original pairs. That balance is a property of the sentences. At token level, each sentence contains several positions at which an error flag would be wrong, and a sentence with multiple verbs can contain a correct verb alongside the target error.

The comparison rule flags every verb as ungrammatical. This is a useful baseline because it already has a large part of the task supplied to it. It restricts its guesses to the class of words that can be positive in this benchmark. It still makes a mistake on every correct verb it flags, including verbs in the grammatical members of the pairs. A trained probe improves on the rule to the extent that it finds the target errors while screening out enough of these false positives.

The baseline varies with construction because the number of verbs varies. On M&L constructions with one verb, the verb-only rule scores 0.67 F₁. The paper reports 0.40 for constructions with two verbs and 0.30 for those with three. Over all M&L constructions the baseline is 0.43. These reference points matter when reading the construction comparisons. The same F₁ can imply a different advantage over indiscriminate verb flagging in a simple clause and a sentence with more verbs. They also explain why the authors show separate baseline lines in the construction plots.

Best ELECTRA probe results and the verb-only baseline on M&L, token-level F₁ ELECTRA separates agreement errors from correct verbs more successfully after learner-data training, and both settings outperform the baseline.

**The numbers**

| System or setting | F₁ |
| --- | --- |
| Verb-only baseline | 0.43 |
| ELECTRA trained on WikEd-S, best layer mean | 0.89 |
| ELECTRA trained on W&I-FCE, best layer (this paper) | 0.95 |

#### How the systems compare

ELECTRA provides the strongest input for the probe. After W&I-FCE training, its best probe reaches 0.95 F₁ on M&L. The best reported WikEd-S result is 0.89 F₁ on the same test, with σ = 0.02 across sampled training sets. The first number is the maximum reported score for a learner-trained layer probe. The second is the best layer result summarized across the Wikipedia samples. Both show that a linear probe can recover a substantial agreement signal from ELECTRA’s representations. Their difference also shows that a strong representation is compatible with sensitivity to which annotated examples train the classifier.

For the masked systems BERT and RoBERTa, the paper gives a range of 0.70 to 0.89 F₁ for the maxima across the reported training conditions. These probes show that the presence of useful agreement information extends beyond ELECTRA’s discriminator. They also leave room for differences between the systems and between layers. Reading the maxima alone would obscure when each system reaches that level and how much it depends on the training source.

The autoregressive group peaks much lower. None of its probes exceeds 0.59 F₁ on M&L under either training source. GPT-2 and unidirectional XLNet stay at or below 0.50 and often fall beneath the overall verb-only baseline of 0.43. Bidirectional XLNet fares somewhat better than the weakest settings, while still trailing the systems with the clearest agreement signal. Describing the group as weak relative to the baseline captures the pattern across probes. A claim that every one of those scores was at or below 0.43 would be stronger than the reported results support.

The family comparison raises a question about what makes the representations useful. ELECTRA’s advantage fits the expectation that distinguishing original tokens from substituted ones can help with detecting an unsuitable form. The masked systems also do well, and the authors note that they see some substituted tokens during training. The directional XLNet comparison gives a separate check on whether richer access to context, by itself, explains the gap. Its result leaves the pretraining objective, directionality, and training data as overlapping explanations. The systems were selected as existing pretrained systems, so these factors vary together.

#### Where in the network the signal is accessible

BERT and ELECTRA have similar broad trajectories on the M&L test. Their probes are around baseline performance in layers 1-5, with the strongest part of the curve in layers 8-12. For BERT, the most useful representation is at the final layer, layer 12. For ELECTRA, layers 9 and 10 appear to carry the most useful representations for the task. This distinction matters because a general statement about late layers can hide whether the strongest representation is the final output or an earlier representation near the end of the network.

RoBERTa follows a different trajectory. It reaches a peak at layer 5 and has broadly steady performance through layer 12, apart from a drop at layer 7. The earlier useful signal means that an experiment restricted to the final layer would miss something about when agreement-related evidence becomes accessible in RoBERTa. Conversely, an experiment restricted to early layers would understate what BERT and ELECTRA make available later. Testing the layers separately allows the authors to draw both conclusions without assuming a common depth at which all the systems represent grammar.

Across training sources, the usual pattern favors W&I-FCE over WikEd-S. The authors observe it for all tested systems apart from GPT-2. The amount of Wikipedia training data available in the full pool is beside the point for this comparison, because the samples and the learner training set have the same sentence count. What changes is the source of the examples and the patterns the probe can learn there. The authors suggest that learner sentences might be closer to M&L in relevant respects. They treat the performance gap as evidence that the features a linear probe can learn from the representation are sensitive to the domain from which it learns them.

#### What changes across constructions

The main construction analysis focuses on BERT and RoBERTa because both use a masked language modelling objective. The authors present probes for simple agreement, sentential complements, prepositional phrases, and subject relative clauses, as well as agreement inside and across object relative clauses. Grouping by construction lets them ask whether what appears to be a strong layer on the overall test is broadly useful or especially good on particular sentence patterns. It also gives each group its appropriate verb-only reference.

Simple agreement is the easiest of these cases for both systems. The only probe setting the authors describe as falling below 0.90 F₁ in that comparison is BERT trained on WikEd-S. Most of the BERT construction results are especially strong at layer 12, in line with its aggregate curve. RoBERTa’s stronger layers tend to include layer 5 and layers 8-12, again resembling the overall result. For RoBERTa, performance drops on subject relative clauses, prepositional phrases, and agreement within object relative clauses, particularly with the Wikipedia training sets. A high score for a nearby subject and verb thus gives an incomplete picture of how reliably the same kind of evidence carries over to sentences with additional structure.

The source effect is visible within individual constructions, where it need not have the same direction as in the aggregate. BERT shows a noticeable gap between the learner-trained and Wikipedia-trained probes in five out of the six comparisons shown. RoBERTa gives more comparable results across the two training sources in simple agreement, in sentential complements, and across object relative clauses. With subject relative clauses, RoBERTa’s WikEd-S probes outperform its W&I-FCE probes. The authors take this as a possible sign that RoBERTa’s signal is less sensitive to the training sample’s domain in some constructions. BERT can still provide the more useful representation for several constructions, especially at its final layer. Strength on the task and stability across training conditions are distinct properties.

### What the ablations show

#### Holding the training count fixed while changing its source

The learner-versus-Wikipedia comparison changes the examples available to the classifier while holding the M&L test fixed. It also matches the number of training sentences in the main experiment. For a given pretrained system and layer, the underlying representation procedure stays the same. The change in result consequently tells us something about how readily a relation learned from one collection of labelled examples applies to the common test. The result is particularly informative for high-scoring systems. A probe can clearly recover useful information from their representations, yet the same method trained on a different source can recover it less well.

The construction results make this comparison more specific. It would be easy to attribute the overall advantage of learner-trained probes to a uniform improvement in detecting errors. RoBERTa’s behavior on subject relative clauses establishes that there are construction-level exceptions. Similarly, similar scores across sources on one construction say little about the same probes on another. Changing the training source tests the transfer of a decision learned by the probe. The breakdown by construction shows where that decision transfers and where it appears sensitive to the source.

#### Comparing the same probe task at different layers

The layer analysis changes the representations to which the probe has access and repeats the same prediction task. The late rise for BERT and ELECTRA suggests that later contextual representations give the classifier a better basis for separating correct verbs from errors than their earlier representations do. RoBERTa is important to interpreting this finding. The earlier peak shows that agreement information can become linearly useful on a different schedule even in systems that share a broad pretraining objective.

The paper relates the BERT pattern to earlier work that altered information about noun number and measured the effect on number agreement. That work led to a hypothesis that information about a subject’s number is transferred before the later layers. The probe curves fit the possibility that the verb’s vector starts to expose the relevant number information in that part of the network. The study also notes a similar curve for ELECTRA, whose objective differs from BERT’s. A difference in objective is therefore compatible with a similar layer profile, while two masked systems can produce different profiles. The authors discuss earlier findings about syntax across BERT’s layers in [What Does BERT Learn about the Structure of Language?](https://md.research.elamur.ai/free/en/papers/jawahar-2019-what-does-bert-learn-about/)

The probes measure the accessibility of the eventual error distinction. A rise in that measurement can occur when the representation makes subject number easier to recover, when it better distinguishes the verb forms, or when it makes the relation between the two more explicit. The curves are consistent with the number-transfer account the authors discuss. Distinguishing those possibilities would require evidence about the individual signals or a direct intervention in this experiment.

#### Changing the directionality setting

Running XLNet with unidirectional and bidirectional decoding addresses a narrower explanation for the weak autoregressive results. The least successful conditions include GPT-2 and unidirectional XLNet, so access to context on both sides is a plausible contributor. Bidirectional XLNet makes only a limited improvement and still gives comparatively weak detection. Directionality alone therefore accounts for only part of the pattern the authors observe. The comparison helps rule out a simple explanation in which providing both directions of context would be sufficient to obtain the performance of BERT, RoBERTa, or ELECTRA.

The authors also identify differences in pretraining data. BERT and ELECTRA use BooksCorpus and English Wikipedia. GPT-2 uses web-scraped text. XLNet and RoBERTa use a mixture that includes BooksCorpus, Wikipedia, and web-scraped data. These are possible contributors to the system-level differences. The XLNet setting change offers a more focused comparison than comparing different pretrained families, but it supplies little leverage for separating the effect of corpus composition from those of the objectives or other training choices across families.

#### Removing target verbs from probe training

The lexical holdout is the most direct test of a particular shortcut. A probe that has seen a verb in training might learn an association specific to that verb or its common contexts. Even a score on a separate test corpus could then overstate transfer to other verbs. The authors test this in BERT with training data drawn from WikEd. They focus on layers 6 to 12, the range selected from the better-performing part of the first experiment. The comparison changes which sentences the probe can see while keeping the pretrained BERT representations as the source of its inputs.

There are 13 target verbs in M&L. The paper reports 946 occurrences of *to be* in WikEd-S, while eight of the remaining verbs have frequencies below 30. A size-matched comparison at the original training size could change exposure very little for some of the rare verbs. The authors therefore compare training sets of 1936, 7744, and 15,488 sentences. For each size they make a condition in which the M&L verbs can occur and one formed by removing sentences that contain those verbs, with *to be* excepted. They also apply that exclusion in the development data. They draw five samples per condition and size and summarize performance across the samples.

Keeping *to be* in training changes what can be tested fairly. The authors score the remaining 12 target verbs. They remove M&L sentences containing only forms of *to be* from this evaluation, and they exclude the *to be* position from scoring in a sentence that also contains another target verb. For example, a sentence can contain *like* inside a relative clause and *is* as the main verb. The probe receives the sentence context, but the score for this analysis omits the position of *is*. This keeps the question focused on the verbs removed from the holdout condition while preserving the surrounding sentence for the positions that are scored.

For the 1936-sentence training sets, allowing the test verbs into training gives a small benefit, limited to ~0.05 F₁ on the modified M&L test and concentrated in layers 8-10. With 7744 or 15,488 training sentences, the authors generally observe no difference between the corresponding inclusion and exclusion conditions. The curves also give little evidence of a benefit from increasing training size in the conditions compared, apart from the smallest set without the target verbs. For these verbs, the signal BERT makes accessible can support detection even when the probe learns its decision from sentences containing other verbs.

The result qualifies the domain and construction findings. One way to interpret the first experiment’s variation would be to attribute much of it to the probe memorizing the particular verbs it encounters. The holdout shows that overlap with the evaluated verbs is largely unnecessary in this BERT and WikEd setup. It leaves open more general regularities involving inflection, surrounding words, or sentence structure, any of which could help a decision generalize to a different verb. Lexical transfer is evidence about one axis of generalization, and it can coexist with the instability seen across sentence patterns and training domains.

#### Checking responses to other error categories

The authors also evaluate BERT and ELECTRA probes against other error types in the W&I data. The reported mean is 0.04, with σ = 0.04, on that check. The low scores support the intended specialization of the probe. It was trained to identify agreement replacements, and its predictions show little alignment with error labels outside that category. This gives the high M&L scores a more specific interpretation than a tendency to mark any token that looks unusual.

The check has a scope different from the verb-only comparison. The baseline establishes how much the probe improves on flagging every verb in the controlled agreement test. The check on other categories asks how readily the learned error signal aligns with other kinds of mistakes in a different evaluation. Together they support the view that the probes can find the targeted errors while leaving many other positions alone. The paper does not give a category-by-category account of false alarms in this check, so the reported result describes selectivity in aggregate.

### Limitations

#### Limits identified by the authors

The authors distinguish finding an accessible signal from discovering how it is encoded. A verb representation might carry a direct indication that the token is grammatically inappropriate. It might carry separate information about the verb, the subject, and their number features in a form that supports a linear decision. The classifier’s success is compatible with several internal arrangements. Its output tells us whether an error label can be recovered, while the representation of the grammatical relation remains an open question. The authors propose investigating that question both for pretrained systems and for systems trained specifically to detect errors.

A related ambiguity concerns the location of the error. A sentence with *authors* and *laughs* presents a mismatch. Changing the verb can repair it, and changing the noun can also create a grammatical sentence with a different intended number. The experiment defines the verb as the erroneous token through its replacement label. The authors report that the probes never flag the nouns in their evaluation. They give two possible explanations. The probe may learn from the labels that verbs are the positions it should flag. Alternatively, the representations may make grammaticality accessible in different ways at noun and verb positions. The predictions cannot resolve the choice between those accounts.

The authors also qualify the comparison between training objectives. ELECTRA’s strong result makes a connection with replaced-token detection plausible. The different layer profiles of BERT and RoBERTa and the similar profiles of BERT and ELECTRA complicate an explanation based solely on the objective. BERT and RoBERTa also encounter replaced tokens during pretraining, and the systems were pretrained on different text collections. The experiment shows a performance pattern among the systems studied. The relative contribution of objectives and corpora remains unresolved.

The verb holdout establishes generalization over a restricted set of verbs. The authors explicitly suggest extending it to a wider vocabulary and expect token frequency in pretraining to matter for harder cases. Removing verbs from probe training leaves existing BERT pretraining intact. The observation that a probe transfers to verbs left out of its supervision is therefore about what can be read from BERT representations for those verbs after pretraining. The paper connects the remaining frequency question to [Frequency Effects on Syntactic Rule Learning in Transformers](https://md.research.elamur.ai/free/en/papers/wei-2021-frequency-effects-syntactic-rule-learning/).

#### Further limits of the design

Every positive label in the main experiment is a particular kind of English agreement replacement. That makes the task interpretable and lets the paper use a controlled benchmark with a clear location for the target. The result has a correspondingly narrow scope. Errors requiring an insertion raise the practical issue that the missing item has no existing token representation. Other replacement categories may merge several linguistic phenomena under one annotation. A probe for agreement can therefore be good evidence about a defined syntactic dependency, while broader claims about a system’s grammatical knowledge require other targets.

The training sentences also differ from ordinary proofreading inputs in a systematic way. Each was selected because at least one annotated agreement error remained after processing. Correct tokens are present throughout, but fully correct sentences enter the evaluation through the grammatical members of the M&L pairs. The evaluation corpus balances correct and incorrect sentences by design. A collection of documents with a different frequency of agreement errors would create a different balance between opportunities for successful detection and opportunities for false alarms. The F₁ scores describe the token decisions under the paper’s test conditions.

The benchmark’s construction controls make it possible to say which sentence patterns are difficult. They also restrict the examples to the patterns and vocabulary chosen for the stimuli. WikEd and W&I-FCE provide distinct natural sources for supervision, but the headline comparison evaluates transfer from each to the same manually constructed set. A learner-trained probe’s advantage on M&L leaves open how it would compare with a Wikipedia-trained probe on naturally occurring agreement errors in revised Wikipedia sentences. Matching training sizes helps with the source comparison, while differences in vocabulary, syntactic mix, validation data, and edit practices remain bundled into that comparison.

A low score has a narrow interpretation as well. The probe reads a single layer’s vector at the last sub-word of the position being classified. If useful information is split across several positions, represented more clearly at a different sub-word, or recoverable through a nonlinear decision, this procedure can miss it. The modest results for GPT-2 and XLNet indicate weak access under the tested readout. They leave open what those systems could do with another readout or in a paired preference test. Even a high score establishes that an external classifier can use the signal. Whether the original system uses the same information for its own predictions is a separate causal question.

Finally, an overall F₁ summarizes errors and correct detections across sentences that differ in difficulty and number of verbs. The construction analysis reveals some of what that aggregation hides. Even there, a common score can arise from different patterns of missed errors and false alarms. The verb-only baseline shows how much the opportunity for false alarms varies across constructions. The study’s strongest evidence comes from reading that baseline, the layer profiles, and the domain and lexical comparisons together, with each comparison tied to the specific question it was designed to answer.

### What came after

The later study [Understanding the Role of Input Token Characters in Language Models](https://md.research.elamur.ai/free/en/papers/alajrami-2023-understanding-role-input-token-characters/) (2023) cites the agreement-probing paper and asks how loss of information about input token characters affects performance. The connection is a question about the information available at token level. In the agreement study, the token arrives intact, and the probe asks whether its contextual representation distinguishes an appropriate verb form from an inappropriate one. The later study’s stated question starts with information about the characters of the input token and asks what happens when some of that information is lost.

The citation situates the agreement study alongside a later inquiry into the relationship between token form and performance. It leaves open whether the later work reused the agreement labels, the converted M&L stimuli, or the layer-wise detector. The connection that can be drawn is between the questions they pose. The agreement study examines a property that can be read from a contextual token representation. The later title points to a different way of investigating the contribution of the token itself, through the consequences of losing information about its characters.

## Cite

Cite as Christopher Davis, Christopher Bryant, Andrew Caines, Marek Rei and Paula Buttery. 2022. Probing for targeted syntactic knowledge through grammatical error detection. Proceedings of the 26th Conference on Computational Natural Language Learning (CoNLL).

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2022.conll-1.25](https://doi.org/10.18653/v1/2022.conll-1.25) · [arXiv 2210.16228](https://arxiv.org/abs/2210.16228)

```bibtex
@inproceedings{davis2022probing,
  title = {{Probing for targeted syntactic knowledge through grammatical error detection}},
  author = {Christopher Davis, Christopher Bryant, Andrew Caines, Marek Rei and Paula Buttery},
  booktitle = {Proceedings of the 26th Conference on Computational Natural Language Learning (CoNLL)},
  year = {2022},
  doi = {10.18653/v1/2022.conll-1.25},
  eprint = {2210.16228},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.18653/v1/2022.conll-1.25}
}
```

> 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)
