arXiv:2610.35112cs.LGOct 2026

Manuscript Offprint

arXiv:2610.35112

Subspace Crystallization in Grokking: Rank Compression Tracks the Phase Transition

Shlok Mehendale, Paras Chopra

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

Abstract

Grokking describes understanding something deeply and intuitively. In neural networks, it is the phenomenon where a network generalizes long after memorizing its training data. This delay has been linked to a fall in the effective rank of the network's weight matrices, but whether this rank compression drives grokking or follows it is still unresolved. We study a mean-field MLP and a one-layer transformer trained on modular arithmetic and observe that: (i) Compression follows the onset, not memorization. Every transformer memorizes its training data within 250 steps, while the grokking onset (the first step at which test accuracy reaches 95%) varies from 6,500 to 21,000 steps. The steepest fall in effective rank comes about 900 steps after the onset, however late the onset occurs, and networks that memorize without grokking compress far less. (ii) Subspace crystallization. We call the span of the fewest top singular directions of a weight matrix that preserve 99% of test accuracy its sufficient subspace. Its size can shrink as the margin between the correct and the best wrong output grows, so we also count the directions needed to keep the outputs within 10%. In the transformer, this count falls during the transition from a quarter or more of the available directions to about a tenth, which we call subspace crystallization. (iii) Imposing low rank does not speed up grokking. Against a factorized full-rank control, capping the rank of the transformer's MLP input weights delays the onset, and capping the rank of its embedding stops 15 of 20 runs from grokking. Compression is therefore a signature of grokking rather than its cause.

1 Introduction

Grokking [Power et al., 2022], memorization followed by delayed generalization, offers a rare window into how circuits emerge from gradient descent: a clean phase transition from a lazy, memorizing regime to a rich, generalizing one [Kumar et al., 2024]. Substantial progress exists on what grokking networks compute [Nanda et al., 2023, Chughtai et al., 2023, Gromov, 2023], and a recurring observation is that the effective rank (ER) of their weight matrices falls as test accuracy jumps [Liu et al., 2023b, DeMoss et al., 2025, Lei and Xu, 2026]. This has led to proposals that a pressure toward low-rank, small-norm or efficient circuits causes grokking [Nanda et al., 2023, Liu et al., 2023a, Varma et al., 2023]. We ask two questions. (Q1) Does this rank compression cause grokking, or follow it? (Q2) Does the learned solution lie in the subspace spanned by a few leading directions of each weight matrix?

*Corresponding author: shlok.mehendale@lossfunk.com

Preprint.

The usual evidence cannot settle these questions, for three reasons. First, rank compression is usually observed after two events, memorization (the first step at which training accuracy reaches 99%) and the rise in test accuracy (Figure 1a), so the timing alone cannot explain which of the two it follows. Second, timing without interventions cannot show cause. Lastly, the compactness of a solution is naturally measured by truncating each weight matrix to lower and lower rank until test accuracy drops. Keeping a weight matrix's k strongest singular directions gives the closest rank-k matrix, which acts only within their span. The span of the fewest top directions that leave the test accuracy unchanged, which we call the sufficient subspace, is then taken as the subspace the solution needs, analogous to the intrinsic dimension of Li et al. [2018]. Accuracy, however, only checks which output is largest. The margin between the correct-class output and the largest other output sets how far the outputs can move before a prediction changes. As margins grow, more directions can be deleted before any prediction changes, so the count can fall even though the network's outputs still depend on those directions.

We address these questions with geometric metrics (effective rank, stable rank, sparsity, inverse participation ratio) and multiple interventions (truncation of weight matrices to their top, bottom or random singular directions, complement interventions, transplant patching with orthogonal alignment, a nuclear-norm penalty, rank caps compared with factorized controls, and optimizer swaps). We study modular addition (a+b)(a+b) mod 97 in two architectures with multiple random initializations. In the transformer, we analyze the embedding WEW_E, the unembedding WUW_U, and the input and output matrices WinW_{\text{in}} and WoutW_{\text{out}} of its MLP block. We call the first step at which test accuracy reaches 95% the grokking onset. To separate memorization from the onset, we follow the transformer with a checkpoint every 250 steps and compare networks that grok with networks that memorize but never grok. To count directions without the margin, we judge each truncation by how much it changes the network's outputs. To test cause, we limit the rank of a weight matrix throughout training and compare each limit with a factorized full-rank control. We test the timing results on held-out transformer seeds and on two further tasks, ab mod 97 and (a+b)(a+b) mod 113. Our results point to compression as a signature of grokking rather than its cause.

References (70)