arXiv cs.LG

The Long Delay to Arithmetic Generalization

· 1小时前
AI 摘要

arXiv:2604.13082v3 Announce Type: replace Abstract: Large language models today still make mistakes on multi-digit arithmetic when they do not have tools, and part of the reason is how numbers are split into tokens. Arithmetic is also a setting where the correct answer to every input and the algorithm that produces it are already known, so training transformers on it lets us study what they learn against a ground truth. These models often fit their training set long before they generalize to held-out inputs, and this delay, known as grokking, decreases as the training set grows. But, how does the representation of numbers change the amount of data a transformer needs to generalize? We study one-step Collatz prediction, in which a transformer reads the digits of an integer in a chosen base and outputs the digits of the next term in its Collatz sequence. We find that the long delay appears only when the training set has few different integers, and that the numeral base determines how many integers are sufficient. In bases where each output digit depends only on a few neighbouring input digits, because the carry between positions depends only on the current digit, a transformer needs several times fewer training integers. We predicted this ordering before training, and input length does not explain it. The same carry structure predicts which bases are easy for a second Collatz map, for integer division, for a decoder-only transformer, and across three model sizes. Finally, a linear probe recovers the low-order residues of the input as accurately from a randomly initialized encoder as from a trained one. Thus, high probe accuracy on such features does not reliably show that a model has learned to compute them. More broadly, we show that the choice of numeral representation affects sample efficiency in ways we can predict from the structure of the task before training.

查看原文(arXiv cs.LG)