Elamur Research

Probing for Constituency Structure in Neural Language Models

Paper · 2022 · David Arps, Younes Samih, Laura Kallmeyer et al.

Summary

Words in a sentence belong to groups, and those groups can sit inside larger ones. A system trained on unannotated text receives no explicit record of where those groups begin or end. Arps and colleagues ask whether the resulting word representations still contain enough information to recover the groups and their grammatical categories. They use the English Penn Treebank as their reference and train simple classifiers to read out its phrase structure. One task asks which phrase first brings two words together as you trace them upward through a tree. Another asks where an individual word sits in its smallest phrase. A final task uses predictions at successive word boundaries to reconstruct the whole tree.

An ordinary sentence gives a classifier several ways to get the right answer. Words that make sense together frequently have predictable grammatical relationships. To weaken that clue, the authors create versions of the treebank in which words are exchanged for other real words found in matching grammatical contexts. The source trees supply the target labels after the exchange. The resulting sentences can be hard to make sense of, while retaining many cues to how the words fit together. Classification and tree reconstruction deteriorate as more words are replaced, but remain substantially better than when the same tasks use contextual representations from BERT with randomly initialized transformer weights.

On unchanged data, the probe using RoBERTa reaches 82.8% accuracy at identifying the shared phrase category and 96.0% at identifying a word’s position in its smallest phrase. Asking for that phrase’s category as well brings accuracy to 91.2%. Reconstructed trees reach 82.6% labeled F1 on the unchanged development split, against 51.4% for random-weight BERT. With the heavier word replacement applied during both training and evaluation, RoBERTa’s reconstruction score is 72.8 labeled F1. Middle layers generally make the categories easiest to recover. For the phrase-position task, a subset of activation dimensions can retain nearly all the accuracy of the full representation.

The experiments show that a linear readout can recover much of the treebank’s constituent structure, including when ordinary combinations of word meanings have been disrupted. Whole-tree recovery also requires a decoding step to assemble the local predictions. The study measures what a separate classifier can recover from the representations. Whether the original system uses those grammatical distinctions when making its own predictions is a separate question.

Deep dive: Probing for Constituency Structure in Neural Language Models

See how Arps and colleagues recover phrase structure and full English parse trees from neural representations, even after replacing many words. · about 36 minutes to read

The problem and its context

What a constituent tree adds

A sentence comes to a reader as a sequence. A constituent tree describes how that sequence is organized into phrases. Its leaves are words, and the nodes above the leaves represent groups of words or larger groups containing smaller phrases. A noun phrase, for instance, can itself contain a modifier with internal structure. The tree records both the extent of each group and its category. Two phrases can have different boundaries and still carry the same category. A readout that detects a noun phrase therefore has to answer a question about a grouping as well as a question about a label. This is one way to describe the structure studied in syntax and grammar.

The paper illustrates this organization with a short sentence about walking on the moon. Its constituency analysis includes a verb phrase beginning with the auxiliary am and another verb phrase beginning with walking. Both reach the end of the sentence. Keeping both brackets records that one verbal group is inside the other. There is also a prepositional phrase beginning with on, inside which the final words form a noun phrase. A word-by-word category sequence could identify an auxiliary, a verb, a preposition, and a noun. The tree adds an account of which stretches behave as groups and how the groups fit together.

The corresponding dependency analysis organizes the same sentence around links between words. It can show that am is an auxiliary dependent, for example. The two overlapping verb phrase spans do not each have a separate node in that analysis. The paper treats this as a reason to probe for constituents directly. It also acknowledges the information that dependency annotations provide. A constituency label such as NP can carry an added function tag such as SBJ to mark a subject, while a dependency annotation uses relations to express grammatical roles. The two annotation schemes provide different views of the sentence, each with distinctions that matter for parsing.

The authors compare the two views on the Penn Treebank. For this comparison they ignore labels and look only at the words covered by individual subtrees. They report that 97% of the bracketings from dependency trees occur in the constituency trees, while 54% of the constituency bracketings occur in the dependency trees. The direction of each percentage matters. Both measure overlap, but they start from different inventories of groups. In this corpus, the constituent analysis explicitly supplies many more of the groups that the study wants to test. The comparison concerns the treebank’s representation of phrase structure and does not require a judgment about which formalism is preferable for every grammatical question. Dependency parsing

What earlier probes could ask

The starting point is a difficulty in interpretability. Success on a language benchmark can show that a system solves the task it was given. The score alone leaves open how the system represents the input. An intermediate word vector is a list of activation values, and its individual entries do not come with grammatical labels. A diagnostic classifier, or probe, learns a mapping from those values to annotations supplied by a researcher. If a simple mapping succeeds on held-out sentences, the result shows that the tested distinction is accessible in the representation under that mapping.

The paper describes two reasons for doing this. One is to understand the features that may contribute to success on an applied task. The other is to ask which distinctions posited in linguistics can be recovered after training on text without those annotations. The second motivates the study. Treebank categories are supplied to the probes after pretraining. This division lets the authors ask whether exposure to text has already produced useful distinctions among phrases, without treating success on a supervised parsing objective as evidence that those distinctions emerged during pretraining.

Earlier work approached the question at different scales. Peters and colleagues examined span representations for signs of phrasal syntax. Tenney and colleagues used probes on spans and the relations between them, moving beyond tasks that assign an independent label to every word. Their tasks included constituency and other kinds of structure. Arps and colleagues describe their constituency findings as consistent with that earlier work. They choose a simpler classifier, add a comparison with systematically altered sentences, and ask whether local predictions can be assembled into a tree. Dissecting Contextual Word Embeddings · What Do You Learn from Context?

