arXiv:2610.35036cs.LGOct 2026

Manuscript Offprint

arXiv:2610.35036

Mapping the Solution-Set Structure of Grokking on Latin Squares

Zihan Gu, Lulu Zhao, Tianyi Ma, Hua Zhang, Wenbo Su, Yanan Cao, Yue Hu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Grokking is a delayed transition from memorisation to generalisation. A network first fits observed examples while remaining near chance on held-out inputs, then generalises abruptly. Prior work has focused mainly on this delay, finding that the network's main loss becomes weight decay after the fitting phase. We name the solution to this optimization problem as the minimum-norm endpoint, and study which tasks make all minimum-norm endpoints generalise from partial observations. Specifically, we model pairwise input tasks as edge colourings of Kq,qK_{q,q}, with Latin colourings as our structured family, and classify each observed instance as all-good, mixed, or no-good by its endpoint set. Furthermore, we prove two contrasting results: (1) Finite-abelian-group families are asymptotically all-good from partial observations; (2) Under a uniform random Latin square, all-good tasks become asymptotically rare for observation-based learners, leaving mixed or no-good behaviour. Moreover, experiments show that relabellings of addition generalise despite their dense polynomial representations. Finally, on tasks of composite order, finite-training results suggest that predictors learn a coarse part of the output before the full label.

1 INTRODUCTION

Grokking is delayed generalisation: a network fits its training examples, remains near chance on held-out inputs for a long period, and then generalises abruptly (Power et al., 2022). The classical instance is modular addition, where the network observes some pairs (x,y)(x, y) with their sums x+ymod  qx + y \mod q and must infer the rest. Such a learning curve combines two things, the quality of the predictor that training eventually reaches and the time taken to reach it, and existing work examines how learned representations, regularisation, and the training data shape this behaviour (Nanda et al., 2023; Mohamadi et al., 2024; Gu et al., 2025). However, a run that generalises shows that there exists one solution does; it does not show that every solution a training could have selected would. We isolate the generalisation behaviour and ask it at the level of the task. Defining the minimum-norm endpoint as the solution to the weight decay-induced optimization problem, our central question is therefore: which task structures make the entire minimum-norm endpoint set generalise?

Answering it needs modelling of the task and endpoint set. A pairwise input task assigns an output to every pair of inputs, and we encode it as an edge colouring of the complete bipartite graph Kq,qK_{q,q}: the two input alphabets are the two vertex classes, each pair (u,v)(u, v) is an edge, which we also call a cell, and the output is its colour. Written out, the colouring is a q×qq \times q table, and at prime-power order it is a polynomial over FqF_q; table, graph, and polynomial are three coordinates on one object. The colouring is Latin when it is proper, so that no vertex sees a colour twice; in table coordinates every symbol appears exactly once in each row and column, so the Latin colourings are the Latin squares of combinatorics. Every group multiplication table is one, and the family therefore contains modular addition together with its natural competitors. Permuting the vertices within either class, permuting the colours, or swapping the two classes only changes how the table is written; we call such a move a relabelling, and the orbit of a colouring under relabellings is our task object. Training observes a uniformly random subset of the cells of fixed size.

Figure

Figure 1: Coordinates, endpoint sets, and the two poles. Left: x+ymod  97x + y \mod 97; a relabelling of it, 9,118 terms and degree 190; and a random-matching colouring outside the orbit. Middle: the minimum-norm interpolators Sq(D)\mathcal{S}_q(\mathcal{D}) agree on the observed cells, may differ elsewhere; their extremes Aq−≤Aq+A_q^- \leq A_q^+ cut τ\tau into all-good, mixed, no-good. Right: each orbit maps to a simplex point; abelian group families sit at the all-good vertex (cyclic addition illustrated), while the uniform Latin ensemble sits on the opposite edge, where the mixed/no-good split is open.

The network reads an edge through its two endpoints, with one embedding table per vertex class, a hidden ReLU layer, and a head over the colours. For the endpoint of training we follow implicit-bias theory, which motivates the minimum-norm interpolator as the idealised late-training object (Soudry et al., 2018; Lyu & Li, 2020; Neyshabur et al., 2015). A partially observed colouring, however, has many minimum-norm interpolators: all meet the margins on the observed cells and are free to disagree on the rest, and a handful of training runs yields a few selected predictors without certifying that they belong to this set or how the set behaves as a whole. We therefore take the whole set, the endpoint set, as the object of study, and describe it by what holds across it at a fixed held-out threshold τ\tau: an observed instance is all-good if every minimum-norm interpolator generalises, no-good if none does, and mixed if both kinds coexist. Averaged over the random observations, the three probabilities form the task's phase profile, a point of a triangle (Figure 1, middle and right).

Relabelling induces a norm-preserving bijection between endpoint sets and preserves the law of the observations, so the phase profile is well defined on orbits: it is a map from colouring orbits to the triangle. The network realises the bijection by permuting the rows of its embedding tables and of its head. This separates task structure from its polynomial description. Take x+ymod  97x + y \mod 97 and relabel it. The endpoint set is transported by the bijection, but the polynomial coordinate becomes a polynomial over F97F_{97} with 9,118 nonzero terms and total degree 190, with essentially the same support density and the same degree as a proper colouring assembled from random perfect matchings, which lies outside the orbit. Networks trained on the relabelled colouring memorise and then generalise as they do on x+yx + y; networks trained on the random-matching colouring end below chance (Figure 1, left). Relabelling preserves the phase while changing polynomial sparsity and degree, and in this comparison those coordinate statistics also fail to distinguish the trained predictors' outcomes. This is why we work with orbits.

Our results place two structures at opposite poles of the triangle. The all-good pole contains every finite abelian group family: at any fixed positive observation fraction, the worst endpoint accuracy converges to one in probability as the order grows. Cyclic addition is one instance, and non-isomorphic abelian groups supply distinct all-good orbits. At the opposite pole, a uniformly random Latin colouring defeats every learner that reads only the observations, at any fixed positive accuracy; consequently the colourings with a non-negligible all-good component have vanishing uniform mass. Generalisation is thus guaranteed throughout a structured family yet rare in the ambient space.

The core of our theory is a lemma of carrier criterion: a network that scores the full grid with controlled margins at a known norm cost. It bounds the cost of every minimum-norm endpoint on every mask, and a finite atlas fixed before the observations counts the harmful low-norm alternatives, whose number is too small for any of them to evade a random mask. The criterion does not depend on the colouring, and abelian characters provide carriers uniformly across group structures. Therefore, we have proven that satisfying this lemma is a sufficient condition for all good. We conjecture that the carrier criterion is also necessary: every asymptotically all-good Latin family admits a full-grid carrier in the same norm-and-margin regime.

Experiments at composite order 64 compare the guaranteed families with non-abelian and non-group candidates and show that coarse output factors are recovered before exact labels. These trained predictors probe structure; they do not measure the phase of the whole endpoint set. Whether a typical random colouring has some good endpoint, and whether any family carries non-vanishing mixed mass, remain open.

References (58)