Teaching Tiny Transformers Arithmetic
Does the way you write the training data decide whether a language model can do arithmetic? I trained small character-level transformers on the same problems written three different ways and measured what changed.
Autoregressive models write one character at a time, left to right. If a tiny model gets arithmetic wrong, is the problem the model's size, or the way the problem is presented to it? Keeping the model fixed and changing only the data format isolates that question.
Baseline
Problem, then the answer, written normally. 123+456=579
Chain-of-Thought
The model writes out intermediate reasoning steps before giving the final answer.
Reverse-Output
Same problem, but the answer's digits are written in reverse order. 123+456=975
Everything else held fixed
Same architecture and parameter count, so any difference comes from the format.
Format beat size
Same model, same problems. Only the way the data was written changed.
Exact-answer accuracy
Writing out intermediate steps made the difference.
100 unseen problems per model.
Mean absolute error
Lower is better. Reversing the answer's digits alone cut error by 77%.
Bars scaled to the baseline error.
Intermediate computation space outweighs raw parameter count
The model didn't get bigger, it got room to think. Giving it space for intermediate steps took accuracy from 1% to 100%.
Order matters too
Just reversing the order of the answer's digits, with no extra reasoning steps, still cut error by more than three-quarters.