Other methods looked for syntax in the geometry of word representations or in the effects of masking. Hewitt and Manning learned a linear transformation under which distances between word vectors correspond to distances in a dependency tree. The question there is whether a tree’s geometry can be exposed by changing how distances are measured in the vector space. Wu and colleagues used perturbed masking to examine how much one word influences the prediction of another. Both approaches provide ways to investigate structure. The present study uses a supervised mapping to the names and positions of constituents, then compares its reliability at different depths and with different selections of activation dimensions. A Structural Probe for Finding Syntax in Word Representations · Perturbed Masking

Why meaningful sentences complicate the test

In ordinary language, plausible combinations of meanings frequently accompany plausible grammatical arrangements. A classifier might succeed on a phrase label because contextual word representations encode familiar lexical combinations, or because they encode patterns that generalize to words with quite different meanings. A high score on ordinary sentences can reflect both. The problem matters especially when the research question concerns grammatical information that remains available outside familiar combinations of words.

The paper describes two precedents for weakening the association. Gulordava and colleagues substituted content words while matching part of speech and morphological features, then tested whether agreement remained recoverable in semantically odd sentences. Hall Maudslay and Cotterell used invented words and measured how they affected dependency probing. Arps and colleagues keep actual words from the corpus and match their dependency contexts before making replacements. The rationale is that familiar forms may still bring usable information about their grammatical behavior, even in combinations unlikely to have been encountered together. That design makes the question narrower than whether grammatical analysis can proceed with wholly unfamiliar vocabulary. Colorless Green Recurrent Networks Dream Hierarchically

There is a second ambiguity in the method itself. A probe could use its capacity to learn about the supervised dataset, including which labels tend to accompany familiar words or pairs. In that case, its accuracy reflects both its inputs and its own ability to learn the mapping. The paper addresses this with a linear classifier, controls based on arbitrary labels, and a comparison to representations made with randomized contextual weights. These instruments answer different questions. An arbitrary-label task tests how readily the probe can exploit lexical identity to reproduce a mapping. Randomizing the contextual weights tests how far the same analysis can get without the learned contextual transformations. Designing and Interpreting Probes with Control Tasks · Probing Classifiers

The method, step by step

Prepare the sentences and their annotations

The experiment starts from sentences with manually annotated phrase trees. The authors remove punctuation and null elements during tree preprocessing. A null element is an annotated position without an overt word. The remaining words can be paired with the activations returned for those positions, and the tree supplies the answers for the classification tasks. The Penn Treebank’s detailed phrase labels can include grammatical functions as well as phrase categories. The authors remove those function tags for the word-pair task to keep its target inventory manageable. They retain distinctions such as subject and temporal noun phrases in the relevant detailed chunking labels. The annotation serves as the reference throughout. Linguistic annotation · Treebanks

The replacement experiment uses the dependency version of the same corpus. For each token, the authors record its part-of-speech tag, the dependency relation to its head, and the list of dependency relations to its dependents. The head is the word to which the token is attached in that analysis. The dependents are the words attached to the token. Matching the relations in both directions makes the replacement rule more specific than choosing an arbitrary word of the same part of speech. A candidate has to occur somewhere in the corpus with the same recorded combination of relations.

The authors create a version replacing a third of the tokens and a version replacing two thirds. The target phrase trees come from the original sentences. Changing the words while keeping their annotated positions gives the authors corresponding examples on which to compare the probes. The intended intervention is on the normal coherence of the wording. A word’s own grammatical characteristics and some of the sentence’s original lexical cues can remain available, depending on which positions are replaced. The annotation retained from the original gives a consistent comparison target across versions.

Candidate lookup is split by data partition. For altered training sentences, the replacement vocabulary is drawn from Penn Treebank sections 0-18. For altered evaluation sentences, candidates can come from sections 19-24, the development and test portions. Thus an evaluation sentence can use replacement words found in either of those portions, while the supervised training replacements use their own pool. This is a separation of the replacement candidate sources. The probes themselves use the standard training and development division described in the experimental setup.

The paper’s examples make the intervention concrete. In the lighter alteration of a sentence about an incoming director, a surname, a number, and an auxiliary change, while much of the surrounding expression remains recognizable. With heavier alteration, the same sentence brings together a beer quantity, a description of being state-owned, and a board appointment. The sequence still contains familiar forms that can suggest grammatical groupings. Their combined meaning gives a reader far less help in deciding how the sentence was constructed. Other examples also show that matching a token’s recorded dependency context does not guarantee a natural sentence after substitution.

Get a representation for each word

The authors take contextual activations from four pretrained transformers. These are uncased BERT base, cased XLNet base, RoBERTa base, and uncased DistilBERT. The first three have 12 layers each, while DistilBERT has 6. The comparison covers systems differing in their settings and pretraining objectives. The trained representations are the inputs to the experiment. The treebank supervision trains the diagnostic classifiers on top of those representations. BERT · XLNet · DistilBERT

The annotated word and the unit processed by a transformer need not coincide. With subword tokenization, an annotated word can be represented as several pieces. The authors average those pieces’ activation vectors to obtain a single vector for the word at the layer being examined. This averaging solves the alignment problem between network outputs and treebank words. It is a separate choice from averaging the vectors of distinct words in a word-pair probe. In the first case, the pieces belong to the same annotated unit. In the second, the two words can play different roles in the relationship the classifier must infer.

The available features depend on the experiment. The layer comparisons give a classifier the activations from one layer at a time. The broad classification comparisons use the full collection of activation dimensions. Activation-subset experiments draw selected coordinates from across layers. The tree reconstruction experiment uses a schedule of layers spaced through the network. These choices allow the authors to ask whether the same kind of information can be read from a particular stage, a compact sample, or a representation assembled from multiple stages.

