{
  "id": 702479,
  "title": "3rd Place Solution for the AIMO3 Competition",
  "content": "<h1>3rd Place Solution for the AIMO3 Competition - Error Analysis &amp; Prompt Engineering</h1>\n<p>I participated in this competition primarily for my own learning and study. My submission is built upon a well-known public baseline notebook, and my primary goal was to improve the prompt design using an original, structured approach. </p>\n<p>Compared to other outstanding notebooks and comprehensive WriteUPs, I truly realize how much I still have to learn. However, I worked hard to analyze the competition's dynamics, design my own experimental framework, and iterate on improvements, so I would love to share my findings with the community.</p>\n<p>I plan to add some models and documentation in the coming days.\nAs I believe the presentation slides are much easier to read, I would highly appreciate it if you could read the attached presentation file.</p>\n<p>Below is a summary of the key points.</p>\n<hr>\n<h2>1. Overview of the Approach</h2>\n<h3>1.1 Models &amp; Algorithms Used</h3>\n<p>My solution is based on the strong public baseline notebook shared by \"ZaynYu\". </p>\n<ul>\n<li><strong>Core LLM</strong>: I used <code>gpt-oss-120b</code> as-is without any additional fine-tuning or parameter training. The model is empowered with a Python code execution tool.</li>\n<li><strong>Voting Mechanism</strong>: I ran 8 parallel solver instances and selected the final integer answer via a majority vote.</li>\n<li><strong>Time Control</strong>: I kept the early-stopping rule from the public baseline, which dynamically allocates remaining time and stops early when a clear majority answer is reached among early solvers.</li>\n</ul>\n<h3>1.2 Validation Strategy &amp; Data Preprocessing</h3>\n<p>To improve the prompt without overfitting to the Public Leaderboard (LB) or the reference.csv set, I established an offline validation process:</p>\n<ul>\n<li><strong>Data Collection</strong>: I collected 1120 full-text LLM-generated answers.</li>\n<li><strong>Dataset Composition</strong>: This dataset included 32 runs per problem across the 10 official reference problems (320 samples) and 16 runs per problem across 50 external hard math problems shared by participants (800 samples).</li>\n<li><strong>Analysis Workflow</strong>: I extracted the full response text, problem context, and final answer correctness into a unified table (<code>llm_history.csv</code>). I then leveraged more capable LLMs to cross-check and categorize why <code>gpt-oss-120b</code> failed on incorrect instances.</li>\n</ul>\n<h3>1.3 Prompt Design</h3>\n<p>The main improvement was in the prompt design. Specifically:</p>\n<ol>\n<li><strong>Use Python for Verification</strong>: Based on patterns frequently observed in correct answers, I instructed the model to use Python for verification.</li>\n<li><strong>Check the Constraints</strong>: Since I observed an error pattern where the model overlooked constraints stated in the problem, I explicitly instructed it to identify and check the constraints while solving.</li>\n<li><strong>Narrow the Search Space</strong>: Since I also observed an error pattern where the model generated Python code with loops that were too large to finish within the time limit, I instructed it to narrow the search space appropriately.</li>\n</ol>\n<hr>\n<h2>2. Details of the Submission</h2>\n<h3>2.1 How the original prompt was developed</h3>\n<h4>2.1.1 Error Analysis</h4>\n<p>I used an LLM that was more capable than gpt-oss-120b, because I expected it to analyze the responses \nmore accurately.However, a stronger LLM can also suggest solution methods that are too advanced for gpt-oss-120b to \nfollow.To avoid this, I also provided examples of correct responses generated by gpt-oss-120b.This helped me search for \neffective solution patterns that were still feasible for gpt-oss-120b to execute.</p>\n<h4>2.1.2 Motivation Behind My Analysis Framework</h4>\n<p>To reduce the risk of overfitting, I used a separate set of 50 problems outside the official competition data while improving the solution.\nThe goal was to avoid relying too heavily on the public leaderboard or the reference problems.</p>\n<p>When I started this experimental workflow, the public notebooks had already reached a very high score around 40/50. While it was impossible to know the exact individual accuracy for each of these 50 problems on the leaderboard, I envisioned the situation as follows:\n[Hypothesis]</p>\n<ul>\n<li>5 problems that are almost impossible to solve.</li>\n<li>10 problems that fluctuate between correct and incorrect.</li>\n<li>35 problems that are always answered correctly.</li>\n</ul>\n<p>Under these circumstances, if I relied solely on the public leaderboard score to evaluate whether my model was improving, I felt I would end up overfitting to just those 10 unstable problems. Given that the score calculations are heavily influenced by the inherent randomness of LLM text generation and problem ordering, I wanted to avoid placing too much emphasis on this metric.</p>\n<p>Since the final private evaluation would evaluate the models on completely unseen problems, my goal was to implement enhancements that targeted all branches of mathematics and various dimensions of difficulty. Using only 10 reference problems felt far too restrictive.</p>\n<p>Furthermore, I reasoned that analyzing the full-text content of the responses would allow me to discover ways to make the outputs even more stable for problems the model was already answering correctly. I believed this qualitative evaluation would alleviate the risk of overfitting.</p>\n<p>(I would like to express my utmost respect to the competitors who pushed the scores to such an incredibly high level around 40/50. Needless to say, the leaderboard score was a critically important metric for guiding the community's progress up to that point.)</p>\n<h3>2.2 What Was Tried and Didn't Work</h3>\n<p>During the development cycle, I explored several ideas that ultimately did not yield improvements and were discarded:</p>\n<ul>\n<li><strong>Intuition-based Prompting</strong>: Instructing the model to reason or answer in Japanese.</li>\n<li><strong>Two-Step Self-Correction</strong>: A prompt that forced a draft-then-finalize sequence.</li>\n<li><strong>Research-inspired Methods</strong>: I experimented with prompts inspired by \"Complexity-based Consistency\".</li>\n<li><strong>Expanding the Voting Pool</strong>: I tried scaling the parallel solver runs from 8 to 16. While some easy problems finished much faster, the answers that completed prematurely showed a slight degradation in precision, leading to an overall increase in errors.</li>\n</ul>\n<hr>\n<h2>3. Prompt</h2>\n<pre><code>    system_prompt = (\n        'You are a world-class mathematical problem solver.'\n        'The final answer is a non-negative integer in [0, 99999].'\n        'Return only the verified final answer in \\boxed{}.'\n        'Before solving, you must:'\n        '1) extract all explicit constraints from the problem,'\n        '2) identify the mathematical structure (algebra / number theory / combinatorics / geometry / functional equation),'\n        '3) choose a solution plan,'\n        '4) use Python for verification when symbolic reasoning is insufficient.'\n        'You must never guess.'\n        'If a candidate answer is found, verify it against all constraints before finalizing.'\n        'Prefer concise reasoning and avoid long unnecessary explanations.'\n    )\n\n    tool_prompt = (\n        'Use Python as a verification and search tool.'\n        'The environment is a stateful Jupyter notebook. '\n        'You must use print() to output results.'\n        'Always:'\n        '- print intermediate key values needed for verification,'\n        '- validate candidate answers against all stated constraints,'\n        '- avoid brute force unless the search space is explicitly bounded or pruned,'\n        '- estimate complexity before large loops,'\n        '- keep code minimal and robust.'\n    )\n\n    preference_prompt = ( \n        'Solve the problem with the following protocol:'\n        'Step 1: Extract constraints and target form.'\n        'Step 2: Derive reductions before coding (parity, modular constraints, bounds, symmetry, invariants, monotonicity, geometric relations, etc.).'\n        'Step 3: Use Python only for:'\n        '- checking candidate formulas,'\n        '- bounded search after pruning,'\n        '- validating edge cases,'\n        '- confirming the final answer.'\n        'Step 4: If using search, explain the pruning rule first.'\n        'Step 5: Before final output, verify:'\n        '- integer,'\n        '- in [0, 99999],'\n        '- all constraints satisfied.'\n        'Step 6: Return only the final verified answer in \\boxed{}.'\n        'Keep reasoning compact. Never guess. If verification fails, discard the candidate and continue.'\n    )\n</code></pre>\n<hr>\n<h3>Reference</h3>\n<ul>\n<li><strong>Baseline notebook</strong>: <a href=\"https://www.kaggle.com/code/zaynyu/40-50-gpt-oss-120b-tir-dynamictime-kernelpool\" target=\"_blank\">Link to Kaggle Code</a></li>\n<li><strong>Set of 50 hard math problems</strong>: <a href=\"https://www.kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3/discussion/672643\" target=\"_blank\">Link to Kaggle discussion</a></li>\n</ul>\n<hr>\n<h3>Competition Link</h3>\n<ul>\n<li><strong>Competition overview page</strong>: <a href=\"https://www.kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3/overview\" target=\"_blank\">Link</a></li>\n<li><strong>Competition data page</strong>: <a href=\"https://www.kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3/data\" target=\"_blank\">Link</a></li>\n</ul>\n<hr>\n<h3>[2026/05/31] Update</h3>\n<ul>\n<li>Added Google Colab version code to the Hugging Face page.</li>\n<li>Fixed a bug in the calculation result counter (added missing counts).</li>\n</ul>",
  "comments": [
    {
      "id": 3463373,
      "author_name": "Durga Kumari",
      "author_url": "",
      "post_date": "2026-05-26T18:24:45.893000",
      "content": "<p>Nice write-up. The structured error analysis and constraint-focused prompt design were particularly interesting. Clear and practical approach.</p>",
      "votes": -1,
      "replies": []
    },
    {
      "id": 3463420,
      "author_name": "Wasiq Ali",
      "author_url": "",
      "post_date": "2026-05-26T21:04:06.793000",
      "content": "<p>The structure of this writeup is a step_by_step procedure which is best for learners </p>",
      "votes": -1,
      "replies": []
    },
    {
      "id": 3463276,
      "author_name": "Fff343",
      "author_url": "",
      "post_date": "2026-05-26T13:42:32.053000",
      "content": "<p>Thanks for sharing. I didn't understand what u changes other than prompt</p>",
      "votes": 0,
      "replies": [
        {
          "id": 3463613,
          "author_name": "SKobayak",
          "author_url": "",
          "post_date": "2026-05-27T12:47:13.723000",
          "content": "<p>In the final submission notebook, I only changed the prompt. There are no other changes.</p>\n<p>Besides the prompt, I also experimented with parallel computation methods and voting systems, but I did not include them in the submission because the score appeared to decrease.</p>",
          "votes": 1,
          "replies": [
            {
              "id": 3463616,
              "author_name": "Mohammad Shadab Alam",
              "author_url": "",
              "post_date": "2026-05-27T13:04:17.280000",
              "content": "<p>Hello <a href=\"https://www.kaggle.com/skobayak\" target=\"_blank\">@skobayak</a> did you manage to observe the variance in the winning submission on the public LB ?</p>",
              "votes": 0,
              "replies": []
            },
            {
              "id": 3464485,
              "author_name": "SKobayak",
              "author_url": "",
              "post_date": "2026-05-30T00:41:55.650000",
              "content": "<p>I submitted my final submission notebook three times, and the public LB scores were 36, 37, and 39. </p>\n<p>(If I am not mistaken, as the submission page display is a bit confusing…)</p>",
              "votes": 0,
              "replies": []
            }
          ]
        }
      ]
    },
    {
      "id": 3462748,
      "author_name": "@kaggleqrdl",
      "author_url": "",
      "post_date": "2026-05-24T19:00:33.443000",
      "content": "<p>Well done, thanks for the writeup.  Quite possible the prompt played a big factor in the win.  Will be interesting to see what the other projects did</p>",
      "votes": 0,
      "replies": []
    }
  ],
  "comment_count": 7,
  "messages": [
    {
      "id": 3462604,
      "postDate": "2026-05-24T05:35:22.770Z",
      "content": "<h1>3rd Place Solution for the AIMO3 Competition - Error Analysis &amp; Prompt Engineering</h1>\n<p>I participated in this competition primarily for my own learning and study. My submission is built upon a well-known public baseline notebook, and my primary goal was to improve the prompt design using an original, structured approach. </p>\n<p>Compared to other outstanding notebooks and comprehensive WriteUPs, I truly realize how much I still have to learn. However, I worked hard to analyze the competition's dynamics, design my own experimental framework, and iterate on improvements, so I would love to share my findings with the community.</p>\n<p>I plan to add some models and documentation in the coming days.\nAs I believe the presentation slides are much easier to read, I would highly appreciate it if you could read the attached presentation file.</p>\n<p>Below is a summary of the key points.</p>\n<hr>\n<h2>1. Overview of the Approach</h2>\n<h3>1.1 Models &amp; Algorithms Used</h3>\n<p>My solution is based on the strong public baseline notebook shared by \"ZaynYu\". </p>\n<ul>\n<li><strong>Core LLM</strong>: I used <code>gpt-oss-120b</code> as-is without any additional fine-tuning or parameter training. The model is empowered with a Python code execution tool.</li>\n<li><strong>Voting Mechanism</strong>: I ran 8 parallel solver instances and selected the final integer answer via a majority vote.</li>\n<li><strong>Time Control</strong>: I kept the early-stopping rule from the public baseline, which dynamically allocates remaining time and stops early when a clear majority answer is reached among early solvers.</li>\n</ul>\n<h3>1.2 Validation Strategy &amp; Data Preprocessing</h3>\n<p>To improve the prompt without overfitting to the Public Leaderboard (LB) or the reference.csv set, I established an offline validation process:</p>\n<ul>\n<li><strong>Data Collection</strong>: I collected 1120 full-text LLM-generated answers.</li>\n<li><strong>Dataset Composition</strong>: This dataset included 32 runs per problem across the 10 official reference problems (320 samples) and 16 runs per problem across 50 external hard math problems shared by participants (800 samples).</li>\n<li><strong>Analysis Workflow</strong>: I extracted the full response text, problem context, and final answer correctness into a unified table (<code>llm_history.csv</code>). I then leveraged more capable LLMs to cross-check and categorize why <code>gpt-oss-120b</code> failed on incorrect instances.</li>\n</ul>\n<h3>1.3 Prompt Design</h3>\n<p>The main improvement was in the prompt design. Specifically:</p>\n<ol>\n<li><strong>Use Python for Verification</strong>: Based on patterns frequently observed in correct answers, I instructed the model to use Python for verification.</li>\n<li><strong>Check the Constraints</strong>: Since I observed an error pattern where the model overlooked constraints stated in the problem, I explicitly instructed it to identify and check the constraints while solving.</li>\n<li><strong>Narrow the Search Space</strong>: Since I also observed an error pattern where the model generated Python code with loops that were too large to finish within the time limit, I instructed it to narrow the search space appropriately.</li>\n</ol>\n<hr>\n<h2>2. Details of the Submission</h2>\n<h3>2.1 How the original prompt was developed</h3>\n<h4>2.1.1 Error Analysis</h4>\n<p>I used an LLM that was more capable than gpt-oss-120b, because I expected it to analyze the responses \nmore accurately.However, a stronger LLM can also suggest solution methods that are too advanced for gpt-oss-120b to \nfollow.To avoid this, I also provided examples of correct responses generated by gpt-oss-120b.This helped me search for \neffective solution patterns that were still feasible for gpt-oss-120b to execute.</p>\n<h4>2.1.2 Motivation Behind My Analysis Framework</h4>\n<p>To reduce the risk of overfitting, I used a separate set of 50 problems outside the official competition data while improving the solution.\nThe goal was to avoid relying too heavily on the public leaderboard or the reference problems.</p>\n<p>When I started this experimental workflow, the public notebooks had already reached a very high score around 40/50. While it was impossible to know the exact individual accuracy for each of these 50 problems on the leaderboard, I envisioned the situation as follows:\n[Hypothesis]</p>\n<ul>\n<li>5 problems that are almost impossible to solve.</li>\n<li>10 problems that fluctuate between correct and incorrect.</li>\n<li>35 problems that are always answered correctly.</li>\n</ul>\n<p>Under these circumstances, if I relied solely on the public leaderboard score to evaluate whether my model was improving, I felt I would end up overfitting to just those 10 unstable problems. Given that the score calculations are heavily influenced by the inherent randomness of LLM text generation and problem ordering, I wanted to avoid placing too much emphasis on this metric.</p>\n<p>Since the final private evaluation would evaluate the models on completely unseen problems, my goal was to implement enhancements that targeted all branches of mathematics and various dimensions of difficulty. Using only 10 reference problems felt far too restrictive.</p>\n<p>Furthermore, I reasoned that analyzing the full-text content of the responses would allow me to discover ways to make the outputs even more stable for problems the model was already answering correctly. I believed this qualitative evaluation would alleviate the risk of overfitting.</p>\n<p>(I would like to express my utmost respect to the competitors who pushed the scores to such an incredibly high level around 40/50. Needless to say, the leaderboard score was a critically important metric for guiding the community's progress up to that point.)</p>\n<h3>2.2 What Was Tried and Didn't Work</h3>\n<p>During the development cycle, I explored several ideas that ultimately did not yield improvements and were discarded:</p>\n<ul>\n<li><strong>Intuition-based Prompting</strong>: Instructing the model to reason or answer in Japanese.</li>\n<li><strong>Two-Step Self-Correction</strong>: A prompt that forced a draft-then-finalize sequence.</li>\n<li><strong>Research-inspired Methods</strong>: I experimented with prompts inspired by \"Complexity-based Consistency\".</li>\n<li><strong>Expanding the Voting Pool</strong>: I tried scaling the parallel solver runs from 8 to 16. While some easy problems finished much faster, the answers that completed prematurely showed a slight degradation in precision, leading to an overall increase in errors.</li>\n</ul>\n<hr>\n<h2>3. Prompt</h2>\n<pre><code>    system_prompt = (\n        'You are a world-class mathematical problem solver.'\n        'The final answer is a non-negative integer in [0, 99999].'\n        'Return only the verified final answer in \\boxed{}.'\n        'Before solving, you must:'\n        '1) extract all explicit constraints from the problem,'\n        '2) identify the mathematical structure (algebra / number theory / combinatorics / geometry / functional equation),'\n        '3) choose a solution plan,'\n        '4) use Python for verification when symbolic reasoning is insufficient.'\n        'You must never guess.'\n        'If a candidate answer is found, verify it against all constraints before finalizing.'\n        'Prefer concise reasoning and avoid long unnecessary explanations.'\n    )\n\n    tool_prompt = (\n        'Use Python as a verification and search tool.'\n        'The environment is a stateful Jupyter notebook. '\n        'You must use print() to output results.'\n        'Always:'\n        '- print intermediate key values needed for verification,'\n        '- validate candidate answers against all stated constraints,'\n        '- avoid brute force unless the search space is explicitly bounded or pruned,'\n        '- estimate complexity before large loops,'\n        '- keep code minimal and robust.'\n    )\n\n    preference_prompt = ( \n        'Solve the problem with the following protocol:'\n        'Step 1: Extract constraints and target form.'\n        'Step 2: Derive reductions before coding (parity, modular constraints, bounds, symmetry, invariants, monotonicity, geometric relations, etc.).'\n        'Step 3: Use Python only for:'\n        '- checking candidate formulas,'\n        '- bounded search after pruning,'\n        '- validating edge cases,'\n        '- confirming the final answer.'\n        'Step 4: If using search, explain the pruning rule first.'\n        'Step 5: Before final output, verify:'\n        '- integer,'\n        '- in [0, 99999],'\n        '- all constraints satisfied.'\n        'Step 6: Return only the final verified answer in \\boxed{}.'\n        'Keep reasoning compact. Never guess. If verification fails, discard the candidate and continue.'\n    )\n</code></pre>\n<hr>\n<h3>Reference</h3>\n<ul>\n<li><strong>Baseline notebook</strong>: <a href=\"https://www.kaggle.com/code/zaynyu/40-50-gpt-oss-120b-tir-dynamictime-kernelpool\" target=\"_blank\">Link to Kaggle Code</a></li>\n<li><strong>Set of 50 hard math problems</strong>: <a href=\"https://www.kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3/discussion/672643\" target=\"_blank\">Link to Kaggle discussion</a></li>\n</ul>\n<hr>\n<h3>Competition Link</h3>\n<ul>\n<li><strong>Competition overview page</strong>: <a href=\"https://www.kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3/overview\" target=\"_blank\">Link</a></li>\n<li><strong>Competition data page</strong>: <a href=\"https://www.kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3/data\" target=\"_blank\">Link</a></li>\n</ul>\n<hr>\n<h3>[2026/05/31] Update</h3>\n<ul>\n<li>Added Google Colab version code to the Hugging Face page.</li>\n<li>Fixed a bug in the calculation result counter (added missing counts).</li>\n</ul>",
      "rawMarkdown": "# 3rd Place Solution for the AIMO3 Competition - Error Analysis & Prompt Engineering\n\n\nI participated in this competition primarily for my own learning and study. My submission is built upon a well-known public baseline notebook, and my primary goal was to improve the prompt design using an original, structured approach. \n\nCompared to other outstanding notebooks and comprehensive WriteUPs, I truly realize how much I still have to learn. However, I worked hard to analyze the competition's dynamics, design my own experimental framework, and iterate on improvements, so I would love to share my findings with the community.\n\nI plan to add some models and documentation in the coming days.\nAs I believe the presentation slides are much easier to read, I would highly appreciate it if you could read the attached presentation file.\n  \nBelow is a summary of the key points.\n\n\n---\n\n## 1. Overview of the Approach\n\n### 1.1 Models & Algorithms Used\nMy solution is based on the strong public baseline notebook shared by \"ZaynYu\". \n- **Core LLM**: I used `gpt-oss-120b` as-is without any additional fine-tuning or parameter training. The model is empowered with a Python code execution tool.\n- **Voting Mechanism**: I ran 8 parallel solver instances and selected the final integer answer via a majority vote.\n- **Time Control**: I kept the early-stopping rule from the public baseline, which dynamically allocates remaining time and stops early when a clear majority answer is reached among early solvers.\n\n### 1.2 Validation Strategy & Data Preprocessing\nTo improve the prompt without overfitting to the Public Leaderboard (LB) or the reference.csv set, I established an offline validation process:\n- **Data Collection**: I collected 1120 full-text LLM-generated answers.\n- **Dataset Composition**: This dataset included 32 runs per problem across the 10 official reference problems (320 samples) and 16 runs per problem across 50 external hard math problems shared by participants (800 samples).\n- **Analysis Workflow**: I extracted the full response text, problem context, and final answer correctness into a unified table (`llm_history.csv`). I then leveraged more capable LLMs to cross-check and categorize why `gpt-oss-120b` failed on incorrect instances.\n\n### 1.3 Prompt Design\nThe main improvement was in the prompt design. Specifically:\n1. **Use Python for Verification**: Based on patterns frequently observed in correct answers, I instructed the model to use Python for verification.\n2. **Check the Constraints**: Since I observed an error pattern where the model overlooked constraints stated in the problem, I explicitly instructed it to identify and check the constraints while solving.\n3. **Narrow the Search Space**: Since I also observed an error pattern where the model generated Python code with loops that were too large to finish within the time limit, I instructed it to narrow the search space appropriately.\n\n\n---\n\n## 2. Details of the Submission\n\n### 2.1 How the original prompt was developed\n\n#### 2.1.1 Error Analysis\nI used an LLM that was more capable than gpt-oss-120b, because I expected it to analyze the responses \nmore accurately.However, a stronger LLM can also suggest solution methods that are too advanced for gpt-oss-120b to \nfollow.To avoid this, I also provided examples of correct responses generated by gpt-oss-120b.This helped me search for \neffective solution patterns that were still feasible for gpt-oss-120b to execute.\n\n#### 2.1.2 Motivation Behind My Analysis Framework\nTo reduce the risk of overfitting, I used a separate set of 50 problems outside the official competition data while improving the solution.\nThe goal was to avoid relying too heavily on the public leaderboard or the reference problems.\n\nWhen I started this experimental workflow, the public notebooks had already reached a very high score around 40/50. While it was impossible to know the exact individual accuracy for each of these 50 problems on the leaderboard, I envisioned the situation as follows:\n[Hypothesis]\n- 5 problems that are almost impossible to solve.\n- 10 problems that fluctuate between correct and incorrect.\n- 35 problems that are always answered correctly.\n\nUnder these circumstances, if I relied solely on the public leaderboard score to evaluate whether my model was improving, I felt I would end up overfitting to just those 10 unstable problems. Given that the score calculations are heavily influenced by the inherent randomness of LLM text generation and problem ordering, I wanted to avoid placing too much emphasis on this metric.\n\nSince the final private evaluation would evaluate the models on completely unseen problems, my goal was to implement enhancements that targeted all branches of mathematics and various dimensions of difficulty. Using only 10 reference problems felt far too restrictive.\n\nFurthermore, I reasoned that analyzing the full-text content of the responses would allow me to discover ways to make the outputs even more stable for problems the model was already answering correctly. I believed this qualitative evaluation would alleviate the risk of overfitting.\n\n(I would like to express my utmost respect to the competitors who pushed the scores to such an incredibly high level around 40/50. Needless to say, the leaderboard score was a critically important metric for guiding the community's progress up to that point.)\n\n### 2.2 What Was Tried and Didn't Work\nDuring the development cycle, I explored several ideas that ultimately did not yield improvements and were discarded:\n- **Intuition-based Prompting**: Instructing the model to reason or answer in Japanese.\n- **Two-Step Self-Correction**: A prompt that forced a draft-then-finalize sequence.\n- **Research-inspired Methods**: I experimented with prompts inspired by \"Complexity-based Consistency\".\n- **Expanding the Voting Pool**: I tried scaling the parallel solver runs from 8 to 16. While some easy problems finished much faster, the answers that completed prematurely showed a slight degradation in precision, leading to an overall increase in errors.\n\n---\n## 3. Prompt\n```python\n    system_prompt = (\n        'You are a world-class mathematical problem solver.'\n        'The final answer is a non-negative integer in [0, 99999].'\n        'Return only the verified final answer in \\boxed{}.'\n        'Before solving, you must:'\n        '1) extract all explicit constraints from the problem,'\n        '2) identify the mathematical structure (algebra / number theory / combinatorics / geometry / functional equation),'\n        '3) choose a solution plan,'\n        '4) use Python for verification when symbolic reasoning is insufficient.'\n        'You must never guess.'\n        'If a candidate answer is found, verify it against all constraints before finalizing.'\n        'Prefer concise reasoning and avoid long unnecessary explanations.'\n    )\n    \n    tool_prompt = (\n        'Use Python as a verification and search tool.'\n        'The environment is a stateful Jupyter notebook. '\n        'You must use print() to output results.'\n        'Always:'\n        '- print intermediate key values needed for verification,'\n        '- validate candidate answers against all stated constraints,'\n        '- avoid brute force unless the search space is explicitly bounded or pruned,'\n        '- estimate complexity before large loops,'\n        '- keep code minimal and robust.'\n    )\n    \n    preference_prompt = ( \n        'Solve the problem with the following protocol:'\n        'Step 1: Extract constraints and target form.'\n        'Step 2: Derive reductions before coding (parity, modular constraints, bounds, symmetry, invariants, monotonicity, geometric relations, etc.).'\n        'Step 3: Use Python only for:'\n        '- checking candidate formulas,'\n        '- bounded search after pruning,'\n        '- validating edge cases,'\n        '- confirming the final answer.'\n        'Step 4: If using search, explain the pruning rule first.'\n        'Step 5: Before final output, verify:'\n        '- integer,'\n        '- in [0, 99999],'\n        '- all constraints satisfied.'\n        'Step 6: Return only the final verified answer in \\boxed{}.'\n        'Keep reasoning compact. Never guess. If verification fails, discard the candidate and continue.'\n    )\n```\n---\n### Reference\n- **Baseline notebook**: [Link to Kaggle Code](https://www.kaggle.com/code/zaynyu/40-50-gpt-oss-120b-tir-dynamictime-kernelpool)\n- **Set of 50 hard math problems**: [Link to Kaggle discussion](https://www.kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3/discussion/672643)\n\n---\n### Competition Link\n- **Competition overview page**: [Link](https://www.kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3/overview)\n- **Competition data page**: [Link](https://www.kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3/data)\n\n---\n### [2026/05/31] Update\n- Added Google Colab version code to the Hugging Face page.\n- Fixed a bug in the calculation result counter (added missing counts).",
      "votes": 9
    },
    {
      "id": 3463373,
      "postDate": "2026-05-26T18:24:45.893Z",
      "content": "<p>Nice write-up. The structured error analysis and constraint-focused prompt design were particularly interesting. Clear and practical approach.</p>",
      "rawMarkdown": "Nice write-up. The structured error analysis and constraint-focused prompt design were particularly interesting. Clear and practical approach.",
      "votes": -1
    },
    {
      "id": 3463420,
      "postDate": "2026-05-26T21:04:06.793Z",
      "content": "<p>The structure of this writeup is a step_by_step procedure which is best for learners </p>",
      "rawMarkdown": "The structure of this writeup is a step_by_step procedure which is best for learners ",
      "votes": -1
    },
    {
      "id": 3463276,
      "postDate": "2026-05-26T13:42:32.053Z",
      "content": "<p>Thanks for sharing. I didn't understand what u changes other than prompt</p>",
      "rawMarkdown": "Thanks for sharing. I didn't understand what u changes other than prompt",
      "replies": [
        {
          "id": 3463613,
          "postDate": "2026-05-27T12:47:13.723Z",
          "content": "<p>In the final submission notebook, I only changed the prompt. There are no other changes.</p>\n<p>Besides the prompt, I also experimented with parallel computation methods and voting systems, but I did not include them in the submission because the score appeared to decrease.</p>",
          "rawMarkdown": "In the final submission notebook, I only changed the prompt. There are no other changes.\n\nBesides the prompt, I also experimented with parallel computation methods and voting systems, but I did not include them in the submission because the score appeared to decrease.",
          "votes": 1,
          "replies": [
            {
              "id": 3463616,
              "postDate": "2026-05-27T13:04:17.280Z",
              "content": "<p>Hello <a href=\"https://www.kaggle.com/skobayak\" target=\"_blank\">@skobayak</a> did you manage to observe the variance in the winning submission on the public LB ?</p>",
              "rawMarkdown": "Hello @skobayak did you manage to observe the variance in the winning submission on the public LB ?"
            },
            {
              "id": 3464485,
              "postDate": "2026-05-30T00:41:55.650Z",
              "content": "<p>I submitted my final submission notebook three times, and the public LB scores were 36, 37, and 39. </p>\n<p>(If I am not mistaken, as the submission page display is a bit confusing…)</p>",
              "rawMarkdown": "I submitted my final submission notebook three times, and the public LB scores were 36, 37, and 39. \n\n(If I am not mistaken, as the submission page display is a bit confusing...)"
            }
          ]
        }
      ]
    },
    {
      "id": 3462748,
      "postDate": "2026-05-24T19:00:33.443Z",
      "content": "<p>Well done, thanks for the writeup.  Quite possible the prompt played a big factor in the win.  Will be interesting to see what the other projects did</p>",
      "rawMarkdown": "Well done, thanks for the writeup.  Quite possible the prompt played a big factor in the win.  Will be interesting to see what the other projects did"
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-20T04:26:54Z",
  "competition_id": 118448,
  "competition_slug": "ai-mathematical-olympiad-progress-prize-3",
  "team_id": 15030302,
  "solution_url": "/competitions/ai-mathematical-olympiad-progress-prize-3/writeups/3rd-place-solution-for-the-aimo3-competition"
}