of those words before it. These strong inﬂuences
are shown by the darker-colored pixels seen in the
second last column of the impact map. This ob-
servation agrees with the ground-truth dependency
tree, which selects “ different” as the head of all
remaining words in the phrase “ this will be a lit-
tle different.” We also observe similar patterns on
“transitions” and “Hill”. Such correlations lead us
to explore the idea of extracting dependency trees
from the matrices (see Section 4.1).
follow social media transitions on Capitol Hill
Figure 2: Part of the constituency tree.
Constituency. Figure 2 shows part of the con-
stituency tree of our example sentence generated
by Stanford CoreNLP ( Manning et al. , 2014). In
this sentence, “ media” and “ on” are two words
that are adjacent to “ transitions”. From the tree,
however, we see that “media” is closer to “transi-
tions” than “on” is in terms of syntactic distance.
If a model is syntactically uninformed, we would
expect “media” and “on” to have comparable im-
pacts on the prediction of “ transitions”, and vice
versa. However, we observe a far greater impact
(darker color) between “media” and “transitions”
than that between “on” and “transitions”. We will
further support this observation with empirical ex-
periments in Section 4.2.
Other Structures. Along the diagonal of the
impact map, we see that words are grouped into
four contiguous chunks that have speciﬁc intents
(e.g., a noun phrase – on Capitol Hill ). We also
observe that the two middle chunks have relatively
strong inter-chunk word impacts and thus a bond-
ing that groups them together, forming a larger
verb phrase. This observation suggest that BERT
may capture the compositionality of the language.
In the following sections we quantitatively eval-
uate these observations.
4 Syntactic Probe
We start with two syntactic probes – dependency
probe and constituency probe.
4.1 Dependency Probe
With the goal of exploring the extent dependency
relations are captured in BERT, we set out to an-
swer the following question: Can BERT outper-
form linguistically uninformed baselines in unsu-
pervised dependency parsing? If so, to what ex-
tent?
We begin by using the token-level perturbed
masking technique to extract an impact matrix F
for each sentence. We then utilize graph-based al-
gorithms to induce a dependency tree fromF, and
compare it against ground-truth whose annotations
4168
[CLS]Forthosewhofollowsocialmedia
transitions
on
Capitol
Hill , this will be alittle
different
.
[CLS]
For
those
who
follow
social
media
transitions
on
Capitol
Hill
,
this
will
be
a
little
different
.
0
1
2
3
4
5
Figure 1: Heatmap of the impact matrix for the sen-
tence “For those who follow social media transitions
on Capitol Hill, this will be a little different.”
3 Visualization with Impact Maps
Before we discuss speciﬁc syntactic phenomena,
let us ﬁrst analyze some example impact matri-
ces derived from sample sentences. We visual-
ize an impact matrix of a sentence by displaying
a heatmap. We use the term “impact map” to refer
to a heatmap of an impact matrix.
Setup. We extract impact matrices by feed-
ing BERT with 1,000 sentences from the English
Parallel Universal Dependencies (PUD) treebank
of the CoNLL 2017 Shared Task ( Zeman et al. ,
2017). We follow the setup and pre-processing
steps employed in pre-training BERT. An example
impact map is shown in Figure 1.
Dependency. We notice that the impact map
contains many stripes, which are short series of
vertical/horizontal cells, typically located along
the diagonal. Take the word “ different” as an ex-
ample (which is illustrated by the second-to-last
column in the impact matrix). We observe a clear
vertical stripe above the main diagonal. The inter-
pretation is that this particular occurrence of the
word “different” strongly affects the occurrences
of those words before it. These strong inﬂuences
are shown by the darker-colored pixels seen in the