SlowGuess/ACL_2020_OCR huggingface dataset:
Department of Computer Science and Cornell Tech, Cornell University
{nk654,he93,arush}@cornell.edu
{yoav}@cs.cornell.edu
Visual features are a promising signal for learning bootstrap textual models. However, black-box learning models make it difficult to isolate the specific contribution of visual components. In this analysis, we consider the case study of the Visually Grounded Neural Syntax Learner (Shi et al., 2019), a recent approach for learning syntax from a visual training signal. By constructing simplified versions of the model, we isolate the core factors that yield the model's strong performance. Contrary to what the model might be capable of learning, we find significantly less expressive versions produce similar predictions and perform just as well, or even better. We also find that a simple lexical signal of noun concreteness plays the main role in the model's predictions as opposed to more complex syntactic reasoning.
Language analysis within visual contexts has been studied extensively, including for instruction following (e.g., Anderson et al., 2018b; Misra et al., 2017, 2018; Blukis et al., 2018, 2019), visual question answering (e.g., Fukui et al., 2016; Hu et al., 2017; Anderson et al., 2018a), and referring expression resolution (e.g., Mao et al., 2016; Yu et al., 2016; Wang et al., 2016). While significant progress has been made on such tasks, the combination of vision and language makes it particularly difficult to identify what information is extracted from the visual context and how it contributes to the language understanding problem.
Recently, Shi et al. (2019) proposed using alignments between phrases and images as a learning signal for syntax acquisition. This task has been long-studied from a text-only setting, including recently using deep learning based approaches (Shen et al., 2018a, 2019; Kim et al., 2019; Havrylov et al., 2019; Drozdov et al., 2019, inter alia). While the
introduction of images provides a rich new signal for the task, it also introduces numerous challenges, such as identifying objects and analyzing scenes.
In this paper, we analyze the Visually Grounded Neural Syntax Learner (VG-NSL) model of Shi et al. (2019). In contrast to the tasks commonly studied in the intersection of vision and language, the existence of an underlying syntactic formalism allows for careful study of the contribution of the visual signal. We identify the key components of the model and design several alternatives to reduce the expressivity of the model, at times, even replacing them with simple non-parameterized rules. This allows us to create several model variants, compare them with the full VG-NSL model, and visualize the information captured by the model parameters.
Broadly, while we would expect a parsing model to distinguish between tokens and phrases along multiple dimensions to represent different syntactic roles, we observe that the model likely does not capture such information. Our experiments show that significantly less expressive models, which are unable to capture such distinctions, learn a similar model of parsing and perform equally and even better than the original VG-NSL model. Our visualizations illustrate that the model is largely focused on acquiring a notion of noun concreteness optimized for the training data, rather than identifying higher-level syntactic roles. Our code and experiment logs are available at https://github.com/lil-lab/vgns1_analysis.
2 Background: VG-NSL
VG-NSL consists of a greedy bottom-up parser made of three components: a token embedding function  $(\phi)$ , a phrase combination function (combine), and a decision scoring function (score). The model is trained using a reward signal computed by matching constituents and images.
Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 2615-2635 July 5 - 10, 2020. ©2020 Association for Computational Linguistics
Given a sentence  $\bar{x}$  with  $n$  tokens  $\langle x_1, \ldots, x_n \rangle$ , the VG-NSL parser (Algorithm 1) greedily constructs a parse tree by building up a set of constituent spans  $\mathcal{T}$ , which are combined spans from a candidate set  $\mathcal{C}$ . Parsing starts by initializing the candidate set  $\mathcal{C}$  with all single-token spans. At each step, a score is computed for each pair of adjacent candidate spans  $[i, k]$  and  $[k + 1, j]$ . The best span  $[i, j]$  is added to  $\mathcal{T}$  and  $\mathcal{C}$ , and the two sub-spans are removed from  $\mathcal{C}$ . The parser continues until the complete span  $[1, n]$  is added to  $\mathcal{T}$ .
Scoring a span  $[i,j]$  uses its span embedding  $\mathbf{x}_{[i,j]}$ . First, a  $d$ -dimensional embedding for each single-token span is computed using  $\phi$ . At each step, the score of all potential new spans  $[i,j]$  are computed from the candidate embeddings  $\mathbf{x}_{[i,k]}$  and  $\mathbf{x}_{[k+1,j]}$ . The VG-NSL scoring function is:
$$
\mathrm {s c o r e} (\mathbf {x} _ {[ i, k ]}, \mathbf {x} _ {[ k + 1, j ]}) = \mathrm {M L P} _ {s} ([ \mathbf {x} _ {[ i, k ]}; \mathbf {x} _ {[ k + 1, j ]} ]) ,
$$
where  $\mathrm{MLP}_s$  is a two-layer feed-forward network. Once the best new span is found, its span embedding is computed using a deterministic combine function. VG-NSL computes the  $d$ -dimensional embedding of the span  $[i,j]$  as the L2-normalized sum of the two combined sub-spans:
$$
\mathrm {c o m b i n e} (\mathbf {x} _ {[ i, k ]}, \mathbf {x} _ {[ k + 1, j ]}) = \frac {\mathbf {x} _ {[ i , k ]} + \mathbf {x} _ {[ k + 1 , j ]}}{\left\| \mathbf {x} _ {[ i , k ]} + \mathbf {x} _ {[ k + 1 , j ]} \right\| _ {2}} .
$$
Learning the token embedding function  $\phi$  and scoring model  $\mathrm{MLP}_s$  relies on a visual signal from aligned images via a reward signal derived from matching constituents and the image. The process alternates between updating the parser parameters and an external visual matching function, which is estimated by optimizing a hinge-based triplet ranking loss similar to the image-caption retrieval loss of Kiros et al. (2014). The parser parameters are estimated using a policy gradient method based on the learned visual matching function, which
encourages constituents that match with the corresponding image. This visual signal is the only objective used to learn the parser parameters. After training, the images are no longer used and the parser is text-only.
3 Model Variations
We consider varying the parameterization of VGNSL, i.e.,  $\phi$ , combine, and score, while keeping the same inference algorithm and learning procedure. Our goal is to constrain model expressivity, while studying its performance and outputs.
Embedding Bottleneck We limit the information capacity of the parsing model by drastically reducing its dimensionality from  $d = 512$  to 1 or 2. We reduce dimensionality by wrapping the token embedding function with a bottleneck layer  $\phi_B(x) = \mathrm{MLP}_B(\phi (x))$ , where  $\mathrm{MLP}_B$  is a two-layer feed-forward network mapping to the reduced size. This bottleneck limits the expressiveness of phrase embeddings throughout the parsing algorithm. During training, we compute both original and reduced embeddings. The original embeddings are used to compute the visual matching reward signal, whereas the reduced embeddings are used by score to determine parsing decisions. At test time, only the reduced embeddings are used. In the case of  $d = 1$ , the model is reduced to using a single criteria. The low dimensional embeddings are also easy to visualize, and to characterize the type of information learned.
Simplified Scoring We experiment with simplified versions of the score function. Together with the lower-dimensional representation, this enables controlling and analyzing the type of decisions the parser is capable of. As we control the information the embeddings can capture, simplifying the scoring function makes sure it does not introduce additional expressivity. The first variation uses a weighted sum with parameters  $\mathbf{u}$ ,  $\mathbf{v}$ :
$$
\mathrm {s c o r e} _ {\mathrm {W S}} (\mathbf {x} _ {[ i, k ]}, \mathbf {x} _ {[ k + 1, j ]}) = \mathbf {u} \cdot \mathbf {x} _ {[ i, k ]} + \mathbf {v} \cdot \mathbf {x} _ {[ k + 1, j ]}.
$$
This formulation allows the model to learn structural biases, such as the head-initial (HI) bias common in English (Baker, 1987). The second is a nonparameterized mean, applicable for  $d = 1$  only:
$$
\mathrm {s c o r e} _ {\mathrm {M}} (\mathbf {x} _ {[ i, k ]}, \mathbf {x} _ {[ k + 1, j ]}) = \frac {\mathbf {x} _ {[ i , k ]} + \tau \mathbf {x} _ {[ k + 1 , j ]}}{1 + \tau},
$$
where  $\tau$  is a hyper-parameter that enables upweighting the right constituent to induce a HI inductive
bias. We experiment with unbiased  $\tau = 1$  (scoreM) and HI-biased  $\tau = 20$  (scoreMHI) scoring.
Reduced Dimension Combine In lower dimensions, the combine function no longer produces useful outputs, i.e., in  $d = 1$  it always gives 1 or -1. We therefore consider mean or max pooling:
$$
\begin{array}{l} \operatorname {c o m b i n e} _ {\mathrm {M E}} \left(\mathbf {x} _ {[ i, k ]}, \mathbf {x} _ {[ k + 1, j ]}\right) = \frac {\mathbf {x} _ {[ i , k ]} + \mathbf {x} _ {[ k + 1 , j ]}}{2} \\ \operatorname {c o m b i n e} _ {\mathrm {M X}} \left(\mathbf {x} _ {[ i, k ]}, \mathbf {x} _ {[ k + 1, j ]}\right) = \\ \max  \left(\mathbf {x} _ {[ i, k ]}, \mathbf {x} _ {[ k + 1, j ]}\right). \\ \end{array}
$$
The mean variant computes the representation of a new span as an equal mixture of the two subspans, while the max directly copies to the new span representation information only from one of the spans. The max function is similar to how head rules lexicalize parsers (Collins, 1996).
We train VG-NSL and our model variants using the setup of Shi et al. (2019), including three training extensions: (a)  $+\mathbf{HI}$ : adding a head-initial inductive bias to the training objective; (b)  $+\mathbf{FastText}$ : the textual representations are partially initialized with pre-trained FastText (Joulin et al., 2016); and (c) -IN:  $^1$ disabling the normalization of image features. We follow the Shi et al. (2019) setup. We train all VG-NSL variants on 82,783 images and 413,915 captions from the MSCOCO (Lin et al., 2014) training set. We evaluate unsupervised constituency parsing performance using 5,000 non-overlapping held-out test captions. We use additional 5,000 non-overlapping validation captions for model selection, as well as for our analysis and visualization in Section 5. We generate binary gold-trees using Benepar (Kitaev and Klein, 2018), an off-the-shelf supervised constituency parser.
We note that the model of the above procedure is not a single-step algorithm. We use the same approach to obtain the optimal combination of  $\mathrm{c}_{\mathrm{ME}}$  and  $\mathrm{s}_{\mathrm{WS}}$ . For example, we first compute the best candidate  $\mathrm{c}_{\mathrm{ME}}$  for each model by using the validation captions between five models. The agreement score is then calculated from these captions. We use the hyper-parameters obtained from Shi et al. (2019). We use the hyper-parameters obtained from Shi et al. (2019) as the initial configuration of the model.
Model	NP	VP	PP	ADJP	Avg. F1
Shi2019	79.6	26.2	42.0	22.0	50.4 ± 0.3
Shi2019*	80.5	26.9	45.0	21.3	51.4 ± 1.1
1, sWS, cME	77.2	17.0	53.4	18.2	49.7 ± 5.9
2, sWS, cME	80.8	19.1	52.3	17.1	51.6 ± 0.6
+HI
Shi2019	74.6	32.5	66.5	21.7	53.3 ± 0.2
Shi2019*	73.1	33.9	64.5	22.5	51.8 ± 0.3
1, sWS, cME	74.0	35.2	62.0	24.2	51.8 ± 0.4
2, sWS, cME	73.8	30.2	63.7	21.9	51.3 ± 0.1
+HI+FastText
Shi2019	78.8	24.4	65.6	22.0	54.4 ± 0.3
Shi2019*	77.3	23.9	64.3	21.9	53.3 ± 0.1
1, sWS, cME	76.6	21.9	68.7	20.6	53.5 ± 1.4
2, sWS, cME	77.5	22.8	66.3	19.3	53.6 ± 0.2
+HI+FastText-IN
Shi2019*	78.3	26.6	67.5	22.1	54.9 ± 0.1
1, SM, cMX	79.6	29.0	38.3	23.5	49.7 ± 0.2
1, SMHI, cMX	77.6	45.0	72.3	24.3	57.5 ± 0.1
1, SM, cME	80.0	26.9	62.2	23.2	54.3 ± 0.2
1, SMHI, cME	76.5	20.5	63.6	22.7	52.2 ± 0.3
1, sWS, cME	77.7	26.3	72.5	22.0	55.5 ± 0.1
2, sWS, cME	78.5	26.3	69.5	21.1	55.2 ± 0.1
Table 1: Test results. We report the results from Shi et al. (2019) as Shi2019 and our reproduction  $(\mathrm{Shi}2019^{*})$ . We report mean  $F_{1}$  and standard deviation for each system and recall for four phrasal categories. Our variants are specified using a representation embedding  $(d\in \{1,2\})$ , a score function  $(s_M$ : mean,  $s_{MHI}$ : mean+HI,  $s_{WS}$ : weighted sum), and a combine function  $(c_{MX}$ : max,  $c_{ME}$ : mean).
We evaluate using gold trees by reporting  $F_{1}$  scores on the ground-truth constituents and recall on several constituent categories. We report mean and standard deviation across the five models.
Quantitative Evaluation Table 1 shows our main results. As the table illustrates, The model variations achieve  $F_{1}$  scores competitive to the scores reported by Shi et al. (2019) across training setups. They achieve comparable recall on different constituent categories, and robustness to parameter initialization, quantified by self-  $F_{1}$ , which we report in an expanded version of this table in Appendix A. The model variations closest to the original model, 1, sWS, cME and 2, sWS, cME, yield similar performance to the original model across different evaluation categories and metrics, especially in the +HI and +HI+FastText settings. Most remarkably, our simplest variants, which use 1d embeddings and a non-parameterized scoring function, are still competitive (1, sM, cME) or even outperform (1, sMHI, cMX) the original VG-NSL.
Our simplified model variations largely learn the
<sup>1</sup>The authors of Shi et al. (2019) suggested this ablation as particularly impactful on the learning outcome.
Training Setting	1, sWS, cME	2, sWS, cME	U
Basic Setting	72.0	77.5	87.5
+HI	78.2	80.3	91.8
+HI+FastText	80.5	83.1	92.3
+HI+FastText-IN	85.6	86.4	92.8
Figure 1: Token embedding visualization for  $2, \mathrm{s}_{\mathrm{WS}}, \mathrm{c}_{\mathrm{ME}}$  (top) and  $1, \mathrm{s}_{\mathrm{WS}}, \mathrm{c}_{\mathrm{ME}}$  (bottom) colored by universal POS tags (Petrov et al., 2012). Appendix A includes an expanded version of this figure.
same parsing model as the original. Table 2 shows self- $F_{1}$  agreement by comparing constituents predicted by our models in each training setting with the original model. We compute this agreement measure by training two sets of five models on the training data, and selecting checkpoints using the validation captions for each of our model variants and the original VG-NSL model. We parse the same validation captions using each model and generate ten parse trees for each caption, one for each model (i.e., five for each distinct set). We calculate self- $F_{1}$  agreement between models by comparing parse trees from model variants to parse trees from the original VG-NSL. We permute all 25 (five by five) combinations of variant/VG-NSL pairs and obtain self- $F_{1}$  agreement between the model variant and the original VG-NSL by averaging scores from each pair. For the upper-bound agreement calculation, we train two distinct sets of five original VG-NSL models. Our parsing model is very similar but not exactly identical: there is roughly a six points F1 agreement gap in the best case compared to the upper bound. We consider these numbers a worst-case scenario because self- $F_{1}$  agreement measures on the validation data are used twice. First, for model selection to eliminate the variance of each five-model set, and second for the variant agreement analysis.
Expressivity Analysis We analyze the embeddings of the two variants closest to the original
Table 2: Self-  $F_{1}$  agreement between two of our variations and the original VG-NSL model. We also report the upper bound scores  $(U)$  calculated by directly comparing two separately trained sets of five original VG-NSL models.
Model	1, sWS, cME
Turney et al. (2011)	0.73
Brysaert et al. (2014)	0.75
Hessel et al. (2018)	0.89
Shi2019*	0.94
Table 3: Pearson correlation coefficient of concreteness estimates between our  $1, \mathrm{SWS}, \mathrm{c}_{\mathrm{ME}}$  variant and existing concreteness estimates, including reproduced estimates derived from VG-NSL by Shi et al. (2019).
Figure 2: Noun distribution using the  $1d$  representation from the  $1, \mathrm{s}_{\mathrm{WS}}, \mathrm{c}_{\mathrm{ME}}$  variant. The nouns are sorted by their representation value in increasing order from left.
model,  $1, \mathrm{s}_{\mathrm{WS}}, \mathrm{c}_{\mathrm{ME}}$  and  $2, \mathrm{s}_{\mathrm{WS}}, \mathrm{c}_{\mathrm{ME}}$ , to identify the information they capture. Both behave similarly to the original VG-NSL. Figure 1 visualizes the token embedding space for these variants. Interestingly, the distribution of the  $2d$  token embeddings seems almost linear, suggesting that the additional dimension is largely not utilized during learning, and that both have a strong preference for separating nouns from tokens belonging to other parts of speech. It seems only one core visual signal is used in the model and if this factor is captured, even a  $1d$  model can propagate it through the tree.
We hypothesize that the core visual aspect learned, which is captured even in the  $1d$  setting, is noun concreteness. Table 3 shows that the reduced token embeddings have strong correlations with existing estimates of concreteness. Figure 2 shows the ordering of example nouns according to our  $1d$  learned model representation. We observe that the concreteness estimated by our model correlates with nouns that are relatively easier to ground visually in MSCOCO images. For example, nouns like "giraffe" and "elephant" are considered most concrete. These nouns are relatively frequent in MSCOCO (e.g., "elephant" appears 4,633 times in the training captions) and also have a low variance in their appearances. On the other hand, nouns with high variance in images (e.g., "traveller") or abstract nouns (e.g., "chart", "spot") are estimated to have low concreteness. Appendix A includes examples of concreteness.
We quantify the role of concreteness-based noun identification in VG-NSL by modifying test-time captions to replace all nouns with the most concrete token (i.e., "elephant"), measured according
Training Setting	Token	1, sWS, cME	Shi2019*
Basic Setting	herd	49.5 ⇒ 36.3	51.0 ⇒ 47.6
Basic Setting*	cat	52.4 ⇒ 56.9	51.0 ⇒ 57.2
+HI	elephant	51.7 ⇒ 63.7	51.6 ⇒ 59.8
+HI+FastText	motorcycle	52.9 ⇒ 59.9	52.9 ⇒ 60.7
+HI+FastText-IN	elephant	55.0 ⇒ 62.9	54.6 ⇒ 60.2
Table 4:  $F_{1}$  scores evaluated before and after replacing nouns in captions with the most concrete token predicted by models using the  $1, \mathrm{s}_{\mathrm{WS}}, \mathrm{c}_{\mathrm{ME}}$  configuration. The replacement occurs during test time only as described in Section 5. In Basic Setting*, we remove one model from  $1, \mathrm{s}_{\mathrm{WS}}, \mathrm{c}_{\mathrm{ME}}$  which has a significantly low  $F_{1}$  agreement (54.2) to the rest of four models using the  $1, \mathrm{s}_{\mathrm{WS}}, \mathrm{c}_{\mathrm{ME}}$  configuration.
to the  $1d$  token embeddings learned by our model. We pick the most concrete noun for each training configuration using mean ranking across token embeddings of the five models in each configuration. For example, instead of parsing the original caption "girl holding a picture," we parse "elephant holding an elephant." This uses part-of-speech information to resolve the issue where nouns with low concreteness are treated in the same manner as other part-of-speech tokens. We compare the output tree to the original gold ones for evaluation. We observe that the  $F_{1}$  score, averaged across the five models, significantly improves from 55.0 to 62.9 for 1, sWS, cME and from 54.6 to 60.2 for the original VG-NSL before and after our caption modification. The performance increase shows that noun identification via concreteness provides an effective parsing strategy, and further corroborates our hypothesis about what phenomena underlie the strong Shi et al. (2019) result. Table 4 includes the results for the other training settings.
6 Conclusion and Related Work
We studied the VG-NSL model by introducing several significantly less expressive variants, analyzing their outputs, and showing they maintain, and even improve performance. Our analysis shows that the visual signal leads VG-NSL to rely mostly on estimates of noun concreteness, in contrast to more complex syntactic reasoning. While our model variants are very similar to the original VG-NSL, they are not completely identical, as reflected by the self- $F_{1}$  scores in Table 2. Studying this type of difference between expressive models and their less expressive, restricted variants remains an important direction for future work. For example, this can be achieved by distilling the original model to the less expressive variants, and observing both the agree
ment between the models and their performance. In our case, this requires further development of distillation methods for the type of reinforcement learning setup VG-NSL uses, an effort that is beyond the scope of this paper.
Our work is related to the recent inference procedure analysis of Dyer et al. (2019). While they study what biases a specific inference algorithm introduces to the unsupervised parsing problem, we focus on the representation induced in a grounded version of the task. Our empirical analysis is related to Htut et al. (2018), who methodologically, and successfully replicate the results of Shen et al. (2018a) to study their performance. The issues we study generalize beyond the parsing task. The question of what is captured by vision and language models has been studied before, including for visual question answering (Agrawal et al., 2016, 2017; Goyal et al., 2017), referring expression resolution (Cirik et al., 2018), and visual navigation (Jain et al., 2019). We ask this question in the setting of syntactic parsing, which allows to ground the analysis in the underlying formalism. Our conclusions are similar: multi-modal models often rely on simple signals, and do not exhibit the complex reasoning we would like them to acquire.
Special thanks to Freda Shi for code release and prompt help in re-producing the experiments of Shi et al. (2019). This work was supported by the NSF (CRII-1656998, IIS-1901030), a Google Focused Award, and the generosity of Eric and Wendy Schmidt by recommendation of the Schmidt Futures program. We thank Jack Hessel, Forrest Davis, and the anonymous reviewers for their helpful feedback.
Aishwarya Agrawal, Dhruv Batra, and Devi Parikh. 2016. Analyzing the behavior of visual question answering models. In Proceedings of the Conference on Empirical Methods in Natural Language Processing, pages 1955-1960.
Aishwarya Agrawal, Aniruddha Kembhavi, Dhruv Batra, and Devi Parikh. 2017. C-VQA: A compositional split of the visual question answering (VQA) v1.0 dataset. CoRR, abs/1704.08243.
Peter Anderson, Xiaodong He, Chris Buehler, Damien Teney, Mark Johnson, Stephen Gould, and Lei Zhang. 2018a. Bottom-up and top-down attention