From treebank sentences to constituency predictions

The steps in order.

From treebank sentences to constituency predictionsStep 1: Clean the annotated sentences and trees1. Clean the annotated sentences and treesStep 2: Create variants with grammatically matched word replacements2. Create variants with grammatically matched word replacementsStep 3: Extract contextual activations for each sentence3. Extract contextual activations for each sentenceStep 4: Average subword activations within each word4. Average subword activations within each wordStep 5: Build word or ordered pair inputs5. Build word or ordered pair inputsStep 6: Train linear classifiers on treebank labels6. Train linear classifiers on treebank labelsStep 7: Decode adjacent pair predictions into trees7. Decode adjacent pair predictions into trees

The last step belongs to the reconstruction experiment. The other tasks end with a label for an individual word or pair, which can be compared directly with the original annotation. All of the diagnostic classification experiments use NeuroX, and the authors make code for the experiments available under the repository name constptbprobing.

Ask which phrase first joins two words

For the first task, imagine starting at two leaves in a tree and following their paths towards the root. The first node the paths share is the lowest common ancestor, abbreviated LCA. Its category is the target. In the paper’s example about a car maker, luxury and maker first meet inside the subject noun phrase. The probe’s target is NP because the function tag identifying the phrase as a subject is stripped for this task. Pairs crossing more of a sentence can first meet at a verb phrase or at a clause. The category depends on where the paths come together in the tree.

The paper writes a sentence as an indexed sequence of words.

s = w₀, …, wₙ

Here s is the sentence, w names a word token, and its subscript gives its position. The index 0 marks the first position and n is the final index. The ellipsis stands for the intervening tokens in their sentence order. For the two positions i and j in a candidate pair, the paper imposes the following condition.

j ≥ i

The indices i and j denote the positions of the first and second tokens in the pair. The inequality means that the second is at the same position or to the right. When the positions are identical, the target is the first phrase node above that word. In the example sentence, the verb sold has VP as its target when paired with itself. The task therefore includes the phrase immediately above one token and the common phrase above two distinct tokens. The target inventory has 28 classes in the Penn Treebank.

For a pair, the authors place the activation vector for the first word before the activation vector for the second. Their notation for that combined input is as follows.

concat(xᵢ, xⱼ) ∈ ℝ²ʳ

Here xᵢ and xⱼ are the contextual vectors for the words at positions i and j. Each has r real-valued coordinates. The operation concat places the complete vectors end to end, and the membership symbol ∈ indicates that the result lies in the real vector space ℝ with 2r coordinates. A classifier can consequently give different weights to a feature observed on the left and to the same feature observed on the right. This matters when the two positions provide different grammatical evidence.

The authors also compare two ways of reducing the pair back to the width of a single word vector. The first averages corresponding coordinates. The second retains the activation with the greater magnitude at each coordinate and preserves its sign.

maxₛ(m, n) = { m if |m| > |n|; n otherwise }

Here m and n are scalar activation values from the same coordinate of the two vectors. The n in this rule is an activation and is local to the formula. Vertical bars indicate absolute value, the greater-than sign compares magnitudes, and the subscript s on maxₛ identifies the signed version of the operation. If the magnitudes are equal, the rule selects n. Applying the rule across all coordinates keeps a strong negative response as readily as a strong positive one. Either pooling method gives the classifier a reduced account of the two words. Concatenation preserves their individual values and their positions in the pair.

Mark a word’s position in its smallest phrase

Chunking changes the unit of prediction from a word pair to one word. The probe assigns B if the word begins its smallest phrase, I if it is inside away from either boundary, E if it ends the phrase, and S if it forms a phrase on its own. A word can lie inside several constituents at different depths. Selecting the shortest eligible phrase gives the classification a definite target. This choice directs the task towards local structure. A word may be at the start of its own phrase while sitting well inside an enclosing phrase.

In the example about the car maker, the number 1,214 begins a noun phrase. Its simple label is B. Its detailed label is B-NP, which combines the boundary role and the category of the phrase. A simple chunk prediction answers where the word is within the smallest group. A detailed prediction must give that position and get the associated category right as part of one label. In the detailed inventory, function-bearing noun phrase categories also give the probe a chance to distinguish grammatical roles that the ancestor inventory folds into NP.

A set of correct chunk tags supplies information about local brackets. It leaves open how those brackets fit together farther up the tree. A set of correct ancestor categories supplies information about the grouping of pairs but can still leave the depths and identities of nodes unresolved. In particular, two boundaries reporting the same category could refer to a shared node or to separate nodes with the same name. Whole-tree recovery therefore needs predictions about the hierarchy itself.

Specify enough labels to rebuild the tree

For reconstruction, the authors adapt a sequence-labeling formulation from Vilares and colleagues. The probe processes adjacent word pairs rather than all the pairs used in the stand-alone LCA task. It makes separate predictions about the lowest common ancestor at the boundary between the words, how deep that ancestor is relative to the one at the preceding boundary, and whether there is a single-word constituent above the first word of the pair. The three targets represent different parts of the description. Phrase names tell the decoder how to label nodes, depth changes help it work out nesting, and the single-word prediction handles structure for which there is no internal boundary between words.

The relative part of the description uses successive pairs of the following form.

(wᵢ, wᵢ₊₁) and (wᵢ₋₁, wᵢ)

