{
  "id": 572908,
  "title": "A bronze for prompt engineering (Public: 20, Private: 24)",
  "content": "<p>At the time AIMO-1 was held last year, I was newly active on Kaggle &amp; didn't even think about joining. I almost skipped AIMO-2 as well, thinking I wasn't ready - but then decided to jump in with 9 days to go, thinking I still had time for 45 experiments. Imagine my shock when I found out that only 1 attempt was allowed per day. On top of that, I lost two attempts due to first not knowing, and then not remembering, that the GPU option wasn't persistent across reruns and edited versions of the same notebook. So in the end, I only got 7 shots, and had to restrict myself to fairly minor changes to a solid public notebook.</p>\n<p>The <a href=\"https://www.kaggle.com/code/yekenot/aimo-2-deepseek-r1-distill-qwen-7b-awq\" target=\"_blank\">notebook I chose</a> was by <a href=\"https://www.kaggle.com/yekenot\" target=\"_blank\">@yekenot</a> - it had scored 26 and I chose it above the 2 other public notebooks which scored 27, since I knew that <a href=\"https://www.kaggle.com/yekenot\" target=\"_blank\">@yekenot</a> produces solid ML code, and at least one of the other two was simply a lucky rerun of his notebook. It turned out that his code was in turn based on <a href=\"https://www.kaggle.com/code/huikang/deepseek-r1-distill-qwen-7b-awq\" target=\"_blank\">another notebook</a> by <a href=\"https://www.kaggle.com/huikang\" target=\"_blank\">@huikang</a>, so I owe a big thanks to both of them. </p>\n<p>I started out by simply rerunning the notebook with a different seed, and scored 23 instead of the expected 26. I experimented with various parameters like the temperature, maximum time per question, gpu memory utilization etc., but kept scoring between 20 and 23, only finally hitting 26 at the second last attempt with gpu_memory_utilization=0.99 and cutoff_time = start_time + (4 * 60 + 50) * 60. With only one attempt left, I decided to switch to deepseek_r1_distill_qwen_14b from deepseek_r1_distill_qwen_7b in order to hopefully achieve a more stable solution - but in my hurry, I ended up using qwen_14b (without deepseek), which was a big mistake and a total waste of my final attempt (public score: 15).</p>\n<p>When I saw the prompts in the baseline notebook, I was immediately struck by two things:</p>\n<ol>\n<li><p>Why were we telling the LLM that it was helpful and harmless, and that it was Qwen developed by Alibaba? Why should that help with solving Olympiad level math problems?</p></li>\n<li><p>Both prompts were essentially the same - perhaps we could gain something by mixing it up a bit?</p></li>\n</ol>\n<p>In order to see examples of successful relevant prompts, I checked out the top solutions for AIMO-1, and decided to adapt <a href=\"https://www.kaggle.com/competitions/ai-mathematical-olympiad-prize/discussion/518960\" target=\"_blank\">the prompting strategy of the 4th ranked team in AIMO-1</a>. This was essentially telling the LLM it was an expert mathematician, especially in solving olympiad level problems, and to solve each problem two ways - via chain of thought (COT), and by writing out code. The two prompts I used were:</p>\n<blockquote>\n  <p>\"You are an expert math skilled in solving challenging math problems, particularly those from the AMC and AIME. You will solve math problems step-by-step, explaining each step in detail for clarity. Ensure your solution is accurate and thorough, covering all necessary calculations and reasoning. Return final answer within \\boxed{}, after taking modulo 1000.\"<br>\n  and<br>\n  \"You are an expert math solver skilled in solving challenging math problems, particularly those from the AMC and AIME. Please write a python code based on sympy library to solve this maths problem. The code is complete, ready to run, contains every solution step, and is commented at key steps. And print the output result. After you get your final answer, take modulo 1000, and return the final answer within \\boxed{}.\"</p>\n</blockquote>\n<p>The immediate result was disappointing, resulting in a public score of only 20. But after the final results were announced, I was delighted to see that this prompting strategy scored 24 on the private leaderboard, and earned me a solo bronze. If there's an AIMO-3, I plan to join much earlier, and hope to do better. I'd like to end by congratulating all winners, and thanking everyone who contributed code and insights, especially <a href=\"https://www.kaggle.com/yekenot\" target=\"_blank\">@yekenot</a>, <a href=\"https://www.kaggle.com/huikang\" target=\"_blank\">@huikang</a>, and <a href=\"https://www.kaggle.com/zonglinhan\" target=\"_blank\">@zonglinhan</a> (and team).  Happy Kaggling, everyone!</p>",
  "comments": [
    {
      "id": 3402125,
      "author_name": "Simon Frieder",
      "author_url": "",
      "post_date": "2026-02-05T09:37:27.817000",
      "content": "<blockquote>\n  <p>if there's an AIMO-3, I plan to join much earlier, and hope to do better. </p>\n</blockquote>\n<p>Haven't seen you over at AIMO3 yet ;)</p>",
      "votes": 1,
      "replies": []
    }
  ],
  "comment_count": 1,
  "messages": [
    {
      "id": 3402125,
      "postDate": "2026-02-05T09:37:27.817Z",
      "content": "<blockquote>\n  <p>if there's an AIMO-3, I plan to join much earlier, and hope to do better. </p>\n</blockquote>\n<p>Haven't seen you over at AIMO3 yet ;)</p>",
      "rawMarkdown": "> if there's an AIMO-3, I plan to join much earlier, and hope to do better. \n\nHaven't seen you over at AIMO3 yet ;)",
      "votes": 1
    },
    {
      "id": 3177025,
      "postDate": "2025-04-12T05:43:53.007Z",
      "content": "<p>At the time AIMO-1 was held last year, I was newly active on Kaggle &amp; didn't even think about joining. I almost skipped AIMO-2 as well, thinking I wasn't ready - but then decided to jump in with 9 days to go, thinking I still had time for 45 experiments. Imagine my shock when I found out that only 1 attempt was allowed per day. On top of that, I lost two attempts due to first not knowing, and then not remembering, that the GPU option wasn't persistent across reruns and edited versions of the same notebook. So in the end, I only got 7 shots, and had to restrict myself to fairly minor changes to a solid public notebook.</p>\n<p>The <a href=\"https://www.kaggle.com/code/yekenot/aimo-2-deepseek-r1-distill-qwen-7b-awq\" target=\"_blank\">notebook I chose</a> was by <a href=\"https://www.kaggle.com/yekenot\" target=\"_blank\">@yekenot</a> - it had scored 26 and I chose it above the 2 other public notebooks which scored 27, since I knew that <a href=\"https://www.kaggle.com/yekenot\" target=\"_blank\">@yekenot</a> produces solid ML code, and at least one of the other two was simply a lucky rerun of his notebook. It turned out that his code was in turn based on <a href=\"https://www.kaggle.com/code/huikang/deepseek-r1-distill-qwen-7b-awq\" target=\"_blank\">another notebook</a> by <a href=\"https://www.kaggle.com/huikang\" target=\"_blank\">@huikang</a>, so I owe a big thanks to both of them. </p>\n<p>I started out by simply rerunning the notebook with a different seed, and scored 23 instead of the expected 26. I experimented with various parameters like the temperature, maximum time per question, gpu memory utilization etc., but kept scoring between 20 and 23, only finally hitting 26 at the second last attempt with gpu_memory_utilization=0.99 and cutoff_time = start_time + (4 * 60 + 50) * 60. With only one attempt left, I decided to switch to deepseek_r1_distill_qwen_14b from deepseek_r1_distill_qwen_7b in order to hopefully achieve a more stable solution - but in my hurry, I ended up using qwen_14b (without deepseek), which was a big mistake and a total waste of my final attempt (public score: 15).</p>\n<p>When I saw the prompts in the baseline notebook, I was immediately struck by two things:</p>\n<ol>\n<li><p>Why were we telling the LLM that it was helpful and harmless, and that it was Qwen developed by Alibaba? Why should that help with solving Olympiad level math problems?</p></li>\n<li><p>Both prompts were essentially the same - perhaps we could gain something by mixing it up a bit?</p></li>\n</ol>\n<p>In order to see examples of successful relevant prompts, I checked out the top solutions for AIMO-1, and decided to adapt <a href=\"https://www.kaggle.com/competitions/ai-mathematical-olympiad-prize/discussion/518960\" target=\"_blank\">the prompting strategy of the 4th ranked team in AIMO-1</a>. This was essentially telling the LLM it was an expert mathematician, especially in solving olympiad level problems, and to solve each problem two ways - via chain of thought (COT), and by writing out code. The two prompts I used were:</p>\n<blockquote>\n  <p>\"You are an expert math skilled in solving challenging math problems, particularly those from the AMC and AIME. You will solve math problems step-by-step, explaining each step in detail for clarity. Ensure your solution is accurate and thorough, covering all necessary calculations and reasoning. Return final answer within \\boxed{}, after taking modulo 1000.\"<br>\n  and<br>\n  \"You are an expert math solver skilled in solving challenging math problems, particularly those from the AMC and AIME. Please write a python code based on sympy library to solve this maths problem. The code is complete, ready to run, contains every solution step, and is commented at key steps. And print the output result. After you get your final answer, take modulo 1000, and return the final answer within \\boxed{}.\"</p>\n</blockquote>\n<p>The immediate result was disappointing, resulting in a public score of only 20. But after the final results were announced, I was delighted to see that this prompting strategy scored 24 on the private leaderboard, and earned me a solo bronze. If there's an AIMO-3, I plan to join much earlier, and hope to do better. I'd like to end by congratulating all winners, and thanking everyone who contributed code and insights, especially <a href=\"https://www.kaggle.com/yekenot\" target=\"_blank\">@yekenot</a>, <a href=\"https://www.kaggle.com/huikang\" target=\"_blank\">@huikang</a>, and <a href=\"https://www.kaggle.com/zonglinhan\" target=\"_blank\">@zonglinhan</a> (and team).  Happy Kaggling, everyone!</p>",
      "rawMarkdown": "At the time AIMO-1 was held last year, I was newly active on Kaggle & didn't even think about joining. I almost skipped AIMO-2 as well, thinking I wasn't ready - but then decided to jump in with 9 days to go, thinking I still had time for 45 experiments. Imagine my shock when I found out that only 1 attempt was allowed per day. On top of that, I lost two attempts due to first not knowing, and then not remembering, that the GPU option wasn't persistent across reruns and edited versions of the same notebook. So in the end, I only got 7 shots, and had to restrict myself to fairly minor changes to a solid public notebook.\n\nThe [notebook I chose](https://www.kaggle.com/code/yekenot/aimo-2-deepseek-r1-distill-qwen-7b-awq) was by @yekenot - it had scored 26 and I chose it above the 2 other public notebooks which scored 27, since I knew that @yekenot produces solid ML code, and at least one of the other two was simply a lucky rerun of his notebook. It turned out that his code was in turn based on [another notebook] (https://www.kaggle.com/code/huikang/deepseek-r1-distill-qwen-7b-awq) by @huikang, so I owe a big thanks to both of them. \n\nI started out by simply rerunning the notebook with a different seed, and scored 23 instead of the expected 26. I experimented with various parameters like the temperature, maximum time per question, gpu memory utilization etc., but kept scoring between 20 and 23, only finally hitting 26 at the second last attempt with gpu_memory_utilization=0.99 and cutoff_time = start_time + (4 * 60 + 50) * 60. With only one attempt left, I decided to switch to deepseek_r1_distill_qwen_14b from deepseek_r1_distill_qwen_7b in order to hopefully achieve a more stable solution - but in my hurry, I ended up using qwen_14b (without deepseek), which was a big mistake and a total waste of my final attempt (public score: 15).\n\nWhen I saw the prompts in the baseline notebook, I was immediately struck by two things:\n\n1. Why were we telling the LLM that it was helpful and harmless, and that it was Qwen developed by Alibaba? Why should that help with solving Olympiad level math problems?\n\n2. Both prompts were essentially the same - perhaps we could gain something by mixing it up a bit?\n\nIn order to see examples of successful relevant prompts, I checked out the top solutions for AIMO-1, and decided to adapt [the prompting strategy of the 4th ranked team in AIMO-1](https://www.kaggle.com/competitions/ai-mathematical-olympiad-prize/discussion/518960). This was essentially telling the LLM it was an expert mathematician, especially in solving olympiad level problems, and to solve each problem two ways - via chain of thought (COT), and by writing out code. The two prompts I used were:\n\n> \"You are an expert math skilled in solving challenging math problems, particularly those from the AMC and AIME. You will solve math problems step-by-step, explaining each step in detail for clarity. Ensure your solution is accurate and thorough, covering all necessary calculations and reasoning. Return final answer within \\\\boxed{}, after taking modulo 1000.\"\nand\n\"You are an expert math solver skilled in solving challenging math problems, particularly those from the AMC and AIME. Please write a python code based on sympy library to solve this maths problem. The code is complete, ready to run, contains every solution step, and is commented at key steps. And print the output result. After you get your final answer, take modulo 1000, and return the final answer within \\\\boxed{}.\"\n\nThe immediate result was disappointing, resulting in a public score of only 20. But after the final results were announced, I was delighted to see that this prompting strategy scored 24 on the private leaderboard, and earned me a solo bronze. If there's an AIMO-3, I plan to join much earlier, and hope to do better. I'd like to end by congratulating all winners, and thanking everyone who contributed code and insights, especially @yekenot, @huikang, and @zonglinhan (and team).  Happy Kaggling, everyone!",
      "votes": 9
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-20T06:43:30Z",
  "competition_id": 86023,
  "competition_slug": "ai-mathematical-olympiad-progress-prize-2",
  "team_id": 13548419,
  "solution_url": "/competitions/ai-mathematical-olympiad-progress-prize-2/writeups/optimistix-a-bronze-for-prompt-engineering-public-"
}