Exploring syntactic information in sentence embeddings through multilingual subject-verb agreement
Authors: Vivi Nastase, Chunyang Jiang, Giuseppe Samo, Paola Merlo (Idiap Research Institute, University of Geneva, 2024)
Topic: Language Models

Abstract
In this paper, our goal is to investigate to what degree multilingual pretrained language models capture cross-linguistically valid abstract linguistic representations. We take the approach of developing curated synthetic data on a large scale, with specific properties, and using them to study sentence representations built using pretrained language models. We use a new multiple-choice task and datasets, Blackbird Language Matrices (BLMs), to focus on a specific grammatical structural phenomenon -- subject-verb agreement across a variety of sentence structures -- in several languages. Finding a solution to this task requires a system detecting complex linguistic patterns and paradigms in text representations. Using a two-level architecture that solves the problem in two steps -- detect syntactic objects and their properties in individual sentences, and find patterns across an input sequence of sentences -- we show that despite having been trained on multilingual texts in a consistent manner, multilingual pretrained language models have language-specific differences, and syntactic structure is not shared, even across closely related languages.

Introduction
Large language models, trained on huge amount of texts, have reached a level of performance that rivals human capabilities on a range of established benchmarks AUTHOR. Despite high performance on high-level language processing tasks, it is not yet clear what kind of information these language models encode, and how. For example, transformer-based pretrained models have shown excellent performance in tasks that seem to require that the model encodes syntactic information AUTHOR. All the knowledge that the LLMs encode comes from unstructured texts and the shallow regularities they are very good at detecting, and which they are able to leverage into information that correlates to higher structures in language. Most notably, AUTHOR have shown that from the unstructured textual input, BERT AUTHOR is able to infer POS, structural, entity-related, syntactic and semantic information at successively higher layers of the architecture, mirroring the classical NLP pipeline AUTHOR. We ask: How is this information encoded in the output layer of the model, i.e. the embeddings? Does it rely on surface information -- such as inflections, function words -- and is assembled on the demands of the task/probes AUTHOR, or does it indeed reflect something deeper that the language model has assembled through the progressive transformation of the input through its many layers? To investigate this question, we use a seemingly simple task -- subject-verb agreement. Subject-verb agreement is often used to test the syntactic abilities of deep neural networks AUTHOR, because, while apparently simple and linear, it is in fact structurally, and theoretically, complex, and requires connecting the subject and the verb across arbitrarily long or complex structural distance. It has an added useful dimension -- it relies on syntactic structure and grammatical number information that many languages share. In previous work we have shown that simple structural information -- the chunk structure of a sentence -- which can be leveraged to determine subject-verb agreement, or to contribute towards more semantic tasks, can be detected in the sentence embeddings obtained from a pre-trained model AUTHOR. This result, though, does not cast light on whether the discovered structure is deeper and more abstract, or it is rather just a reflection of surface indicators, such as function words or morphological markers. To tease apart these two options, we set up an experiment covering four languages: English, French, Italian and Romanian. These languages, while different, have shared properties that make sharing of syntactic structure a reasonable expectation, if the pretrained multilingual model does indeed discover and encode syntactic structure. We use parallel datasets in the four languages, built by (approximately) translating the BLM-AgrF dataset AUTHOR, a multiple-choice linguistic test inspired from the Raven Progressive Matrices visual intelligence test, previously used to explore subject-verb agreement in French. Our work offers two contributions: (i) four parallel datasets -- on English, French, Italian and Romanian, focused on subject-verb agreement; (ii) cross-lingual and multilingual testing of a multilingual pretrained model, to explore the degree to which syntactic structure information is shared across different languages. Our cross-lingual and multilingual experiments show poor transfer across languages, even those most related, like Italian and French. This result indicates that pretrained models encode syntactic information based on shallow and language-specific clues, from which they are not yet able to take the step towards abstracting grammatical structure. The datasets are available at and the code at .

Conclusion
We have aimed to add some evidence to the question How do state-of-the-art systems \llknow\gg what they \llknow\gg? AUTHOR by projecting the subject-verb agreement problem in a multilingual space. We chose languages that share syntactic structures, and have particular differences that can provide clues about whether the models learned rely on shallower indicators, or the pretrained models encode deeper knowledge. Our experiments show that pretrained language models do not encode abstract syntactic structures, but rather this information is assembled "upon request" -- by the probe or task -- based on language-specific indicators. %PGM This is too strong, it might be that the chunk information is in middle levels and it gets merged with other types of info before getting to the output. In fact, I bet that is what is going on. Understanding how information is encoded in large language models can help determine the next necessary step towards making language models truly deep. \paragraph{Acknowledgments We gratefully acknowledge the partial support of this work by the Swiss National Science Foundation, through grant SNF Advanced grant TMAG-1\_209426 to PM. \onecolumn \appendix