OctoMath: Contextual Bandit Routing for Modular Olympiad-Style Mathematical Reasoning
Large Language Models (LLMs) have recently achieved great performance on complex mathematical problems with long chains of thought (COT) reasoning. However, this comes at a high cost, as it can allocate excessive computation, especially on trivial arithmetic tasks, even if the answers are correct. Therefore, we aimed at finding a way to make a reduction in reasoning overhead and computational waste while maintaining the use of LLM reasoning. In this paper, we propose our OctoMath system as a suggested solution for this problem and to rely on faster and more accurate approaches rather than a monolithic LLM. OctoMath is a hybrid neuro-symbolic routing system that can solve math problems by making a multi-armed contextual bandit (LinUCB) direct them to their correct solving strategies, either deterministic or neural. Moreover, the project is done for the submission of the AI Mathematical Olympiad - Progress Prize 3 (AIMO3) competition on Kaggle, where we strictly followed their constraints, such as: Kaggle internet off and no use of external APIs by making a new dataset of offline Ollama Packages. Results for our case study experiment indicate a 19,825x speedup when using our OctoMath system compared to the standard LLM DeepSeek-R1-Distill-Qwen-7B on the same Kaggle constrained CPU environment. In general, this system presents the hybrid neural-symbolic paradigm advocated by one of the papers, and all code, datasets, and runtime are publicly available. Moreover, this work is a research proof of concept that focuses on routing, offline deployment, and verification-assisted inference rather than state-of-the-art benchmark performance.
Authors
- Ahmed Hazem Hassan Fakhry (ORCID: https://orcid.org/0009-0000-6000-4351)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-05-22
- DOI
- https://doi.org/10.5281/zenodo.20329074
- Primary Topic
- Advanced Graph Neural Networks
- Type
- preprint