Here wᵢ is the current token, wᵢ₊₁ is its successor, and wᵢ₋₁ is its predecessor. The parentheses group the two tokens in each pair. The first pair crosses the boundary after the current token, while the second crosses the boundary just before it. The depth target compares the ancestors of these boundaries. In the paper’s illustrated label sequence, a ROOT marker also identifies boundaries whose ancestor is at the root. The same sequence contains changes in depth and cases in which the neighboring depths stay level.

The first classifier predicts the category at the current boundary. The second predicts the relative depth information. The third gives the category of a single-word constituent above the current token when there is one and otherwise gives the negative label. The paper reports that over 90% of the data for this distinction consists of tokens that occur in multiword constituents. Negative cases thus dominate that part of the task. The decoder uses the outputs together to produce a labeled constituent tree, which can then be compared with the reference tree as a whole.

The reconstruction classifiers take concatenated representations of adjacent words from every third layer of the 12-layer systems or every second layer of the 6-layer system. The authors use this spacing to keep the feature vectors smaller while retaining access to activations from across the network. The linearity claim applies to the classifiers that generate the local labels. The structural decoding step uses those labels to assemble the tree. Together these steps test whether enough of the information needed for reconstruction is accessible in the representations.

Fit the probes and define the controls

The classifiers use linear scores over their input features. They are trained for 10 epochs with Adam, using an initial learning rate of 0.001. Both regularization coefficients are set to 0.001. The same general training setup supports comparisons across the tasks and interventions. The input vectors can change with the experiment, while the form of classifier stays simple enough that success can be interpreted in terms of linear access to the target.

For the activation analysis, the authors use an elastic net objective. It combines the cost of assigning a low probability to the correct category with two penalties on the classifier weights.

L(θ) = −∑ⱼ log Pθ(tₛⱼ ∣ sⱼ) + λ₁‖θ‖₁ + λ₂‖θ‖₂²

Here L is the loss being minimized and θ denotes the trainable classifier weights. The sum ∑ⱼ ranges over training examples indexed by j. The input for instance j is sⱼ and its correct target is tₛⱼ. The term Pθ is the probability the classifier with weights θ assigns to the target, and ∣ means that the probability is conditioned on the input. The logarithm and leading minus sign penalize low probabilities on correct labels. The positive terms add regularization. The coefficient λ₁ weights the L1 norm ‖θ‖₁, which sums absolute weight magnitudes. The coefficient λ₂ weights the squared L2 norm ‖θ‖₂², which sums squared weights. The objective balances pressure to concentrate the useful weight on a smaller selection of features with pressure to avoid large weights and allow evidence to be distributed.

The resulting linguistic correlation analysis ranks activation dimensions by how salient they are for the classifier’s task. The authors can then train new probes using only the highest-ranked coordinates, the lowest-ranked coordinates, or a random selection of the same size. Refitting with each subset matters. It measures what a probe can learn from the available features after it has adapted its weights to the smaller input. A feature set that supports a strong refitted probe need not be the set the original full-input probe relied on most heavily.

The arbitrary-label controls preserve the broad shape of the class distribution while changing what the labels mean. For chunking, each word type receives a randomly assigned target, repeated on every occurrence of that type. For ancestor prediction, the assignment is attached to a pair of word types. Repeated occurrences of that pair have the same arbitrary target even if the actual constituent relationship changes. The authors call the gap between linguistic-task accuracy and control-task accuracy selectivity. A large gap shows that the linguistic labels are easier to recover than the arbitrary lexical assignment under that particular control.

The other controls change the input. Random BERT retains the ordinary BERT base architecture, vocabulary, and static input embeddings, while its transformer weights are randomized. Applying the probe to those activations helps estimate the contribution of the learned contextual transformations. The single-token controls for ancestor prediction keep the ordinary representations and train separate classifiers using only the left or only the right word vector. They test how much each contextual position can already reveal about the answer before both are combined.

Experiments and results

Reading the scores and the data conditions

The study reports accuracy for the ancestor and chunking classifications. For the ancestor task, an example is a word pair and a correct prediction gives its reference category. For chunking, an example is a word and a correct prediction gives its position label or its combined position and phrase label. Tree reconstruction uses labeled F1, which balances precision and recall for bracketed spans with their categories. Precision concerns how many predicted labeled spans agree with the reference. Recall concerns how many reference labeled spans the reconstruction recovers. Correct individual boundary predictions can help the tree score, but the evaluation ultimately concerns the spans produced by the decoder.

The paper marks unchanged data as orig. and the lighter and heavier replacements as .33 and .67. In a condition written as .33/orig., the classifier is trained on lightly altered sentences and evaluated on unchanged sentences. A matched altered condition such as .33/.33 changes both training and evaluation. The distinction is important. A comparison between .33/orig. and .33/.33 keeps the training version fixed and changes evaluation. A comparison between orig./orig. and .33/orig. holds evaluation on ordinary sentences fixed while changing the supervised training input. These comparisons address different aspects of transfer between the data versions.

The experiments use the standard Penn Treebank training and development split, although the accuracy tables use the column label “train/test” for the condition. For whole-tree reconstruction the authors explicitly identify 38k training sentences and 5.5k development sentences. The phrase labels are unevenly distributed. The ancestor inventory has particularly frequent high nodes such as S, the ordinary sentence category. The paper also shows that the simple chunking labels are comparatively balanced. Punctuation is excluded from the chunking evaluation, even though the appendix lists a punctuation entry when describing the tag distribution.

Predicting shared phrase categories

With unchanged training and evaluation data, RoBERTa reaches 82.8% ancestor accuracy in the main results. Its selectivity is 58.3 and its reported performance gap over Random BERT is 23.4. The selectivity figure is already a difference against the arbitrary-label task, whereas the Random BERT gap concerns a probe with a different input representation. Both are reported alongside accuracy so that the reader can see whether accurate target prediction also survives comparisons to the two controls.

