ReverseMath: Answer Inversion for Scalable and Verifiable Mathematical Problem Generation
For researchers and practitioners evaluating and training LLMs on mathematical reasoning, ReverseMath provides a scalable method to generate fresh, verifiable problems to detect memorization and augment training data.
ReverseMath generates new math problems by inverting the answer of existing ones, enabling scalable creation of verifiable problems. It reveals memorization-like behavior in LLMs and improves reasoning performance when used as training data augmentation.
Mathematical reasoning benchmarks are vital for evaluating large language models (LLMs), but many are static and repeatedly exposed through public evaluation and training pipelines, making it difficult to separate genuine reasoning from memorization. Meanwhile, manually constructing new math problems with reliable answers remains costly. We introduce ReverseMath, a scalable method for generating new math problems through answer inversion. Given a problem and its answer, ReverseMath masks a numerical value in the original problem, treats the original answer as a known condition, and rewrites the problem so that the masked value becomes the new answer. The generated problem reverses the original input-output relation, making its answer known by construction. We study ReverseMath for both evaluation and training. For evaluation, paired original/reversed problems reveal substantial behavioral shifts: models sometimes fail on reversed problems and even incorrectly output the original answer, suggesting memorization-like behavior. For training, ReverseMath provides automatically labeled reversed problems as data augmentation for reinforcement learning (RL). Experiments show that including ReverseMath-generated data improves mathematical reasoning performance across multiple benchmarks, demonstrating its value as both an analysis tool and a scalable source of verifiable training data.