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

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

OctoMath: Contextual Bandit Routing for Modular Olympiad-Style Mathematical Reasoning

Ahmed Hazem Hassan Fakhry
Zenodo (CERN European Organization for Nuclear Research)
Advanced Graph Neural Networks
preprint

OctoMath: Contextual Bandit Routing for Modular Olympiad-Style Mathematical Reasoning

Ahmed Hazem Hassan Fakhry
preprint en

Abstract

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.

Zenodo (CERN European Organization for Nuclear Research)
Advanced Graph Neural Networks
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.