The ordered pair is appreciably more useful than either word by itself. On unchanged data, the left-only RoBERTa probe reaches 66.5% ancestor accuracy and the right-only probe reaches 40.8%. These are contextual vectors, so a left-only input can already reflect a wider sentence. The result measures the value of giving the classifier separate access to both positions. The task is asymmetric in the corpus as well. The authors expect the left token to be a stronger predictor because the trees tend to branch to the right, making the left token often closer to the ancestor.

The appendix’s comparison of pair encodings reports the original-data RoBERTa concatenation score as 82.9, while the main table gives 82.8. The chart uses the appendix values throughout, so that all three settings come from the same comparison. Signed absolute maximum and averaging are competitive with each other relative to the larger advantage of retaining both vectors, but their order is clear in this setting.

RoBERTa pair inputs on unchanged Penn Treebank ancestor accuracy

Keeping the ordered word vectors intact gives the strongest ancestor readout.

RoBERTa pair inputs on unchanged Penn Treebank ancestor accuracyElementwise average: 63.9Elementwise average63.9Signed absolute maximum: 69.3Signed absolute maximum69.3Concatenation (this paper): 82.9Concatenation (this paper)82.9
The numbers
System or settingaccuracy %
Elementwise average63.9
Signed absolute maximum69.3
Concatenation (this paper)82.9

Across pretrained systems, the same appendix comparison places XLNet at 83.1, BERT at 81.4, and DistilBERT at 81.0 ancestor accuracy with concatenation on unchanged data. Similar accuracy leaves room for different error patterns and control scores. XLNet records 67.8 selectivity in this comparison, while BERT records 59.0 and DistilBERT 55.2. The probes differ in how well they do on the arbitrary-label task as well as in how well they classify the actual syntactic labels.

For RoBERTa, ancestor accuracy on unchanged evaluation sentences is 81.1 when the probe trains on the lighter replacement data and 79.3 when it trains on the heavier replacement data. When training and evaluation both use the lighter replacement, accuracy is 79.7. With the heavier replacement on both sides, it is 77.4, with selectivity of 59.9 and a reported gap over Random BERT of 23.1. Thus accuracy depends on the sentence version, while the distance from both controls remains substantial even in the most altered matched condition. The selectivity figures also show why it helps to report a control gap separately. Target accuracy falls across these conditions, while the gap to the arbitrary task need not follow the same ordering.

Marking local phrases

In the unchanged condition, RoBERTa’s chunking accuracy is 96.0% for simple positions and 91.2% when the label also names the phrase. The detailed task can count a prediction as wrong even when the position part is correct. Its selectivity of 9.4 is lower than the simple task’s 13.7 in this condition. Its gap over Random BERT is larger, at 32.3 for detailed chunking against 22.2 for simple chunking. The two comparisons concern different alternatives. Arbitrary word-type assignments may be easy for a probe to learn even if a contextual transformation contributes meaningfully to the real phrase categories.

The next chart holds the detailed target inventory fixed and varies which version the classifier gets during training and evaluation. The unchanged training and evaluation condition gives the highest accuracy. Among the altered conditions, a probe trained on the lighter replacement data does better when the evaluation sentences are unchanged. The same preference for unchanged evaluation occurs with heavier replacement in training.

RoBERTa detailed chunking accuracy across Penn Treebank sentence versions

Detailed phrase tags are recovered most accurately on unchanged sentences, with the lowest score under heavier replacement at both stages.

RoBERTa detailed chunking accuracy across Penn Treebank sentence versionsUnchanged training and evaluation (this paper): 91.2Unchanged training and evaluation (thispaper)91.2Lighter replacement training, unchanged evaluation: 90.5Lighter replacement training, unchangedevaluation90.5Lighter replacement training and evaluation: 89.2Lighter replacement training andevaluation89.2Heavier replacement training, unchanged evaluation: 89.3Heavier replacement training, unchangedevaluation89.3Heavier replacement training and evaluation: 87.1Heavier replacement training andevaluation87.1
The numbers
System or settingaccuracy %
Unchanged training and evaluation (this paper)91.2
Lighter replacement training, unchanged evaluation90.5
Lighter replacement training and evaluation89.2
Heavier replacement training, unchanged evaluation89.3
Heavier replacement training and evaluation87.1

The simple chunking task is relatively robust under the same manipulation. RoBERTa records 94.4 simple chunking accuracy with lighter replacement in both training and evaluation, and 93.3 with heavier replacement in both. In the heavier matched condition, its selectivity is 13.6 and its gap over Random BERT is 23.2. For detailed chunking in that condition, selectivity is 6.7 and the reported gap over Random BERT is 36.1. The linear probe still makes many correct detailed predictions, and its advantage over randomized contextual weights remains large even as the advantage over the arbitrary lexical control narrows.

The appendix shows similar patterns across systems for chunking. On unchanged data, the simple position accuracy is 95.3 for DistilBERT, 95.2 for BERT, and 94.3 for XLNet. For the detailed tags, the corresponding scores are 90.3, 90.6, and 91.1. The ordering changes with the requested label. XLNet’s lower simple position score among those systems coexists with its higher detailed score. The experiment therefore gives a reason to keep the two tasks separate when comparing representations.

Recovering entire trees

The comparison below gives the appendix’s labeled F1 values on the unchanged Penn Treebank development split. All four pretrained systems yield substantial structure under the linear classifiers and sequence decoder. Random BERT, evaluated with the same overall procedure, is appreciably lower. It still supplies some information usable by a supervised classifier, which is why it provides a more informative reference point than treating the absence of learned contextual weights as the absence of any possible signal.

