Blackbird language matrices (BLM), a new task for rule-like
  generalization in neural networks: Motivations and Formal Specifications
We motivate and formally define a new task for fine-tuning rule-like
generalization in large language models. It is conjectured that the
shortcomings of current LLMs are due to a lack of ability to generalize. It has
been argued that, instead, humans are better at generalization because they
have a tendency at extracting rules from complex data. We try to recreate this
tendency to rule-based generalization. When exposed to tests of analytic
intelligence, for example, the visual RAVEN IQ test, human problem-solvers
identify the relevant objects in the picture and their relevant attributes and
reason based on rules applied to these objects and attributes. Based on the
induced rules, they are able to provide a solution to the test. We propose a
task that translates this IQ task into language. In this paper, we provide the
formal specification for the task and the generative process of its datasets.
Paola Merlo
# Blackbird language matrices (BLM), a new task for rule-like generalization

###### Abstract

We motivate and formally define a new task for fine-tuning rule-like generalization in large language models.

It is conjectured that shortcomings of current LLMs are due to a lack of ability to generalize. It has been argued that, instead, humans are better at generalization because they have a tendency at extracting rules from complex data. We try to recreate this tendency to rule-based generalization.

When exposed to tests of analytic intelligence, for example the visual RAVEN IQ test, human problem-solvers identify the relevant objects in the picture and their relevant attributes and reason based on rules applied to these objects and attributes. Based on the induced rules, they are able to provide a solution to the test.

We propose a task that translates this IQ task into language. In this paper, we provide the formal specification for the task, and the generative process of its datasets.

## 1 Introduction

Current consensus about LLM is that to reach better, possibly human-like, abilities in abstraction and generalisation, we need to develop tasks and data that help us understand their current generalisation abilities and help us train LLMs to more complex and compositional skills.

Generalisation in NLP has been defined in a very narrow way, as extension from a set of data points to new data points of exactly the same nature (i.i.d. assumption). Even under this very narrow definition, recent studies show that current algorithms do not generalise well (Belinkov and Bisk, 2018; Belinkov and Glass, 2019; Kiela et al., 2021).

In contrast, humans are good generalizers. A large body of literature of experimental work has demonstrated that the human mind is predisposed to extract regularities and generate rules from data, in a way that is distinct from the patterns of activation of neural networks (Lakretz et al., 2019, 2021; Sable-Meyer et al., 2021).

One possible approach to develop more robust methods, then, is to pay more attention to the decomposition of complex observations and to the causal chains in the generative process that gives rise to the data. Scholkopf et al. (2012) give the example of a dataset that consists of altitude A and average annual temperature T of weather stations (Peters et al., 2017) and argue that a robust model represents not their correlation, but the underlying problem structure and the causal effect of A on T.

To discover the underlying problem structure, machine learning research in vision has developed the notion of _disentanglement_. A disentangled representation can be defined as one where single latent units are sensitive to changes in single generative factors, while being relatively invariant to changes in other factors (Bengio et al., 2013).

Let's look at an illustrative example of complex linguistic relations that might require discovering the underlying causal relations: the causative alternation in English, shown in (1).

\begin{tabular}{l c c} (1) & The teacher & opened & the door. \\ Agent & & & \\ The door & & & \\ Theme & & & \\ \end{tabular}

This alternation applies to change of state verbs, such as _open, break, melt, burn_ among many others, verbs that describe a change that affects the state of the undergoing participant (it is, after the action, _the door_ that changes from a state of being closed to a state of being open). They occur in two subcategorisation frames that are related to each other in a regular way: the object of the transitive frame is the subject of the intransitive frame. This way, in terms of semantic roles, the subject of the transitive is an agent, but the subject of the intransitive is a theme.

To learn the structure of such a complex alterna
tion automatically, a neural network must be able (i) to identify the elements manipulated by the alternation, (ii) to identify the relevant attributes of these elements and (iii) recognize and formulate the rules of change of these attributes and elements across the two sentences. Thus finding the solution requires abilities in handling phenomena that span more than one sentence, whose correspondences must be recognised, in structure and meaning.

To study what factors and models lead to learning more disentangled linguistic representations, representations that reflect the underlying linguistic rules of grammar, we take the approach of developing curated data on a large scale, building models to learn these data and investigating the models' behaviour.

