Blackbird Language Matrices Tasks for Generalization (2023)

Abstract: To develop a system with near-human language capabilities, we need to understand current systems’ generalisation and compositional abilities. We approach this by generating compositional, structured data, inspired from visual intelligence tests, that depend on the problem-solvers being able to disentangle objects and their absolute and relative properties in a sequence of images. We design an analogous task and develop the corresponding datasets that capture specific linguistic phenomena and their properties. Solving each problem instance depends on detecting the relevant linguistic objects and generative rules of the problem. We propose two datasets modelling two linguistic phenomena – subject-verb agreement in French, and verb alternations in English. The datasets can be used to investigate how LLMs encode linguistic objects, such as phrases, their grammatical and semantic properties, such as number or semantic role, and how such information is combined to correctly solve each problem. Specifically generated error types help investigate the behaviour of the system, which important information it is able to detect, and which structures mislead it.

## motivation the current reported success of large language models (llms) is based on computationally expensive algorithms and large amounts of data that are available for only a few, non-representative languages. such data may also contain biases and imbalances, and its sheer size prevents curation. to be able to build robust models that can learn better from manageable sized data, we need to understand the current systems' generalisation and compositional abilities. we argue that a system with high language competence and performance, that is able to learn from small amounts of data, and is cross-linguistically valid, should capture the three fundamental properties of human language: (i) human language is described by several abstract levels of representations (e.g. morphological, phonological, syntactic, semantic), mapped onto each other by complex many-to-many rules; (ii) it is compositional; (iii) it is structured. for genbench, we propose several datasets under the same umbrella, as they have the same format, but encode different linguistic phenomena, each in a different language -subject verb agreement in french, verb alternations in english. they can be used separately, or in combination, to explore the properties and the generalisation abilities of a llm in various ways. additional datasets are in development, thus expanding the scope of the exploration. with respect to the workshop aims, our motivations are as follows. cognitive : explore how specific linguistic information is encoded in pretrained sentence representation, and determine whether, or to what degree, we can identify symbolic structures and compositional elements within these representations. intrinsic : explore whether pretrained llms have learned language representations whose properties can be mapped onto those proposed in linguistics, and whether the tasks we propose are solved through identifiable rules. while the proposed datasets are presented as a diagnostic tool -to detect patterns that encode linguistic rules and phenomena -we envision that they could also be used to bring such patterns to the fore, through fine-tuning pretrained sentence embeddings, thus pushing continuous distributed representations towards more symbolic, and interpretable, ones. ## blackbird language matrices the design of our datasets were inspired by raven progressive matrices (rpms) @xcite , an example of which is presented in figure 1 . rpms are used in visual iq tests, as they rely on problem-solvers identifying elements and their attributes such as position, shape, colour and size, and their absolute and relative properties (for instance, how their positions change relative to each other throughout the matrix of images). analogously, in language, elements correspond to phrase types, attributes correspond to grammatical gender or number, or specific semantic properties, and their connective properties are the relative positions within a syntactic structure or the mapping across levels of representations. ## benchmarking we used two baselines to benchmark the proposed datasets. they are designed to test whether we can access the relevant information for the targeted phenomena in a given blm task, in transformerbased sentence representations. figure 6 shows the general process flow. the two baselines are a feed-forward neural network (ffnn) and a convolutional neural network (cnn). the ffnn baseline is a three-layer feed-forward neural network. it transforms the context c of a blm instance into a 1d-tensor which is a concatenation of the representation of each sentence. this is passed through three fully-connected layers. the output is a vector that we take to represent the embedding of the answer sentence. this architecture allows the system to find patterns within and across sentences through the nodes in the successive layers. the cnn baseline consists of three convolutional steps, followed by a linear layer to compress the output to the desired dimensions. the input consists of a stack of context sentence representations. this setup finds localized patterns within sentence representation and across the sequence of sentences. the output of the two networks is the same -a vector representing the sentence embedding of the correct answer. the learning objective is to maximize the probability of the correct answer from the candidate answer set. because the incorrect answers in the answer set are specifically designed to be minimally different from the correct answer, we implement the objective through the max-margin loss function. this function combines the distances between the predicted answer and the correct and erroneous ones. we first compute a score for the embedding e j of each candidate answer a j in the answer set a with respect to the predicted sentence embedding e pred as the cosine of the angle between the respective vectors: at prediction time, we take the answer with the highest score value from a candidate set as the correct answer. ## results and error analysis the train/test data splits are presented in ## related work the genbench taxonomy differs sometimes from the meaning of some existing terms elsewhere referring to generalisation. in situating our work in comparison to other related work, we reason based on the actual nature of the generalisation being sought rather than the terminology. our closest related dataset in spirit, in terms of motivation and goals, is the cogs dataset @xcite . it is also different from our dataset in implementation. the cogs dataset aims at providing out-of-distribution test cases to test compositionality of structure and meaning. to this goal, a training set is generated with a cfg and parallel lambda-expressions and a test set with a different cfg, specifically designed to exhibit testing constructions that are previously unseen as such and whose solution requires compositional generalisation of components seen at training. these unseen constructions comprise both structural and lexical generalisation: the former aiming to test the ability to create new structures from existing parts, the latter to test ability to adapt existing structures to novel content. while our dataset strives for similar goals, the way to go about it is different in one relevant respect. the cogs dataset determines by design the combinatorics that the network needs to find, imposing therefore preexisting hard independence assumptions generated by a cfg in the test set. these pre-existing discrete rules of combination must be discovered to find a correct parsing solution. our approach is more in the spirit of hidden rep-resentation learning. we do not require that the network has explicitly learnt new generative ways of combining elements. but we encourage representations that learn soft constraints, in the form of disentangled representations that correspond to the generative underlying factors. beside testing soft constraints on structural generalisation, we also provide tests of lexical generalisation (through the different types of lexical variability in the matrix). in this respect, the datasets provided here are related to those used in the literature on disentanglement in computer vision. for example, van steenkiste et al. (2020) developed a dataset for computer vision similar to rpms. they evaluate the usefulness of the representations learned for abstract reasoning. they note that learning disentangled representations leads to faster few-shot learning. also, recently zheng and lapata (2022) propose a different method for disentangling relations expressed in a sentence which may share arguments. this is implemented as an extension to sequence-to-sequence (seq2seq) models, where at each decoding step the source input is re-encoded by conditioning the source representations on the newly decoded target context. these specialized representations make it easier for the encoder to exploit relevant-only information for each prediction. with the appropriate dataset, such approaches can be used to probe the abilities of pretrained llms. the datasets we propose in this paper have the necessary properties: they focus on specific linguistic phenomena, they display lexical and structural variation, and include known confounding factors for the targered phenomena. they are, then, close to the work that investigates network representations. for example, @xcite focus on how bert encodes grammatical number in english and how this information is used for performing number agreement. the focus is on word embeddings and quantifying how much number information they encode at various layers of the bert architecture. using a combination of probing approaches, they discover that subjects and predicates embeddings do encode number information, but at different layers. further investigations into where and how the number information is shared reveals that number information is not directly shared, but rather passed through intermediate tokens. the study of the argument-structure properties of verbs and semantic role assignments is also a test-bed for the core syntactic and semantic abilities of neu-ral networks @xcite . in particular, @xcite demonstrates that transformers can encode information on the two alternants of the spray-load alternation. ## conclusions in this paper, we describe an approach to generate compositional, structured data, inspired from visual intelligence tests. we presented two datasets, each focused on a different linguistic phenomenon, and in a different language. solving each problem instance depends on the system detecting the relevant linguistic objects, and their absolute and relative properties. these datasets can be used to investigate whether this type of information can be detected in, and whether it is used by, pretrained llms. because the datasets are formatted in the same way, they can be used separately, or in various combinations, to test cross-task and cross-language model properties. additional such datasets are under development, thus potentially expanding the scope of the exploration. further experiments are also ongoing. one of our goals is to understand how information is encoded in pretrained transformer-based sentence embeddings. we investigate whether there are patterns within sentence representations that reveal specific linguistic phenomena. towards this end, we have developed architectures designed to discover such patterns that can be applied successfully, without adaptation (in terms of architecture or hyperparameters) to different problems in different languages. this provides insight into how transformers encode sentence-level information.