Labeled F1 for reconstructed trees on unchanged Penn Treebank development data

RoBERTa leads the pretrained systems, and all pretrained representations support better recovery than random-weight BERT.

Labeled F1 for reconstructed trees on unchanged Penn Treebank development dataRandom BERT: 51.36Random BERT51.36DistilBERT: 79.88DistilBERT79.88BERT: 80.42BERT80.42XLNet: 80.52XLNet80.52RoBERTa (this paper): 82.58RoBERTa (this paper)82.58
The numbers
System or settinglabeled F1
Random BERT51.36
DistilBERT79.88
BERT80.42
XLNet80.52
RoBERTa (this paper)82.58

RoBERTa’s reconstruction result depends on both the training and evaluation version. In the main results, it scores 80.9 labeled F1 after lighter replacement in training and evaluation on unchanged development sentences. It scores 77.8 when the lighter replacement is used at both stages. With heavier replacement in training, the scores are 78.3 on unchanged development sentences and 72.8 on the corresponding altered development sentences. The main table reports a gap over Random BERT of 28.1 in that final condition. The decoder consequently recovers a substantial amount of the reference structure after the intervention, while whole-tree quality is clearly sensitive to the wording it receives.

The other pretrained systems show the same broad dependence on replacement. With heavier replacement in both training and evaluation, the appendix reports labeled F1 of 69.63 for BERT, 69.72 for DistilBERT, and 69.91 for XLNet. Random BERT scores 44.71 in that condition. Similarities among the pretrained aggregate scores establish that the recovery is available from several sources of representations. Whether they get the same spans correct or struggle on the same examples requires another comparison.

The paper also reports that its BERT result exceeds the earlier result from Vilares and colleagues by 2.2 points. This is a comparison between complete readout setups. The earlier linear classifier received the final layer at the first position in the pair. Arps and colleagues give their classifier activations from both adjacent positions and from a selection of layers. The reported advantage describes the combined input change. The comparison does not isolate a contribution from an individual layer or from the second word alone.

What the ablations show

Preserving the two sides of a pair

The comparison between concatenation and pooling tests how much the input format itself constrains the probe. The average of two activations can be small because both are small or because large responses of opposite signs cancel. Those cases may carry different evidence for the target label. Averaging also removes the distinction between the first and second positions. A signed maximum keeps stronger coordinate-level responses, so it preserves some signals that averaging would flatten. It still does not give the classifier independent access to both original values. The best-performing method leaves that distinction intact.

This is a controlled comparison of feature constructions, with an accompanying difference in input width. The concatenated representation gives the classifier a weight for each side, while the pooled alternatives provide fewer coordinates. The control task is therefore informative. The paper finds that the improvement in linguistic accuracy with concatenation is not matched by a similar improvement in arbitrary-label accuracy. That is why concatenation leads on both task accuracy and selectivity. The result supports the view that preserving the pair’s structure helps recover the actual relationship, even though input width and information preservation change together.

The left-only and right-only comparisons clarify why symmetric pooling can be costly. The left-only probe does better for each of the pretrained systems in the paper’s comparison. In a corpus with the branching tendency the authors describe, the left word can often be relatively near the phrase node of interest. Giving the classifier the two positions separately allows it to exploit that asymmetry and any complementary evidence in the right word. It also leaves open which part of the improvement comes from treating the positions differently and which part comes from having two independent values per coordinate.

Varying how much ordinary meaning is available

Replacement helps distinguish performance that persists when the words are recombined from performance seen only with ordinary sentences. Training on altered examples and evaluating on ordinary ones shows that the classifiers can learn from unusual wording and recover much of the familiar annotation. Matching altered training with altered evaluation goes further. The familiar word combinations are disrupted on both sides, and the scores remain well above the randomized-weight baseline. For the authors, this is evidence that the representations contain grammatical information usable beyond the ordinary meanings of the original sentences.

The declines matter too. Given the same altered training condition, the probe generally does better when evaluated on unchanged sentences. The authors give two explanations that can coexist. The probe may still benefit from whatever semantic cues survive, including the meanings of the real words and the combinations left intact. Some altered sentences may also deviate from well-formed syntax because the replacement rule preserves a recorded context without checking every grammatical requirement in the new sentence. The experiments measure the outcome of both changes together.

The paper’s reconstruction examples show why a single accuracy or F1 score cannot describe every effect of replacement. In one development example, the ordinary RoBERTa reconstruction merges the SBAR and S nodes in a relative clause into an SBAR. With heavy replacement, the probe still recognizes the short chunks, while assigning a different structure to the relative clause’s verb phrase. In another example, the reconstruction from the altered sentence recognizes a verb phrase in spite of an inflectional mismatch after did. It also recovers a noun phrase involving or that the ordinary reconstruction misses. Alteration lowers overall accuracy while sometimes changing a local decision in favor of the reference. These examples also show how errors in nesting can coexist with successful recovery of short phrases.

Finding where the readout works best

Layer-wise retraining asks where the same class of probe has the easiest job. For each layer, the authors train a classifier restricted to that layer’s representation. The embedding layer performs worse than the strongest contextual layers, and middle layers generally lead. The paper attributes the decline in the highest layers to their closer involvement with the pretraining objective. That is an interpretation of the observed layer profile. The experiments measure accessibility at each layer and do not intervene on the objective to establish its role in causing the decline.