To this end we develop a new linguistic task, (similar to Raven's progressive matrices for vision), which we call Blackbird Language Matrices (BLMs) that define prediction tasks to learn these complex linguistic patterns and paradigms. The contribution of this work lies in the definition of a new challenging learning task, which requires tackling a mixture of language processing abilities and abstract rule learning. This task takes us closer to investigations of human linguistic intelligence.

In this work, we provide the formal specification for the matrices. One such BLM problem has already been used in Merlo et al. (2022) and Nastase and Merlo (2023) and its data is described in detail in An et al. (2023).

### Raven's Progressive Matrices for vision

Raven's progressive matrices (progressive because tasks get harder) are IQ tests consisting of a sequence of images, called the _context_, connected in a logical sequence by underlying generative rules (Raven, 1938). The task is to determine the missing element in this visual sequence, the _answer_. The answer is chosen among a set of closely or loosely similar alternatives. An instance of this task is given in Figure 1: given a matrix on the left, choose the last element of the matrix from a choice of elements. The matrices are built according to generative rules that span the whole sequence of stimuli and the answers are constructed to be similar enough that the solution can be found only if the rules are identified correctly. For example in Figure 1, the matrix is constructed according to two rules: Rule 1: from left to right, the red dot moves one place clockwise each time. This pattern continues onto the next row; Rule 2: from top to bottom, the blue square moves one place anticlockwise each time. This pattern continues onto the next column. Identifying these rules leads to the correct answer, the only cell that continues the generative rules correctly.

To establish how to develop human-like rule-based inference, it pays to survey how humans solve this kind of intelligence test and develop a corresponding formalisation.

## 2 Formal Specifications of BLMs

The formal specifications we develop in the following sections use a vocabulary that is inspired by the cognitive primitives identified in the study by Carpenter et al. (1990). We are also inspired by computational methods in vision, that reproduce RAVEN's matrices, although the vision problems have slightly different properties and can arguably be described fully by context-free processes (Wang and Su, 2015; Barrett et al., 2018; Zhang et al., 2019; Zhu and Mumford, 2006).

We define here a new task and data format, we call it Blackbird's Language Matrices (BLMs).

Definition Let a 4-tuple \((LP,C,W,w_{c})\) be given, where \(LP\) is the definition of the linguistic grammatical phenomenon, \(C\) is the corresponding context matrices, \(W\) is the answer set, and \(w_{c}\) is the selected item of \(W\) that is correct.

The BLM _task_ can be defined as the instruction:

\[\text{find }(w_{c}\in W)\text{ given }C.\]

A BLM _problem_\((LP,C,W,Aug)\) is an instance of a BLM task, where \(Aug\) is the augmentation

Figure 1: Example of progressive matrice in the visual world. The task is to determine the missing element in a visual pattern. Given the matrix on the left, choose the last element of the matrix from the choice of elements on the right. The matrix is constructed according to two rules (see text for explanation). Identifying these rules leads to the correct answer (marked by double edges).
method for the matrices. We describe all components in the next sections.

### Defining the linguistic phenomenon

The first step in the definition of the problem consists in formally defining the linguistic grammatical phenomenon as a paradigm.

Definition Let a linguistic phenomenon LP be given. LP is exhaustively defined by a grammar \(G_{LP}=(O,A,E,I,L)\) s.t.

\(O\) is the set of objects

\(A\) is the set of attributes of the objects in \(O\)

\(E\) is the set of external observed rules

\(I\) is the set of unobserved internal rules

\(L\) is the lexicon of objects in \(O\), attributes in \(A\), and operators in \(E\cup I\).

For example, as shown in the example Figure 3, in the subject-verb agreement phenomenon, the agreement rule is the primary production in \(E\), while the fact that agreement can occur independently of the distance of the elements expresses the fact that agreement applies to structural representations, a rule in \(I\). Sometimes, but not always, I acts as a confusing factor.

Rules are triples of objects (shown in red), attributes (in green) and operations (in blue). Objects are usually phrases, attributes are usually morpho-syntactic properties of the phrases and operations are typical grammatical operations: feature match, movement (becomes), lexical substitution (changes).

### Defining the matrices

Definition A \(BLM\)_matrix_ is a tuple=\((S,R,T)\) s.t.

\(S\) is the shape of the matrix

\(R\) are the relational operators that connect the items of the matrix

\(T\) is the set of items of the matrix.

Shape

\(S(n,l)\) is the shape of the matrix, which consists of \(n\) items and each item can be at most of length \(l\).

The length of the items can vary. The items can be sentences or elements in a morphological paradigm. The choice of \(n\) depends on how many items need to be shown to illustrate the paradigm and on whether the illustration is exhaustive or sampled. For example, a matrix of size eight is exhaustive for an agreement problem with three noun phrases and a two-way number differentiation (singular, plural), but can only present a sample of the information for the causative alternation.

Relational operations

Connective sequential operations, such as alternation or progression are chosen. The point of these relational operations is to trasform a list of items (sentences or words) into a predictable sequence that connects all the items.

The values of \(R\), so far, are alternations or progression. They could also be conjunction, disjunction, exclusive OR and other logical or graded operators.

Alternation applies to a given \((o,a)\) pair and loops over all the values of \(a\) with a given increment defined over the items of the matrix. For example, the grammatical feature number is binary in certain languages. So, alternation\((o=NP;a_{i}=(s,p);i=1,2,3,...)\). This is used to create different alternations of \((o,a)\) in the sentence, which in the subject-verb agreement BLM is used to show independence from linear distance.

Progression applies to countable attributes or ordinal attributes, for example, existence. So, one can have 1,2,...,\(n\) of a given object \(n\). Progression can also apply to \(position\) or to graded properties such as \(length\).

Items

The items \(T\) are defined by \(G_{LP}=(O,A,E,I,L)\) and they are drawn from the set \(\mathcal{T}\).

The matrix is created by sampling \((o,a,r)\). The ways in which \(r\in R\) can apply to a given \((o,a)\) pair has to be predefined, as it is not entirely context-free.

### Defining the answer set

The answer set \(W\) consists of a set of items like those in \(C\). One item in W, \(w_{c}\), is the correct answer to complete the sequence defined by \(C\). The other items are the contrastive set. They are items that
**BLM task:**: Find \((w_{c}\in W)\) given \(C\),

given a 4-tuple \((LP,C,W,w_{c})\), where \(LP\) is the definition of the linguistic grammatical phenomenon, \(C\) is the corresponding context matrices, \(W\) is the answer set, and \(w_{c}\) is the selected item of \(W\) that is correct.
**BLM problem:**: A \(BLM\)_problem_ is a tuple\((LP,C,W,Aug)\). It is an instance of a BLM task, where \(Aug\) is the augmentation method for the matrices.
**BLM matrix:**: A \(BLM\)_matrix_ is a tuple \((S,R,T)\) s.t. \(S\) is the shape of the matrix, \(R\) are the relational operators that connect the items of the matrix, \(T\) is the set of items of the matrix.
**Linguistic phenomenon LP:**: A _linguistic phenomenon LP_ is exhaustively defined by a grammar \(G_{LP}=(O,A,E,I,L)\) s.t. \(O\) is the set of objects, \(A\) is the set of attributes of the objects in \(O\), \(E\) is the set of external observed rules, \(I\) is the set of unobserved internal rules, \(L\) is the lexicon of objects in \(O\), attributes in \(A\), and operators in \(E\cup I\).
**Shape:**: \(S(n,l)\) is the shape of the matrix, which consists of \(n\) items and each item can be at most of length \(l\).
**Relational operations:**: Alternation \((o=NP;a_{i}=(s,p);i=1,2,3,...)\). Progression applies to countable attributes or ordinal attributes.
**Context set:**: The _context set_\(C\) is a set of items generated by \(LP\).
**Answer set:**: The _answer set_\(W\) is a set of items generated by \(LP\). One item in W, \(w_{c}\), is the correct answer. The other items are the contrastive set. They are items that violate \(G_{LP}\) either in \(E,I\) or in \(R\).
**Augmented BLM:**: An _augmented BLM_ is a quadruple \((S,R,T,Aug)\). \(S\) is the shape of the matrix, \(R\) are the relational operations that connect the \(T\) items of the matrix. The items \(T\) are defined by \(G_{LP}=(O,A,E,I,L)\) and they are drawn from the set \(\mathcal{T}\).

\(Aug\) is a set of operations defined to augment the cardinality of \(\mathcal{T}\), while keeping S and R constant. \(Aug\) is defined by controlled manipulations of Os and As in T to collect similar elements, s.t.

\(|P(o_{aug})-P(o)|\leq rank(10)\) and \(|P(t^{i}_{aug})-P(t^{i})|\leq\epsilon\)

Figure 2: Summary of definitions concerning the Blackbird Language Matrices task.
violate \(G_{LP}\) either in \(E,I\) or in \(R\). In other words, the contrastive set comprises elements that violate one or more of the rules of construction of the context matrix C, either in the primary rules \(E\), in the auxiliary rules \(I\), or in the matrix operators \(R\).

Sometimes they are built almost automatically, sometimes by hand. The cardinality of the answer set is determined by how many facets of the linguistic phenomenon need to be shown to have been learned.

### Augmenting the matrices

Different levels of lexical and structural complexity can be obtained by changing the lexical items (step by step), in a given matrix.

Definition An _augmented BLM_ is a quadruple \((S,R,T,Aug)\).

\(S\) is the shape of the matrix, \(R\) are the relational operations that connect the \(T\) items of the matrix.

\(Aug\) is a set of operations defined to augment the cardinality of \(\mathcal{T}\), while keeping S and R constant. \(Aug\) is defined by controlled manipulations of Os and As in \(\mathcal{T}\) to collect similar elements, s.t.

\[|score(o_{aug})-score(o)| \leq rank(10)\text{ and }\] \[|score(t_{aug}^{i})-score(t^{i})| \leq\epsilon\]

In words and in practice, we augment the sentence set \(\mathcal{T}\) by modifying the noun phrases of the items in \(T\). We generate alternatives with a language model choosing among the top \(n\), and verifying that the acceptability score of the resulting sentences is still acceptable, within a margin from the original sentence. The margin is set with a variable-size window and collects the top 10 alternative noun phrases. The acceptability of the resulting sentences is validated manually.

## 3 BLM Formal Template and Example

The abstract template of context and answer set, with its objects and attributes, that corresponds to the problem of subject-verb agreement is shown in Figure 5. This abstract template also corresponds to the example of matrices shown in Figure 6.

Figure 4: Example answer set.

Figure 5: Examples of template and progressive matrices for the number agreement problems Merlo et al. (2022); An et al. (2023); Nastase and Merlo (2023).

Figure 3: Example of corresponding to formal definitions of E and I for two LPs.
The sequence is generated by a rule of progression of number of attractors (one and two), a rule of subject-verb agreement that alternates every sentence between singular and plural of the head noun and a rule of number of the attractors that alternates between singular and plural with a frequency period of two. Thus, the correct answer for this example is a sentence that has three noun phrases and a plural subject and plural first attractor and singular second attractor.

## 4 Conclusions

In this paper, we have defined precisely the main concepts underlying a new multiple-choice task, Blackbird Language Matrices (BLMs), inspired by IQ test for humans. The task is based on solving a missing-element puzzle that requires identifying the correct completion of a context sequence among several minimally contrastive alternatives. These matrices have already shown to define a challenging task Merlo et al. (2022), and a first full-fledged dataset is available and described in An et al. (2023). This task has also been shown to be useful for detailed investigation of distributed representations Nastase and Merlo (2023).

Because the context sequence is developed in such a way that it is the implicit definition of a linguistic phenomenon, the matrix can become a way of teaching complex structured problems to current neural networks. It is also a powerful tool to evaluate the already existing abilities of current large language models in a challenging task of analytic intelligence. Work is underway on all these aspects.

## Ethics Statement

To the best of our knowledge, there are no ethics concerns with this paper.

## Acknowledgments

We gratefully acknowledge the partial support of this work by the Swiss National Science Foundation, through grants #51NF40_180888 (NCCR Evolving Language) and SNF Advanced grant TMAG-1_209426 to PM. Thanks to all collaborators and audiences that have shown interest in this concept.

Figure 6: Example of lexically varied contexts for the main clause contexts. Correct answer in bold, Merlo et al. (2022); An et al. (2023); Nastase and Merlo (2023).