🤖 AI Summary
This study addresses the failure of Transformers in multi-digit multiplication due to the absence of explicit carry mechanisms during a single forward pass. We train Llama-style Transformers from scratch, demonstrating that inserting delimiters into inputs renders the carry operation learnable. Through activation patching and mechanistic interpretability analyses, we reveal that carries are encoded as circular geometric structures within the residual stream at prediction positions, and we identify their causal propagation pathways. These insights enable us to optimize the learning sequence across output positions. Our contributions include establishing that input formatting determines task success, elucidating the angular circular representation mechanism for carries, and achieving an exact match rate improvement from 1% to 89% without chain-of-thought prompting, thereby successfully realizing carry learning for multi-digit multiplication.
📝 Abstract
Transformers asked to multiply multi-digit numbers in a single forward pass often fail, and interpretability studies of pretrained language models find arithmetic solved by input-range heuristics rather than by an explicit carry. We train small Llama-style transformers from scratch on 4x4 multiplication without chain of thought and find that the input format is decisive: inserting a space token between digits raises exact-match accuracy from 1% to 89%. Output positions are learned in carry-chain order, with the middle digits, which have the longest-range dependencies, learned last. Inside the model, the separator token that predicts each digit (its prediction slot) encodes the carry-in as an angle on a ring in the residual stream; examples with more distinct carry values fill more of the ring. Activation patching between examples matched on the column sum shows that this state is causally used before the last layer: patching the prediction slot alone transfers the source carry in up to 84% of cases after block 4 for one middle column of our best model, while for other columns the carry is first assembled at the neighboring answer slot before reaching its own. Remaining errors are almost always off by one, consistent with a small error on the carry or on the circular digit code.