The best layer depends on the task and the source of the representations. For chunking, the probes given all layers do better than any single layer in the reported comparison. For LCA prediction, layers 4-5 in RoBERTa and 6-8 in BERT can each beat the respective all-layer result. RoBERTa’s accuracy also rises earlier in the stack. These results show that the readout benefits from combining layers in some settings, while restricting the input can be beneficial in others. They locate where particular features are most accessible to a simple supervised classifier. They do not give a timetable for when the original system uses a grammatical operation.

The activation-subset study then asks whether the readout depends on a narrow group of coordinates. For chunking on unchanged RoBERTa data, the probes trained on highly ranked, low-ranked, and randomly chosen coordinates perform similarly across much of the comparison. The authors report that 20 − 30% of the coordinates can suffice for accuracy comparable to training on the full representation. That result supports a distributed account of the information useful for chunking. Many samples of the activations retain enough evidence for a classifier to recover the tags.

The analysis is harder to interpret for LCA prediction. A ranking over a concatenated vector mixes coordinates belonging to the left position with coordinates belonging to the right. The same fraction also describes a larger absolute feature count than it would for a single word. A small performance difference between subsets can reflect how the probe draws on the available signals from both positions. The paper therefore also examines where high-ranked coordinates for particular categories come from. It finds many in middle layers and notes that positional features at the embedding layer can help with identifying widely separated words whose ancestor is S. The highest layers contribute more strongly to the NP readout than to the S readout in the reported comparison. The authors suggest that the structural variety grouped under NP may help explain this difference.

Looking at rank changes and errors

Rankings also change when the training sentence version changes. For the simple chunking task, 21.2% of the 1% highest-ranked activations on unchanged data also belong to the highest-ranked 1% for the lighter replacement data. The analogous overlap between unchanged data and heavier replacement is 16.2%. The paper interprets the small overlaps as evidence that the classifier accentuates different features when ordinary meaning is less dependable. A rank overlap is a comparison of fitted classifiers. It does not assign a unique semantic or syntactic function to any individual coordinate.

Error patterns add context to the aggregate ancestor accuracy. In the paper’s label distribution, S accounts for 39.20% of the examples, VP for 25.37%, and NP for 22.66%. More distant pairs tend to meet higher in the tree, where the label is frequently S. The paper finds higher ancestor accuracy for larger word separations across all four pretrained systems. Thus higher accuracy at longer distances goes together with a change in the types of examples being classified. It cannot on its own establish that the probe handles a wider range of long-distance structures with greater precision.

Category-specific errors make that distinction clearer. Prepositional phrases are frequently recovered correctly, while adjectival phrases are sometimes classified as nouns or verbs at the phrase level. Noun phrases are confused with a variety of other categories. The authors suggest that this may reflect the breadth of constructions annotated as NP, which include appositions and relative clauses. In detailed chunking, beginnings of frequent categories tend to be recognized well. The probe can also recover some of the distinctions among plain, subject, temporal, and locative noun phrases. These analyses show where accuracy goes beyond the frequent sentence-level label and where particular categories remain difficult.

Finally, the authors compare the reconstructed trees from different representations directly. When they compare sentence-level F scores against the reference, the Pearson correlation between XLNet and RoBERTa is 0.52 on unchanged data. For BERT and DistilBERT, it is 0.64. These values summarize how similarly the systems vary in success from sentence to sentence. A separate comparison scores predicted trees against one another and also finds the closest agreement between BERT and DistilBERT. Two RoBERTa reconstructions on the same data agree at labeled F1 of 96.3. That repeat comparison puts the variation across systems in context. Since pretraining data and objectives differ together, the authors' interpretation that the systems make different grammatical generalizations is broader than any claim about which training choice explains the difference.

Limitations

Limits the authors state

The authors distinguish access to a representation from use by the system that produced it. The output of the study is a set of trained readouts and reconstructed trees. Their performance shows which distinctions can be recovered with the chosen input and classifier. Establishing that a distinction is causally important for a particular prediction would require testing the role of that information in the original prediction process. Even a high-quality tree reconstructed from the activations leaves this question open.

The experiments cover one language and one principal constituency annotation scheme. The authors describe the method as applicable in principle to other languages, provided suitable pretrained representations and extensive annotated data are available. Their findings do not establish how a language with different structures, or a treebank that labels similar constructions differently, would behave under the same procedure. The paper identifies other languages and annotation schemes as directions for future work, including a constituency-related resource developed from the Penn Treebank. CCGbank

The authors report a particular dependence on the amount of supervision. In pilot experiments, fewer than 10k training sentences were enough for high accuracy on ordinary sentences. The performance gap between ordinary and altered sentences narrowed as training increased from 10k sentences to 38k sentences. The intervention is therefore sensitive to the amount of evidence the probe has had to learn from. A comparison run with much less training material could produce a larger apparent effect of the altered input even if its representations had similar potential under more extensive supervision.

Large annotated datasets also make the procedure computationally demanding. For a 12-layer system, the paper reports 4 hours for the full set of chunking experiments and around 15 hours for the ancestor experiments when all three pair encodings are included. Whole-tree reconstruction across the data variants takes around 3 hours in the reported setup. These timings include collecting and handling activation values as well as running the classifiers. The extra burden of ancestor analysis includes building inputs for word pairs. The figures characterize the authors’ experimental setup rather than giving a general runtime estimate for other corpora or hardware.

Limits visible in the setup

The altered sentences preserve a known annotation through a substitution rule. The rule matches a word’s part of speech and observed dependency context, which is a concrete way to retain much of the structure. It does not independently establish that the entire edited sentence still has the inherited parse. An agreement mismatch in one reconstruction example illustrates this gap. A disagreement between a prediction and the retained annotation can reflect a mistake by the probe, a grammatically altered input whose best analysis may have changed, or both. The measured decline is consequently a score under the inherited tree, with an unknown contribution from changes in grammatical well-formedness.

