Sequential Group Composition: A Window into the Mechanics of Deep Learning

Giovanni Luca Marchetti, Daniel Kunin, Adele Myers, Francisco Acosta, Nina Miolane

Introduction

While deep learning models excel at sequence modeling, the internal mechanics of how they acquire structured, non-linear rules—such as arithmetic, geometry, or algorithmic logic—remain largely opaque. To gain insight into this phenomenon, researchers introduce the sequential group composition task as a mathematical "microscope" to study how neural networks learn structured operations.

The Sequential Group Composition Task

To understand how networks internalize rules, the authors strip the problem down to its algebraic essence. In the sequential group composition task, a network receives a sequence of elements from a finite group (such as rotations of a triangle or integers modulo $p$) and must predict their cumulative product.

This task serves as a perfect testbed for three reasons:

  1. It is non-linear: A simple linear model cannot solve it.
  2. It is order-sensitive: For many non-Abelian groups, changing the sequence order changes the final result.
  3. It scales exponentially: As the sequence length $k$ increases, the number of possible sequences grows exponentially, making simple memorization impossible.

The authors test their theories using synthetic datasets generated from various finite groups, including Cyclic ($C_p$), Dihedral ($D_p$), Octahedral ($O_h$), and Alternating ($A_5$) groups. These group elements are mapped to real-valued vectors via orbit-based encodings to make them digestible for standard neural networks.

Methodology: A Mathematical Microscope

The researchers analyze the training process using a combination of Group Representation Theory and Alternating Gradient Flows (AGF).

By applying Group Fourier Analysis, the authors decompose the group composition task into "irreducible representations" (irreps). Much like breaking a complex audio signal into sine waves, this allows them to track exactly which "frequency" of the group structure the network is learning at any given time.

Analyzing networks in the limit of vanishing initialization (where weights start near zero) reveals that learning happens in a "staircase" fashion. The network hits a plateau, identifies a useful feature (an irrep), and then the loss drops sharply as it integrates that feature.

Key Insights: How Networks Learn

  • Greedy and Stepwise Learning: Networks do not learn the entire group multiplication table at once. Instead, they learn one irrep at a time. The order of learning is determined by the Fourier statistics of the encoding—essentially, the network picks up the "loudest" signal first.
  • Dimensional Bias: There is a systematic bias toward learning lower-dimensional representations first, an effect that becomes increasingly pronounced as the sequence length $k$ grows.
  • The "Curse" of Shallowness: For a two-layer network to compute a product of $k$ elements, it must coordinate multiple neurons to act as a "product" unit. The authors prove that to perfectly learn a sequence of length $k$, a two-layer network requires a hidden layer width that grows exponentially ($2^k$). Specifically, the theoretical bound for success requires a width $H \geq (k+1)2^{k-1} \lfloor |G|/2 \rfloor$. Narrow networks simply lack the mathematical coordination to cancel out extraneous terms.

The Power of Depth: Exploiting Associativity

While shallow networks suffer from the curse of shallowness, deeper architectures can solve the task with dramatically smaller widths by exploiting associativity—the mathematical property that $(a \cdot b) \cdot c = a \cdot (b \cdot c)$.

  • Recurrent Neural Networks (RNNs): RNNs can compose elements sequentially in $k$ steps with a width that is entirely independent of $k$. Mechanistically, the researchers found that in trained RNNs, the internal weight matrices actually learn to become block-diagonal, aligning themselves perfectly with the group's irreducible representations just as the theory predicted.
  • Deep MLPs: Multi-layer perceptrons can solve the task in $\log k$ layers by using a parallel "divide and conquer" composition strategy.

Limitations and Future Directions

While the paper successfully proves that efficient deep solutions exist (a constructive analysis), proving that gradient descent will always find them (a dynamical analysis) is currently limited to two-layer networks. Additionally, the current theory focuses exclusively on finite groups.

Future work will look toward extending these findings to continuous groups (like rotations in 3D space) or infinite groups. Furthermore, moving beyond simple algebraic composition toward semiautomata (which include irreversible operations like "reset") and formal grammars could bridge the gap between this theoretical framework and the complex recursive rules found in natural language processing.

Summary updated

BibTeX
@inproceedings{marchetti2026sequential,
  author = {Giovanni Luca Marchetti and Daniel Kunin and Adele Myers and Francisco Acosta and Nina Miolane},
  title = {{Sequential Group Composition: A Window into the Mechanics of Deep Learning}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=oFD9pc53pF},
}
Figure