{
  "id": 693579,
  "title": "Agentic Reasoning Model gpt-oss-120b",
  "content": "<p><strong>Abstract</strong></p>\n<p>This writeup presents an agentic inference-time reasoning system developed for the AI Mathematical Olympiad (AIMO) Progress Prize 3. Recognizing that Olympiad-level mathematical problem solving is fundamentally limited by unreliable reasoning and arithmetic errors in large language models, this work shifts the focus from traditional fine-tuning toward structured test-time orchestration.</p>\n<p>Our approach introduces a code-driven verification framework, where the model is explicitly guided to generate executable Python programs as an intermediate step before producing final answers. This transforms the reasoning process from heuristic generation to deterministic computation.</p>\n<p>The system is built upon three key components:</p>\n<p>Tool-Integrated Reasoning (TIR): A tightly coupled execution pipeline that enables the model to generate, execute, and verify Python code in a controlled environment, significantly reducing numerical and logical errors.\nStructured Prompting &amp; Agentic Control: A strict reasoning protocol that enforces step-by-step analysis, code generation, execution, and validation, ensuring consistency and minimizing hallucinations.\nIterative Solver Loop: An inference-time reasoning strategy that integrates model outputs with tool feedback, enabling self-correction and more reliable final predictions.</p>\n<p>Through extensive evaluation across diverse mathematical domains—including algebra, geometry, number theory, and combinatorics—we observe that enforcing executable verification substantially improves solution accuracy and robustness.</p>\n<p>Our results demonstrate that augmenting language models with deterministic computation and structured reasoning constraints is a highly effective strategy for solving complex mathematical problems, offering a scalable alternative to purely model-based approaches.</p>\n<p><strong>What I Implemented</strong></p>\n<p>In this notebook, I developed an agentic inference-time mathematical reasoning system designed to improve the reliability of large language models on complex problems.</p>\n<p>Instead of relying on direct answer generation, the system enforces a structured reasoning pipeline augmented with executable verification.</p>\n<p><strong>1. Tool-Integrated Reasoning (Core Contribution)</strong></p>\n<p>The central idea of my approach is to force the model to use Python code for solving problems.</p>\n<p>The model is guided to:\nAnalyze the problem\nConvert reasoning into Python code\nExecute the code\nUse the output as the final answer\nA custom tool module:\nExecutes code dynamically in a controlled environment\nReturns outputs for verification</p>\n<p>This reduces:\n<em>Arithmetic mistakes,\nLogical inconsistencies,\nHallucinated answers</em></p>\n<p><strong>2. Structured Prompting Framework</strong></p>\n<p>I designed a strict system prompt that enforces:</p>\n<p>Step-by-step reasoning\nMandatory code generation\nVerification before answering</p>\n<p>This ensures the model:</p>\n<p><em>Follows a deterministic workflow,\nAvoids skipping reasoning steps</em></p>\n<p><strong>3. Agent-Based Solver Architecture</strong></p>\n<p>The solution is implemented as an agentic pipeline, consisting of:</p>\n<p><em>Template Layer: Formats the problem and injects system constraints,\nSolver Engine: Controls reasoning flow and interaction with tools,\nExecution Tool: Runs generated Python code and returns results</em></p>\n<p><strong>4. Inference Pipeline Integration</strong></p>\n<p>I implemented a prediction function that:</p>\n<p>Takes input questions\nPasses them through the agent pipeline\nReturns final verified answers</p>\n<p>This is integrated into a Kaggle-compatible inference setup.</p>\n<p><strong>5. Evaluation Across Problem Types</strong></p>\n<p>The system was tested on multiple categories:</p>\n<p><em>Algebra (polynomials, equations),\nGeometry (triangle and projection problems),\nNumber Theory (divisibility, factorization),\nCombinatorics (counting constraints)</em></p>\n<ol>\n<li>Key Observations</li>\n</ol>\n<p><em>Pure LLM reasoning is unreliable for precise math,\nCode execution significantly improves correctness,\nStructured prompting stabilizes outputs\nT\nTool usage provides consistent verification</em></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F13407901%2F37772c6b31eb8ad8ec91ae8eeb1a52a3%2F1.png?generation=1776786406870699&amp;alt=media\" alt=\"Constraint\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F13407901%2Fabb81b32533dbb5b681fba0369977a2e%2F3.png?generation=1776786450621427&amp;alt=media\" alt=\"Tool Execution Parameters\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F13407901%2F6e3cae53d6d1c9d3c01e2a53964a1470%2F2.png?generation=1776786472164453&amp;alt=media\" alt=\"Solver Parameters\"></p>\n<p>Also I was reading the Research Paper of AIMO season 2 <a href=\"https://arxiv.org/pdf/2504.16891\" target=\"_blank\">link</a> and was trying to do it.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F13407901%2Fef79b33d70c106809a340a2eeca5d79b%2Fresearch.png?generation=1776786686297478&amp;alt=media\" alt=\"Research\"></p>\n<p><strong>Prompt will be shared later</strong></p>\n<p>cheers!!</p>",
  "comments": [],
  "comment_count": 0,
  "messages": [
    {
      "id": 3446435,
      "postDate": "2026-04-21T15:59:46.787Z",
      "content": "<p><strong>Abstract</strong></p>\n<p>This writeup presents an agentic inference-time reasoning system developed for the AI Mathematical Olympiad (AIMO) Progress Prize 3. Recognizing that Olympiad-level mathematical problem solving is fundamentally limited by unreliable reasoning and arithmetic errors in large language models, this work shifts the focus from traditional fine-tuning toward structured test-time orchestration.</p>\n<p>Our approach introduces a code-driven verification framework, where the model is explicitly guided to generate executable Python programs as an intermediate step before producing final answers. This transforms the reasoning process from heuristic generation to deterministic computation.</p>\n<p>The system is built upon three key components:</p>\n<p>Tool-Integrated Reasoning (TIR): A tightly coupled execution pipeline that enables the model to generate, execute, and verify Python code in a controlled environment, significantly reducing numerical and logical errors.\nStructured Prompting &amp; Agentic Control: A strict reasoning protocol that enforces step-by-step analysis, code generation, execution, and validation, ensuring consistency and minimizing hallucinations.\nIterative Solver Loop: An inference-time reasoning strategy that integrates model outputs with tool feedback, enabling self-correction and more reliable final predictions.</p>\n<p>Through extensive evaluation across diverse mathematical domains—including algebra, geometry, number theory, and combinatorics—we observe that enforcing executable verification substantially improves solution accuracy and robustness.</p>\n<p>Our results demonstrate that augmenting language models with deterministic computation and structured reasoning constraints is a highly effective strategy for solving complex mathematical problems, offering a scalable alternative to purely model-based approaches.</p>\n<p><strong>What I Implemented</strong></p>\n<p>In this notebook, I developed an agentic inference-time mathematical reasoning system designed to improve the reliability of large language models on complex problems.</p>\n<p>Instead of relying on direct answer generation, the system enforces a structured reasoning pipeline augmented with executable verification.</p>\n<p><strong>1. Tool-Integrated Reasoning (Core Contribution)</strong></p>\n<p>The central idea of my approach is to force the model to use Python code for solving problems.</p>\n<p>The model is guided to:\nAnalyze the problem\nConvert reasoning into Python code\nExecute the code\nUse the output as the final answer\nA custom tool module:\nExecutes code dynamically in a controlled environment\nReturns outputs for verification</p>\n<p>This reduces:\n<em>Arithmetic mistakes,\nLogical inconsistencies,\nHallucinated answers</em></p>\n<p><strong>2. Structured Prompting Framework</strong></p>\n<p>I designed a strict system prompt that enforces:</p>\n<p>Step-by-step reasoning\nMandatory code generation\nVerification before answering</p>\n<p>This ensures the model:</p>\n<p><em>Follows a deterministic workflow,\nAvoids skipping reasoning steps</em></p>\n<p><strong>3. Agent-Based Solver Architecture</strong></p>\n<p>The solution is implemented as an agentic pipeline, consisting of:</p>\n<p><em>Template Layer: Formats the problem and injects system constraints,\nSolver Engine: Controls reasoning flow and interaction with tools,\nExecution Tool: Runs generated Python code and returns results</em></p>\n<p><strong>4. Inference Pipeline Integration</strong></p>\n<p>I implemented a prediction function that:</p>\n<p>Takes input questions\nPasses them through the agent pipeline\nReturns final verified answers</p>\n<p>This is integrated into a Kaggle-compatible inference setup.</p>\n<p><strong>5. Evaluation Across Problem Types</strong></p>\n<p>The system was tested on multiple categories:</p>\n<p><em>Algebra (polynomials, equations),\nGeometry (triangle and projection problems),\nNumber Theory (divisibility, factorization),\nCombinatorics (counting constraints)</em></p>\n<ol>\n<li>Key Observations</li>\n</ol>\n<p><em>Pure LLM reasoning is unreliable for precise math,\nCode execution significantly improves correctness,\nStructured prompting stabilizes outputs\nT\nTool usage provides consistent verification</em></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F13407901%2F37772c6b31eb8ad8ec91ae8eeb1a52a3%2F1.png?generation=1776786406870699&amp;alt=media\" alt=\"Constraint\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F13407901%2Fabb81b32533dbb5b681fba0369977a2e%2F3.png?generation=1776786450621427&amp;alt=media\" alt=\"Tool Execution Parameters\"></p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F13407901%2F6e3cae53d6d1c9d3c01e2a53964a1470%2F2.png?generation=1776786472164453&amp;alt=media\" alt=\"Solver Parameters\"></p>\n<p>Also I was reading the Research Paper of AIMO season 2 <a href=\"https://arxiv.org/pdf/2504.16891\" target=\"_blank\">link</a> and was trying to do it.</p>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F13407901%2Fef79b33d70c106809a340a2eeca5d79b%2Fresearch.png?generation=1776786686297478&amp;alt=media\" alt=\"Research\"></p>\n<p><strong>Prompt will be shared later</strong></p>\n<p>cheers!!</p>",
      "rawMarkdown": "**Abstract**\n\nThis writeup presents an agentic inference-time reasoning system developed for the AI Mathematical Olympiad (AIMO) Progress Prize 3. Recognizing that Olympiad-level mathematical problem solving is fundamentally limited by unreliable reasoning and arithmetic errors in large language models, this work shifts the focus from traditional fine-tuning toward structured test-time orchestration.\n\nOur approach introduces a code-driven verification framework, where the model is explicitly guided to generate executable Python programs as an intermediate step before producing final answers. This transforms the reasoning process from heuristic generation to deterministic computation.\n\nThe system is built upon three key components:\n\nTool-Integrated Reasoning (TIR): A tightly coupled execution pipeline that enables the model to generate, execute, and verify Python code in a controlled environment, significantly reducing numerical and logical errors.\nStructured Prompting & Agentic Control: A strict reasoning protocol that enforces step-by-step analysis, code generation, execution, and validation, ensuring consistency and minimizing hallucinations.\nIterative Solver Loop: An inference-time reasoning strategy that integrates model outputs with tool feedback, enabling self-correction and more reliable final predictions.\n\nThrough extensive evaluation across diverse mathematical domains—including algebra, geometry, number theory, and combinatorics—we observe that enforcing executable verification substantially improves solution accuracy and robustness.\n\nOur results demonstrate that augmenting language models with deterministic computation and structured reasoning constraints is a highly effective strategy for solving complex mathematical problems, offering a scalable alternative to purely model-based approaches.\n\n**What I Implemented**\n\nIn this notebook, I developed an agentic inference-time mathematical reasoning system designed to improve the reliability of large language models on complex problems.\n\nInstead of relying on direct answer generation, the system enforces a structured reasoning pipeline augmented with executable verification.\n\n**1. Tool-Integrated Reasoning (Core Contribution)**\n\nThe central idea of my approach is to force the model to use Python code for solving problems.\n\nThe model is guided to:\nAnalyze the problem\nConvert reasoning into Python code\nExecute the code\nUse the output as the final answer\nA custom tool module:\nExecutes code dynamically in a controlled environment\nReturns outputs for verification\n\nThis reduces:\n*Arithmetic mistakes,\nLogical inconsistencies,\nHallucinated answers*\n\n**2. Structured Prompting Framework**\n\nI designed a strict system prompt that enforces:\n\nStep-by-step reasoning\nMandatory code generation\nVerification before answering\n\nThis ensures the model:\n\n*Follows a deterministic workflow,\nAvoids skipping reasoning steps*\n\n**3. Agent-Based Solver Architecture**\n\nThe solution is implemented as an agentic pipeline, consisting of:\n\n*Template Layer: Formats the problem and injects system constraints,\nSolver Engine: Controls reasoning flow and interaction with tools,\nExecution Tool: Runs generated Python code and returns results*\n\n**4. Inference Pipeline Integration**\n\nI implemented a prediction function that:\n\nTakes input questions\nPasses them through the agent pipeline\nReturns final verified answers\n\nThis is integrated into a Kaggle-compatible inference setup.\n\n**5. Evaluation Across Problem Types**\n\nThe system was tested on multiple categories:\n\n*Algebra (polynomials, equations),\nGeometry (triangle and projection problems),\nNumber Theory (divisibility, factorization),\nCombinatorics (counting constraints)*\n\n6. Key Observations\n\n*Pure LLM reasoning is unreliable for precise math,\nCode execution significantly improves correctness,\nStructured prompting stabilizes outputs\nT\nTool usage provides consistent verification*\n\n![Constraint](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F13407901%2F37772c6b31eb8ad8ec91ae8eeb1a52a3%2F1.png?generation=1776786406870699&alt=media)\n\n![Tool Execution Parameters](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F13407901%2Fabb81b32533dbb5b681fba0369977a2e%2F3.png?generation=1776786450621427&alt=media)\n\n![Solver Parameters](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F13407901%2F6e3cae53d6d1c9d3c01e2a53964a1470%2F2.png?generation=1776786472164453&alt=media)\n\n\nAlso I was reading the Research Paper of AIMO season 2 [link](https://arxiv.org/pdf/2504.16891) and was trying to do it.\n\n![Research](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F13407901%2Fef79b33d70c106809a340a2eeca5d79b%2Fresearch.png?generation=1776786686297478&alt=media)\n\n\n**Prompt will be shared later**\n\ncheers!!",
      "votes": 1
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-20T04:22:44Z",
  "competition_id": 118448,
  "competition_slug": "ai-mathematical-olympiad-progress-prize-3",
  "team_id": 15460453,
  "solution_url": "/competitions/ai-mathematical-olympiad-progress-prize-3/writeups/agentic-reasoning-model-gpt-oss-120b"
}