The substitution also leaves recognizable words and varying amounts of ordinary context. The authors choose real forms because those forms can carry useful grammatical information learned during pretraining. The same choice preserves lexical meaning and can preserve associations among the unchanged words. Strong performance after replacement shows that the original combination of meanings is dispensable for many predictions. The experiment gives limited grounds for identifying a purely syntactic component of the representation or estimating how much semantic information remains available to the probe. The changed activation rankings tell us that the fit shifts across conditions, with the cause and content of individual coordinate changes unresolved.

Aggregate accuracy needs to be read alongside the class distribution and examples. A frequent high-level category can make some kinds of pairs easy to classify, while infrequent distinctions contribute little to the overall score. The reported confusion patterns concern prominent labels. They give a more detailed account of those labels than of the rarest categories. Furthermore, the left-only and right-only inputs are contextual, so differences between them concern access through a position in a sentence. They do not compare isolated words or independent lexical sources.

The controls sharpen the interpretation within their designs. A random label assigned to a word type tests a different memorization problem from a random label assigned to a pair of word types. The two arbitrary-label tasks have different numbers of possible assignments and different opportunities for repeated input. Selectivity is therefore most informative when it compares settings within the same task. Random BERT addresses another question and retains trained static input embeddings. Its score measures what can be recovered with those features and randomized contextual transformations. The gap to that baseline gives a useful benchmark for the contribution of pretrained context without identifying particular learned operations.

Whole-tree recovery inherits the limits of its sequence encoding. The paper gives an example in which a unary chain from NP to QP above a leaf cannot be predicted by its version of the algorithm. A unary chain consists of successive phrase nodes without branching at that point. The reported labeled F1 therefore depends on the ability of the representation to support the readout and on the structures that the readout is designed to express. Independent classifiers can also make errors in the category or depth decisions used to build a span. The study’s strongest evidence is that their local outputs supply enough information to assemble high-quality trees, subject to the chosen label inventory and decoding procedure.

What came after

The subsequent citations place the paper alongside work on hierarchy, multilingual grammar, construction meaning, and the interpretation of linguistic probes. The citing works’ titles identify their topics. The citation relationships alone leave their use of the Penn Treebank intervention, the ordered pair probe, and the reconstruction procedure unspecified.

Allen-Zhu and Li’s Physics of Language Models, Part 1 takes the learning of hierarchical language structures as its subject. The point of contact is the acquisition of hierarchy. Arps and colleagues test for it by supplying reference phrase annotations after pretraining and measuring how much a readout can recover. The later title identifies hierarchical learning as the focus, while leaving the relationship between its experimental procedure and the constituency probes open. Physics of Language Models, Part 1

Morphosyntactic Probing of Multilingual BERT addresses grammatical probing in a multilingual setting. Its scope brings together word form and syntactic distinctions across languages. That connects to a specific limit of the earlier study, whose supervised target labels come from an English treebank. The citation places the two studies in the same line of representational analysis, with the exact targets and the role of the earlier phrase-level probes left unspecified. Morphosyntactic Probing of Multilingual BERT

Multilingual Nonce Dependency Treebanks has the closest overlap in stated subject. It concerns deliberately unusual sentences, multiple languages, and the representation and processing of syntax. It also names dependency treebanks, whereas the earlier paper uses dependency contexts to construct altered inputs and constituent trees to supply the diagnostic targets. The later title thus identifies a change in both language coverage and the kind of annotation foregrounded in the investigation. Whether it carries over the precise replacement rule or the same comparisons is open. Multilingual Nonce Dependency Treebanks

On Quick Kisses and How to Make Them Count examines event construal in light verb constructions with BERT. The topic connects grammar and meaning at the level of a particular construction. Arps and colleagues use unusual word combinations to reduce the support that normal sentence meanings provide for grammatical predictions. The later work’s stated subject makes the interpretation of a construction central. The citation establishes that the constituency study figures in that investigation, without specifying an adopted probe or reporting a replication. On Quick Kisses and How to Make Them Count

Language Models as Models of Language places systems trained on language in relation to the study of language itself. A natural connection is the distinction between recovery and explanation. Arps and colleagues show that phrase annotations can be read out and explicitly limit what this establishes about the system’s own predictions. That distinction gives a concrete example of the evidential question raised by the later work’s subject. Its title and citation leave the specific use of the constituency results open. Language Models as Models of Language

The critical review of probing for compositional meaning addresses how studies assess representations of meaning built from parts. The earlier paper supplies a related case on the syntax side. It asks how to interpret a successful readout when structure and meaning ordinarily support each other, and it tests alternative explanations through word replacement and controls. The review’s title identifies probing evidence as the object of scrutiny. Its citation of the constituency study establishes the connection without establishing which evidence or conclusions the review adopts. Compositional Meaning Representations in LLMs

Cite

Cite as David Arps, Younes Samih, Laura Kallmeyer and Hassan Sajjad. 2022. Probing for Constituency Structure in Neural Language Models. Findings of the Association for Computational Linguistics: EMNLP 2022.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2022.findings-emnlp.502

@inproceedings{arps2022probing,
  title = {{Probing for Constituency Structure in Neural Language Models}},
  author = {David Arps, Younes Samih, Laura Kallmeyer and Hassan Sajjad},
  booktitle = {Findings of the Association for Computational Linguistics: EMNLP 2022},
  year = {2022},
  doi = {10.18653/v1/2022.findings-emnlp.502},
  url = {https://doi.org/10.18653/v1/2022.findings-emnlp.502}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/arps-2022-probing-constituency-structure-neural-language/