Type Diversity Enables Transformers to Generalise Compositionally

Anssi Moisio, Mathias Creutz, Mikko Kurimo
9/11/2026
cs.CL
transformer-attention

No confident code implementation found for this paper.

Abstract

Compositional generalisation has been divided into lexical and structural generalisation. Previous work has found that structural generalisation is harder than lexical for Transformers.

Show full abstract

We propose that this difference is not inherent to Transformers, but due to the high diversity of lexical types and low diversity of structural types in the specific datasets of these previous works. By type diversity we mean the number of different constructors of that type, instead of, for example, the specific word combinations that might populate the structure. To test this, we vary the amounts of type diversity of lexical and structural types in previously published datasets. We create linguistically diverse variants of the COGS and SLOG datasets using Grammatical Framework. We find that type diversity correlates with compositional generalisation equally in lexical and structural test cases, supporting our hypothesis. We note a contradiction with the proposition in previous work that compound divergence explains the difficulty in compositional generalisation tasks. We further investigate the effects of other dataset properties on compositional generalisation, such as the diversity of types other than the novel test structure, and surface properties of the logical semantics format.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{moisio2026type,
  title  = {Type Diversity Enables Transformers to Generalise Compositionally},
  author = {Anssi Moisio and Mathias Creutz and Mikko Kurimo},
  year   = {2026},
  eprint = {2609.13144},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2609.13144v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2609.13144.svg)](https://codeofpaper.com/paper/2609.13144)

Discussion