{
  "id": 692161,
  "title": "Adaptive Test-Time Optimization of gpt-oss-120b with TIR and CoT",
  "content": "<h1>Abstract</h1>\n<p>This writeup presents an advanced inference-time optimization strategy developed by the Potrhino team for the final evaluation of the AI Mathematical Olympiad (AIMO) Progress Prize 3, ranking 373rd out of 4,138. Recognizing that solving Olympiad-level mathematics under strict temporal and computational constraints nowadays is primarily an efficiency-bottlenecked task, we pivot from traditional model fine-tuning toward adaptive test-time orchestration. Leveraging the open-weight gpt-oss-120b model, our approach integrates:</p>\n<ul>\n<li><strong>Tool-Integrated Reasoning</strong> (TIR) in a high-precision environment with adaptive timeouts;</li>\n<li><strong>Dynamic time management</strong> across problem set;</li>\n<li>Lightweight role-based <strong>Chain-of-Thought</strong> (CoT) prompting with robust format recovery;</li>\n<li><strong>Self-Consistency</strong> with consensus-based early termination and confidence-/entropy-based tie-breaking;</li>\n<li><strong>Adaptive pruning</strong> of less promising reasoning paths. </li>\n</ul>\n<p>Through rigorous ablation studies, we demonstrate that the synergy of these techniques significantly elevates the model’s performance ceiling, achieving the following scores:</p>\n<ul>\n<li><strong>42.0/50</strong> on the AIMO3 Private Leaderboard;</li>\n<li><strong>43/50</strong> on the AIMO3 Public Leaderboard;</li>\n<li><strong>41/75</strong> on high-difficulty problems used for local validation.</li>\n</ul>\n<p>Our results establish that strategic resource management and deterministic tool augmentation can improve mathematical reasoning performance. To ensure full reproducibility, our code, environment configurations, and experimental logs are made publicly available.</p>\n<h1>1. Introduction</h1>\n<p>In recent years, <strong>Large Language Models</strong> (LLMs) have demonstrated remarkable proficiency across a broad spectrum of natural language tasks, evolving from fluent text generators into versatile problem solvers. Despite these advancements, complex mathematical reasoning remains a challenge, particularly at the Olympiad level. Proficiency in this domain is critical, as it serves as a cornerstone for solving intricate problems in fields ranging from advanced engineering to quantitative finance. While recent breakthroughs have seen <strong>Artificial Intelligence</strong> (AI) achieve human-level performance on <strong>International Mathematical Olympiad</strong> (IMO) problems, a notable performance gap persists between state-of-the-art closed-source models and their open-weight counterparts. </p>\n<p>The <strong>AI Mathematical Olympiad Progress Prize 3</strong> (AIMO3) [1] aims to bridge this divide by challenging participants to develop open-source algorithms and models capable of solving high-level mathematical problems under <strong>strict computational and time constraints</strong>. While AIMO Progress Prize 2 was won in April 2025 by Nvidia's NemoSkills team [2], AIMO3 utilizes entirely original problems to eliminate the risk of data contamination. Every ground-truth label is an integer within the range [0, 99999]. Submissions, consisting of <strong>Kaggle notebooks</strong>, are evaluated on a private test set of 50 math problems, where scoring is based on the consistency of two independent predictions: for each problem, a score of 1.0 is awarded if both answers are correct, 0.5 if only one is correct, and 0 otherwise. The competition enforces a rigorous offline environment, limiting execution to 5 hours on GPU-accelerated notebooks (H100, P100, or T4×2) or 12 hours on CPU-based notebooks. </p>\n<p>This writeup details the strategy presented by the Potrhino team, which achieved a score of <strong>43/50</strong> in the public evaluation. The proposed approach leverages the <strong>gpt-oss-120b</strong> [7] model on H100 hardware, integrating:</p>\n<ul>\n<li><strong>Tool-Integrated Reasoning</strong> (TIR) [3] in a high-precision environment;</li>\n<li><strong>Dynamic time management</strong> across problems;</li>\n<li>Lightweight role-based <strong>Chain-of-Thought</strong> (CoT) [4] prompting with robust format recovery;</li>\n<li><strong>Self-Consistency</strong> [5] with consensus-based early termination and confidence-/entropy-based tie-breaking;</li>\n<li><strong>Adaptive pruning</strong> of less promising reasoning paths, using concepts inspired by \"<strong>Deep Think with Confidence</strong>\" [6] framework. </li>\n</ul>\n<p>These methodologies are designed to <strong>optimize test-time inference</strong> under strict computational and time constraints. The following sections introduce the fundamental concepts, then describe the proposed strategy, and finally provide a comprehensive analysis of the results.</p>\n<h1>2. Related Work</h1>\n<h2>2.1. Tool-Integrated Reasoning [3]</h2>\n<p>While LLMs have evolved into versatile problem solvers, purely text-based reasoning often struggles with tasks requiring precise numerical computation, long-horizon search, or rigorous verification. To address these inherent limitations, <strong>Tool-Integrated Reasoning</strong> (TIR) has emerged as an increasingly adopted paradigm. By equipping LLMs with external tools, such as <strong>Python code interpreters</strong>, TIR effectively expands the model's capabilities and transcends the \"capability ceiling\" of purely linguistic inference.</p>\n<p>Recent research demonstrates that TIR-augmented models decisively <strong>outperform pure-text</strong> counterparts across challenging mathematical benchmarks. This performance gain is particularly evident in the <strong>pass@k</strong> metric, as the interpreter provides a deterministic execution environment that mitigates common calculation errors. Furthermore, this advantage extends beyond mere arithmetic. It also facilitates complex problem-solving strategies, such as brute-force search and algorithmic simulation, which would be intractably verbose or prone to failure in a standard autoregressive setup. </p>\n<p><em>Figure 1</em> shows pass@k curves for the TIR (RL-trained) and pure-text models (Qwen3 8B) across benchmarks: (a) AIME24, (b) AIME25 [3]. This illustrates how TIR provides a significant gain in accuracy on AIME problems, which makes it an ideal candidate for AIMO3.</p>\n<h5>Figure 1</h5>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F319f0b6de502290fff5b1b1f46194bf3%2FTIR_ACCURACY.png?generation=1776346717057232&amp;alt=media\" alt=\"\"></p>\n<h2>2.2. Chain-of-Thought Prompting [4]</h2>\n<p>While scaling the parameters of LLMs generally improves performance, scale alone is often insufficient for mastering complex arithmetic and symbolic reasoning. <strong>Chain-of-Thought</strong> (CoT) prompting addresses this limitation by eliciting a series of intermediate reasoning steps before arriving at a final conclusion. This approach offers several critical advantages for Olympiad-level mathematics:</p>\n<ul>\n<li><strong>Problem Decomposition</strong>: CoT allows the model to break down multi-step problems into manageable intermediate steps, effectively allocating more computational \"budget\" to high-complexity tasks.</li>\n<li><strong>Interpretability and Debugging</strong>: It provides a transparent window into the model’s reasoning path, facilitating the identification and correction of logical fallacies or calculation errors.</li>\n<li><strong>Versatility</strong>: CoT is applicable to a wide range of reasoning tasks, from abstract proof-based questions to symbolic manipulation.</li>\n<li><strong>Zero-Shot/Few-Shot Elicitation</strong>: Reasoning abilities can be readily activated in sufficiently large models via specialized prompting or few-shot exemplars.</li>\n</ul>\n<p>CoT transforms a model from a direct predictor into a systematic reasoner, enabling it to bridge the gap between problem understanding and the final output. <em>Figure 2</em> shows the solve rate of CoT and other prompting variations using LaMDA 137B and PaLM 540B on the GSM8K dataset [4]. This illustrates how CoT outperforms other prompting variations, highlighting its effectiveness in improving reasoning for math problems. However, CoT alone does not guarantee correctness, as errors can propagate across intermediate steps.</p>\n<h5>Figure 2</h5>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F13633ce68b5c9d7569e1b919b209264a%2FCoT_ACCURACY.png?generation=1776551872549459&amp;alt=media\" alt=\"\"></p>\n<h2>2.3. Self-Consistency [5]</h2>\n<p>A fundamental characteristic of complex problem-solving is the existence of multiple diverse reasoning paths that converge on the same correct solution. <strong>Self-Consistency</strong> leverages this intuition by replacing traditional greedy decoding with a sampling-based approach. The method involves generating a diverse set of reasoning paths and subsequently selecting the most consistent final answer by marginalizing out the sampled paths, a process commonly implemented as <strong>majority voting</strong>. This technique significantly enhances the robustness of CoT prompting. While an LLM may occasionally produce erroneous intermediate steps, incorrect reasoning paths are statistically less likely to converge on the same final value compared to valid logical sequences. Consequently, the correct answer tends to exhibit higher agreement across the sample population. Beyond raw accuracy gains, Self-Consistency provides two additional advantages:</p>\n<ul>\n<li><strong>Uncertainty Estimation</strong>: The agreement among sampled answers serves as a reliable proxy for the model's confidence in a given solution.</li>\n<li><strong>Calibration</strong>: It improves output reliability by filtering out stochastic \"hallucinations\" or calculation errors through consensus. </li>\n</ul>\n<p>A primary constraint of Self-Consistency is the increased test-time compute required. However, empirical evidence suggests that performance gains often saturate relatively quickly. Therefore, a strategically limited number of paths (e.g., k=5 or k=10) can capture the majority of the benefits without exceeding time limits. This trade-off is especially critical in constrained environments such as AIMO3, where inference budget is strictly limited. \n<em>Figure 3</em> shows how Self-Consistency improves accuracy across various reasoning tasks, using LaMDA-137B [5].</p>\n<h5>Figure 3</h5>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F5a7fdb7a5084e8f86210ad0329bbb23c%2FSelf_consistency_ACCURACY.png?generation=1776348545912708&amp;alt=media\" alt=\"\"></p>\n<h2>2.4. Deep Think with Confidence [6]</h2>\n<p>While parallel reasoning techniques like Self-Consistency enhance accuracy, they often encounter two primary bottlenecks: the linear scaling of inference overhead and diminishing returns caused by the equal weighting of all reasoning traces. Standard majority voting fails to account for quality variations, potentially allowing low-confidence or \"hallucinated\" traces to compromise the final output.\nTo address these limitations, the <strong>Deep Think with Confidence</strong> (DeepConf) methodology integrates confidence-aware filtering based on local token-level statistics. Unlike global measures that average confidence across an entire sequence, thereby masking localized reasoning failures, DeepConf monitors fluctuations at critical intermediate steps. This approach offers two distinct operational modes:</p>\n<ul>\n<li><strong>Offline Mode</strong>: Traces are filtered post-generation by aggregating entropy and confidence scores. This identifies and discards low-quality reasoning paths before the voting process, ensuring only robust chains contribute to the final consensus.</li>\n<li><strong>Online Mode</strong>: This mode enables real-time generation control and early stopping. By detecting low-confidence signals as they emerge, the system can prematurely terminate suboptimal traces, significantly reducing redundant token generation.</li>\n</ul>\n<p>Empirical results demonstrate that DeepConf not only improves accuracy by mitigating noise from low-quality traces but also optimizes resource allocation. In offline mode, DeepConf@512 achieves <strong>99.9%</strong> accuracy on AIME 2025 using gpt-oss-120b (without tools), effectively saturating the benchmark compared to 97.0% for cons@512 (consensus/majority voting) and 91.8% for pass@1. In online mode, DeepConf reduces token generation by up to 84.7% compared to standard parallel sampling while maintaining or exceeding baseline accuracy. This efficiency is critical for maximizing the number of effective reasoning paths under strict computational and time constraints. This idea directly inspired our adaptive pruning and early termination strategy. <em>Figure 4</em> shows the aforementioned results for both online and offline modes on AIME 2025 [6]. </p>\n<h5>Figure 4</h5>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F66b614b3c5d06a433690b0af1d1aeb5d%2FDeep_conf_ACCURACY.png?generation=1776348951716265&amp;alt=media\" alt=\"\"></p>\n<h2>2.5. gpt-oss-120b [7]</h2>\n<p><strong>gpt-oss-120b</strong> is an open-weight, reasoning-focused autoregressive model released under the Apache 2.0 license. Optimized for agentic workflows, it excels in instruction following, structured output generation, and tool integration (e.g., Python execution). The model architecture is a <strong>Mixture-of-Experts</strong> (MoE) Transformer, featuring 36 layers with a total of 116.8B parameters, of which 5.1B are active per token. The MoE weights are quantized to <strong>MXFP4</strong> format (4.25 bits per parameter), comprising over 90% of the total parameter count. This enables operation within the constraints of a single <strong>80GB GPU</strong> (such as the H100). The model was trained using the <strong>Harmony</strong> chat format, which utilizes specialized tokens for message boundaries and a role-based hierarchy to resolve instruction conflicts (<strong>System &gt; Developer &gt; User &gt; Assistant &gt; Tool</strong>). A distinctive feature of gpt-oss-120b is its support for three distinct reasoning levels (<strong>Low, Medium, and High</strong>), where higher levels correlate with increased <strong>CoT</strong> length and logical depth (as shown in <em>Figure 5</em> [7]).</p>\n<h5>Figure 5</h5>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fdfdbd0b9257ab6a1010135c1e9bef41c%2Fgpt-oss-cot.png?generation=1776349514505657&amp;alt=media\" alt=\"\"></p>\n<p>The model is natively trained to utilize a suite of agentic tools:</p>\n<ul>\n<li><strong>Python Tool</strong>: Enables code execution within a stateful Jupyter notebook environment, facilitating TIR.</li>\n<li><strong>Browsing Tool</strong>: Facilitates web interaction to improve factual accuracy beyond the knowledge cutoff (not used in this work due to offline constraints).</li>\n<li><strong>Custom Developer Functions</strong>: Allow for arbitrary function schemas defined via the Harmony format.</li>\n</ul>\n<p>By interleaving CoT with TIR, gpt-oss-120b achieves high accuracy on mathematical benchmarks (as illustrated in <em>Figure 6</em>) while maintaining rapid inference speed and efficient memory utilization. We selected gpt-oss-120b due to its strong reasoning capabilities, native support for tool use, and compatibility with single-GPU deployment under AIMO constraints.</p>\n<h5>Figure 6</h5>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F73d193171bc7b245bc1f3888488b99f3%2Fgpt-oss-benchmark_table.png?generation=1776349624566200&amp;alt=media\" alt=\"\"></p>\n<h1>3. Adaptive Test-Time Optimization of gpt-oss-120b with TIR and CoT</h1>\n<p>The primary challenge of the AIMO3 competition lies in developing an AI system capable of solving IMO-level mathematical problems under stringent time and computational constraints. While modern LLMs have shown increasing proficiency in this domain, success hinges on identifying the optimal <strong>trade-off</strong> between reasoning <strong>accuracy</strong> and execution <strong>latency</strong>. \nOur approach addresses this challenge by leveraging the <strong>gpt-oss-120b</strong> model as a high-capacity foundation and concentrating development efforts on <strong>test-time optimization</strong>. The overall approach is structured around a set of strategic pillars, with hyperparameters calibrated to balance robustness and efficiency, while remaining amenable to further fine-grained optimization. These pillars include:</p>\n<ul>\n<li><strong>Tool-Integrated Reasoning</strong> (TIR) in a <strong>high-precision environment</strong>;</li>\n<li><strong>Dynamic time management</strong> across problems;</li>\n<li><strong>Lightweight role-based CoT prompting</strong> with <strong>robust format recovery</strong>;</li>\n<li><strong>Self-Consistency</strong> with <strong>consensus-based early termination</strong> and <strong>confidence-/entropy-based tie-breaking</strong>;</li>\n<li><strong>Adaptive pruning of less promising reasoning paths</strong>, using concepts inspired by DeepConf framework. </li>\n</ul>\n<h2>3.1. gpt-oss-120b as a High-Capacity Foundation Model</h2>\n<p>We select the open-weight <strong>gpt-oss-120b</strong> model as the primary backbone. Given its strong baseline performance on mathematical benchmarks, further supervised fine-tuning (SFT) is deemed unnecessary. Specifically, the model achieves <strong>strong performance on AIME 2024 and AIME 2025</strong> [7] when utilizing the <strong>\"High\" CoT reasoning level</strong> combined with <strong>TIR</strong>. Beyond raw accuracy, the model aligns well with the competition's hardware and temporal constraints. Utilizing the MXFP4 quantized format, gpt-oss-120b <strong>fits comfortably within the VRAM of a single H100 GPU</strong>, maintaining high inference throughput despite its 120B parameters. Furthermore, the <strong>average response length for AIME 2025</strong> problems is reported to remain <strong>below 16k tokens</strong> [7], which supports an effective balance between depth of reasoning with execution speed. Consequently, we hypothesize that further SFT would yield diminishing returns relative to the substantial computational costs and the risk of increasing latency. This design choice also improves reproducibility, as it avoids reliance on additional proprietary training data or compute-intensive fine-tuning stages.</p>\n<h2>3.2. Tool-Integrated Reasoning (TIR) in a High-Precision Environment</h2>\n<p>The model's reasoning process is augmented by a <strong>Python tool</strong>, which can be invoked at any step of its reasoning chain. The model generates code blocks containing <code>print()</code> statements to retrieve intermediate results, which are then executed in a <strong>stateful Jupyter notebook</strong> environment. </p>\n<h3>3.2.1. Environment Configuration and Precision</h3>\n<p>To facilitate complex symbolic and numerical tasks, the execution environment is pre-configured with essential <strong>scientific libraries</strong> (e.g., <code>math, numpy, sympy</code>). To handle the rigorous demands of Olympiad-level problems, such as <strong>deeply nested recursion</strong>, operations involving <strong>very large integers</strong> or <strong>high-precision floating-point</strong> arithmetic, we increase the system’s default limits as follow:</p>\n<ul>\n<li><code>recursion_limit = 2000</code>;</li>\n<li><code>precision = 100000</code>;</li>\n<li><code>int_max_digits = 1000000</code>.</li>\n</ul>\n<h3>3.2.2. Long Output Management</h3>\n<p>To prevent <strong>long execution outputs</strong> from saturating the model’s context window, we implement a centralized <strong>truncation strategy</strong>. Outputs exceeding a predefined <strong>threshold</strong> (<code>L_max = 1000</code> characters) are clipped: only the initial and final <code>L_max/2</code> characters are preserved, separated by a <code>... TRUNCATED ...</code> marker. This ensures the model receives both the <strong>beginning and final portions of the output</strong> while discarding redundant intermediate iterations. This encourages more concise tool usage and provides the model with the segments of the output that typically contain the most relevant information. </p>\n<h3>3.2.3. Adaptive Timeouts</h3>\n<p>To ensure that inefficient or infinite loops do not deplete the problem's time budget, we implement an adaptive timeout strategy for code execution. This strategy balances the need for rapid feedback on simpler problems with the requirement for long-running computations on more complex ones: </p>\n<ul>\n<li><strong>Iterative Optimization</strong>: If a code execution triggers a timeout, the error is fed back into the model's context. This explicitly signals the model to optimize its algorithmic approach (e.g., moving from a brute-force to a more efficient mathematical simulation).</li>\n<li><strong>Exponential Backoff</strong>: Each consecutive timeout for a given problem allows for a slightly longer execution window for the subsequent attempt, capped at twice the initial duration. This prevents inefficient code from stalling the pipeline while still allowing complex computations to complete.</li>\n</ul>\n<p>The <strong>execution timeout</strong> for each call is determined by the following formula:</p>\n<p>$$Texec = \\min( \\min(Tinit \\cdot 1.3^n, 2 \\cdot Tinit), Tremaining )$$</p>\n<p>Where: </p>\n<ul>\n<li><code>Tinit</code> is the starting execution timeout (set to <code>8s</code>);</li>\n<li><code>n</code> is the number of consecutive timeouts for the current problem;</li>\n<li><code>Tremaining</code> is the residual time allocated to the specific problem.</li>\n</ul>\n<p>The selection of <code>Tinit=8s</code> and the growth factor of <code>1.3</code> is driven by an empirical balance between code complexity and session latency. A baseline of <code>8s</code> is sufficient for the majority of standard mathematical scripts (e.g., symbolic manipulations or short loops). The exponential scaling factor of <code>1.3</code> is specifically calibrated to allow the execution limit to double after exactly three consecutive timeouts. Capping the growth at <code>2 * Tinit</code> prevents unoptimized or runaway scripts from depleting the global time budget, which is a critical risk in time-constrained environments. Furthermore, we hypothesize that if a model fails to produce an efficient solution within three attempts (and nearly doubling the initial timeout), the bottleneck is likely structural rather than purely computational. Beyond this threshold, additional time yields diminishing returns, as the model is encouraged to shift toward an alternative reasoning strategy or a more efficient mathematical simulation rather than marginally optimizing failing code.\nThe interaction between the LLM and the execution environment is managed via a dedicated worker process; the detailed operational logic of this Jupyter worker is provided in <em>Algorithm 1</em> (see Appendix).</p>\n<h2>3.3. Dynamic Time Management Across Problems</h2>\n<p>The total execution time is partitioned across all 50 problems to ensure robustness against varying problem difficulties. After accounting for the initial setup overhead, including environment initialization and model loading, we implement a <strong>dynamic time-budgeting algorithm</strong>. The budget for a given problem, <code>Tp</code>, is determined by:</p>\n<p>$$Tp = \\max( \\min(Tpool, Tavg \\cdot Cmax), Tavg \\cdot Cmin )$$</p>\n<p>Where: </p>\n<ul>\n<li><code>Tpool</code> is the total remaining time after subtracting the reserved buffer for all future problems (<code>Tavg * Cmin</code> for each remaining problem);</li>\n<li><code>Tavg</code> represents the baseline allocation, calculated as the initial total available time divided by the total number of problems;</li>\n<li><code>Cmax</code> is a scaling constant for upper bound (2.1);</li>\n<li><code>Cmin</code> is a scaling constant for lower bound (0.86).</li>\n</ul>\n<p>This mechanism ensures that a single outlier (an extremely difficult problem) cannot deplete the resources required for the rest of the test set. Furthermore, it allows simpler problems to conclude early and return their unused budget to the global pool, thereby granting additional computational time to high-complexity cases without risking a global submission timeout.\nThe coefficients <code>Cmin</code> and <code>Cmax</code> were empirically selected to balance risk and performance. A <code>Cmin</code> of 0.86 ensures that even in the worst-case scenario, every problem is guaranteed approximately 85% of the baseline average time. Conversely, a <code>Cmax</code> of 2.1 allows the solver to spend more than double the average time on difficult problems without destabilizing the overall schedule. This upper bound was also found to be sufficient for the model to reach the maximum effective depth of its context window. This dynamic approach ensures that the \"time-to-solution\" is maximized for challenging problems while maintaining a zero-failure rate regarding the global 5-hour deadline. The detailed operational logic is provided in <em>Algorithm 2</em> (see Appendix).</p>\n<h2>3.4. Lightweight Role-Based CoT Prompting with Robust Format Recovery</h2>\n<p>The prompts used for solving mathematical problems are intentionally <strong>minimal</strong> and <strong>role-based</strong>. Since gpt-oss-120b is natively optimized for multi-level CoT reasoning, overly verbose or complex prompts can introduce unwanted bias or lead the model toward suboptimal reasoning paths. Instead, we leveraged the model's role-based hierarchy to enforce constraints while preserving its inherent problem-solving flexibility. The strategy is organized across following prompts:</p>\n<ul>\n<li><strong>System Role</strong> (Highest Priority): This prompt contains the most critical constraints that the model must follow literally. It defines the <strong>model's persona</strong> as a \"rigorous world-class math competitor\" and strictly dictates the <strong>output format</strong> (a single integer between 0 and 99999 within a \\boxed{} delimiter).</li>\n<li><strong>Developer Role</strong>: This role provides <strong>\"soft\" guidance</strong> rather than rigid instructions. The used prompt suggests a <strong>careful CoT approach</strong> and <strong>encourages the use of the Python tool</strong> for verification or complex calculations. We also included a directive to <strong>avoid guessing</strong> and provided a <strong>list of pre-installed libraries</strong> to streamline tool usage. While official OpenAI best practices suggest that CoT-style prompts are unnecessary for models with built-in reasoning, our empirical results with gpt-oss-120b show that CoT prompts increase the number of correct responses for hard problems, although they generally generate longer responses for simpler tasks. An evaluation of two versions of a previous notebook revealed that the CoT version achieved a score of 39 on the Public Leaderboard, while the non-CoT version achieved 37. Furthermore, in [6] the authors achieved 99.9% accuracy on AIME 2025 using gpt-oss-120b by specifically appending \"Please reason step by step, and put your final answer within \\boxed{}.\" to the user prompt. We explicitly avoided step-by-step prompting, which can lead to excessively verbose outputs at the 'High' reasoning level (a submission replacing \"carefully\" with \"step by step\" yielded a score of 38 on the Public Leaderboard). Using the word \"carefully\" provided the best tradeoff: it encourages precision, caution, and consistency without forcing the model into the extreme verbosity of a full \"step-by-step\" instruction. This approach can help to reduce errors on difficult problems while maintaining efficiency on simpler ones.</li>\n<li><strong>Tool Description</strong>: A synthetic prompt defines the execution environment as a <strong>stateful Jupyter notebook</strong> without internet access. It explicitly instructs the model to use <code>print()</code> for output, preventing empty execution results.</li>\n<li><strong>User Role</strong>: To avoid instruction confusion, the user role contains only the <strong>raw text of the mathematical problem</strong>.</li>\n</ul>\n<h3>3.4.1. Prompt Templates</h3>\n<p><strong>SYSTEM</strong>: \"<em>You are a rigorous world-class math competitor. You must return the final answer in \\boxed{}. The final answer must be a single integer (digits only) between 0 and 99999 inclusive.</em>\"</p>\n<p><strong>DEVELOPER</strong>: \"<em>Reason carefully to solve the problem and use the Python tool when necessary. You have access to math, numpy, sympy, mpmath, decimal, itertools, and pulp. Never guess.</em>\"</p>\n<p><strong>TOOL DESC</strong>: \"<em>Use this tool to execute Python code. The environment is a stateful Jupyter notebook. You must use print() to output results. Internet access is off.</em>\"</p>\n<p><strong>USER</strong>: \"<em>{problem}</em>\"</p>\n<h3>3.4.2. Format Recovery</h3>\n<p>To convert the model's natural language output into the required competition format, the system employs a <strong>multi-stage extraction pipeline</strong>. It first attempts to extract the answer within standard LaTeX delimiters. If no match is found, it falls back to a secondary search for internal tags typically generated by the model's final reasoning tokens. The extraction utilizes the following regular expressions:</p>\n<ul>\n<li><strong>Primary Regex</strong> (Standard):  <code>oxed\\s*\\{[^\\d-]*(-?[0-9,]+\\.?[0-9]*)[^\\d]*\\}</code></li>\n<li><strong>Fallback Regex</strong> (Internal Tag):  <code>assistantfinal\\s*[^\\n\\d-]*(-?[0-9,]+\\.?[0-9]*)[^\\d]*</code></li>\n</ul>\n<p>In cases where multiple matches occur within a single reasoning path, the system processes them in reverse chronological order (from the most recent to the first). This heuristic assumes that the model's final conclusion, often following a self-correction or a summary step, is more likely to be accurate than initial estimates. For each extracted candidate, a normalization function is applied to ensure compliance with the competition's constraints:</p>\n<ul>\n<li><strong>Sanitization</strong>: Commas (frequently used as thousands separators) are removed to prevent parsing errors.</li>\n<li><strong>Rounding and Casting</strong>: Candidates are rounded to the nearest integer to resolve floating-point artifacts or minor calculation residues from the Python tool.</li>\n<li><strong>Modular Arithmetic</strong>: A modulo <code>100,000</code> operation is applied. This ensures the output falls within the required <code>[0, 99999]</code> range, effectively handling cases where the model calculates a correct large value but omits the competition-specific modulus in its final response.</li>\n</ul>\n<p>A candidate is considered a valid final answer only if it results in an integer within the specified range. If a reasoning path concludes without a tool call and fails to yield a valid answer, a <strong>self-correction loop</strong> is triggered to <strong>recover a valid formatted answer</strong>. A follow-up prompt is appended to the conversation to guide the model:</p>\n<p><strong>USER</strong> (Recovery): \"<em>The previous response did not produce a valid final answer. Continue solving the problem. Remember that the final answer must be a single integer (digits only) between 0 and 99999 inclusive, and must be placed in \\boxed{}.</em>\"</p>\n<p>To prevent infinite loops and manage the time budget, this recovery attempt is limited to a single iteration; if a second failure occurs, the trace is terminated.</p>\n<h2>3.5. Self-Consistency with Consensus-Based Early Termination and Confidence-/Entropy-Based Tie-Breaking</h2>\n<p>Whereas our configuration supports a maximum concurrency of 7.52x, we initialize <strong>7 parallel reasoning paths per problem</strong> to maintain a stable and efficient Self-Consistency pipeline. To enhance accuracy and minimize computational redundancy, we implement an advanced <strong>voting</strong> mechanism that integrates <strong>confidence/entropy-based tie-breaking</strong>, <strong>consensus-driven early termination</strong>, and a <strong>fallback to tool outputs</strong>.</p>\n<h3>3.5.1. Confidence-/entropy-based tie-breaking</h3>\n<p>Starting from the second completed reasoning path, the system applies a <strong>majority vote</strong> each time a new answer is generated. In the event of a tie, where multiple candidates share the same maximum frequency, we apply a scoring metric to select the most reliable candidate (i.e., the one with the highest score). The score for a candidate answer <code>a</code>, denoted as <code>S</code>, is calculated as:</p>\n<p>$$S_{tie, a} = \\sum_{i \\in \\text{Paths}(a)} S_{a, i}$$</p>\n<p>Where <code>S</code> represents the individual score of reasoning path <code>i</code> that yielded answer <code>a</code>:</p>\n<p>$$S_{a, i} = p_i \\cdot (1 - H_{g, i}) \\cdot C_{g, i}$$</p>\n<p>Where:</p>\n<ul>\n<li><code>p</code> is a coefficient set to <code>0.75</code> if path <code>i</code> required Format Recovery (indicating a failure in the initial formatting), and <code>1.0</code> otherwise. As reported in the Main results section, paths requiring recovery are statistically less reliable.</li>\n<li><code>H</code> is the mean entropy of the entire reasoning path <code>i</code>, considering the top <code>20</code> tokens for each generation step (inspired by [6]):</li>\n</ul>\n<p>$$H_{g, i} = \\frac{\\sum_{t=1}^{L} \\sum_{j=1}^{20} - \\exp(lp_{t,j}) \\log_2(\\exp(lp_{t,j}))}{L \\cdot \\log_2(20)}$$</p>\n<ul>\n<li><code>C</code> is the mean confidence of the entire reasoning path <code>i</code> (inspired by [6]):</li>\n</ul>\n<p>$$C_{g, i} = \\exp\\left(\\frac{1}{L} \\sum_{t=1}^{L} lp_t\\right)$$</p>\n<ul>\n<li><code>lp</code> is the log-probability of the <code>j-th</code> top candidate token at generation step <code>t</code>;</li>\n<li><code>lp</code> is the log-probability of the token selected at generation step <code>t</code>;</li>\n<li><code>L</code> is the length of reasoning path, in tokens.</li>\n</ul>\n<h3>3.5.2. Consensus-Based Early Termination</h3>\n<p>To optimize the inference budget, the system evaluates the consensus of the leading answer after each vote. If the agreement among reasoning paths is sufficiently robust, the process terminates early. We define four hierarchical levels of consensus based on answer frequency, the number of active tasks, and the remaining time budget.</p>\n<ul>\n<li><strong>Strong Consensus</strong>: Triggered when an answer holds an absolute majority or a lead that cannot be mathematically overtaken by remaining tasks:\n<code>max_vote &gt; max(2, active_tasks/2) or max_vote &gt; still_running_tasks + second_high_frequency</code> </li>\n<li><strong>Uncontested Consensus</strong>: Triggered when the leader holds at least half of the active tasks and a clear margin over the second candidate:\n<code>max_vote &gt;= max(2, active_tasks // 2) and max_vote - 1 &gt; second_high_frequency</code></li>\n<li><strong>Mature Consensus</strong>: Activated after 50% of the problem's time budget has elapsed, requiring a leader with at least 2 votes:\n<code>max_vote &gt;= max(2, active_tasks // 2) and max_vote &gt; second_high_frequency and elapsed_time &gt; available_time * 0.5</code></li>\n<li><strong>Emergent Consensus</strong>: A lower-threshold trigger used after 75% of the time budget has passed to ensure a result is returned under uncertainty:\n<code>max_vote &gt;= max(2, active_tasks // 2 - 1) and max_vote - 1 &gt; second_high_frequency and elapsed_time &gt; available_time * 0.75</code></li>\n</ul>\n<p>Where:</p>\n<ul>\n<li><code>max_vote</code> is the frequency of the current best answer (max frequency among answers);</li>\n<li><code>active_tasks</code> includes both running tasks and completed tasks that have already produced a valid answer (i.e., excluding only those that terminated without producing a valid answer);</li>\n<li><code>still_running_tasks</code> is the number of still running tasks;</li>\n<li><code>second_high_frequency</code> is the frequency of the second best answer;</li>\n<li><code>available_time</code> is the available time for the current problem;</li>\n<li><code>elapsed_time</code> is the elapsed time from the start of the inference for the current problem.</li>\n</ul>\n<p>In all cases, at least 2 valid votes are required before triggering any consensus condition, to prevent early termination on potentially noisy single-path results.</p>\n<h3>3.5.3. Fallback to Tool Outputs</h3>\n<p>If all reasoning paths conclude without a valid formatted answer (often due to model timeouts during the final CoT steps), the system performs a vote on the last valid numerical output returned by the Python interpreter within each reasoning path. This fallback mechanism significantly improves robustness; empirical analysis shows that the model frequently computes the correct value via TIR (as shown in the Main results section) but may fail to encapsulate it in the required \\boxed{} format if the execution limit is reached.</p>\n<h2>3.6. Adaptive pruning of less promising reasoning paths</h2>\n<p>To optimize computational efficiency for problems requiring extended reasoning chains, we implement an <strong>early pruning strategy</strong> designed to <strong>terminate less promising reasoning paths</strong>, inspired by the DeepConf framework [6]. When the elapsed time for a problem reaches a predefined fraction of its allocated budget, and the number of active paths still exceeds a given threshold, the system evaluates all paths and prunes the lowest-scoring ones. This mechanism reallocates GPU resources to the remaining high-scoring paths, allowing them to reach greater logical depth within the residual time. In our implementation, pruning is triggered when the elapsed time exceeds <code>60%</code> of the allocated budget and more than 75% of the initial reasoning paths remain active.\nEach reasoning path <code>i</code> is evaluated using a composite score <code>S</code> that integrates global and local token-level statistics. The pruning score is defined as:</p>\n<p>$$S_i = p_i \\cdot (1 - H_{g, i}) \\cdot (1 - H_{tail, i}) \\cdot C_{g, i} \\cdot C_{tail, i}$$</p>\n<p>Where <code>p</code>, <code>H</code> and <code>C</code> are the same as defined in Section 3.5.1, while <code>H</code> and <code>C</code> are analogous to <code>H</code> and <code>C</code>, but are computed using only the last <code>2048</code> tokens of the reasoning path (inspired by [6]).</p>\n<p>This scoring function effectively penalizes paths exhibiting high uncertainty (entropy) or low probability (confidence). While global metrics (<code>H</code>, <code>C</code>) provide an overview of the path's stability, the inclusion of tail metrics (<code>H</code>, <code>C</code>) is critical for detecting real-time \"hallucinations\" or logical instabilities (e.g., repetitive loops) that often emerge late in the generation process. By monitoring these fluctuations, the system can terminate decaying reasoning chains and focus the remaining temporal budget on the most robust candidates, maximizing the effectiveness of the Self-Consistency pool under strict time constraints. These combined metrics improve the accuracy of identifying and pruning reasoning paths that are likely to produce incorrect answers (as shown in the Main Results section).</p>\n<h1>4. Main Results</h1>\n<p>The proposed methodology was implemented and evaluated within the Kaggle competition environment (Python notebook, snapshot of 2025-11-07) , leveraging an NVIDIA H100 GPU accelerator. The software stack relies on the following dependencies:</p>\n<ul>\n<li><strong>AIMO3 dataset</strong> [1]: Provides the official competition environment and reference problem sets.</li>\n<li><strong>gpt-oss-120b</strong> [7]: Serves as the foundational LLM for all inference tasks.</li>\n<li><strong>openai-harmony</strong> [8]: Ensures that inference-time chat templates remain fully consistent with the model’s original training format.</li>\n<li><strong>vLLM</strong> [9]: A high-throughput inference engine used to deploy the model efficiently on the H100 GPU, optimizing memory usage and generation latency.</li>\n<li><strong>NumPy</strong> [10]: Used for numerical operations and to resolve minor dependency conflicts.</li>\n<li><strong>PuLP</strong> [11]: Invoked via the Python tool for solving linear programming and mathematical optimization subproblems when required.</li>\n</ul>\n<p>The following sections describe the experimental setup in detail, including the local validation strategy, default hyperparameter configurations, and an in-depth analysis of performance across multiple experimental runs, with a particular focus on ablation studies, overall performance and comparison with state of the art.</p>\n<h2>4.1. System Architecture and Execution Logic</h2>\n<p>The gpt-oss-120b model is loaded into GPU memory at the beginning of execution and persists throughout the entire inference process. To accelerate the initialization phase, model artifacts are first copied into RAM using multiprocessing, <strong>reducing load time from approximately 900s to ~250s</strong>. During this stage, all environment variables required for vLLM optimization and logging are configured.\nTo ensure strict compliance with competition time constraints and to prevent resource contention, the system’s core logic is decoupled into isolated processes using the multiprocessing library. These processes communicate via standardized queues, enabling robust and fault-tolerant execution.\nThe overall architecture is organized as follows:</p>\n<ul>\n<li><strong>Main Process</strong>: Responsible for global configuration, LLM deployment, initialization of the Python tool environment, and dynamic time management across the problem set. It executes a high-level control loop that orchestrates problem ingestion and final result collection.</li>\n<li><strong>Inference Engine</strong>: Each problem is handled using a dedicated thread pool that manages parallel reasoning paths. These threads interact with an OpenAI-compatible inference API (via vLLM), stream responses in real time, monitor elapsed time for early termination, and implement pruning of low-scoring paths. This component also handles log-probability extraction, final answer parsing, and computation of performance metrics.</li>\n<li><strong>Agentic Integration</strong>: The inference process interleaves text generation with Python tool execution. Each reasoning path is associated with a stateful Jupyter notebook instance running in a separate process, ensuring full isolation.</li>\n</ul>\n<p>Detailed pseudocode for system orchestration and inference workflows is provided in <em>Algorithm 3</em> and <em>Algorithm 4</em> in the Appendix.</p>\n<h2>4.2. Validation Dataset</h2>\n<p>For local testing, validation, and hyperparameter optimization, we employ a high-quality mathematical reasoning dataset comprising <strong>75 problems</strong>. This benchmark was specifically curated for the AIMO3 competition, with a focus on evaluating reasoning reliability through executable Python-based TIR (see <code>imo-benchmark.csv</code> in [15]). In alignment with the competition requirements, each problem is associated with a ground-truth integer answer within the range <code>[0, 99999]</code>.\nThe primary motivation for selecting this dataset is its high level of difficulty. This complexity is critical for accurately measuring performance gains during the optimization process. In contrast to simpler benchmarks, where many problems can be solved through shallow reasoning, this dataset provides a strong discriminative signal, enabling a clear assessment of the effectiveness of advanced reasoning strategies and test-time optimization techniques.</p>\n<h2>4.3. Hyperparameters and Experimental Configuration</h2>\n<p>Several parameters were inspired by high-performing public notebooks [12][13][14], which achieved strong results on both reference problems and the public leaderboard. To evaluate the individual contribution of each optimization strategy, we perform a series of controlled experimental runs. Each run isolates a specific component by disabling it while keeping all other parameters constant, following a standard ablation study methodology.\nThe primary hyperparameters used across all runs are summarized in <em>Table 1</em> in the Appendix. While the validation set consists of 75 problems (compared to 50 in the public/private leaderboard), the configuration remains identical to our final competition submission, with the total time budget scaled proportionally (7.5 hours for validation vs. 5 hours for submission).</p>\n<p>Additional vLLM optimizations were applied to reduce latency and memory overhead, including chunked prefill, prefix caching, asynchronous scheduling, and reduced CUDA graph capture size and sequence limits. Standard values were retained for top_p and top_k. All runs in Section 4.4 use this configuration unless otherwise specified. Additional implementation details are available in the submission notebook ([16] refers to the submission notebook, [17] refers to required dependencies, [21] refers to Google Colab version of submission notebook).</p>\n<h2>4.4. Experimental Runs and Comparative Settings</h2>\n<p>To rigorously evaluate the impact of each architectural component, we conducted a series of experimental runs, described in <em>Table 2</em>. Each run is based on the \"final_submission\" configuration, with the deactivation of a specific feature to isolate its effect on performance, except for the \"baseline\" run, where all new optimizations are disabled, and the \"time_constraints_disabled\", where only time constraints are removed.</p>\n<h5>Table 2: Experimental Runs</h5>\n<table>\n<thead>\n<tr>\n<th>Run Name</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>time_constraints_disabled</td>\n<td>Removes time constraints to the final submission to assess the model's unconstrained capability ceiling</td>\n</tr>\n<tr>\n<td>final_submission</td>\n<td>Configuration used for the final submission, including all optimizations</td>\n</tr>\n<tr>\n<td>early_break_disabled</td>\n<td>Disables dynamic pruning of low-scoring reasoning paths</td>\n</tr>\n<tr>\n<td>early_termination_disabled</td>\n<td>Disables the consensus-driven early termination mechanism</td>\n</tr>\n<tr>\n<td>medium_reasoning</td>\n<td>Reduces the reasoning level of gpt-oss-120b from HIGH to MEDIUM</td>\n</tr>\n<tr>\n<td>dynamic_time_management_disabled</td>\n<td>Uses static time allocation (average time per problem instead of dynamic time management)</td>\n</tr>\n<tr>\n<td>python_tool_disabled</td>\n<td>Uses pure Chain-of-Thought (CoT) reasoning without Python tool integration</td>\n</tr>\n<tr>\n<td>baseline</td>\n<td>Baseline before new optimizations</td>\n</tr>\n</tbody>\n</table>\n<p>The <strong>baseline</strong> run represents the most advanced configuration achievable using standard practices within the competition's constraints, characterized by:</p>\n<ul>\n<li><strong>Chain-of-Thought</strong> (CoT): Utilization of the native \"HIGH\" reasoning level of gpt-oss-120b;</li>\n<li><strong>Self-Consistency</strong>: A standard <code>k=7</code> parallel sampling approach with majority voting;</li>\n<li><strong>Time Allocation</strong>: Static average time per problem;</li>\n<li><strong>Pure Linguistic Inference</strong>: Deactivation of the Python tool integration, dynamic pruning of low-scoring reasoning paths, and consensus-driven early termination mechanism.</li>\n</ul>\n<p>It is important to note that while gpt-oss-120b natively supports Tool-Integrated Reasoning (TIR), the official implementation (requiring gpt-oss&gt;=0.0.5 and Python 3.12) proved incompatible with the Kaggle H100 environment (Python 3.11.13). Consequently, the baseline represents the model's unassisted reasoning limit, while our work introduces a custom-built, compatible TIR orchestration layer.</p>\n<p>Each run generates a detailed telemetry log capturing key metrics for every reasoning path (runs are available in [18], while generated logs are available in [19]). These logs are aggregated and analyzed to compute per-run performance statistics as well as global reasoning trends, which are presented in the following charts and tables (statistics and charts logic are available in [20]).</p>\n<h2>4.5. Experimental Results and Analysis</h2>\n<p>The following sections present a detailed analysis of the performance metrics obtained from the experimental runs described above. Results are evaluated across multiple dimensions, including ablation studies designed to isolate the contribution of each component and overall accuracy compared against the state-of-the-art baseline.\nIn particular, we analyze how individual test-time optimization strategies affect final accuracy. These results provide a comprehensive view of the system’s behavior, demonstrating how each component contributes to solving complex mathematical problems under strict time and resource constraints.</p>\n<h3>4.5.1. Ablation Studies</h3>\n<p>This section mainly evaluates the individual contribution of each optimization strategy to the overall system performance. By systematically deactivating specific components, we isolate their impact on accuracy, providing empirical justification for the architectural choices described in Section 3.</p>\n<h4>4.5.1.1. Distribution of Reasoning Path Outcomes per Experimental Run</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fa534f8cf678921b130b1bd54de970db6%2Fof%20incomplete%20wrong%20and%20correct%20reasoning%20paths%20per%20run.png?generation=1776729740190033&amp;alt=media\" alt=\"\">\nThe chart illustrates the distribution of incomplete, incorrect, and correct reasoning paths across the different experimental configurations. This global metric aggregates all individual traces generated for every problem, regardless of the final consensus answer.\nThe data demonstrates that TIR and dynamic time management significantly improve the yield of correct reasoning paths. Conversely, the HIGH reasoning level is primarily responsible for reducing the incidence of logical fallacies and incorrect outputs. The early break logic provides a marginal gain in the number of correct paths by reallocating resources to more promising chains.\nAs expected, removing time constraints altogether results in the highest proportion of correct paths, establishing the model's theoretical \"capability ceiling.\" Interestingly, disabling consensus-based early termination appears to slightly increase the count of correct paths; however, this is likely an artifact of redundant computations on simpler problems that would have otherwise terminated early, rather than a genuine improvement in solving more complex tasks.</p>\n<h4>4.5.1.2. Comparative Accuracy Metrics: pass@7, cons@7, and conf_cons@7</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F9503d0ccc3e12c6632d7d4bfb4711391%2Fpass7%20cons7%20and%20conf_conf7%20accuracy%20per%20run.png?generation=1776729780368012&amp;alt=media\" alt=\"\">\nThe chart compares three distinct accuracy metrics across each experimental run:</p>\n<ul>\n<li><strong>pass@k</strong> (k=7): Indicates the probability that at least one of the 7 reasoning paths produces the correct answer. This serves as the upper bound of the model's potential.</li>\n<li><strong>cons@k</strong> (k=7): Represents the accuracy achieved through standard majority voting among the 7 paths.</li>\n<li><strong>conf_cons@k</strong> (k=7): Our proposed metric which, while following the majority voting logic, employs the confidence- and entropy-based tie-breaking mechanism described in Section 3.5.1 when a consensus is not reached.</li>\n</ul>\n<p>The results demonstrate that the conf_cons@7 metric consistently outperforms the standard cons@7, although a gap remains compared to the pass@7 theoretical maximum. Consistent with previous observations, Python tool integration provides the most significant accuracy gain. However, each supplementary technique contributes to a cumulative improvement in the final score, most notably the dynamic time management and HIGH reasoning level, followed by the incremental gains from early break and early termination logic. Finally, removing time constraints establishes a higher accuracy ceiling, confirming that the model's performance is currently limited more by the inference budget than by its intrinsic reasoning capabilities.</p>\n<p>Regarding the gain provided by the Python tool integration, while the used validation set employed is tool-oriented, the benefits of TIR will partially transfer to more \"abstract\" domains, albeit with a shift in how the tool is utilized. For instance:</p>\n<ul>\n<li>Symbolic Algebra &amp; Geometry: By leveraging libraries like sympy, the model can offload complex algebraic manipulations or coordinate geometry calculations to a deterministic solver. This minimizes \"calculation drift\" in long CoT sequences, where models often make small sign errors or arithmetic slips.</li>\n<li>Verification, not just Solution: Even in proof-based or symbolic problems, TIR acts as a powerful verifier. The model can write scripts to test specific cases or validate intermediate numerical properties, providing a feedback loop that pure CoT lacks.</li>\n<li>Logical Structuring: Writing code forces the model to decompose abstract problems into discrete, executable steps. This \"algorithmic thinking\" often helps maintain a coherent logical flow even in pure proof tasks, reducing the likelihood of circular reasoning or vague hand-waving.</li>\n</ul>\n<p>As for the performance gains driven by dynamic time management, there is room for further optimization. As reported in Section 3.3., it is based on the scaling constants <code>Cmin</code> and <code>Cmax</code>. Initially, the parameter <code>Cmax=2.1</code> was empirically selected to allow the model to reach its maximum effective context window depth on difficult problems. The following table summarizes additional configurations evaluated during the final phases of the competition:</p>\n<table>\n<thead>\n<tr>\n<th>Cmin</th>\n<th>Cmax</th>\n<th>Public LB Scores</th>\n<th>Mean Score</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>0.88</td>\n<td>2.2</td>\n<td>37</td>\n<td>37.0</td>\n</tr>\n<tr>\n<td>0.86</td>\n<td>2.1</td>\n<td>39, 37, 38, 43</td>\n<td>39.25 (Final Submission)</td>\n</tr>\n<tr>\n<td>0.85</td>\n<td>2.0</td>\n<td>36</td>\n<td>36.0</td>\n</tr>\n<tr>\n<td>0.80</td>\n<td>2.0</td>\n<td>39</td>\n<td>39.0</td>\n</tr>\n<tr>\n<td>0.80</td>\n<td>2.1</td>\n<td>42, 41</td>\n<td>41.5</td>\n</tr>\n</tbody>\n</table>\n<p>While the selected final submission (<code>Cmin=0.86</code>, <code>Cmax=2.1</code>) achieved the highest peak score of 43/50, subsequent analysis suggests that a lower floor (<code>Cmin=0.80</code>) paired with <code>Cmax=2.1</code> yields a more stable mean performance (41.5).\nThe configuration <code>(0.80, 2.1)</code> was identified very close to the competition deadline, consequently, we prioritized the <code>(0.86, 2.1)</code> configuration for the final submission as it had already demonstrated high-ceiling potential in earlier runs.\nThese results indicate that performance is sensitive to the <code>Cmin</code> floor. A lower <code>Cmin</code> grants the system more flexibility to reallocate time from \"easy\" problems to \"hard\" ones, whereas an excessively high <code>Cmax</code> may lead to diminishing returns if the model exceeds its useful reasoning depth.</p>\n<p>Mathematical reasoning tasks are sensitive to problem ordering and stochastic sampling, and variance estimates are crucial to distinguish architectural gains from statistical noise. The experimental runs were conducted near the competition deadline to provide a reproducible and objective summary of each technique’s behavior on a high-difficulty public dataset. We acknowledge that these specific local runs reflect a single execution. Due to the significant computational intensity—each 75-problem run requiring approximately 7.5 hours on an NVIDIA H100 GPU—and strict hardware availability constraints, conducting multiple full-scale repetitions was not feasible within the remaining timeframe. \nHowever, the significance of the observed performance gaps is supported by the following factors:</p>\n<p></p><ul>\n<li>Noise Reduction by Design: We utilized a 75-problem \"High-Difficulty\" dataset to provide a more discriminative signal than standard benchmarks. Furthermore, Dynamic Time Management mitigates variance related to problem ordering by optimizing resource allocation, while Self-Consistency (<code>k=7</code>) reduces the impact of stochastic sampling.</li>\n<li>Consistency with Historical Evidence: The performance trends in our ablation studies align with the findings from months of internal testing and Public Leaderboard submissions. In every run, the removal of core components (TIR, HIGH reasoning level, or Dynamic Time Management) resulted in a logical and consistent degradation of accuracy.</li>\n<li>Public Leaderboard Correlation: To provide a broader perspective on variance, we compared the Public LB scores of our \"Final Submission\" against the \"Early Break Disabled\" configuration (the configuration with the smallest accuracy gap in local tests, 0.55 vs 0.51).<p></p>\n<table>\n<thead>\n<tr>\n<th>Notebook Configuration</th>\n<th>Public LB Scores</th>\n<th>Mean Score</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Final Submission</td>\n<td>39, 37, 38, 43</td>\n<td>39.25</td>\n</tr>\n<tr>\n<td>Early Break Disabled</td>\n<td>36, 38</td>\n<td>37</td>\n</tr>\n<tr>\n<td></td></tr></tbody></table></li></ul>\n\n\n\n\nAs shown, the Final Submission consistently maintains a higher mean score on the Public Leaderboard, mirroring the gap observed in our local experimental runs. The substantial gap between the Baseline (17/75) and the Final Submission (41/75) in local validation represents a nearly 2.4x improvement. Such a significant margin strongly suggests that the gains are driven by architectural optimizations rather than mere stochastic fluctuations.\n\n\n\n\nWhile we agree that additional runs would further refine these estimates, the convergence of local results, Public Leaderboard data, and ablation consistency provides strong evidence for the effectiveness of the proposed techniques.\n\n\n\n\n\n<h4>4.5.1.3. Effectiveness of Error Detection Metrics for Path Pruning</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fd6b8d4ef1100854418395f55909038a5%2FCorrect%20selection%20of%20wrong%20answers%20()%20by%20chosing%20the%20worst%20value%20of%20different%20metrics.png?generation=1776729854362148&amp;alt=media\" alt=\"\">\nThis chart evaluates the capability of different token-level metrics to correctly identify incorrect reasoning paths within \"ambiguous\" problems (defined as those where the model generated both correct and incorrect answers). By selecting the path with the worst value for a given metric, we measure how frequently that metric successfully points to a wrong answer.\nThe results indicate that tail entropy is the most reliable indicator of a failing reasoning chain, achieving the highest precision in identifying incorrect paths. This is followed by global mean entropy, tail confidence, and mean confidence. These findings empirically justify the composite \"early_break_score\" used in our pruning logic (Section 3.6). By using this metric, the system can effectively detect late-stage hallucinations or logical instabilities, allowing for the strategic termination of suboptimal paths and the reallocation of computational budget to more promising candidates.</p>\n<h4>4.5.1.4. Tie-breaking Success Rate by Metric Aggregation</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fb9ceb877d71d35ec7b4cefa680537dc2%2FTie-breaking%20success%20rate%20()%20per%20summed%20metric.png?generation=1778966896557181&amp;alt=media\" alt=\"\">\nThis chart illustrates the effectiveness of various metrics when used to resolve ties in \"ambiguous\" problems (those containing both correct and incorrect paths where no clear majority exists). The success rate is measured by selecting the answer with the highest aggregate score, where the score is the sum of the metric values across all paths yielding that specific answer.\nWhile the selected final submission utilized a tie_break_score based on global mean confidence and global mean entropy (Section 3.5.1), subsequent analyses reveal that alternative metrics may offer superior discriminative power. In particular, incorporating local confidence bottlenecks and reasoning-path length can produce substantially stronger tie-breaking performance.</p>\n<table>\n<thead>\n<tr>\n<th>Metric</th>\n<th>Formula</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Revised tie_break_score_A</td>\n<td>$$(1 - \\text{length_perc}) \\cdot \\text{min_conf}$$</td>\n</tr>\n<tr>\n<td>Revised tie_break_score_B</td>\n<td>$$\\text{tie_break_score} \\cdot (1 - \\text{length_perc}) \\cdot \\text{min_conf}$$</td>\n</tr>\n<tr>\n<td>Revised tie_break_score_C</td>\n<td>$$\\text{tie_break_score} \\cdot (1 - \\text{length_perc}) \\cdot \\text{min_conf} \\cdot \\text{tail_conf}$$</td>\n</tr>\n</tbody>\n</table>\n<p>Here, <code>length_perc</code> denotes the ratio between the generated response length and the model context limit (response_length / max_model_len).\nThese results suggest that localized confidence failures are more informative than global averages. Metrics such as mean_conf and mean_entropy can remain relatively stable even when a reasoning trajectory contains a critical logical error. In contrast, min_conf and tail_conf act as bottleneck indicators: a single low-confidence transition often coincides with a hallucinated deduction or unstable reasoning step and can act as a \"pivot point\" leading to reasoning divergence.\nThe inverse correlation between reasoning-path length and correctness is also notable. For Olympiad-style mathematical problems, successful solutions tend to emerge from relatively concise reasoning chains, whereas excessively long trajectories are more likely to exhibit reasoning drift, repetition, or self-inconsistent exploration.\nThese results suggest that combining global stability metrics with local confidence statistics and trajectory-length regularization may provide a more robust tie-breaking strategy for adaptive reasoning systems.</p>\n<h4>4.5.1.5. Reliability Analysis of the Format Recovery Mechanism</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F81ad1a4852a908d9f57d0444e443ab52%2FCorrect%20and%20wrong%20answers%20()%20which%20used%20format-recovery%20mechanism.png?generation=1776730054933917&amp;alt=media\" alt=\"\">\nThe chart illustrates the distribution of correct and incorrect answers for reasoning paths that required the Format Recovery mechanism during inference. The data reveals a significant correlation between formatting failures and logical errors: reasoning paths necessitating recovery are nearly twice as likely to produce an incorrect answer compared to those that adhere to the requested format natively. This empirical evidence justifies our decision to incorporate a penalty coefficient for recovered paths within both the tie-breaking and early-break scoring functions (Sections 3.5.1 and 3.6). By discounting these structurally weaker traces, the system increases the probability of selecting the most robust and consistent reasoning chains as the final output.</p>\n<h4>4.5.1.6. Accuracy of the Tool-Output Fallback Mechanism</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F86ad830e51b650eff4617779595a3d12%2FGuessed%20correct%20answers%20()%20by%20last%20tool%20valid%20execution.png?generation=1776730097700401&amp;alt=media\" alt=\"\">\nThis chart evaluates the correspondence between the final valid integer output from the Python interpreter and the ground-truth answer across all reasoning path of experimental runs. The data demonstrates that utilizing the last valid tool output as a fallback is a highly effective strategy for problems that reach the execution timeout before a formal conclusion can be generated.\nIn many high-complexity cases, the model successfully computes the correct value via a tool call in the final stages of reasoning, but lacks the remaining temporal budget to synthesize the final Chain-of-Thought (CoT) and the required LaTeX formatting. \nOn the 75-problem validation set, excluding the python_tool_disabled and baseline ablations (which do not use the Python tool), the tool-output fallback mechanism was triggered 45 times in total. A fallback event occurs when all 7 reasoning paths fail to produce a correctly formatted final answer, but at least one reasoning path generated a valid numerical result during a Python tool execution. Among these 45 fallback activations, the mechanism recovered the correct answer 3 times, corresponding to a conditional accuracy of approximately 6.67% once the fallback fires.\nAlthough the conditional success rate is relatively low, the fallback was intentionally designed as a last-resort recovery mechanism rather than a primary selection strategy. In these cases, the standard extraction and aggregation pipeline had already failed completely, meaning that without the fallback the system would deterministically output an incorrect answer. Consequently, even a small number of successful recoveries translates directly into measurable score improvements. Importantly, the fallback introduces essentially no additional inference-time cost, since it only reuses numerical outputs already produced during earlier Python tool executions rather than generating new reasoning trajectories. This empirically justifies our implementation of a consensus-based vote on tool outputs (Section 3.5.3) when no reasoning path reaches a natural termination within the allotted time.</p>\n<h4>4.5.1.7. Aggregate Token Generation and Reasoning Length</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fbd19d9e9ea9f5db56bf1b739f841a479%2FGlobal%20length%20of%20reasoning%20paths%20per%20run.png?generation=1776730147413787&amp;alt=media\" alt=\"\">\nThe chart illustrates the total length (in tokens) of all reasoning paths generated across each experimental run. The following observations can be made:</p>\n<ul>\n<li><strong>Reasoning Depth</strong>: The MEDIUM reasoning level demonstrates significantly higher conciseness, as expected, though at the cost of the logical depth required for Olympiad-level problems.</li>\n<li><strong>Computational Efficiency</strong>: The integration of the Python tool and early break logic markedly reduces the total token count. TIR allows the model to outsource complex calculations to a deterministic interpreter rather than performing verbose step-by-step arithmetic. Simultaneously, the early break mechanism prunes suboptimal paths, preventing the waste of the inference budget on low-probability outcomes.</li>\n<li><strong>Resource Optimization</strong>: Conversely, consensus-based early termination and dynamic time management may increase the total token generation. Without early termination, the system would remain idle or complete redundant traces instead of initiating inference on the next problem with maximum parallelism. Furthermore, dynamic management allows more difficult problems to reach their full reasoning potential rather than being prematurely terminated by a static timeout, thereby maximizing the utilization of the available context window.</li>\n</ul>\n<h3>4.5.2. Overall Performance and Comparison with State of the Art</h3>\n<p>The integration of the strategies discussed in the previous sections culminated in a robust mathematical solver. This framework effectively raised the model's capability ceiling by optimizing the inference process. To quantify this gain, we compared our final submission against a standard state-of-the-art (SOTA) baseline. This baseline represents the most advanced configuration achievable using standard practices within the competition's constraints, as described in Section 4.4.</p>\n<p>In local validation (on selected hard problems), our final submission achieved a score of <strong>41/75</strong>, which increased to <strong>47/75</strong> when time constraints were removed. In comparison, the initial baseline score was <strong>17/75</strong>.</p>\n<p>On the AIMO3 Public Leaderboard, our selected final submission achieved a maximum score of <strong>43/50</strong> and a mean score of <strong>39.25/50</strong> (based on four submissions with range 37-43). </p>\n<p>On the AIMO3 Private Leaderboard, our selected final submission achieved a score of <strong>42.0/50</strong>, ranking 373rd out of 4,138.</p>\n<p>These results could be further improved by increasing the number of parallel paths per problem and expanding the context window on more powerful hardware.</p>\n<h1>5. Conclusion and Future Work</h1>\n<p>In this work, we presented a novel strategy designed for the AIMO3 competition. By integrating a custom-built, fault-tolerant Tool-Integrated Reasoning (TIR) layer with adaptive test-time optimizations, including dynamic time management, lightweight role-based CoT prompting with robust format recovery, Self-Consistency with consensus-based early termination and confidence-/entropy-based tie-breaking, adaptive pruning of less promising reasoning paths, we successfully extended the mathematical reasoning capabilities of the gpt-oss-120b model.\nOur experimental results demonstrate that the bottleneck in automated mathematical problem-solving often lies in the efficiency of the inference process, rather than just the model's intrinsic knowledge. The transition from a standard baseline to our optimized strategy yielded a significant performance gain, confirming that a deterministic execution environment paired with strategic test-time optimizations can achieve state-of-the-art results.\nMoving forward, we identify several promising avenues for improvement:</p>\n<ul>\n<li><strong>Hyperparameter Optimization</strong>: While the current parameters were derived empirically, future work will focus on a more rigorous tuning process. Additionally, combining voting techniques that utilize different sampling parameters could further stabilize predictions.</li>\n<li><strong>Process-based Reward Models</strong> (PRM): Integrating learned reward models could refine pruning and tie-breaking logic, allowing the system to detect subtle logical fallacies that current token-level or entropy-based metrics might miss.</li>\n<li><strong>Multi-model Ensembles</strong>: Exploring architectures where different specialized models collaborate via the same orchestration layer could establish a new performance ceiling for automated mathematical reasoning.</li>\n</ul>\n<h1>References</h1>\n<p>[1] Simon Frieder, Sam Bealing, Philip Vonderlind, Sida Li, Arsenii Nikolaiev, Geoff C. Smith, Kevin Buzzard, Timothy Gowers, Peter J. Liu, Po-Shen Loh, Lester Mackey, Leonardo de Moura, Dan Roberts, D. Sculley, Terence Tao, David Balduzzi, Simon Coyle, Alex Gerko, Ryan Holbrook, Addison Howard, and XTX Markets. AI Mathematical Olympiad - Progress Prize 3. <a href=\"https://kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3\" target=\"_blank\">https://kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3</a>, 2025. Kaggle.</p>\n<p>[2] Ivan Moshkov, Darragh Hanley, Ivan Sorokin, Shubham Toshniwal, Christof Henkel, Benedikt Schifferer, Wei Du, Igor Gitman. AIMO-2 Winning Solution: Building State-of-the-Art Mathematical Reasoning Models with OpenMathReasoning dataset, 2025. URL <a href=\"https://arxiv.org/pdf/2504.16891\" target=\"_blank\">https://arxiv.org/pdf/2504.16891</a>.</p>\n<p>[3] Heng Lin and Zhongwen Xu. Understanding Tool-Integrated Reasoning, 2025. URL <a href=\"https://arxiv.org/pdf/2508.19201\" target=\"_blank\">https://arxiv.org/pdf/2508.19201</a>.</p>\n<p>[4] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed H. Chi, Quoc V. Le, Denny Zhou. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models, 2023. URL <a href=\"https://arxiv.org/pdf/2201.11903\" target=\"_blank\">https://arxiv.org/pdf/2201.11903</a>.</p>\n<p>[5] Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed H. Chi, Sharan Narang, Aakanksha Chowdhery, Denny Zhou. Self-consistency improves chain of thought reasoning in language models, 2023. URL <a href=\"https://arxiv.org/pdf/2203.11171\" target=\"_blank\">https://arxiv.org/pdf/2203.11171</a>.</p>\n<p>[6] Yichao Fu, Xuewei Wang, Yuandong Tian, Jiawei Zhao. Deep think with confidence, 2025. URL <a href=\"https://arxiv.org/pdf/2508.15260\" target=\"_blank\">https://arxiv.org/pdf/2508.15260</a>.</p>\n<p>[7] OpenAI. gpt-oss-120b &amp; gpt-oss-20b Model Card, 2025. URL <a href=\"https://arxiv.org/pdf/2508.10925\" target=\"_blank\">https://arxiv.org/pdf/2508.10925</a>, <a href=\"https://huggingface.co/openai/gpt-oss-120b\" target=\"_blank\">https://huggingface.co/openai/gpt-oss-120b</a>, <a href=\"https://www.kaggle.com/models/danielhanchen/gpt-oss-120b/Transformers/default/1\" target=\"_blank\">https://www.kaggle.com/models/danielhanchen/gpt-oss-120b/Transformers/default/1</a>.</p>\n<p>[8] openai-harmony 0.0.8. URL <a href=\"https://pypi.org/project/openai-harmony/0.0.8/\" target=\"_blank\">https://pypi.org/project/openai-harmony/0.0.8/</a>.</p>\n<p>[9] vllm 0.11.2. URL <a href=\"https://pypi.org/project/vllm/0.11.2/\" target=\"_blank\">https://pypi.org/project/vllm/0.11.2/</a>, <a href=\"https://docs.vllm.ai/projects/recipes/en/latest/OpenAI/GPT-OSS.html#troubleshooting\" target=\"_blank\">https://docs.vllm.ai/projects/recipes/en/latest/OpenAI/GPT-OSS.html#troubleshooting</a>, <a href=\"https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken\" target=\"_blank\">https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken</a>, <a href=\"https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken\" target=\"_blank\">https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken</a>.</p>\n<p>[10] numpy 2.2.0. URL <a href=\"https://pypi.org/project/numpy/2.2.0/\" target=\"_blank\">https://pypi.org/project/numpy/2.2.0/</a>.</p>\n<p>[11] PuLP 3.3.0. <a href=\"https://pypi.org/project/PuLP/3.3.0/\" target=\"_blank\">https://pypi.org/project/PuLP/3.3.0/</a></p>\n<p>[12] ShelterW. [Way to 30+/50] GPT-OSS - w/ python tool. URL <a href=\"https://www.kaggle.com/code/shelterw/way-to-30-50-gpt-oss-w-python-tool?scriptVersionId=285192299\" target=\"_blank\">https://www.kaggle.com/code/shelterw/way-to-30-50-gpt-oss-w-python-tool?scriptVersionId=285192299</a></p>\n<p>[13] Andreas Bisiadis. AIMO 3 | GPT-OSS-120B (with tools). URL <a href=\"https://www.kaggle.com/code/andreasbis/aimo-3-gpt-oss-120b-with-tools?scriptVersionId=290379281\" target=\"_blank\">https://www.kaggle.com/code/andreasbis/aimo-3-gpt-oss-120b-with-tools?scriptVersionId=290379281</a></p>\n<p>[14] parthenos. [44/50] LET ME (over)COOK!!!. URL <a href=\"https://www.kaggle.com/code/nihilisticneuralnet/44-50-skill-optional-luck-zaroori?scriptVersionId=291499043\" target=\"_blank\">https://www.kaggle.com/code/nihilisticneuralnet/44-50-skill-optional-luck-zaroori?scriptVersionId=291499043</a></p>\n<p>[15] wenliangtlh. AIMO3-High-Difficulty-Tool-Calling-Dataset. URL <a href=\"https://www.kaggle.com/datasets/wenliangtlh/aimo3-high-difficulty-tool-calling-dataset\" target=\"_blank\">https://www.kaggle.com/datasets/wenliangtlh/aimo3-high-difficulty-tool-calling-dataset</a></p>\n<p>[16] Potrhino. AIMO3-v3, version 11 (final submission notebook). URL <a href=\"https://www.kaggle.com/code/potrhino/aimo3-v3?scriptVersionId=302225896\" target=\"_blank\">https://www.kaggle.com/code/potrhino/aimo3-v3?scriptVersionId=302225896</a></p>\n<p>[17] Potrhino. AIMO3-dependencies-v1, version 10 (dependencies of final submission notebook). URL <a href=\"https://www.kaggle.com/code/potrhino/aimo3-dependencies-v1?scriptVersionId=297334166\" target=\"_blank\">https://www.kaggle.com/code/potrhino/aimo3-dependencies-v1?scriptVersionId=297334166</a></p>\n<p>[18] Potrhino. AIMO3-v3-v11-runs (validation runs notebook for main results). URL <a href=\"https://www.kaggle.com/code/potrhino/aimo3-v3-v11-runs?scriptVersionId=313133192\" target=\"_blank\">https://www.kaggle.com/code/potrhino/aimo3-v3-v11-runs?scriptVersionId=313133192</a></p>\n<p>[19] Potrhino. AIMO3-local-logs (validation results dataset). URL <a href=\"https://www.kaggle.com/datasets/potrhino/aimo3-local-logs\" target=\"_blank\">https://www.kaggle.com/datasets/potrhino/aimo3-local-logs</a></p>\n<p>[20] Potrhino. AIMO3-v3-v11-results (validation stats &amp; charts notebook). URL <a href=\"https://www.kaggle.com/code/potrhino/aimo3-v3-v11-results?scriptVersionId=313200617\" target=\"_blank\">https://www.kaggle.com/code/potrhino/aimo3-v3-v11-results?scriptVersionId=313200617</a></p>\n<p>[21] Potrhino. potrhino-aimo3-v3.ipynb (Google Colab version of final submission notebook). <a href=\"https://colab.research.google.com/drive/1vXAcdEiVcTM7oeQTFcsZsfQ6-ms33TK5?usp=sharing\" target=\"_blank\">https://colab.research.google.com/drive/1vXAcdEiVcTM7oeQTFcsZsfQ6-ms33TK5?usp=sharing</a></p>\n<h1>Appendix</h1>\n<h2>Table 1: Hyperparameters</h2>\n<table>\n<thead>\n<tr>\n<th>Param</th>\n<th>Value</th>\n<th>Note</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>device</td>\n<td>cuda</td>\n<td>Enables NVIDIA H100 GPU acceleration required to run gpt-oss-120b</td>\n</tr>\n<tr>\n<td>dtype</td>\n<td>auto</td>\n<td>Uses default precision (bfloat16)</td>\n</tr>\n<tr>\n<td>kv-cache-dtype</td>\n<td>fp8_e4m3</td>\n<td>Reduces memory footprint vs. bf16, enabling higher parallelism with negligible precision loss</td>\n</tr>\n<tr>\n<td>gpu_memory_utilization</td>\n<td>0.97</td>\n<td>Maximizes GPU memory usage during inference</td>\n</tr>\n<tr>\n<td>max_model_len</td>\n<td>64*1024</td>\n<td>Balances reasoning depth and VRAM constraints</td>\n</tr>\n<tr>\n<td>enable_tool</td>\n<td>True</td>\n<td>Enables Python tool usage during reasoning</td>\n</tr>\n<tr>\n<td>reasoning</td>\n<td>HIGH</td>\n<td>Activates the highest CoT reasoning level</td>\n</tr>\n<tr>\n<td>temperature</td>\n<td>1.0</td>\n<td>Balances stochasticity for diverse Self-Consistency sampling</td>\n</tr>\n<tr>\n<td>min_p</td>\n<td>0.02</td>\n<td>Filters low-probability tokens while preserving diversity</td>\n</tr>\n<tr>\n<td>reasoning_paths</td>\n<td>7</td>\n<td>Number of parallel reasoning paths for majority voting</td>\n</tr>\n<tr>\n<td>max_time</td>\n<td>int(5<em>60</em>60<em>1.5 - 3.5</em>60)</td>\n<td>Total available time budget</td>\n</tr>\n<tr>\n<td>problems_number</td>\n<td>50+25</td>\n<td>Total number of problems in validation</td>\n</tr>\n<tr>\n<td>enable_dynamic_time_management</td>\n<td>True</td>\n<td>Enables adaptive per-problem time allocation</td>\n</tr>\n<tr>\n<td>min_time_coef</td>\n<td>0.86</td>\n<td>Lower bound for time allocation scaling</td>\n</tr>\n<tr>\n<td>max_time_coef</td>\n<td>2.1</td>\n<td>Upper bound for time allocation scaling</td>\n</tr>\n<tr>\n<td>top_logprobs</td>\n<td>20</td>\n<td>Used to compute entropy based on top-20 token probabilities [6]</td>\n</tr>\n<tr>\n<td>group_logprobs_len</td>\n<td>2048</td>\n<td>Window size for tail entropy/confidence estimation [6]</td>\n</tr>\n<tr>\n<td>enable_early_break</td>\n<td>True</td>\n<td>Enables pruning of low-scoring reasoning paths</td>\n</tr>\n<tr>\n<td>execution_timeout</td>\n<td>8</td>\n<td>Initial execution timeout (seconds) for Python tool calls</td>\n</tr>\n<tr>\n<td>max_tool_step</td>\n<td>200</td>\n<td>Maximum number of tool calls per reasoning path</td>\n</tr>\n<tr>\n<td>max_tool_output_len</td>\n<td>1000</td>\n<td>Maximum tool output length before truncation</td>\n</tr>\n<tr>\n<td>max_tool_error</td>\n<td>5</td>\n<td>Maximum number of tool errors before environment reset</td>\n</tr>\n<tr>\n<td>precision</td>\n<td>100000</td>\n<td>Numerical precision for Python tool environment</td>\n</tr>\n<tr>\n<td>int_max_digits</td>\n<td>1000000</td>\n<td>Maximum integer size supported for Python tool environment</td>\n</tr>\n<tr>\n<td>recursion_limit</td>\n<td>2000</td>\n<td>Maximum recursion depth for Python tool environment</td>\n</tr>\n<tr>\n<td>enable_early_termination</td>\n<td>True</td>\n<td>Enables consensus-based early termination</td>\n</tr>\n</tbody>\n</table>\n<h2>Algorithm 1: Python Tool Execution Process</h2>\n<pre><code>    Initialize Jupyter kernel session\n    Configure Environment:\n        - Pre-import libraries (math, numpy, sympy, etc.)\n        - Set high float precision and integer max_digits\n        - Increase recursion depth limit\n\n    While True:\n        Receive {Python_code, available_time} from Main Process\n\n        If Python_code is None:\n            Shutdown Kernel and Exit\n\n        If Python_code is \"CLEAN\":\n            Restart Jupyter Kernel and re-initialize environment\n            Return empty confirmation\n\n        Else:\n            # Determine execution limit using Adaptive Timeout logic\n            T_limit = Calculate_Timeout(available_time, consecutive_timeouts)\n\n            # Execute code in the stateful session\n            Output = Execute_in_Jupyter(Python_code, timeout=T_limit)\n\n            # Post-process Output (Output Length Control)\n            If length(Output) &gt; THRESHOLD:\n                Output = Truncate_Center(Output, max_length=THRESHOLD)\n\n            Return Output\n</code></pre>\n<h2>Algorithm 2: Dynamic time management</h2>\n<pre><code>    #Init constants\n    START_TIME = time.now() \n    ...initialization logic...\n    INIT_OVERHEAD = time.now() - START_TIME\n    TOTAL_CLOCK = int(5*60*60 - 3.5*60) #5 hours with a safety margin of 3.5 minutes (in seconds)\n    DEADLINE = START_TIME + TOTAL_CLOCK\n    TOTAL_PROBLEMS = 50\n    C_min = 0.86 \n    C_max = 2.1 \n    T_avg = (TOTAL_CLOCK - INIT_OVERHEAD) / TOTAL_PROBLEMS \n\n    #Main loop\n    processed_problems = 0\n    for each incoming problem P:\n        # Reserve time for all future problems\n        remaining_problems = TOTAL_PROBLEMS - processed_problems - 1\n        reserved_buffer = remaining_problems * (T_avg  * C_min)\n        # Calculate current budget\n        T_pool = DEADLINE - time.now() - reserved_buffer\n        # Apply elastic constraints\n        available_time = max( min(T_pool, T_avg * C_max), T_avg * C_min )\n        # Final problem consumes all remaining time\n        if remaining_problems == 0:\n            available_time = DEADLINE - time.now()\n        #Solve the problem within available_time\n        solve(P, time_limit=available_time)\n        processed_problems += 1\n</code></pre>\n<h2>Algorithm 3: Main process logic</h2>\n<pre><code>    Init global configurations\n    Spawn Process \"PM\": Load LLM into memory\n    Spawn Process Pool \"PTP\": Stateful Python Tool environments (one per parallel path)\n\n    For each incoming problem \"P\":\n        If \"P\" is None: \n            Shutdown \"PTP\" pool and \"PM\" process\n            Break\n\n        Compute available time \"T\" # Via Dynamic Time Management logic\n        Init \"AG\": List for valid reasoning path answers\n        Init \"ATG\": List for fallback tool-only answers\n        Init Stop Event \"S\": For early termination\n        Init Global Metrics \"GM\": For cross-thread pruning/scoring\n\n        Start Thread Pool \"TP\":\n            Execute parallel inference on \"P\" using \"PM\" (LLM) and \"PTP\" (Tools)\n\n        Init \"best_answer\" to 0\n        Init \"max_vote\" to 0\n        For each completed thread \"j\" in \"TP\":\n            Get response metrics \"A_j\"\n            If \"A_j\" contains a valid extracted answer:\n                Add \"A_j\" to \"AG\"\n                # Update Best Answer and relative vote using Self-Consistency + Tie-Break\n                \"best_answer\", \"max_vote\" = SmartVote(\"AG\")\n\n                If Consensus-Based Early Termination criteria met:\n                    Signal Stop Event \"S\" to halt remaining threads\n                    Break\n            Else:\n                # Fallback: check if the last Python tool output is a valid number\n                If \"AT_j\" contains valid tool result:\n                    Add \"AT_j\" to \"ATG\"\n\n        # Final Fallback: If no reasoning path finished, vote on Tool outputs\n        If \"max_vote\" == 0 and \"ATG\" is not empty:\n            \"best_answer\", \"max_vote\" = SmartVote(\"ATG\")\n\n        Shutdown Thread Pool \"TP\" (cleanup)\n        Return \"best_answer\"\n</code></pre>\n<h2>Algorithm 4: Thread-Level Inference Logic</h2>\n<pre><code>    Init conversation \"C\" with role-based prompts and tool definitions\n    Init \"available_steps\" = 200\n    Init \"FormatRecoveryEnabled\" = True\n    Init \"response_text\", \"logprobs\", \"top_logprobs\" as empty\n\n    While \"available_steps\" &gt; 0:\n        If context_window_exhausted: # Safety margin of 4096 to allow final answer/tool output\n            Break  \n\n        Open Response Stream \"RS\" from LLM\n        For each chunk in \"RS\":\n            If Stop_Event \"S\" is set or global_time_limit reached:\n                Break\n\n            Update \"response_text\", \"logprobs\", and \"top_logprobs\"\n\n            # Adaptive Pruning Check (every 2048 tokens)\n            If Pruning_Enabled and tokens_since_last_check &gt; 2048:\n                Compute reasoning metrics (Entropy/Confidence)\n                Update Global Metrics \"GM[i]\"\n                If pruning_criteria_met: # Based on elapsed time, active tasks and relative score\n                    Break\n\n        If Stop_Event \"S\" is set: Break\n\n        Extract Numerical Answer \"A_j\"\n        If \"A_j\" is valid: \n            Break # Success: Answer found\n\n        if global_time_limit reached or pruning_criteria_met:\n            break\n\n        Update conversation \"C\" with current reasoning step (reasoning, tool call)\n\n        If current response contains a Tool Call:   \n            Extract generated Python code\n            Execute code in Jupyter session \"PTP[i]\" -&gt; Get result \"RES\"\n            Update conversation \"C\" with Tool Output\n            If \"RES\" is a valid integer answer:\n                Save as Fallback Tool Answer \"AT_j\"\n        Else: # No tool call and no valid answer found\n            If \"FormatRecoveryEnabled\":\n                Update \"C\" with a new User Prompt for Format recovery\n                \"FormatRecoveryEnabled\" = False # Only one recovery attempt allowed\n            Else:\n                Break # Failed to recover format\n\n        \"available_steps\" -= 1\n\n    Clean Jupyter Session \"PTP[i]\"\n    Compute final response metrics (Mean/Tail Entropy, Confidence, etc.)\n    Return Metrics and Candidate Answers (\"A_j\", \"AT_j\")\n</code></pre>",
  "comments": [
    {
      "id": 3459195,
      "author_name": "Potrhino",
      "author_url": "",
      "post_date": "2026-05-17T13:29:30.877000",
      "content": "<p>Edited on May 17th 2026 for the rebuttal phase:</p>\n<ul>\n<li><strong>Abstract &amp; Section 4.5.2</strong>: Added the official Private Leaderboard score and final ranking.</li>\n<li><strong>Section 3.4</strong>: Expanded the discussion on the empirical use of CoT-style prompting versus non-CoT alternatives for gpt-oss-120b, reporting key performance trade-offs on the Public Leaderboard.</li>\n<li><strong>Section 4.5.1.2</strong>: <ul>\n<li>Added a qualitative discussion addressing the generalization of Tool-Integrated Reasoning (TIR) benefits to abstract, non-tool-oriented domains (e.g., symbolic algebra, geometry proofs) through formalization and verification loops.</li>\n<li>Integrated detailed hyperparameter configurations for the dynamic time-management system (analyzing <code>Cmin</code> and <code>Cmax</code> variants) and provided a dedicated ablation study table comparing their Public LB mean scores.</li>\n<li>Expanded the discussion on the statistical significance of local results, adding a direct correlation table between local validation and Public Leaderboard configurations (including the Early Break Disabled run, which is the configuration with the smallest accuracy gap in local tests) to address stochastic variance. Explicitly noted hardware and computational constraints as limitations for multi-run repetitions.</li></ul></li>\n<li><strong>Section 4.5.1.4</strong>: Integrated a post-hoc analysis of the revised tie_break_score. Added the formulas for the three new variants, reported their relative measured accuracy in a dedicated chart, and discussed why local confidence bottlenecks and trajectory-length regularization provide a more robust strategy.</li>\n<li><strong>Section 4.5.1.6</strong>: Added details regarding the tool-output fallback mechanism, including its exact trigger frequency (45 times on the validation set) and its conditional recovery accuracy (6.67%).</li>\n</ul>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 3457775,
      "author_name": "Philip Vonderlind",
      "author_url": "",
      "post_date": "2026-05-14T10:16:54.900000",
      "content": "<p>Adding to the comments from <a href=\"https://www.kaggle.com/sambealing\" target=\"_blank\">@sambealing</a> below, I have a few additional questions:</p>\n<ol>\n<li><p><strong>CoT</strong>: Why did you choose to use CoT-style prompting with a model that has already been extensively trained for reasoning? The official OpenAI <a href=\"https://developers.openai.com/api/docs/guides/reasoning-best-practices\" target=\"_blank\">reasoning best practices</a> recommends avoiding CoT-style prompts for models with built-in reasoning capabilities, since they already reason internally. Did you also test your approach with a different prompt format that does not explicitly encourage CoT-style reasoning?</p></li>\n<li><p><strong>Time Management</strong>: Time management is a crucial part of this competition, with many possible areas for improvement. Since you present an adaptive time-management system as a key component, it would be helpful to see ablations comparing different strategies and configurations.</p></li>\n<li><p><strong>Variance on Local Evaluations</strong>: As we have seen in AIMO3, variance has a large impact on notebook scores due to problem difficulty and random ordering. Did you run your experiments multiple times and record local variance? I could only find reported averages for the public leaderboard scores, but not for the individual configurations tested on your 75-problem evaluation dataset. Adding variance estimates would allow readers to better assess the statistical significance of the differences between configurations.</p></li>\n</ol>",
      "votes": 0,
      "replies": [
        {
          "id": 3458928,
          "author_name": "Potrhino",
          "author_url": "",
          "post_date": "2026-05-17T00:28:42.783000",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/philipvonderlind\" target=\"_blank\">@philipvonderlind</a> ,</p>\n<p>thank you for your time and for these insightful questions.</p>\n<p>Please find my detailed responses to each point below.</p>\n<h3>1. <strong>CoT</strong>:</h3>\n<p>While official OpenAI best practices suggest that CoT-style prompts are unnecessary for models with built-in reasoning, my empirical results with gpt-oss-120b tell a more nuanced story. In local runs, I observed that CoT prompts increased the number of correct responses for the hardest problems, although they generally generated longer responses for simpler tasks compared to formats that do not explicitly encourage CoT. To evaluate this, I submitted two versions of a previous notebook that differed only in the \"User\" prompt, but used a fixed configuration for \"System\", \"Developer\" and \"Tool\", as following:</p>\n<ul>\n<li><strong>System</strong>: <em>\"You are a rigorous and precise math expert.\"</em></li>\n<li><strong>Developer</strong>: <em>\"Solve the problem and use the Python tool when necessary. You must return the final answer inside \\boxed{}. The final answer is an integer between 0 and 99999 inclusive.\"</em></li>\n<li><strong>Tool</strong>: <em>\"Use this tool to execute Python code. The environment is a stateful Jupyter notebook. You must use print() to output results.\"</em></li>\n<li><strong>User (Non-CoT version)</strong>: <em>\"{problem}\\n\\nYou have access to <code>math</code>, <code>numpy</code>, <code>sympy</code> and <code>mpmath</code> to solve the problem.\"</em></li>\n<li><strong>User (CoT version)</strong> (<a href=\"https://arxiv.org/html/2601.19302v1#S3):\" target=\"_blank\">https://arxiv.org/html/2601.19302v1#S3):</a> <em>\"{problem}\\n\\nPhase 1 (Formalization):\\nIdentify givens and target. Write the key equations.\\nPhase 2 (Adaptive Solving):\\nSolve via CoT (think step-by-step), PoT (compute with code), direct calculation, or elimination.\\nVerify your solution, then return your final answer.\"</em></li>\n</ul>\n<p>The CoT version achieved a score of <strong>39</strong> on the Public Leaderboard, while the Non-CoT version achieved a score of <strong>37</strong>.\nFurthermore, in <a href=\"https://arxiv.org/pdf/2508.15260\" target=\"_blank\">https://arxiv.org/pdf/2508.15260</a> the authors achieve 99.9% accuracy on AIME 2025 using gpt-oss-120b by specifically appending <em>\"Please reason step by step, and put your final answer within \\boxed{}.\"</em> to the user prompt (Section <em>\"F EXPERIMENTAL SETTINGS\"</em>).</p>\n<p>I also tested several other prompting strategies:</p>\n<ul>\n<li>Replacing <em>\"carefully\"</em> with <em>\"step by step\"</em> in the developer prompt of final submission achieved a score of <strong>38</strong> on the Public Leaderboard.</li>\n<li>Removing the developer prompt in favor of a very verbose system/tool description (similar to high-scoring public notebooks) also yielded a <strong>38</strong> on the Public Leaderboard.</li>\n<li>I experimented with other styles such as \"Chain of Draft\" (<a href=\"https://arxiv.org/pdf/2502.18600)\" target=\"_blank\">https://arxiv.org/pdf/2502.18600)</a>, \"Thoughts Are All Over the Place\" (<a href=\"https://arxiv.org/pdf/2501.18585\" target=\"_blank\">https://arxiv.org/pdf/2501.18585</a>) and prompt used in AIMO Progress Prize 2.</li>\n</ul>\n<p>Ultimately, I found that using the word \"carefully\" provided the best tradeoff. It encourages precision, caution, and consistency without forcing the model into the extreme verbosity of a full \"step-by-step\" instruction. This approach can help to reduces errors on difficult problems while maintaining efficiency on simpler ones.</p>\n<h3>2. <strong>Time management</strong>:</h3>\n<p>The dynamic time management system was designed to mitigate the inefficiency of static allocation, where simple problems can waste budget and complex ones are cut short. Our ablation study confirms that the final_submission (dynamic) significantly outperforms the dynamic_time_management_disabled (static) run, which relies on a fixed average time per problem.\nThe dynamic time management is based on the scaling constants <code>Cmin</code> and <code>Cmax</code> (Section 3.3.). Initially, the parameter <code>Cmax=2.1</code> was empirically selected to allow the model to reach its maximum effective context window depth on difficult problems. The following table summarizes additional configurations evaluated during the final phases of the competition:</p>\n<table>\n<thead>\n<tr>\n<th>Cmin</th>\n<th>Cmax</th>\n<th>Public LB Scores</th>\n<th>Mean Score</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>0.88</td>\n<td>2.2</td>\n<td>37</td>\n<td>37.0</td>\n</tr>\n<tr>\n<td>0.86</td>\n<td>2.1</td>\n<td>39, 37, 38, 43</td>\n<td>39.25 (Final Submission)</td>\n</tr>\n<tr>\n<td>0.85</td>\n<td>2.0</td>\n<td>36</td>\n<td>36.0</td>\n</tr>\n<tr>\n<td>0.80</td>\n<td>2.0</td>\n<td>39</td>\n<td>39.0</td>\n</tr>\n<tr>\n<td>0.80</td>\n<td>2.1</td>\n<td>42, 41</td>\n<td>41.5</td>\n</tr>\n</tbody>\n</table>\n<p>While the selected final submission (<code>Cmin=0.86</code>, <code>Cmax=2.1</code>) achieved the highest peak score of <strong>43/50</strong>, subsequent analysis suggests that a lower floor (<code>Cmin=0.80</code>) paired with <code>Cmax=2.1</code> yields a more stable mean performance (<strong>41.5</strong>).\nThe configuration <code>(0.80, 2.1)</code> was identified very close to the competition deadline, consequently, we prioritized the <code>(0.86, 2.1)</code> configuration for the final submission as it had already demonstrated high-ceiling potential in earlier runs.\nThese results indicate that performance is sensitive to the <code>Cmin</code> floor. A lower <code>Cmin</code> grants the system more flexibility to reallocate time from \"easy\" problems to \"hard\" ones, whereas an excessively high <code>Cmax</code> may lead to diminishing returns if the model exceeds its useful reasoning depth.\nWe agree that further systematic ablations on these hyperparameters could define a more precise \"Pareto front\" for time-constrained mathematical reasoning.</p>\n<h3>3. <strong>Variance on Local Evaluations</strong>:</h3>\n<p>We appreciate the emphasis on variance. Mathematical reasoning tasks are indeed sensitive to problem ordering and stochastic sampling, and variance estimates are crucial to distinguish architectural gains from statistical noise.\nThe experimental runs reported in Section 4.5 were conducted near the competition deadline to provide a reproducible and objective summary of each technique’s behavior on a high-difficulty public dataset. We acknowledge that these specific local runs reflect a single execution. Due to the significant computational intensity—each 75-problem run requiring approximately 7.5 hours on an NVIDIA H100 GPU—and strict hardware availability constraints, conducting multiple full-scale repetitions was not feasible within the remaining timeframe.\nHowever, we believe the significance of the observed performance gaps is supported by the following factors:</p>\n<p></p><ul>\n<li><strong>Noise Reduction by Design</strong>: We utilized a 75-problem \"High-Difficulty\" dataset to provide a more discriminative signal than standard benchmarks. Furthermore, Dynamic Time Management mitigates variance related to problem ordering by optimizing resource allocation, while Self-Consistency (<code>k=7</code>) reduces the impact of stochastic sampling.</li>\n<li><strong>Consistency with Historical Evidence</strong>: The performance trends in our ablation studies align with the findings from months of internal testing and Public Leaderboard submissions. In every run, the removal of core components (TIR, HIGH reasoning level, or Dynamic Time Management) resulted in a logical and consistent degradation of accuracy.</li>\n<li><strong>Public Leaderboard Correlation</strong>: To provide a broader perspective on variance, we compared the Public LB scores of our \"Final Submission\" against the \"Early Break Disabled\" configuration (the configuration with the smallest accuracy gap in local tests, 0.55 vs 0.51 (Section 4.5.1.2.)).<p></p>\n<table>\n<thead>\n<tr>\n<th>Notebook Configuration</th>\n<th>Public LB Scores</th>\n<th>Mean Score</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Final Submission</td>\n<td>39, 37, 38, 43</td>\n<td>39.25</td>\n</tr>\n<tr>\n<td>Early Break Disabled</td>\n<td>36, 38</td>\n<td>37</td>\n</tr>\n<tr>\n<td></td></tr></tbody></table></li></ul>\n\n\n\n\nAs shown, the Final Submission consistently maintains a higher mean score on the Public Leaderboard, mirroring the gap observed in our local experimental runs.\n\n\n\n\nThe substantial gap between the Baseline (<strong>17/75</strong>) and the Final Submission (<strong>41/75</strong>) in local validation represents a nearly <strong>2.4x</strong> improvement. Such a significant margin strongly suggests that the gains are driven by architectural optimizations rather than mere stochastic fluctuations.\n\n\n\n\nWhile we agree that additional runs would further refine these estimates, the convergence of local results, Public Leaderboard data, and ablation consistency provides strong evidence for the effectiveness of the proposed techniques. However, this remains a valuable direction for future work.\n\n\n\n\n",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 3457749,
      "author_name": "Sam Bealing",
      "author_url": "",
      "post_date": "2026-05-14T09:14:51.057000",
      "content": "<p>Hi, thank you for your submission to the Writeup Prize. <a href=\"https://www.kaggle.com/philipvonderlind\" target=\"_blank\">@philipvonderlind</a> and I will post some questions below that help us in assessing your submission more closely, as described in the <a href=\"https://www.kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3/discussion/689703\" target=\"_blank\">updated discussion post</a>.</p>\n<ol>\n<li><strong>Better tie-breaking metrics (§4.5.1.4):</strong> You found that reasoning-path length and minimum token confidence are stronger discriminators than your final <code>mean_conf · (1-mean_entropy)</code> aggregation. Did you have a chance to resubmit with the revised scoring function before the deadline, and if not, do you have any data of how it might affect performance on other benchmarks?</li>\n<li><strong>Tool-fallback fire rate (§3.5.3):</strong> §4.5.1.6 evaluates the tool-output fallback's accuracy, but I couldn't see the actual fire rate. On your 75-problem validation set, on what fraction did all 7 reasoning paths fail to produce a formatted final answer (i.e. when the fallback actually fires), and how often does the fallback then pick the correct answer?</li>\n<li><strong>TIR-friendly validation set:</strong> Your 75-problem set is sourced from a problem set specifically focussed on tool-calling. Do you think the TIR gains you report would transfer to problem types where tool use is less natural (e.g. pure symbolic algebra, geometry proofs), or could the gains concentrate on problems that are already tool-friendly?</li>\n</ol>\n<p>Look forward to reading your responses on these.</p>",
      "votes": 0,
      "replies": [
        {
          "id": 3458925,
          "author_name": "Potrhino",
          "author_url": "",
          "post_date": "2026-05-17T00:11:20.943000",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/sambealing\" target=\"_blank\">@sambealing</a> ,</p>\n<p>thank you for your time and for these insightful questions. </p>\n<p>Please find my detailed responses to each point below.</p>\n<h3>1. <strong>Better tie-breaking metrics</strong>:</h3>\n<p>Unfortunately, I completed the tie-breaking analysis only after the competition deadline, so I was unable to submit a revised scoring function to the Public Leaderboard. However, post-hoc analysis on the experimental runs described in Section 4.5.1.4 indicates that the original aggregation (described in Section 3.5.1.) was not the most discriminative signal for selecting among candidate reasoning paths.\nIn particular, incorporating local confidence bottlenecks and reasoning-path length produced substantially stronger tie-breaking performance:</p>\n<table>\n<thead>\n<tr>\n<th>Metric</th>\n<th>Tie-breaking accuracy</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Original tie_break_score</td>\n<td>0.492</td>\n</tr>\n<tr>\n<td>Revised tie_break_score_A <code>(1−length_perc)⋅min_conf</code></td>\n<td>0.542</td>\n</tr>\n<tr>\n<td>Revised tie_break_score_B <code>tie_break_score⋅(1−length_perc)⋅min_conf</code></td>\n<td>0.610</td>\n</tr>\n<tr>\n<td>Revised tie_break_score_C <code>tie_break_score⋅(1−length_perc)⋅min_conf⋅tail_conf</code></td>\n<td>0.661</td>\n</tr>\n</tbody>\n</table>\n<p>Here, <code>length_perc</code> denotes the ratio between the generated response length and the model context limit (response_length / max_model_len).\nThese results suggest that localized confidence failures are more informative than global averages. Metrics such as mean_conf and mean_entropy can remain relatively stable even when a reasoning trajectory contains a critical logical error. In contrast, min_conf and tail_conf act as bottleneck indicators: a single low-confidence transition often coincides with a hallucinated deduction or unstable reasoning step.\nThe inverse correlation between reasoning-path length and correctness was also notable. For Olympiad-style mathematical problems, successful solutions tended to emerge from relatively concise reasoning chains, whereas excessively long trajectories were more likely to exhibit reasoning drift, repetition, or self-inconsistent exploration.\nThese results, summarized in the accompanying chart, suggest that combining global stability metrics with local confidence statistics and trajectory-length regularization may provide a more robust tie-breaking strategy for adaptive reasoning systems.\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F23110311%2F566687e5063e21dec95c4570a1294636%2FTie-breaking%20success%20rate%20()%20per%20summed%20metric.png?generation=1778976268035266&amp;alt=media\" alt=\"\"></p>\n<h3>2. <strong>Tool-fallback fire rate</strong>:</h3>\n<p>On the 75-problem validation set, excluding the python_tool_disabled and baseline ablations (which do not use the Python tool), the tool-output fallback mechanism was triggered <strong>45</strong> times in total.\nA fallback event occurs when all 7 reasoning paths fail to produce a correctly formatted final answer, but at least one reasoning path generated a valid numerical result during a Python tool execution.\nAmong these 45 fallback activations, the mechanism recovered the correct answer <strong>3</strong> times, corresponding to a conditional accuracy of approximately <strong>6.67%</strong> once the fallback fires.\nAlthough the conditional success rate is relatively low, the fallback was intentionally designed as a last-resort recovery mechanism rather than a primary selection strategy. In these cases, the standard extraction and aggregation pipeline had already failed completely, meaning that without the fallback the system would deterministically output an incorrect answer.\nConsequently, even a small number of successful recoveries translates directly into measurable score improvements. Importantly, the fallback introduces essentially no additional inference-time cost, since it only reuses numerical outputs already produced during earlier Python tool executions rather than generating new reasoning trajectories.</p>\n<h3>3. <strong>TIR-friendly validation set</strong>:</h3>\n<p>While the validation set was indeed tool-oriented, I believe the benefits of TIR would partially transfer to more \"abstract\" domains, albeit with a shift in how the tool is utilized. For instance:</p>\n<ul>\n<li><strong>Symbolic Algebra &amp; Geometry</strong>: By leveraging libraries like <code>sympy</code>, the model can offload complex algebraic manipulations or coordinate geometry calculations to a deterministic solver. This minimizes \"calculation drift\" in long CoT sequences, where models often make small sign errors or arithmetic slips.</li>\n<li><strong>Verification, not just Solution</strong>: Even in proof-based or symbolic problems, TIR acts as a powerful verifier. The model can write scripts to test specific cases or validate intermediate numerical properties, providing a feedback loop that pure CoT lacks.</li>\n<li><strong>Logical Structuring</strong>: Writing code forces the model to decompose abstract problems into discrete, executable steps. This \"algorithmic thinking\" often help in maintaining a coherent logical flow even in pure proof tasks, reducing the likelihood of circular reasoning or vague hand-waving.</li>\n</ul>\n<p>Therefore, while the magnitude of the gain might vary depending on the problem type, I expect the system to maintain a competitive edge even on benchmarks where tool-use is less intuitive.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "comment_count": 5,
  "messages": [
    {
      "id": 3443347,
      "postDate": "2026-04-16T12:27:55.997Z",
      "content": "<h1>Abstract</h1>\n<p>This writeup presents an advanced inference-time optimization strategy developed by the Potrhino team for the final evaluation of the AI Mathematical Olympiad (AIMO) Progress Prize 3, ranking 373rd out of 4,138. Recognizing that solving Olympiad-level mathematics under strict temporal and computational constraints nowadays is primarily an efficiency-bottlenecked task, we pivot from traditional model fine-tuning toward adaptive test-time orchestration. Leveraging the open-weight gpt-oss-120b model, our approach integrates:</p>\n<ul>\n<li><strong>Tool-Integrated Reasoning</strong> (TIR) in a high-precision environment with adaptive timeouts;</li>\n<li><strong>Dynamic time management</strong> across problem set;</li>\n<li>Lightweight role-based <strong>Chain-of-Thought</strong> (CoT) prompting with robust format recovery;</li>\n<li><strong>Self-Consistency</strong> with consensus-based early termination and confidence-/entropy-based tie-breaking;</li>\n<li><strong>Adaptive pruning</strong> of less promising reasoning paths. </li>\n</ul>\n<p>Through rigorous ablation studies, we demonstrate that the synergy of these techniques significantly elevates the model’s performance ceiling, achieving the following scores:</p>\n<ul>\n<li><strong>42.0/50</strong> on the AIMO3 Private Leaderboard;</li>\n<li><strong>43/50</strong> on the AIMO3 Public Leaderboard;</li>\n<li><strong>41/75</strong> on high-difficulty problems used for local validation.</li>\n</ul>\n<p>Our results establish that strategic resource management and deterministic tool augmentation can improve mathematical reasoning performance. To ensure full reproducibility, our code, environment configurations, and experimental logs are made publicly available.</p>\n<h1>1. Introduction</h1>\n<p>In recent years, <strong>Large Language Models</strong> (LLMs) have demonstrated remarkable proficiency across a broad spectrum of natural language tasks, evolving from fluent text generators into versatile problem solvers. Despite these advancements, complex mathematical reasoning remains a challenge, particularly at the Olympiad level. Proficiency in this domain is critical, as it serves as a cornerstone for solving intricate problems in fields ranging from advanced engineering to quantitative finance. While recent breakthroughs have seen <strong>Artificial Intelligence</strong> (AI) achieve human-level performance on <strong>International Mathematical Olympiad</strong> (IMO) problems, a notable performance gap persists between state-of-the-art closed-source models and their open-weight counterparts. </p>\n<p>The <strong>AI Mathematical Olympiad Progress Prize 3</strong> (AIMO3) [1] aims to bridge this divide by challenging participants to develop open-source algorithms and models capable of solving high-level mathematical problems under <strong>strict computational and time constraints</strong>. While AIMO Progress Prize 2 was won in April 2025 by Nvidia's NemoSkills team [2], AIMO3 utilizes entirely original problems to eliminate the risk of data contamination. Every ground-truth label is an integer within the range [0, 99999]. Submissions, consisting of <strong>Kaggle notebooks</strong>, are evaluated on a private test set of 50 math problems, where scoring is based on the consistency of two independent predictions: for each problem, a score of 1.0 is awarded if both answers are correct, 0.5 if only one is correct, and 0 otherwise. The competition enforces a rigorous offline environment, limiting execution to 5 hours on GPU-accelerated notebooks (H100, P100, or T4×2) or 12 hours on CPU-based notebooks. </p>\n<p>This writeup details the strategy presented by the Potrhino team, which achieved a score of <strong>43/50</strong> in the public evaluation. The proposed approach leverages the <strong>gpt-oss-120b</strong> [7] model on H100 hardware, integrating:</p>\n<ul>\n<li><strong>Tool-Integrated Reasoning</strong> (TIR) [3] in a high-precision environment;</li>\n<li><strong>Dynamic time management</strong> across problems;</li>\n<li>Lightweight role-based <strong>Chain-of-Thought</strong> (CoT) [4] prompting with robust format recovery;</li>\n<li><strong>Self-Consistency</strong> [5] with consensus-based early termination and confidence-/entropy-based tie-breaking;</li>\n<li><strong>Adaptive pruning</strong> of less promising reasoning paths, using concepts inspired by \"<strong>Deep Think with Confidence</strong>\" [6] framework. </li>\n</ul>\n<p>These methodologies are designed to <strong>optimize test-time inference</strong> under strict computational and time constraints. The following sections introduce the fundamental concepts, then describe the proposed strategy, and finally provide a comprehensive analysis of the results.</p>\n<h1>2. Related Work</h1>\n<h2>2.1. Tool-Integrated Reasoning [3]</h2>\n<p>While LLMs have evolved into versatile problem solvers, purely text-based reasoning often struggles with tasks requiring precise numerical computation, long-horizon search, or rigorous verification. To address these inherent limitations, <strong>Tool-Integrated Reasoning</strong> (TIR) has emerged as an increasingly adopted paradigm. By equipping LLMs with external tools, such as <strong>Python code interpreters</strong>, TIR effectively expands the model's capabilities and transcends the \"capability ceiling\" of purely linguistic inference.</p>\n<p>Recent research demonstrates that TIR-augmented models decisively <strong>outperform pure-text</strong> counterparts across challenging mathematical benchmarks. This performance gain is particularly evident in the <strong>pass@k</strong> metric, as the interpreter provides a deterministic execution environment that mitigates common calculation errors. Furthermore, this advantage extends beyond mere arithmetic. It also facilitates complex problem-solving strategies, such as brute-force search and algorithmic simulation, which would be intractably verbose or prone to failure in a standard autoregressive setup. </p>\n<p><em>Figure 1</em> shows pass@k curves for the TIR (RL-trained) and pure-text models (Qwen3 8B) across benchmarks: (a) AIME24, (b) AIME25 [3]. This illustrates how TIR provides a significant gain in accuracy on AIME problems, which makes it an ideal candidate for AIMO3.</p>\n<h5>Figure 1</h5>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F319f0b6de502290fff5b1b1f46194bf3%2FTIR_ACCURACY.png?generation=1776346717057232&amp;alt=media\" alt=\"\"></p>\n<h2>2.2. Chain-of-Thought Prompting [4]</h2>\n<p>While scaling the parameters of LLMs generally improves performance, scale alone is often insufficient for mastering complex arithmetic and symbolic reasoning. <strong>Chain-of-Thought</strong> (CoT) prompting addresses this limitation by eliciting a series of intermediate reasoning steps before arriving at a final conclusion. This approach offers several critical advantages for Olympiad-level mathematics:</p>\n<ul>\n<li><strong>Problem Decomposition</strong>: CoT allows the model to break down multi-step problems into manageable intermediate steps, effectively allocating more computational \"budget\" to high-complexity tasks.</li>\n<li><strong>Interpretability and Debugging</strong>: It provides a transparent window into the model’s reasoning path, facilitating the identification and correction of logical fallacies or calculation errors.</li>\n<li><strong>Versatility</strong>: CoT is applicable to a wide range of reasoning tasks, from abstract proof-based questions to symbolic manipulation.</li>\n<li><strong>Zero-Shot/Few-Shot Elicitation</strong>: Reasoning abilities can be readily activated in sufficiently large models via specialized prompting or few-shot exemplars.</li>\n</ul>\n<p>CoT transforms a model from a direct predictor into a systematic reasoner, enabling it to bridge the gap between problem understanding and the final output. <em>Figure 2</em> shows the solve rate of CoT and other prompting variations using LaMDA 137B and PaLM 540B on the GSM8K dataset [4]. This illustrates how CoT outperforms other prompting variations, highlighting its effectiveness in improving reasoning for math problems. However, CoT alone does not guarantee correctness, as errors can propagate across intermediate steps.</p>\n<h5>Figure 2</h5>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F13633ce68b5c9d7569e1b919b209264a%2FCoT_ACCURACY.png?generation=1776551872549459&amp;alt=media\" alt=\"\"></p>\n<h2>2.3. Self-Consistency [5]</h2>\n<p>A fundamental characteristic of complex problem-solving is the existence of multiple diverse reasoning paths that converge on the same correct solution. <strong>Self-Consistency</strong> leverages this intuition by replacing traditional greedy decoding with a sampling-based approach. The method involves generating a diverse set of reasoning paths and subsequently selecting the most consistent final answer by marginalizing out the sampled paths, a process commonly implemented as <strong>majority voting</strong>. This technique significantly enhances the robustness of CoT prompting. While an LLM may occasionally produce erroneous intermediate steps, incorrect reasoning paths are statistically less likely to converge on the same final value compared to valid logical sequences. Consequently, the correct answer tends to exhibit higher agreement across the sample population. Beyond raw accuracy gains, Self-Consistency provides two additional advantages:</p>\n<ul>\n<li><strong>Uncertainty Estimation</strong>: The agreement among sampled answers serves as a reliable proxy for the model's confidence in a given solution.</li>\n<li><strong>Calibration</strong>: It improves output reliability by filtering out stochastic \"hallucinations\" or calculation errors through consensus. </li>\n</ul>\n<p>A primary constraint of Self-Consistency is the increased test-time compute required. However, empirical evidence suggests that performance gains often saturate relatively quickly. Therefore, a strategically limited number of paths (e.g., k=5 or k=10) can capture the majority of the benefits without exceeding time limits. This trade-off is especially critical in constrained environments such as AIMO3, where inference budget is strictly limited. \n<em>Figure 3</em> shows how Self-Consistency improves accuracy across various reasoning tasks, using LaMDA-137B [5].</p>\n<h5>Figure 3</h5>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F5a7fdb7a5084e8f86210ad0329bbb23c%2FSelf_consistency_ACCURACY.png?generation=1776348545912708&amp;alt=media\" alt=\"\"></p>\n<h2>2.4. Deep Think with Confidence [6]</h2>\n<p>While parallel reasoning techniques like Self-Consistency enhance accuracy, they often encounter two primary bottlenecks: the linear scaling of inference overhead and diminishing returns caused by the equal weighting of all reasoning traces. Standard majority voting fails to account for quality variations, potentially allowing low-confidence or \"hallucinated\" traces to compromise the final output.\nTo address these limitations, the <strong>Deep Think with Confidence</strong> (DeepConf) methodology integrates confidence-aware filtering based on local token-level statistics. Unlike global measures that average confidence across an entire sequence, thereby masking localized reasoning failures, DeepConf monitors fluctuations at critical intermediate steps. This approach offers two distinct operational modes:</p>\n<ul>\n<li><strong>Offline Mode</strong>: Traces are filtered post-generation by aggregating entropy and confidence scores. This identifies and discards low-quality reasoning paths before the voting process, ensuring only robust chains contribute to the final consensus.</li>\n<li><strong>Online Mode</strong>: This mode enables real-time generation control and early stopping. By detecting low-confidence signals as they emerge, the system can prematurely terminate suboptimal traces, significantly reducing redundant token generation.</li>\n</ul>\n<p>Empirical results demonstrate that DeepConf not only improves accuracy by mitigating noise from low-quality traces but also optimizes resource allocation. In offline mode, DeepConf@512 achieves <strong>99.9%</strong> accuracy on AIME 2025 using gpt-oss-120b (without tools), effectively saturating the benchmark compared to 97.0% for cons@512 (consensus/majority voting) and 91.8% for pass@1. In online mode, DeepConf reduces token generation by up to 84.7% compared to standard parallel sampling while maintaining or exceeding baseline accuracy. This efficiency is critical for maximizing the number of effective reasoning paths under strict computational and time constraints. This idea directly inspired our adaptive pruning and early termination strategy. <em>Figure 4</em> shows the aforementioned results for both online and offline modes on AIME 2025 [6]. </p>\n<h5>Figure 4</h5>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F66b614b3c5d06a433690b0af1d1aeb5d%2FDeep_conf_ACCURACY.png?generation=1776348951716265&amp;alt=media\" alt=\"\"></p>\n<h2>2.5. gpt-oss-120b [7]</h2>\n<p><strong>gpt-oss-120b</strong> is an open-weight, reasoning-focused autoregressive model released under the Apache 2.0 license. Optimized for agentic workflows, it excels in instruction following, structured output generation, and tool integration (e.g., Python execution). The model architecture is a <strong>Mixture-of-Experts</strong> (MoE) Transformer, featuring 36 layers with a total of 116.8B parameters, of which 5.1B are active per token. The MoE weights are quantized to <strong>MXFP4</strong> format (4.25 bits per parameter), comprising over 90% of the total parameter count. This enables operation within the constraints of a single <strong>80GB GPU</strong> (such as the H100). The model was trained using the <strong>Harmony</strong> chat format, which utilizes specialized tokens for message boundaries and a role-based hierarchy to resolve instruction conflicts (<strong>System &gt; Developer &gt; User &gt; Assistant &gt; Tool</strong>). A distinctive feature of gpt-oss-120b is its support for three distinct reasoning levels (<strong>Low, Medium, and High</strong>), where higher levels correlate with increased <strong>CoT</strong> length and logical depth (as shown in <em>Figure 5</em> [7]).</p>\n<h5>Figure 5</h5>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fdfdbd0b9257ab6a1010135c1e9bef41c%2Fgpt-oss-cot.png?generation=1776349514505657&amp;alt=media\" alt=\"\"></p>\n<p>The model is natively trained to utilize a suite of agentic tools:</p>\n<ul>\n<li><strong>Python Tool</strong>: Enables code execution within a stateful Jupyter notebook environment, facilitating TIR.</li>\n<li><strong>Browsing Tool</strong>: Facilitates web interaction to improve factual accuracy beyond the knowledge cutoff (not used in this work due to offline constraints).</li>\n<li><strong>Custom Developer Functions</strong>: Allow for arbitrary function schemas defined via the Harmony format.</li>\n</ul>\n<p>By interleaving CoT with TIR, gpt-oss-120b achieves high accuracy on mathematical benchmarks (as illustrated in <em>Figure 6</em>) while maintaining rapid inference speed and efficient memory utilization. We selected gpt-oss-120b due to its strong reasoning capabilities, native support for tool use, and compatibility with single-GPU deployment under AIMO constraints.</p>\n<h5>Figure 6</h5>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F73d193171bc7b245bc1f3888488b99f3%2Fgpt-oss-benchmark_table.png?generation=1776349624566200&amp;alt=media\" alt=\"\"></p>\n<h1>3. Adaptive Test-Time Optimization of gpt-oss-120b with TIR and CoT</h1>\n<p>The primary challenge of the AIMO3 competition lies in developing an AI system capable of solving IMO-level mathematical problems under stringent time and computational constraints. While modern LLMs have shown increasing proficiency in this domain, success hinges on identifying the optimal <strong>trade-off</strong> between reasoning <strong>accuracy</strong> and execution <strong>latency</strong>. \nOur approach addresses this challenge by leveraging the <strong>gpt-oss-120b</strong> model as a high-capacity foundation and concentrating development efforts on <strong>test-time optimization</strong>. The overall approach is structured around a set of strategic pillars, with hyperparameters calibrated to balance robustness and efficiency, while remaining amenable to further fine-grained optimization. These pillars include:</p>\n<ul>\n<li><strong>Tool-Integrated Reasoning</strong> (TIR) in a <strong>high-precision environment</strong>;</li>\n<li><strong>Dynamic time management</strong> across problems;</li>\n<li><strong>Lightweight role-based CoT prompting</strong> with <strong>robust format recovery</strong>;</li>\n<li><strong>Self-Consistency</strong> with <strong>consensus-based early termination</strong> and <strong>confidence-/entropy-based tie-breaking</strong>;</li>\n<li><strong>Adaptive pruning of less promising reasoning paths</strong>, using concepts inspired by DeepConf framework. </li>\n</ul>\n<h2>3.1. gpt-oss-120b as a High-Capacity Foundation Model</h2>\n<p>We select the open-weight <strong>gpt-oss-120b</strong> model as the primary backbone. Given its strong baseline performance on mathematical benchmarks, further supervised fine-tuning (SFT) is deemed unnecessary. Specifically, the model achieves <strong>strong performance on AIME 2024 and AIME 2025</strong> [7] when utilizing the <strong>\"High\" CoT reasoning level</strong> combined with <strong>TIR</strong>. Beyond raw accuracy, the model aligns well with the competition's hardware and temporal constraints. Utilizing the MXFP4 quantized format, gpt-oss-120b <strong>fits comfortably within the VRAM of a single H100 GPU</strong>, maintaining high inference throughput despite its 120B parameters. Furthermore, the <strong>average response length for AIME 2025</strong> problems is reported to remain <strong>below 16k tokens</strong> [7], which supports an effective balance between depth of reasoning with execution speed. Consequently, we hypothesize that further SFT would yield diminishing returns relative to the substantial computational costs and the risk of increasing latency. This design choice also improves reproducibility, as it avoids reliance on additional proprietary training data or compute-intensive fine-tuning stages.</p>\n<h2>3.2. Tool-Integrated Reasoning (TIR) in a High-Precision Environment</h2>\n<p>The model's reasoning process is augmented by a <strong>Python tool</strong>, which can be invoked at any step of its reasoning chain. The model generates code blocks containing <code>print()</code> statements to retrieve intermediate results, which are then executed in a <strong>stateful Jupyter notebook</strong> environment. </p>\n<h3>3.2.1. Environment Configuration and Precision</h3>\n<p>To facilitate complex symbolic and numerical tasks, the execution environment is pre-configured with essential <strong>scientific libraries</strong> (e.g., <code>math, numpy, sympy</code>). To handle the rigorous demands of Olympiad-level problems, such as <strong>deeply nested recursion</strong>, operations involving <strong>very large integers</strong> or <strong>high-precision floating-point</strong> arithmetic, we increase the system’s default limits as follow:</p>\n<ul>\n<li><code>recursion_limit = 2000</code>;</li>\n<li><code>precision = 100000</code>;</li>\n<li><code>int_max_digits = 1000000</code>.</li>\n</ul>\n<h3>3.2.2. Long Output Management</h3>\n<p>To prevent <strong>long execution outputs</strong> from saturating the model’s context window, we implement a centralized <strong>truncation strategy</strong>. Outputs exceeding a predefined <strong>threshold</strong> (<code>L_max = 1000</code> characters) are clipped: only the initial and final <code>L_max/2</code> characters are preserved, separated by a <code>... TRUNCATED ...</code> marker. This ensures the model receives both the <strong>beginning and final portions of the output</strong> while discarding redundant intermediate iterations. This encourages more concise tool usage and provides the model with the segments of the output that typically contain the most relevant information. </p>\n<h3>3.2.3. Adaptive Timeouts</h3>\n<p>To ensure that inefficient or infinite loops do not deplete the problem's time budget, we implement an adaptive timeout strategy for code execution. This strategy balances the need for rapid feedback on simpler problems with the requirement for long-running computations on more complex ones: </p>\n<ul>\n<li><strong>Iterative Optimization</strong>: If a code execution triggers a timeout, the error is fed back into the model's context. This explicitly signals the model to optimize its algorithmic approach (e.g., moving from a brute-force to a more efficient mathematical simulation).</li>\n<li><strong>Exponential Backoff</strong>: Each consecutive timeout for a given problem allows for a slightly longer execution window for the subsequent attempt, capped at twice the initial duration. This prevents inefficient code from stalling the pipeline while still allowing complex computations to complete.</li>\n</ul>\n<p>The <strong>execution timeout</strong> for each call is determined by the following formula:</p>\n<p>$$Texec = \\min( \\min(Tinit \\cdot 1.3^n, 2 \\cdot Tinit), Tremaining )$$</p>\n<p>Where: </p>\n<ul>\n<li><code>Tinit</code> is the starting execution timeout (set to <code>8s</code>);</li>\n<li><code>n</code> is the number of consecutive timeouts for the current problem;</li>\n<li><code>Tremaining</code> is the residual time allocated to the specific problem.</li>\n</ul>\n<p>The selection of <code>Tinit=8s</code> and the growth factor of <code>1.3</code> is driven by an empirical balance between code complexity and session latency. A baseline of <code>8s</code> is sufficient for the majority of standard mathematical scripts (e.g., symbolic manipulations or short loops). The exponential scaling factor of <code>1.3</code> is specifically calibrated to allow the execution limit to double after exactly three consecutive timeouts. Capping the growth at <code>2 * Tinit</code> prevents unoptimized or runaway scripts from depleting the global time budget, which is a critical risk in time-constrained environments. Furthermore, we hypothesize that if a model fails to produce an efficient solution within three attempts (and nearly doubling the initial timeout), the bottleneck is likely structural rather than purely computational. Beyond this threshold, additional time yields diminishing returns, as the model is encouraged to shift toward an alternative reasoning strategy or a more efficient mathematical simulation rather than marginally optimizing failing code.\nThe interaction between the LLM and the execution environment is managed via a dedicated worker process; the detailed operational logic of this Jupyter worker is provided in <em>Algorithm 1</em> (see Appendix).</p>\n<h2>3.3. Dynamic Time Management Across Problems</h2>\n<p>The total execution time is partitioned across all 50 problems to ensure robustness against varying problem difficulties. After accounting for the initial setup overhead, including environment initialization and model loading, we implement a <strong>dynamic time-budgeting algorithm</strong>. The budget for a given problem, <code>Tp</code>, is determined by:</p>\n<p>$$Tp = \\max( \\min(Tpool, Tavg \\cdot Cmax), Tavg \\cdot Cmin )$$</p>\n<p>Where: </p>\n<ul>\n<li><code>Tpool</code> is the total remaining time after subtracting the reserved buffer for all future problems (<code>Tavg * Cmin</code> for each remaining problem);</li>\n<li><code>Tavg</code> represents the baseline allocation, calculated as the initial total available time divided by the total number of problems;</li>\n<li><code>Cmax</code> is a scaling constant for upper bound (2.1);</li>\n<li><code>Cmin</code> is a scaling constant for lower bound (0.86).</li>\n</ul>\n<p>This mechanism ensures that a single outlier (an extremely difficult problem) cannot deplete the resources required for the rest of the test set. Furthermore, it allows simpler problems to conclude early and return their unused budget to the global pool, thereby granting additional computational time to high-complexity cases without risking a global submission timeout.\nThe coefficients <code>Cmin</code> and <code>Cmax</code> were empirically selected to balance risk and performance. A <code>Cmin</code> of 0.86 ensures that even in the worst-case scenario, every problem is guaranteed approximately 85% of the baseline average time. Conversely, a <code>Cmax</code> of 2.1 allows the solver to spend more than double the average time on difficult problems without destabilizing the overall schedule. This upper bound was also found to be sufficient for the model to reach the maximum effective depth of its context window. This dynamic approach ensures that the \"time-to-solution\" is maximized for challenging problems while maintaining a zero-failure rate regarding the global 5-hour deadline. The detailed operational logic is provided in <em>Algorithm 2</em> (see Appendix).</p>\n<h2>3.4. Lightweight Role-Based CoT Prompting with Robust Format Recovery</h2>\n<p>The prompts used for solving mathematical problems are intentionally <strong>minimal</strong> and <strong>role-based</strong>. Since gpt-oss-120b is natively optimized for multi-level CoT reasoning, overly verbose or complex prompts can introduce unwanted bias or lead the model toward suboptimal reasoning paths. Instead, we leveraged the model's role-based hierarchy to enforce constraints while preserving its inherent problem-solving flexibility. The strategy is organized across following prompts:</p>\n<ul>\n<li><strong>System Role</strong> (Highest Priority): This prompt contains the most critical constraints that the model must follow literally. It defines the <strong>model's persona</strong> as a \"rigorous world-class math competitor\" and strictly dictates the <strong>output format</strong> (a single integer between 0 and 99999 within a \\boxed{} delimiter).</li>\n<li><strong>Developer Role</strong>: This role provides <strong>\"soft\" guidance</strong> rather than rigid instructions. The used prompt suggests a <strong>careful CoT approach</strong> and <strong>encourages the use of the Python tool</strong> for verification or complex calculations. We also included a directive to <strong>avoid guessing</strong> and provided a <strong>list of pre-installed libraries</strong> to streamline tool usage. While official OpenAI best practices suggest that CoT-style prompts are unnecessary for models with built-in reasoning, our empirical results with gpt-oss-120b show that CoT prompts increase the number of correct responses for hard problems, although they generally generate longer responses for simpler tasks. An evaluation of two versions of a previous notebook revealed that the CoT version achieved a score of 39 on the Public Leaderboard, while the non-CoT version achieved 37. Furthermore, in [6] the authors achieved 99.9% accuracy on AIME 2025 using gpt-oss-120b by specifically appending \"Please reason step by step, and put your final answer within \\boxed{}.\" to the user prompt. We explicitly avoided step-by-step prompting, which can lead to excessively verbose outputs at the 'High' reasoning level (a submission replacing \"carefully\" with \"step by step\" yielded a score of 38 on the Public Leaderboard). Using the word \"carefully\" provided the best tradeoff: it encourages precision, caution, and consistency without forcing the model into the extreme verbosity of a full \"step-by-step\" instruction. This approach can help to reduce errors on difficult problems while maintaining efficiency on simpler ones.</li>\n<li><strong>Tool Description</strong>: A synthetic prompt defines the execution environment as a <strong>stateful Jupyter notebook</strong> without internet access. It explicitly instructs the model to use <code>print()</code> for output, preventing empty execution results.</li>\n<li><strong>User Role</strong>: To avoid instruction confusion, the user role contains only the <strong>raw text of the mathematical problem</strong>.</li>\n</ul>\n<h3>3.4.1. Prompt Templates</h3>\n<p><strong>SYSTEM</strong>: \"<em>You are a rigorous world-class math competitor. You must return the final answer in \\boxed{}. The final answer must be a single integer (digits only) between 0 and 99999 inclusive.</em>\"</p>\n<p><strong>DEVELOPER</strong>: \"<em>Reason carefully to solve the problem and use the Python tool when necessary. You have access to math, numpy, sympy, mpmath, decimal, itertools, and pulp. Never guess.</em>\"</p>\n<p><strong>TOOL DESC</strong>: \"<em>Use this tool to execute Python code. The environment is a stateful Jupyter notebook. You must use print() to output results. Internet access is off.</em>\"</p>\n<p><strong>USER</strong>: \"<em>{problem}</em>\"</p>\n<h3>3.4.2. Format Recovery</h3>\n<p>To convert the model's natural language output into the required competition format, the system employs a <strong>multi-stage extraction pipeline</strong>. It first attempts to extract the answer within standard LaTeX delimiters. If no match is found, it falls back to a secondary search for internal tags typically generated by the model's final reasoning tokens. The extraction utilizes the following regular expressions:</p>\n<ul>\n<li><strong>Primary Regex</strong> (Standard):  <code>oxed\\s*\\{[^\\d-]*(-?[0-9,]+\\.?[0-9]*)[^\\d]*\\}</code></li>\n<li><strong>Fallback Regex</strong> (Internal Tag):  <code>assistantfinal\\s*[^\\n\\d-]*(-?[0-9,]+\\.?[0-9]*)[^\\d]*</code></li>\n</ul>\n<p>In cases where multiple matches occur within a single reasoning path, the system processes them in reverse chronological order (from the most recent to the first). This heuristic assumes that the model's final conclusion, often following a self-correction or a summary step, is more likely to be accurate than initial estimates. For each extracted candidate, a normalization function is applied to ensure compliance with the competition's constraints:</p>\n<ul>\n<li><strong>Sanitization</strong>: Commas (frequently used as thousands separators) are removed to prevent parsing errors.</li>\n<li><strong>Rounding and Casting</strong>: Candidates are rounded to the nearest integer to resolve floating-point artifacts or minor calculation residues from the Python tool.</li>\n<li><strong>Modular Arithmetic</strong>: A modulo <code>100,000</code> operation is applied. This ensures the output falls within the required <code>[0, 99999]</code> range, effectively handling cases where the model calculates a correct large value but omits the competition-specific modulus in its final response.</li>\n</ul>\n<p>A candidate is considered a valid final answer only if it results in an integer within the specified range. If a reasoning path concludes without a tool call and fails to yield a valid answer, a <strong>self-correction loop</strong> is triggered to <strong>recover a valid formatted answer</strong>. A follow-up prompt is appended to the conversation to guide the model:</p>\n<p><strong>USER</strong> (Recovery): \"<em>The previous response did not produce a valid final answer. Continue solving the problem. Remember that the final answer must be a single integer (digits only) between 0 and 99999 inclusive, and must be placed in \\boxed{}.</em>\"</p>\n<p>To prevent infinite loops and manage the time budget, this recovery attempt is limited to a single iteration; if a second failure occurs, the trace is terminated.</p>\n<h2>3.5. Self-Consistency with Consensus-Based Early Termination and Confidence-/Entropy-Based Tie-Breaking</h2>\n<p>Whereas our configuration supports a maximum concurrency of 7.52x, we initialize <strong>7 parallel reasoning paths per problem</strong> to maintain a stable and efficient Self-Consistency pipeline. To enhance accuracy and minimize computational redundancy, we implement an advanced <strong>voting</strong> mechanism that integrates <strong>confidence/entropy-based tie-breaking</strong>, <strong>consensus-driven early termination</strong>, and a <strong>fallback to tool outputs</strong>.</p>\n<h3>3.5.1. Confidence-/entropy-based tie-breaking</h3>\n<p>Starting from the second completed reasoning path, the system applies a <strong>majority vote</strong> each time a new answer is generated. In the event of a tie, where multiple candidates share the same maximum frequency, we apply a scoring metric to select the most reliable candidate (i.e., the one with the highest score). The score for a candidate answer <code>a</code>, denoted as <code>S</code>, is calculated as:</p>\n<p>$$S_{tie, a} = \\sum_{i \\in \\text{Paths}(a)} S_{a, i}$$</p>\n<p>Where <code>S</code> represents the individual score of reasoning path <code>i</code> that yielded answer <code>a</code>:</p>\n<p>$$S_{a, i} = p_i \\cdot (1 - H_{g, i}) \\cdot C_{g, i}$$</p>\n<p>Where:</p>\n<ul>\n<li><code>p</code> is a coefficient set to <code>0.75</code> if path <code>i</code> required Format Recovery (indicating a failure in the initial formatting), and <code>1.0</code> otherwise. As reported in the Main results section, paths requiring recovery are statistically less reliable.</li>\n<li><code>H</code> is the mean entropy of the entire reasoning path <code>i</code>, considering the top <code>20</code> tokens for each generation step (inspired by [6]):</li>\n</ul>\n<p>$$H_{g, i} = \\frac{\\sum_{t=1}^{L} \\sum_{j=1}^{20} - \\exp(lp_{t,j}) \\log_2(\\exp(lp_{t,j}))}{L \\cdot \\log_2(20)}$$</p>\n<ul>\n<li><code>C</code> is the mean confidence of the entire reasoning path <code>i</code> (inspired by [6]):</li>\n</ul>\n<p>$$C_{g, i} = \\exp\\left(\\frac{1}{L} \\sum_{t=1}^{L} lp_t\\right)$$</p>\n<ul>\n<li><code>lp</code> is the log-probability of the <code>j-th</code> top candidate token at generation step <code>t</code>;</li>\n<li><code>lp</code> is the log-probability of the token selected at generation step <code>t</code>;</li>\n<li><code>L</code> is the length of reasoning path, in tokens.</li>\n</ul>\n<h3>3.5.2. Consensus-Based Early Termination</h3>\n<p>To optimize the inference budget, the system evaluates the consensus of the leading answer after each vote. If the agreement among reasoning paths is sufficiently robust, the process terminates early. We define four hierarchical levels of consensus based on answer frequency, the number of active tasks, and the remaining time budget.</p>\n<ul>\n<li><strong>Strong Consensus</strong>: Triggered when an answer holds an absolute majority or a lead that cannot be mathematically overtaken by remaining tasks:\n<code>max_vote &gt; max(2, active_tasks/2) or max_vote &gt; still_running_tasks + second_high_frequency</code> </li>\n<li><strong>Uncontested Consensus</strong>: Triggered when the leader holds at least half of the active tasks and a clear margin over the second candidate:\n<code>max_vote &gt;= max(2, active_tasks // 2) and max_vote - 1 &gt; second_high_frequency</code></li>\n<li><strong>Mature Consensus</strong>: Activated after 50% of the problem's time budget has elapsed, requiring a leader with at least 2 votes:\n<code>max_vote &gt;= max(2, active_tasks // 2) and max_vote &gt; second_high_frequency and elapsed_time &gt; available_time * 0.5</code></li>\n<li><strong>Emergent Consensus</strong>: A lower-threshold trigger used after 75% of the time budget has passed to ensure a result is returned under uncertainty:\n<code>max_vote &gt;= max(2, active_tasks // 2 - 1) and max_vote - 1 &gt; second_high_frequency and elapsed_time &gt; available_time * 0.75</code></li>\n</ul>\n<p>Where:</p>\n<ul>\n<li><code>max_vote</code> is the frequency of the current best answer (max frequency among answers);</li>\n<li><code>active_tasks</code> includes both running tasks and completed tasks that have already produced a valid answer (i.e., excluding only those that terminated without producing a valid answer);</li>\n<li><code>still_running_tasks</code> is the number of still running tasks;</li>\n<li><code>second_high_frequency</code> is the frequency of the second best answer;</li>\n<li><code>available_time</code> is the available time for the current problem;</li>\n<li><code>elapsed_time</code> is the elapsed time from the start of the inference for the current problem.</li>\n</ul>\n<p>In all cases, at least 2 valid votes are required before triggering any consensus condition, to prevent early termination on potentially noisy single-path results.</p>\n<h3>3.5.3. Fallback to Tool Outputs</h3>\n<p>If all reasoning paths conclude without a valid formatted answer (often due to model timeouts during the final CoT steps), the system performs a vote on the last valid numerical output returned by the Python interpreter within each reasoning path. This fallback mechanism significantly improves robustness; empirical analysis shows that the model frequently computes the correct value via TIR (as shown in the Main results section) but may fail to encapsulate it in the required \\boxed{} format if the execution limit is reached.</p>\n<h2>3.6. Adaptive pruning of less promising reasoning paths</h2>\n<p>To optimize computational efficiency for problems requiring extended reasoning chains, we implement an <strong>early pruning strategy</strong> designed to <strong>terminate less promising reasoning paths</strong>, inspired by the DeepConf framework [6]. When the elapsed time for a problem reaches a predefined fraction of its allocated budget, and the number of active paths still exceeds a given threshold, the system evaluates all paths and prunes the lowest-scoring ones. This mechanism reallocates GPU resources to the remaining high-scoring paths, allowing them to reach greater logical depth within the residual time. In our implementation, pruning is triggered when the elapsed time exceeds <code>60%</code> of the allocated budget and more than 75% of the initial reasoning paths remain active.\nEach reasoning path <code>i</code> is evaluated using a composite score <code>S</code> that integrates global and local token-level statistics. The pruning score is defined as:</p>\n<p>$$S_i = p_i \\cdot (1 - H_{g, i}) \\cdot (1 - H_{tail, i}) \\cdot C_{g, i} \\cdot C_{tail, i}$$</p>\n<p>Where <code>p</code>, <code>H</code> and <code>C</code> are the same as defined in Section 3.5.1, while <code>H</code> and <code>C</code> are analogous to <code>H</code> and <code>C</code>, but are computed using only the last <code>2048</code> tokens of the reasoning path (inspired by [6]).</p>\n<p>This scoring function effectively penalizes paths exhibiting high uncertainty (entropy) or low probability (confidence). While global metrics (<code>H</code>, <code>C</code>) provide an overview of the path's stability, the inclusion of tail metrics (<code>H</code>, <code>C</code>) is critical for detecting real-time \"hallucinations\" or logical instabilities (e.g., repetitive loops) that often emerge late in the generation process. By monitoring these fluctuations, the system can terminate decaying reasoning chains and focus the remaining temporal budget on the most robust candidates, maximizing the effectiveness of the Self-Consistency pool under strict time constraints. These combined metrics improve the accuracy of identifying and pruning reasoning paths that are likely to produce incorrect answers (as shown in the Main Results section).</p>\n<h1>4. Main Results</h1>\n<p>The proposed methodology was implemented and evaluated within the Kaggle competition environment (Python notebook, snapshot of 2025-11-07) , leveraging an NVIDIA H100 GPU accelerator. The software stack relies on the following dependencies:</p>\n<ul>\n<li><strong>AIMO3 dataset</strong> [1]: Provides the official competition environment and reference problem sets.</li>\n<li><strong>gpt-oss-120b</strong> [7]: Serves as the foundational LLM for all inference tasks.</li>\n<li><strong>openai-harmony</strong> [8]: Ensures that inference-time chat templates remain fully consistent with the model’s original training format.</li>\n<li><strong>vLLM</strong> [9]: A high-throughput inference engine used to deploy the model efficiently on the H100 GPU, optimizing memory usage and generation latency.</li>\n<li><strong>NumPy</strong> [10]: Used for numerical operations and to resolve minor dependency conflicts.</li>\n<li><strong>PuLP</strong> [11]: Invoked via the Python tool for solving linear programming and mathematical optimization subproblems when required.</li>\n</ul>\n<p>The following sections describe the experimental setup in detail, including the local validation strategy, default hyperparameter configurations, and an in-depth analysis of performance across multiple experimental runs, with a particular focus on ablation studies, overall performance and comparison with state of the art.</p>\n<h2>4.1. System Architecture and Execution Logic</h2>\n<p>The gpt-oss-120b model is loaded into GPU memory at the beginning of execution and persists throughout the entire inference process. To accelerate the initialization phase, model artifacts are first copied into RAM using multiprocessing, <strong>reducing load time from approximately 900s to ~250s</strong>. During this stage, all environment variables required for vLLM optimization and logging are configured.\nTo ensure strict compliance with competition time constraints and to prevent resource contention, the system’s core logic is decoupled into isolated processes using the multiprocessing library. These processes communicate via standardized queues, enabling robust and fault-tolerant execution.\nThe overall architecture is organized as follows:</p>\n<ul>\n<li><strong>Main Process</strong>: Responsible for global configuration, LLM deployment, initialization of the Python tool environment, and dynamic time management across the problem set. It executes a high-level control loop that orchestrates problem ingestion and final result collection.</li>\n<li><strong>Inference Engine</strong>: Each problem is handled using a dedicated thread pool that manages parallel reasoning paths. These threads interact with an OpenAI-compatible inference API (via vLLM), stream responses in real time, monitor elapsed time for early termination, and implement pruning of low-scoring paths. This component also handles log-probability extraction, final answer parsing, and computation of performance metrics.</li>\n<li><strong>Agentic Integration</strong>: The inference process interleaves text generation with Python tool execution. Each reasoning path is associated with a stateful Jupyter notebook instance running in a separate process, ensuring full isolation.</li>\n</ul>\n<p>Detailed pseudocode for system orchestration and inference workflows is provided in <em>Algorithm 3</em> and <em>Algorithm 4</em> in the Appendix.</p>\n<h2>4.2. Validation Dataset</h2>\n<p>For local testing, validation, and hyperparameter optimization, we employ a high-quality mathematical reasoning dataset comprising <strong>75 problems</strong>. This benchmark was specifically curated for the AIMO3 competition, with a focus on evaluating reasoning reliability through executable Python-based TIR (see <code>imo-benchmark.csv</code> in [15]). In alignment with the competition requirements, each problem is associated with a ground-truth integer answer within the range <code>[0, 99999]</code>.\nThe primary motivation for selecting this dataset is its high level of difficulty. This complexity is critical for accurately measuring performance gains during the optimization process. In contrast to simpler benchmarks, where many problems can be solved through shallow reasoning, this dataset provides a strong discriminative signal, enabling a clear assessment of the effectiveness of advanced reasoning strategies and test-time optimization techniques.</p>\n<h2>4.3. Hyperparameters and Experimental Configuration</h2>\n<p>Several parameters were inspired by high-performing public notebooks [12][13][14], which achieved strong results on both reference problems and the public leaderboard. To evaluate the individual contribution of each optimization strategy, we perform a series of controlled experimental runs. Each run isolates a specific component by disabling it while keeping all other parameters constant, following a standard ablation study methodology.\nThe primary hyperparameters used across all runs are summarized in <em>Table 1</em> in the Appendix. While the validation set consists of 75 problems (compared to 50 in the public/private leaderboard), the configuration remains identical to our final competition submission, with the total time budget scaled proportionally (7.5 hours for validation vs. 5 hours for submission).</p>\n<p>Additional vLLM optimizations were applied to reduce latency and memory overhead, including chunked prefill, prefix caching, asynchronous scheduling, and reduced CUDA graph capture size and sequence limits. Standard values were retained for top_p and top_k. All runs in Section 4.4 use this configuration unless otherwise specified. Additional implementation details are available in the submission notebook ([16] refers to the submission notebook, [17] refers to required dependencies, [21] refers to Google Colab version of submission notebook).</p>\n<h2>4.4. Experimental Runs and Comparative Settings</h2>\n<p>To rigorously evaluate the impact of each architectural component, we conducted a series of experimental runs, described in <em>Table 2</em>. Each run is based on the \"final_submission\" configuration, with the deactivation of a specific feature to isolate its effect on performance, except for the \"baseline\" run, where all new optimizations are disabled, and the \"time_constraints_disabled\", where only time constraints are removed.</p>\n<h5>Table 2: Experimental Runs</h5>\n<table>\n<thead>\n<tr>\n<th>Run Name</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>time_constraints_disabled</td>\n<td>Removes time constraints to the final submission to assess the model's unconstrained capability ceiling</td>\n</tr>\n<tr>\n<td>final_submission</td>\n<td>Configuration used for the final submission, including all optimizations</td>\n</tr>\n<tr>\n<td>early_break_disabled</td>\n<td>Disables dynamic pruning of low-scoring reasoning paths</td>\n</tr>\n<tr>\n<td>early_termination_disabled</td>\n<td>Disables the consensus-driven early termination mechanism</td>\n</tr>\n<tr>\n<td>medium_reasoning</td>\n<td>Reduces the reasoning level of gpt-oss-120b from HIGH to MEDIUM</td>\n</tr>\n<tr>\n<td>dynamic_time_management_disabled</td>\n<td>Uses static time allocation (average time per problem instead of dynamic time management)</td>\n</tr>\n<tr>\n<td>python_tool_disabled</td>\n<td>Uses pure Chain-of-Thought (CoT) reasoning without Python tool integration</td>\n</tr>\n<tr>\n<td>baseline</td>\n<td>Baseline before new optimizations</td>\n</tr>\n</tbody>\n</table>\n<p>The <strong>baseline</strong> run represents the most advanced configuration achievable using standard practices within the competition's constraints, characterized by:</p>\n<ul>\n<li><strong>Chain-of-Thought</strong> (CoT): Utilization of the native \"HIGH\" reasoning level of gpt-oss-120b;</li>\n<li><strong>Self-Consistency</strong>: A standard <code>k=7</code> parallel sampling approach with majority voting;</li>\n<li><strong>Time Allocation</strong>: Static average time per problem;</li>\n<li><strong>Pure Linguistic Inference</strong>: Deactivation of the Python tool integration, dynamic pruning of low-scoring reasoning paths, and consensus-driven early termination mechanism.</li>\n</ul>\n<p>It is important to note that while gpt-oss-120b natively supports Tool-Integrated Reasoning (TIR), the official implementation (requiring gpt-oss&gt;=0.0.5 and Python 3.12) proved incompatible with the Kaggle H100 environment (Python 3.11.13). Consequently, the baseline represents the model's unassisted reasoning limit, while our work introduces a custom-built, compatible TIR orchestration layer.</p>\n<p>Each run generates a detailed telemetry log capturing key metrics for every reasoning path (runs are available in [18], while generated logs are available in [19]). These logs are aggregated and analyzed to compute per-run performance statistics as well as global reasoning trends, which are presented in the following charts and tables (statistics and charts logic are available in [20]).</p>\n<h2>4.5. Experimental Results and Analysis</h2>\n<p>The following sections present a detailed analysis of the performance metrics obtained from the experimental runs described above. Results are evaluated across multiple dimensions, including ablation studies designed to isolate the contribution of each component and overall accuracy compared against the state-of-the-art baseline.\nIn particular, we analyze how individual test-time optimization strategies affect final accuracy. These results provide a comprehensive view of the system’s behavior, demonstrating how each component contributes to solving complex mathematical problems under strict time and resource constraints.</p>\n<h3>4.5.1. Ablation Studies</h3>\n<p>This section mainly evaluates the individual contribution of each optimization strategy to the overall system performance. By systematically deactivating specific components, we isolate their impact on accuracy, providing empirical justification for the architectural choices described in Section 3.</p>\n<h4>4.5.1.1. Distribution of Reasoning Path Outcomes per Experimental Run</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fa534f8cf678921b130b1bd54de970db6%2Fof%20incomplete%20wrong%20and%20correct%20reasoning%20paths%20per%20run.png?generation=1776729740190033&amp;alt=media\" alt=\"\">\nThe chart illustrates the distribution of incomplete, incorrect, and correct reasoning paths across the different experimental configurations. This global metric aggregates all individual traces generated for every problem, regardless of the final consensus answer.\nThe data demonstrates that TIR and dynamic time management significantly improve the yield of correct reasoning paths. Conversely, the HIGH reasoning level is primarily responsible for reducing the incidence of logical fallacies and incorrect outputs. The early break logic provides a marginal gain in the number of correct paths by reallocating resources to more promising chains.\nAs expected, removing time constraints altogether results in the highest proportion of correct paths, establishing the model's theoretical \"capability ceiling.\" Interestingly, disabling consensus-based early termination appears to slightly increase the count of correct paths; however, this is likely an artifact of redundant computations on simpler problems that would have otherwise terminated early, rather than a genuine improvement in solving more complex tasks.</p>\n<h4>4.5.1.2. Comparative Accuracy Metrics: pass@7, cons@7, and conf_cons@7</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F9503d0ccc3e12c6632d7d4bfb4711391%2Fpass7%20cons7%20and%20conf_conf7%20accuracy%20per%20run.png?generation=1776729780368012&amp;alt=media\" alt=\"\">\nThe chart compares three distinct accuracy metrics across each experimental run:</p>\n<ul>\n<li><strong>pass@k</strong> (k=7): Indicates the probability that at least one of the 7 reasoning paths produces the correct answer. This serves as the upper bound of the model's potential.</li>\n<li><strong>cons@k</strong> (k=7): Represents the accuracy achieved through standard majority voting among the 7 paths.</li>\n<li><strong>conf_cons@k</strong> (k=7): Our proposed metric which, while following the majority voting logic, employs the confidence- and entropy-based tie-breaking mechanism described in Section 3.5.1 when a consensus is not reached.</li>\n</ul>\n<p>The results demonstrate that the conf_cons@7 metric consistently outperforms the standard cons@7, although a gap remains compared to the pass@7 theoretical maximum. Consistent with previous observations, Python tool integration provides the most significant accuracy gain. However, each supplementary technique contributes to a cumulative improvement in the final score, most notably the dynamic time management and HIGH reasoning level, followed by the incremental gains from early break and early termination logic. Finally, removing time constraints establishes a higher accuracy ceiling, confirming that the model's performance is currently limited more by the inference budget than by its intrinsic reasoning capabilities.</p>\n<p>Regarding the gain provided by the Python tool integration, while the used validation set employed is tool-oriented, the benefits of TIR will partially transfer to more \"abstract\" domains, albeit with a shift in how the tool is utilized. For instance:</p>\n<ul>\n<li>Symbolic Algebra &amp; Geometry: By leveraging libraries like sympy, the model can offload complex algebraic manipulations or coordinate geometry calculations to a deterministic solver. This minimizes \"calculation drift\" in long CoT sequences, where models often make small sign errors or arithmetic slips.</li>\n<li>Verification, not just Solution: Even in proof-based or symbolic problems, TIR acts as a powerful verifier. The model can write scripts to test specific cases or validate intermediate numerical properties, providing a feedback loop that pure CoT lacks.</li>\n<li>Logical Structuring: Writing code forces the model to decompose abstract problems into discrete, executable steps. This \"algorithmic thinking\" often helps maintain a coherent logical flow even in pure proof tasks, reducing the likelihood of circular reasoning or vague hand-waving.</li>\n</ul>\n<p>As for the performance gains driven by dynamic time management, there is room for further optimization. As reported in Section 3.3., it is based on the scaling constants <code>Cmin</code> and <code>Cmax</code>. Initially, the parameter <code>Cmax=2.1</code> was empirically selected to allow the model to reach its maximum effective context window depth on difficult problems. The following table summarizes additional configurations evaluated during the final phases of the competition:</p>\n<table>\n<thead>\n<tr>\n<th>Cmin</th>\n<th>Cmax</th>\n<th>Public LB Scores</th>\n<th>Mean Score</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>0.88</td>\n<td>2.2</td>\n<td>37</td>\n<td>37.0</td>\n</tr>\n<tr>\n<td>0.86</td>\n<td>2.1</td>\n<td>39, 37, 38, 43</td>\n<td>39.25 (Final Submission)</td>\n</tr>\n<tr>\n<td>0.85</td>\n<td>2.0</td>\n<td>36</td>\n<td>36.0</td>\n</tr>\n<tr>\n<td>0.80</td>\n<td>2.0</td>\n<td>39</td>\n<td>39.0</td>\n</tr>\n<tr>\n<td>0.80</td>\n<td>2.1</td>\n<td>42, 41</td>\n<td>41.5</td>\n</tr>\n</tbody>\n</table>\n<p>While the selected final submission (<code>Cmin=0.86</code>, <code>Cmax=2.1</code>) achieved the highest peak score of 43/50, subsequent analysis suggests that a lower floor (<code>Cmin=0.80</code>) paired with <code>Cmax=2.1</code> yields a more stable mean performance (41.5).\nThe configuration <code>(0.80, 2.1)</code> was identified very close to the competition deadline, consequently, we prioritized the <code>(0.86, 2.1)</code> configuration for the final submission as it had already demonstrated high-ceiling potential in earlier runs.\nThese results indicate that performance is sensitive to the <code>Cmin</code> floor. A lower <code>Cmin</code> grants the system more flexibility to reallocate time from \"easy\" problems to \"hard\" ones, whereas an excessively high <code>Cmax</code> may lead to diminishing returns if the model exceeds its useful reasoning depth.</p>\n<p>Mathematical reasoning tasks are sensitive to problem ordering and stochastic sampling, and variance estimates are crucial to distinguish architectural gains from statistical noise. The experimental runs were conducted near the competition deadline to provide a reproducible and objective summary of each technique’s behavior on a high-difficulty public dataset. We acknowledge that these specific local runs reflect a single execution. Due to the significant computational intensity—each 75-problem run requiring approximately 7.5 hours on an NVIDIA H100 GPU—and strict hardware availability constraints, conducting multiple full-scale repetitions was not feasible within the remaining timeframe. \nHowever, the significance of the observed performance gaps is supported by the following factors:</p>\n<p></p><ul>\n<li>Noise Reduction by Design: We utilized a 75-problem \"High-Difficulty\" dataset to provide a more discriminative signal than standard benchmarks. Furthermore, Dynamic Time Management mitigates variance related to problem ordering by optimizing resource allocation, while Self-Consistency (<code>k=7</code>) reduces the impact of stochastic sampling.</li>\n<li>Consistency with Historical Evidence: The performance trends in our ablation studies align with the findings from months of internal testing and Public Leaderboard submissions. In every run, the removal of core components (TIR, HIGH reasoning level, or Dynamic Time Management) resulted in a logical and consistent degradation of accuracy.</li>\n<li>Public Leaderboard Correlation: To provide a broader perspective on variance, we compared the Public LB scores of our \"Final Submission\" against the \"Early Break Disabled\" configuration (the configuration with the smallest accuracy gap in local tests, 0.55 vs 0.51).<p></p>\n<table>\n<thead>\n<tr>\n<th>Notebook Configuration</th>\n<th>Public LB Scores</th>\n<th>Mean Score</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Final Submission</td>\n<td>39, 37, 38, 43</td>\n<td>39.25</td>\n</tr>\n<tr>\n<td>Early Break Disabled</td>\n<td>36, 38</td>\n<td>37</td>\n</tr>\n<tr>\n<td></td></tr></tbody></table></li></ul>\n\n\n\n\nAs shown, the Final Submission consistently maintains a higher mean score on the Public Leaderboard, mirroring the gap observed in our local experimental runs. The substantial gap between the Baseline (17/75) and the Final Submission (41/75) in local validation represents a nearly 2.4x improvement. Such a significant margin strongly suggests that the gains are driven by architectural optimizations rather than mere stochastic fluctuations.\n\n\n\n\nWhile we agree that additional runs would further refine these estimates, the convergence of local results, Public Leaderboard data, and ablation consistency provides strong evidence for the effectiveness of the proposed techniques.\n\n\n\n\n\n<h4>4.5.1.3. Effectiveness of Error Detection Metrics for Path Pruning</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fd6b8d4ef1100854418395f55909038a5%2FCorrect%20selection%20of%20wrong%20answers%20()%20by%20chosing%20the%20worst%20value%20of%20different%20metrics.png?generation=1776729854362148&amp;alt=media\" alt=\"\">\nThis chart evaluates the capability of different token-level metrics to correctly identify incorrect reasoning paths within \"ambiguous\" problems (defined as those where the model generated both correct and incorrect answers). By selecting the path with the worst value for a given metric, we measure how frequently that metric successfully points to a wrong answer.\nThe results indicate that tail entropy is the most reliable indicator of a failing reasoning chain, achieving the highest precision in identifying incorrect paths. This is followed by global mean entropy, tail confidence, and mean confidence. These findings empirically justify the composite \"early_break_score\" used in our pruning logic (Section 3.6). By using this metric, the system can effectively detect late-stage hallucinations or logical instabilities, allowing for the strategic termination of suboptimal paths and the reallocation of computational budget to more promising candidates.</p>\n<h4>4.5.1.4. Tie-breaking Success Rate by Metric Aggregation</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fb9ceb877d71d35ec7b4cefa680537dc2%2FTie-breaking%20success%20rate%20()%20per%20summed%20metric.png?generation=1778966896557181&amp;alt=media\" alt=\"\">\nThis chart illustrates the effectiveness of various metrics when used to resolve ties in \"ambiguous\" problems (those containing both correct and incorrect paths where no clear majority exists). The success rate is measured by selecting the answer with the highest aggregate score, where the score is the sum of the metric values across all paths yielding that specific answer.\nWhile the selected final submission utilized a tie_break_score based on global mean confidence and global mean entropy (Section 3.5.1), subsequent analyses reveal that alternative metrics may offer superior discriminative power. In particular, incorporating local confidence bottlenecks and reasoning-path length can produce substantially stronger tie-breaking performance.</p>\n<table>\n<thead>\n<tr>\n<th>Metric</th>\n<th>Formula</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Revised tie_break_score_A</td>\n<td>$$(1 - \\text{length_perc}) \\cdot \\text{min_conf}$$</td>\n</tr>\n<tr>\n<td>Revised tie_break_score_B</td>\n<td>$$\\text{tie_break_score} \\cdot (1 - \\text{length_perc}) \\cdot \\text{min_conf}$$</td>\n</tr>\n<tr>\n<td>Revised tie_break_score_C</td>\n<td>$$\\text{tie_break_score} \\cdot (1 - \\text{length_perc}) \\cdot \\text{min_conf} \\cdot \\text{tail_conf}$$</td>\n</tr>\n</tbody>\n</table>\n<p>Here, <code>length_perc</code> denotes the ratio between the generated response length and the model context limit (response_length / max_model_len).\nThese results suggest that localized confidence failures are more informative than global averages. Metrics such as mean_conf and mean_entropy can remain relatively stable even when a reasoning trajectory contains a critical logical error. In contrast, min_conf and tail_conf act as bottleneck indicators: a single low-confidence transition often coincides with a hallucinated deduction or unstable reasoning step and can act as a \"pivot point\" leading to reasoning divergence.\nThe inverse correlation between reasoning-path length and correctness is also notable. For Olympiad-style mathematical problems, successful solutions tend to emerge from relatively concise reasoning chains, whereas excessively long trajectories are more likely to exhibit reasoning drift, repetition, or self-inconsistent exploration.\nThese results suggest that combining global stability metrics with local confidence statistics and trajectory-length regularization may provide a more robust tie-breaking strategy for adaptive reasoning systems.</p>\n<h4>4.5.1.5. Reliability Analysis of the Format Recovery Mechanism</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F81ad1a4852a908d9f57d0444e443ab52%2FCorrect%20and%20wrong%20answers%20()%20which%20used%20format-recovery%20mechanism.png?generation=1776730054933917&amp;alt=media\" alt=\"\">\nThe chart illustrates the distribution of correct and incorrect answers for reasoning paths that required the Format Recovery mechanism during inference. The data reveals a significant correlation between formatting failures and logical errors: reasoning paths necessitating recovery are nearly twice as likely to produce an incorrect answer compared to those that adhere to the requested format natively. This empirical evidence justifies our decision to incorporate a penalty coefficient for recovered paths within both the tie-breaking and early-break scoring functions (Sections 3.5.1 and 3.6). By discounting these structurally weaker traces, the system increases the probability of selecting the most robust and consistent reasoning chains as the final output.</p>\n<h4>4.5.1.6. Accuracy of the Tool-Output Fallback Mechanism</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F86ad830e51b650eff4617779595a3d12%2FGuessed%20correct%20answers%20()%20by%20last%20tool%20valid%20execution.png?generation=1776730097700401&amp;alt=media\" alt=\"\">\nThis chart evaluates the correspondence between the final valid integer output from the Python interpreter and the ground-truth answer across all reasoning path of experimental runs. The data demonstrates that utilizing the last valid tool output as a fallback is a highly effective strategy for problems that reach the execution timeout before a formal conclusion can be generated.\nIn many high-complexity cases, the model successfully computes the correct value via a tool call in the final stages of reasoning, but lacks the remaining temporal budget to synthesize the final Chain-of-Thought (CoT) and the required LaTeX formatting. \nOn the 75-problem validation set, excluding the python_tool_disabled and baseline ablations (which do not use the Python tool), the tool-output fallback mechanism was triggered 45 times in total. A fallback event occurs when all 7 reasoning paths fail to produce a correctly formatted final answer, but at least one reasoning path generated a valid numerical result during a Python tool execution. Among these 45 fallback activations, the mechanism recovered the correct answer 3 times, corresponding to a conditional accuracy of approximately 6.67% once the fallback fires.\nAlthough the conditional success rate is relatively low, the fallback was intentionally designed as a last-resort recovery mechanism rather than a primary selection strategy. In these cases, the standard extraction and aggregation pipeline had already failed completely, meaning that without the fallback the system would deterministically output an incorrect answer. Consequently, even a small number of successful recoveries translates directly into measurable score improvements. Importantly, the fallback introduces essentially no additional inference-time cost, since it only reuses numerical outputs already produced during earlier Python tool executions rather than generating new reasoning trajectories. This empirically justifies our implementation of a consensus-based vote on tool outputs (Section 3.5.3) when no reasoning path reaches a natural termination within the allotted time.</p>\n<h4>4.5.1.7. Aggregate Token Generation and Reasoning Length</h4>\n<p><img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fbd19d9e9ea9f5db56bf1b739f841a479%2FGlobal%20length%20of%20reasoning%20paths%20per%20run.png?generation=1776730147413787&amp;alt=media\" alt=\"\">\nThe chart illustrates the total length (in tokens) of all reasoning paths generated across each experimental run. The following observations can be made:</p>\n<ul>\n<li><strong>Reasoning Depth</strong>: The MEDIUM reasoning level demonstrates significantly higher conciseness, as expected, though at the cost of the logical depth required for Olympiad-level problems.</li>\n<li><strong>Computational Efficiency</strong>: The integration of the Python tool and early break logic markedly reduces the total token count. TIR allows the model to outsource complex calculations to a deterministic interpreter rather than performing verbose step-by-step arithmetic. Simultaneously, the early break mechanism prunes suboptimal paths, preventing the waste of the inference budget on low-probability outcomes.</li>\n<li><strong>Resource Optimization</strong>: Conversely, consensus-based early termination and dynamic time management may increase the total token generation. Without early termination, the system would remain idle or complete redundant traces instead of initiating inference on the next problem with maximum parallelism. Furthermore, dynamic management allows more difficult problems to reach their full reasoning potential rather than being prematurely terminated by a static timeout, thereby maximizing the utilization of the available context window.</li>\n</ul>\n<h3>4.5.2. Overall Performance and Comparison with State of the Art</h3>\n<p>The integration of the strategies discussed in the previous sections culminated in a robust mathematical solver. This framework effectively raised the model's capability ceiling by optimizing the inference process. To quantify this gain, we compared our final submission against a standard state-of-the-art (SOTA) baseline. This baseline represents the most advanced configuration achievable using standard practices within the competition's constraints, as described in Section 4.4.</p>\n<p>In local validation (on selected hard problems), our final submission achieved a score of <strong>41/75</strong>, which increased to <strong>47/75</strong> when time constraints were removed. In comparison, the initial baseline score was <strong>17/75</strong>.</p>\n<p>On the AIMO3 Public Leaderboard, our selected final submission achieved a maximum score of <strong>43/50</strong> and a mean score of <strong>39.25/50</strong> (based on four submissions with range 37-43). </p>\n<p>On the AIMO3 Private Leaderboard, our selected final submission achieved a score of <strong>42.0/50</strong>, ranking 373rd out of 4,138.</p>\n<p>These results could be further improved by increasing the number of parallel paths per problem and expanding the context window on more powerful hardware.</p>\n<h1>5. Conclusion and Future Work</h1>\n<p>In this work, we presented a novel strategy designed for the AIMO3 competition. By integrating a custom-built, fault-tolerant Tool-Integrated Reasoning (TIR) layer with adaptive test-time optimizations, including dynamic time management, lightweight role-based CoT prompting with robust format recovery, Self-Consistency with consensus-based early termination and confidence-/entropy-based tie-breaking, adaptive pruning of less promising reasoning paths, we successfully extended the mathematical reasoning capabilities of the gpt-oss-120b model.\nOur experimental results demonstrate that the bottleneck in automated mathematical problem-solving often lies in the efficiency of the inference process, rather than just the model's intrinsic knowledge. The transition from a standard baseline to our optimized strategy yielded a significant performance gain, confirming that a deterministic execution environment paired with strategic test-time optimizations can achieve state-of-the-art results.\nMoving forward, we identify several promising avenues for improvement:</p>\n<ul>\n<li><strong>Hyperparameter Optimization</strong>: While the current parameters were derived empirically, future work will focus on a more rigorous tuning process. Additionally, combining voting techniques that utilize different sampling parameters could further stabilize predictions.</li>\n<li><strong>Process-based Reward Models</strong> (PRM): Integrating learned reward models could refine pruning and tie-breaking logic, allowing the system to detect subtle logical fallacies that current token-level or entropy-based metrics might miss.</li>\n<li><strong>Multi-model Ensembles</strong>: Exploring architectures where different specialized models collaborate via the same orchestration layer could establish a new performance ceiling for automated mathematical reasoning.</li>\n</ul>\n<h1>References</h1>\n<p>[1] Simon Frieder, Sam Bealing, Philip Vonderlind, Sida Li, Arsenii Nikolaiev, Geoff C. Smith, Kevin Buzzard, Timothy Gowers, Peter J. Liu, Po-Shen Loh, Lester Mackey, Leonardo de Moura, Dan Roberts, D. Sculley, Terence Tao, David Balduzzi, Simon Coyle, Alex Gerko, Ryan Holbrook, Addison Howard, and XTX Markets. AI Mathematical Olympiad - Progress Prize 3. <a href=\"https://kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3\" target=\"_blank\">https://kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3</a>, 2025. Kaggle.</p>\n<p>[2] Ivan Moshkov, Darragh Hanley, Ivan Sorokin, Shubham Toshniwal, Christof Henkel, Benedikt Schifferer, Wei Du, Igor Gitman. AIMO-2 Winning Solution: Building State-of-the-Art Mathematical Reasoning Models with OpenMathReasoning dataset, 2025. URL <a href=\"https://arxiv.org/pdf/2504.16891\" target=\"_blank\">https://arxiv.org/pdf/2504.16891</a>.</p>\n<p>[3] Heng Lin and Zhongwen Xu. Understanding Tool-Integrated Reasoning, 2025. URL <a href=\"https://arxiv.org/pdf/2508.19201\" target=\"_blank\">https://arxiv.org/pdf/2508.19201</a>.</p>\n<p>[4] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed H. Chi, Quoc V. Le, Denny Zhou. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models, 2023. URL <a href=\"https://arxiv.org/pdf/2201.11903\" target=\"_blank\">https://arxiv.org/pdf/2201.11903</a>.</p>\n<p>[5] Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed H. Chi, Sharan Narang, Aakanksha Chowdhery, Denny Zhou. Self-consistency improves chain of thought reasoning in language models, 2023. URL <a href=\"https://arxiv.org/pdf/2203.11171\" target=\"_blank\">https://arxiv.org/pdf/2203.11171</a>.</p>\n<p>[6] Yichao Fu, Xuewei Wang, Yuandong Tian, Jiawei Zhao. Deep think with confidence, 2025. URL <a href=\"https://arxiv.org/pdf/2508.15260\" target=\"_blank\">https://arxiv.org/pdf/2508.15260</a>.</p>\n<p>[7] OpenAI. gpt-oss-120b &amp; gpt-oss-20b Model Card, 2025. URL <a href=\"https://arxiv.org/pdf/2508.10925\" target=\"_blank\">https://arxiv.org/pdf/2508.10925</a>, <a href=\"https://huggingface.co/openai/gpt-oss-120b\" target=\"_blank\">https://huggingface.co/openai/gpt-oss-120b</a>, <a href=\"https://www.kaggle.com/models/danielhanchen/gpt-oss-120b/Transformers/default/1\" target=\"_blank\">https://www.kaggle.com/models/danielhanchen/gpt-oss-120b/Transformers/default/1</a>.</p>\n<p>[8] openai-harmony 0.0.8. URL <a href=\"https://pypi.org/project/openai-harmony/0.0.8/\" target=\"_blank\">https://pypi.org/project/openai-harmony/0.0.8/</a>.</p>\n<p>[9] vllm 0.11.2. URL <a href=\"https://pypi.org/project/vllm/0.11.2/\" target=\"_blank\">https://pypi.org/project/vllm/0.11.2/</a>, <a href=\"https://docs.vllm.ai/projects/recipes/en/latest/OpenAI/GPT-OSS.html#troubleshooting\" target=\"_blank\">https://docs.vllm.ai/projects/recipes/en/latest/OpenAI/GPT-OSS.html#troubleshooting</a>, <a href=\"https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken\" target=\"_blank\">https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken</a>, <a href=\"https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken\" target=\"_blank\">https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken</a>.</p>\n<p>[10] numpy 2.2.0. URL <a href=\"https://pypi.org/project/numpy/2.2.0/\" target=\"_blank\">https://pypi.org/project/numpy/2.2.0/</a>.</p>\n<p>[11] PuLP 3.3.0. <a href=\"https://pypi.org/project/PuLP/3.3.0/\" target=\"_blank\">https://pypi.org/project/PuLP/3.3.0/</a></p>\n<p>[12] ShelterW. [Way to 30+/50] GPT-OSS - w/ python tool. URL <a href=\"https://www.kaggle.com/code/shelterw/way-to-30-50-gpt-oss-w-python-tool?scriptVersionId=285192299\" target=\"_blank\">https://www.kaggle.com/code/shelterw/way-to-30-50-gpt-oss-w-python-tool?scriptVersionId=285192299</a></p>\n<p>[13] Andreas Bisiadis. AIMO 3 | GPT-OSS-120B (with tools). URL <a href=\"https://www.kaggle.com/code/andreasbis/aimo-3-gpt-oss-120b-with-tools?scriptVersionId=290379281\" target=\"_blank\">https://www.kaggle.com/code/andreasbis/aimo-3-gpt-oss-120b-with-tools?scriptVersionId=290379281</a></p>\n<p>[14] parthenos. [44/50] LET ME (over)COOK!!!. URL <a href=\"https://www.kaggle.com/code/nihilisticneuralnet/44-50-skill-optional-luck-zaroori?scriptVersionId=291499043\" target=\"_blank\">https://www.kaggle.com/code/nihilisticneuralnet/44-50-skill-optional-luck-zaroori?scriptVersionId=291499043</a></p>\n<p>[15] wenliangtlh. AIMO3-High-Difficulty-Tool-Calling-Dataset. URL <a href=\"https://www.kaggle.com/datasets/wenliangtlh/aimo3-high-difficulty-tool-calling-dataset\" target=\"_blank\">https://www.kaggle.com/datasets/wenliangtlh/aimo3-high-difficulty-tool-calling-dataset</a></p>\n<p>[16] Potrhino. AIMO3-v3, version 11 (final submission notebook). URL <a href=\"https://www.kaggle.com/code/potrhino/aimo3-v3?scriptVersionId=302225896\" target=\"_blank\">https://www.kaggle.com/code/potrhino/aimo3-v3?scriptVersionId=302225896</a></p>\n<p>[17] Potrhino. AIMO3-dependencies-v1, version 10 (dependencies of final submission notebook). URL <a href=\"https://www.kaggle.com/code/potrhino/aimo3-dependencies-v1?scriptVersionId=297334166\" target=\"_blank\">https://www.kaggle.com/code/potrhino/aimo3-dependencies-v1?scriptVersionId=297334166</a></p>\n<p>[18] Potrhino. AIMO3-v3-v11-runs (validation runs notebook for main results). URL <a href=\"https://www.kaggle.com/code/potrhino/aimo3-v3-v11-runs?scriptVersionId=313133192\" target=\"_blank\">https://www.kaggle.com/code/potrhino/aimo3-v3-v11-runs?scriptVersionId=313133192</a></p>\n<p>[19] Potrhino. AIMO3-local-logs (validation results dataset). URL <a href=\"https://www.kaggle.com/datasets/potrhino/aimo3-local-logs\" target=\"_blank\">https://www.kaggle.com/datasets/potrhino/aimo3-local-logs</a></p>\n<p>[20] Potrhino. AIMO3-v3-v11-results (validation stats &amp; charts notebook). URL <a href=\"https://www.kaggle.com/code/potrhino/aimo3-v3-v11-results?scriptVersionId=313200617\" target=\"_blank\">https://www.kaggle.com/code/potrhino/aimo3-v3-v11-results?scriptVersionId=313200617</a></p>\n<p>[21] Potrhino. potrhino-aimo3-v3.ipynb (Google Colab version of final submission notebook). <a href=\"https://colab.research.google.com/drive/1vXAcdEiVcTM7oeQTFcsZsfQ6-ms33TK5?usp=sharing\" target=\"_blank\">https://colab.research.google.com/drive/1vXAcdEiVcTM7oeQTFcsZsfQ6-ms33TK5?usp=sharing</a></p>\n<h1>Appendix</h1>\n<h2>Table 1: Hyperparameters</h2>\n<table>\n<thead>\n<tr>\n<th>Param</th>\n<th>Value</th>\n<th>Note</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>device</td>\n<td>cuda</td>\n<td>Enables NVIDIA H100 GPU acceleration required to run gpt-oss-120b</td>\n</tr>\n<tr>\n<td>dtype</td>\n<td>auto</td>\n<td>Uses default precision (bfloat16)</td>\n</tr>\n<tr>\n<td>kv-cache-dtype</td>\n<td>fp8_e4m3</td>\n<td>Reduces memory footprint vs. bf16, enabling higher parallelism with negligible precision loss</td>\n</tr>\n<tr>\n<td>gpu_memory_utilization</td>\n<td>0.97</td>\n<td>Maximizes GPU memory usage during inference</td>\n</tr>\n<tr>\n<td>max_model_len</td>\n<td>64*1024</td>\n<td>Balances reasoning depth and VRAM constraints</td>\n</tr>\n<tr>\n<td>enable_tool</td>\n<td>True</td>\n<td>Enables Python tool usage during reasoning</td>\n</tr>\n<tr>\n<td>reasoning</td>\n<td>HIGH</td>\n<td>Activates the highest CoT reasoning level</td>\n</tr>\n<tr>\n<td>temperature</td>\n<td>1.0</td>\n<td>Balances stochasticity for diverse Self-Consistency sampling</td>\n</tr>\n<tr>\n<td>min_p</td>\n<td>0.02</td>\n<td>Filters low-probability tokens while preserving diversity</td>\n</tr>\n<tr>\n<td>reasoning_paths</td>\n<td>7</td>\n<td>Number of parallel reasoning paths for majority voting</td>\n</tr>\n<tr>\n<td>max_time</td>\n<td>int(5<em>60</em>60<em>1.5 - 3.5</em>60)</td>\n<td>Total available time budget</td>\n</tr>\n<tr>\n<td>problems_number</td>\n<td>50+25</td>\n<td>Total number of problems in validation</td>\n</tr>\n<tr>\n<td>enable_dynamic_time_management</td>\n<td>True</td>\n<td>Enables adaptive per-problem time allocation</td>\n</tr>\n<tr>\n<td>min_time_coef</td>\n<td>0.86</td>\n<td>Lower bound for time allocation scaling</td>\n</tr>\n<tr>\n<td>max_time_coef</td>\n<td>2.1</td>\n<td>Upper bound for time allocation scaling</td>\n</tr>\n<tr>\n<td>top_logprobs</td>\n<td>20</td>\n<td>Used to compute entropy based on top-20 token probabilities [6]</td>\n</tr>\n<tr>\n<td>group_logprobs_len</td>\n<td>2048</td>\n<td>Window size for tail entropy/confidence estimation [6]</td>\n</tr>\n<tr>\n<td>enable_early_break</td>\n<td>True</td>\n<td>Enables pruning of low-scoring reasoning paths</td>\n</tr>\n<tr>\n<td>execution_timeout</td>\n<td>8</td>\n<td>Initial execution timeout (seconds) for Python tool calls</td>\n</tr>\n<tr>\n<td>max_tool_step</td>\n<td>200</td>\n<td>Maximum number of tool calls per reasoning path</td>\n</tr>\n<tr>\n<td>max_tool_output_len</td>\n<td>1000</td>\n<td>Maximum tool output length before truncation</td>\n</tr>\n<tr>\n<td>max_tool_error</td>\n<td>5</td>\n<td>Maximum number of tool errors before environment reset</td>\n</tr>\n<tr>\n<td>precision</td>\n<td>100000</td>\n<td>Numerical precision for Python tool environment</td>\n</tr>\n<tr>\n<td>int_max_digits</td>\n<td>1000000</td>\n<td>Maximum integer size supported for Python tool environment</td>\n</tr>\n<tr>\n<td>recursion_limit</td>\n<td>2000</td>\n<td>Maximum recursion depth for Python tool environment</td>\n</tr>\n<tr>\n<td>enable_early_termination</td>\n<td>True</td>\n<td>Enables consensus-based early termination</td>\n</tr>\n</tbody>\n</table>\n<h2>Algorithm 1: Python Tool Execution Process</h2>\n<pre><code>    Initialize Jupyter kernel session\n    Configure Environment:\n        - Pre-import libraries (math, numpy, sympy, etc.)\n        - Set high float precision and integer max_digits\n        - Increase recursion depth limit\n\n    While True:\n        Receive {Python_code, available_time} from Main Process\n\n        If Python_code is None:\n            Shutdown Kernel and Exit\n\n        If Python_code is \"CLEAN\":\n            Restart Jupyter Kernel and re-initialize environment\n            Return empty confirmation\n\n        Else:\n            # Determine execution limit using Adaptive Timeout logic\n            T_limit = Calculate_Timeout(available_time, consecutive_timeouts)\n\n            # Execute code in the stateful session\n            Output = Execute_in_Jupyter(Python_code, timeout=T_limit)\n\n            # Post-process Output (Output Length Control)\n            If length(Output) &gt; THRESHOLD:\n                Output = Truncate_Center(Output, max_length=THRESHOLD)\n\n            Return Output\n</code></pre>\n<h2>Algorithm 2: Dynamic time management</h2>\n<pre><code>    #Init constants\n    START_TIME = time.now() \n    ...initialization logic...\n    INIT_OVERHEAD = time.now() - START_TIME\n    TOTAL_CLOCK = int(5*60*60 - 3.5*60) #5 hours with a safety margin of 3.5 minutes (in seconds)\n    DEADLINE = START_TIME + TOTAL_CLOCK\n    TOTAL_PROBLEMS = 50\n    C_min = 0.86 \n    C_max = 2.1 \n    T_avg = (TOTAL_CLOCK - INIT_OVERHEAD) / TOTAL_PROBLEMS \n\n    #Main loop\n    processed_problems = 0\n    for each incoming problem P:\n        # Reserve time for all future problems\n        remaining_problems = TOTAL_PROBLEMS - processed_problems - 1\n        reserved_buffer = remaining_problems * (T_avg  * C_min)\n        # Calculate current budget\n        T_pool = DEADLINE - time.now() - reserved_buffer\n        # Apply elastic constraints\n        available_time = max( min(T_pool, T_avg * C_max), T_avg * C_min )\n        # Final problem consumes all remaining time\n        if remaining_problems == 0:\n            available_time = DEADLINE - time.now()\n        #Solve the problem within available_time\n        solve(P, time_limit=available_time)\n        processed_problems += 1\n</code></pre>\n<h2>Algorithm 3: Main process logic</h2>\n<pre><code>    Init global configurations\n    Spawn Process \"PM\": Load LLM into memory\n    Spawn Process Pool \"PTP\": Stateful Python Tool environments (one per parallel path)\n\n    For each incoming problem \"P\":\n        If \"P\" is None: \n            Shutdown \"PTP\" pool and \"PM\" process\n            Break\n\n        Compute available time \"T\" # Via Dynamic Time Management logic\n        Init \"AG\": List for valid reasoning path answers\n        Init \"ATG\": List for fallback tool-only answers\n        Init Stop Event \"S\": For early termination\n        Init Global Metrics \"GM\": For cross-thread pruning/scoring\n\n        Start Thread Pool \"TP\":\n            Execute parallel inference on \"P\" using \"PM\" (LLM) and \"PTP\" (Tools)\n\n        Init \"best_answer\" to 0\n        Init \"max_vote\" to 0\n        For each completed thread \"j\" in \"TP\":\n            Get response metrics \"A_j\"\n            If \"A_j\" contains a valid extracted answer:\n                Add \"A_j\" to \"AG\"\n                # Update Best Answer and relative vote using Self-Consistency + Tie-Break\n                \"best_answer\", \"max_vote\" = SmartVote(\"AG\")\n\n                If Consensus-Based Early Termination criteria met:\n                    Signal Stop Event \"S\" to halt remaining threads\n                    Break\n            Else:\n                # Fallback: check if the last Python tool output is a valid number\n                If \"AT_j\" contains valid tool result:\n                    Add \"AT_j\" to \"ATG\"\n\n        # Final Fallback: If no reasoning path finished, vote on Tool outputs\n        If \"max_vote\" == 0 and \"ATG\" is not empty:\n            \"best_answer\", \"max_vote\" = SmartVote(\"ATG\")\n\n        Shutdown Thread Pool \"TP\" (cleanup)\n        Return \"best_answer\"\n</code></pre>\n<h2>Algorithm 4: Thread-Level Inference Logic</h2>\n<pre><code>    Init conversation \"C\" with role-based prompts and tool definitions\n    Init \"available_steps\" = 200\n    Init \"FormatRecoveryEnabled\" = True\n    Init \"response_text\", \"logprobs\", \"top_logprobs\" as empty\n\n    While \"available_steps\" &gt; 0:\n        If context_window_exhausted: # Safety margin of 4096 to allow final answer/tool output\n            Break  \n\n        Open Response Stream \"RS\" from LLM\n        For each chunk in \"RS\":\n            If Stop_Event \"S\" is set or global_time_limit reached:\n                Break\n\n            Update \"response_text\", \"logprobs\", and \"top_logprobs\"\n\n            # Adaptive Pruning Check (every 2048 tokens)\n            If Pruning_Enabled and tokens_since_last_check &gt; 2048:\n                Compute reasoning metrics (Entropy/Confidence)\n                Update Global Metrics \"GM[i]\"\n                If pruning_criteria_met: # Based on elapsed time, active tasks and relative score\n                    Break\n\n        If Stop_Event \"S\" is set: Break\n\n        Extract Numerical Answer \"A_j\"\n        If \"A_j\" is valid: \n            Break # Success: Answer found\n\n        if global_time_limit reached or pruning_criteria_met:\n            break\n\n        Update conversation \"C\" with current reasoning step (reasoning, tool call)\n\n        If current response contains a Tool Call:   \n            Extract generated Python code\n            Execute code in Jupyter session \"PTP[i]\" -&gt; Get result \"RES\"\n            Update conversation \"C\" with Tool Output\n            If \"RES\" is a valid integer answer:\n                Save as Fallback Tool Answer \"AT_j\"\n        Else: # No tool call and no valid answer found\n            If \"FormatRecoveryEnabled\":\n                Update \"C\" with a new User Prompt for Format recovery\n                \"FormatRecoveryEnabled\" = False # Only one recovery attempt allowed\n            Else:\n                Break # Failed to recover format\n\n        \"available_steps\" -= 1\n\n    Clean Jupyter Session \"PTP[i]\"\n    Compute final response metrics (Mean/Tail Entropy, Confidence, etc.)\n    Return Metrics and Candidate Answers (\"A_j\", \"AT_j\")\n</code></pre>",
      "rawMarkdown": "# Abstract\nThis writeup presents an advanced inference-time optimization strategy developed by the Potrhino team for the final evaluation of the AI Mathematical Olympiad (AIMO) Progress Prize 3, ranking 373rd out of 4,138. Recognizing that solving Olympiad-level mathematics under strict temporal and computational constraints nowadays is primarily an efficiency-bottlenecked task, we pivot from traditional model fine-tuning toward adaptive test-time orchestration. Leveraging the open-weight gpt-oss-120b model, our approach integrates:\n- **Tool-Integrated Reasoning** (TIR) in a high-precision environment with adaptive timeouts;\n- **Dynamic time management** across problem set;\n- Lightweight role-based **Chain-of-Thought** (CoT) prompting with robust format recovery;\n- **Self-Consistency** with consensus-based early termination and confidence-/entropy-based tie-breaking;\n- **Adaptive pruning** of less promising reasoning paths. \n\nThrough rigorous ablation studies, we demonstrate that the synergy of these techniques significantly elevates the model’s performance ceiling, achieving the following scores:\n- **42.0/50** on the AIMO3 Private Leaderboard;\n- **43/50** on the AIMO3 Public Leaderboard;\n- **41/75** on high-difficulty problems used for local validation.\n\nOur results establish that strategic resource management and deterministic tool augmentation can improve mathematical reasoning performance. To ensure full reproducibility, our code, environment configurations, and experimental logs are made publicly available.\n\n# 1. Introduction\nIn recent years, **Large Language Models** (LLMs) have demonstrated remarkable proficiency across a broad spectrum of natural language tasks, evolving from fluent text generators into versatile problem solvers. Despite these advancements, complex mathematical reasoning remains a challenge, particularly at the Olympiad level. Proficiency in this domain is critical, as it serves as a cornerstone for solving intricate problems in fields ranging from advanced engineering to quantitative finance. While recent breakthroughs have seen **Artificial Intelligence** (AI) achieve human-level performance on **International Mathematical Olympiad** (IMO) problems, a notable performance gap persists between state-of-the-art closed-source models and their open-weight counterparts. \n\nThe **AI Mathematical Olympiad Progress Prize 3** (AIMO3) [1] aims to bridge this divide by challenging participants to develop open-source algorithms and models capable of solving high-level mathematical problems under **strict computational and time constraints**. While AIMO Progress Prize 2 was won in April 2025 by Nvidia's NemoSkills team [2], AIMO3 utilizes entirely original problems to eliminate the risk of data contamination. Every ground-truth label is an integer within the range [0, 99999]. Submissions, consisting of **Kaggle notebooks**, are evaluated on a private test set of 50 math problems, where scoring is based on the consistency of two independent predictions: for each problem, a score of 1.0 is awarded if both answers are correct, 0.5 if only one is correct, and 0 otherwise. The competition enforces a rigorous offline environment, limiting execution to 5 hours on GPU-accelerated notebooks (H100, P100, or T4×2) or 12 hours on CPU-based notebooks. \n\nThis writeup details the strategy presented by the Potrhino team, which achieved a score of **43/50** in the public evaluation. The proposed approach leverages the **gpt-oss-120b** [7] model on H100 hardware, integrating:\n- **Tool-Integrated Reasoning** (TIR) [3] in a high-precision environment;\n- **Dynamic time management** across problems;\n- Lightweight role-based **Chain-of-Thought** (CoT) [4] prompting with robust format recovery;\n- **Self-Consistency** [5] with consensus-based early termination and confidence-/entropy-based tie-breaking;\n- **Adaptive pruning** of less promising reasoning paths, using concepts inspired by \"**Deep Think with Confidence**\" [6] framework. \n\nThese methodologies are designed to **optimize test-time inference** under strict computational and time constraints. The following sections introduce the fundamental concepts, then describe the proposed strategy, and finally provide a comprehensive analysis of the results.\n\n# 2. Related Work\n## 2.1. Tool-Integrated Reasoning [3]\nWhile LLMs have evolved into versatile problem solvers, purely text-based reasoning often struggles with tasks requiring precise numerical computation, long-horizon search, or rigorous verification. To address these inherent limitations, **Tool-Integrated Reasoning** (TIR) has emerged as an increasingly adopted paradigm. By equipping LLMs with external tools, such as **Python code interpreters**, TIR effectively expands the model's capabilities and transcends the \"capability ceiling\" of purely linguistic inference.\n\nRecent research demonstrates that TIR-augmented models decisively **outperform pure-text** counterparts across challenging mathematical benchmarks. This performance gain is particularly evident in the **pass@k** metric, as the interpreter provides a deterministic execution environment that mitigates common calculation errors. Furthermore, this advantage extends beyond mere arithmetic. It also facilitates complex problem-solving strategies, such as brute-force search and algorithmic simulation, which would be intractably verbose or prone to failure in a standard autoregressive setup. \n\n*Figure 1* shows pass@k curves for the TIR (RL-trained) and pure-text models (Qwen3 8B) across benchmarks: (a) AIME24, (b) AIME25 [3]. This illustrates how TIR provides a significant gain in accuracy on AIME problems, which makes it an ideal candidate for AIMO3.\n##### Figure 1\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F319f0b6de502290fff5b1b1f46194bf3%2FTIR_ACCURACY.png?generation=1776346717057232&alt=media)\n\n## 2.2. Chain-of-Thought Prompting [4]\nWhile scaling the parameters of LLMs generally improves performance, scale alone is often insufficient for mastering complex arithmetic and symbolic reasoning. **Chain-of-Thought** (CoT) prompting addresses this limitation by eliciting a series of intermediate reasoning steps before arriving at a final conclusion. This approach offers several critical advantages for Olympiad-level mathematics:\n- **Problem Decomposition**: CoT allows the model to break down multi-step problems into manageable intermediate steps, effectively allocating more computational \"budget\" to high-complexity tasks.\n- **Interpretability and Debugging**: It provides a transparent window into the model’s reasoning path, facilitating the identification and correction of logical fallacies or calculation errors.\n- **Versatility**: CoT is applicable to a wide range of reasoning tasks, from abstract proof-based questions to symbolic manipulation.\n- **Zero-Shot/Few-Shot Elicitation**: Reasoning abilities can be readily activated in sufficiently large models via specialized prompting or few-shot exemplars.\n\nCoT transforms a model from a direct predictor into a systematic reasoner, enabling it to bridge the gap between problem understanding and the final output. *Figure 2* shows the solve rate of CoT and other prompting variations using LaMDA 137B and PaLM 540B on the GSM8K dataset [4]. This illustrates how CoT outperforms other prompting variations, highlighting its effectiveness in improving reasoning for math problems. However, CoT alone does not guarantee correctness, as errors can propagate across intermediate steps.\n##### Figure 2\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F13633ce68b5c9d7569e1b919b209264a%2FCoT_ACCURACY.png?generation=1776551872549459&alt=media)\n\n## 2.3. Self-Consistency [5]\nA fundamental characteristic of complex problem-solving is the existence of multiple diverse reasoning paths that converge on the same correct solution. **Self-Consistency** leverages this intuition by replacing traditional greedy decoding with a sampling-based approach. The method involves generating a diverse set of reasoning paths and subsequently selecting the most consistent final answer by marginalizing out the sampled paths, a process commonly implemented as **majority voting**. This technique significantly enhances the robustness of CoT prompting. While an LLM may occasionally produce erroneous intermediate steps, incorrect reasoning paths are statistically less likely to converge on the same final value compared to valid logical sequences. Consequently, the correct answer tends to exhibit higher agreement across the sample population. Beyond raw accuracy gains, Self-Consistency provides two additional advantages:\n- **Uncertainty Estimation**: The agreement among sampled answers serves as a reliable proxy for the model's confidence in a given solution.\n- **Calibration**: It improves output reliability by filtering out stochastic \"hallucinations\" or calculation errors through consensus. \n\nA primary constraint of Self-Consistency is the increased test-time compute required. However, empirical evidence suggests that performance gains often saturate relatively quickly. Therefore, a strategically limited number of paths (e.g., k=5 or k=10) can capture the majority of the benefits without exceeding time limits. This trade-off is especially critical in constrained environments such as AIMO3, where inference budget is strictly limited. \n*Figure 3* shows how Self-Consistency improves accuracy across various reasoning tasks, using LaMDA-137B [5].\n##### Figure 3\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F5a7fdb7a5084e8f86210ad0329bbb23c%2FSelf_consistency_ACCURACY.png?generation=1776348545912708&alt=media)\n\n## 2.4. Deep Think with Confidence [6]\nWhile parallel reasoning techniques like Self-Consistency enhance accuracy, they often encounter two primary bottlenecks: the linear scaling of inference overhead and diminishing returns caused by the equal weighting of all reasoning traces. Standard majority voting fails to account for quality variations, potentially allowing low-confidence or \"hallucinated\" traces to compromise the final output.\nTo address these limitations, the **Deep Think with Confidence** (DeepConf) methodology integrates confidence-aware filtering based on local token-level statistics. Unlike global measures that average confidence across an entire sequence, thereby masking localized reasoning failures, DeepConf monitors fluctuations at critical intermediate steps. This approach offers two distinct operational modes:\n- **Offline Mode**: Traces are filtered post-generation by aggregating entropy and confidence scores. This identifies and discards low-quality reasoning paths before the voting process, ensuring only robust chains contribute to the final consensus.\n- **Online Mode**: This mode enables real-time generation control and early stopping. By detecting low-confidence signals as they emerge, the system can prematurely terminate suboptimal traces, significantly reducing redundant token generation.\n\nEmpirical results demonstrate that DeepConf not only improves accuracy by mitigating noise from low-quality traces but also optimizes resource allocation. In offline mode, DeepConf@512 achieves **99.9%** accuracy on AIME 2025 using gpt-oss-120b (without tools), effectively saturating the benchmark compared to 97.0% for cons@512 (consensus/majority voting) and 91.8% for pass@1. In online mode, DeepConf reduces token generation by up to 84.7% compared to standard parallel sampling while maintaining or exceeding baseline accuracy. This efficiency is critical for maximizing the number of effective reasoning paths under strict computational and time constraints. This idea directly inspired our adaptive pruning and early termination strategy. *Figure 4* shows the aforementioned results for both online and offline modes on AIME 2025 [6]. \n##### Figure 4\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F66b614b3c5d06a433690b0af1d1aeb5d%2FDeep_conf_ACCURACY.png?generation=1776348951716265&alt=media)\n\n## 2.5. gpt-oss-120b [7]\n**gpt-oss-120b** is an open-weight, reasoning-focused autoregressive model released under the Apache 2.0 license. Optimized for agentic workflows, it excels in instruction following, structured output generation, and tool integration (e.g., Python execution). The model architecture is a **Mixture-of-Experts** (MoE) Transformer, featuring 36 layers with a total of 116.8B parameters, of which 5.1B are active per token. The MoE weights are quantized to **MXFP4** format (4.25 bits per parameter), comprising over 90% of the total parameter count. This enables operation within the constraints of a single **80GB GPU** (such as the H100). The model was trained using the **Harmony** chat format, which utilizes specialized tokens for message boundaries and a role-based hierarchy to resolve instruction conflicts (**System > Developer > User > Assistant > Tool**). A distinctive feature of gpt-oss-120b is its support for three distinct reasoning levels (**Low, Medium, and High**), where higher levels correlate with increased **CoT** length and logical depth (as shown in *Figure 5* [7]).\n##### Figure 5\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fdfdbd0b9257ab6a1010135c1e9bef41c%2Fgpt-oss-cot.png?generation=1776349514505657&alt=media)\n\nThe model is natively trained to utilize a suite of agentic tools:\n- **Python Tool**: Enables code execution within a stateful Jupyter notebook environment, facilitating TIR.\n- **Browsing Tool**: Facilitates web interaction to improve factual accuracy beyond the knowledge cutoff (not used in this work due to offline constraints).\n- **Custom Developer Functions**: Allow for arbitrary function schemas defined via the Harmony format.\n\nBy interleaving CoT with TIR, gpt-oss-120b achieves high accuracy on mathematical benchmarks (as illustrated in *Figure 6*) while maintaining rapid inference speed and efficient memory utilization. We selected gpt-oss-120b due to its strong reasoning capabilities, native support for tool use, and compatibility with single-GPU deployment under AIMO constraints.\n##### Figure 6\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F73d193171bc7b245bc1f3888488b99f3%2Fgpt-oss-benchmark_table.png?generation=1776349624566200&alt=media)\n\n# 3. Adaptive Test-Time Optimization of gpt-oss-120b with TIR and CoT\nThe primary challenge of the AIMO3 competition lies in developing an AI system capable of solving IMO-level mathematical problems under stringent time and computational constraints. While modern LLMs have shown increasing proficiency in this domain, success hinges on identifying the optimal **trade-off** between reasoning **accuracy** and execution **latency**. \nOur approach addresses this challenge by leveraging the **gpt-oss-120b** model as a high-capacity foundation and concentrating development efforts on **test-time optimization**. The overall approach is structured around a set of strategic pillars, with hyperparameters calibrated to balance robustness and efficiency, while remaining amenable to further fine-grained optimization. These pillars include:\n- **Tool-Integrated Reasoning** (TIR) in a **high-precision environment**;\n- **Dynamic time management** across problems;\n- **Lightweight role-based CoT prompting** with **robust format recovery**;\n- **Self-Consistency** with **consensus-based early termination** and **confidence-/entropy-based tie-breaking**;\n- **Adaptive pruning of less promising reasoning paths**, using concepts inspired by DeepConf framework. \n\n## 3.1. gpt-oss-120b as a High-Capacity Foundation Model\nWe select the open-weight **gpt-oss-120b** model as the primary backbone. Given its strong baseline performance on mathematical benchmarks, further supervised fine-tuning (SFT) is deemed unnecessary. Specifically, the model achieves **strong performance on AIME 2024 and AIME 2025** [7] when utilizing the **\"High\" CoT reasoning level** combined with **TIR**. Beyond raw accuracy, the model aligns well with the competition's hardware and temporal constraints. Utilizing the MXFP4 quantized format, gpt-oss-120b **fits comfortably within the VRAM of a single H100 GPU**, maintaining high inference throughput despite its 120B parameters. Furthermore, the **average response length for AIME 2025** problems is reported to remain **below 16k tokens** [7], which supports an effective balance between depth of reasoning with execution speed. Consequently, we hypothesize that further SFT would yield diminishing returns relative to the substantial computational costs and the risk of increasing latency. This design choice also improves reproducibility, as it avoids reliance on additional proprietary training data or compute-intensive fine-tuning stages.\n\n## 3.2. Tool-Integrated Reasoning (TIR) in a High-Precision Environment\nThe model's reasoning process is augmented by a **Python tool**, which can be invoked at any step of its reasoning chain. The model generates code blocks containing `print()` statements to retrieve intermediate results, which are then executed in a **stateful Jupyter notebook** environment. \n### 3.2.1. Environment Configuration and Precision\nTo facilitate complex symbolic and numerical tasks, the execution environment is pre-configured with essential **scientific libraries** (e.g., `math, numpy, sympy`). To handle the rigorous demands of Olympiad-level problems, such as **deeply nested recursion**, operations involving **very large integers** or **high-precision floating-point** arithmetic, we increase the system’s default limits as follow:\n- `recursion_limit = 2000`;\n- `precision = 100000`;\n- `int_max_digits = 1000000`.\n### 3.2.2. Long Output Management\nTo prevent **long execution outputs** from saturating the model’s context window, we implement a centralized **truncation strategy**. Outputs exceeding a predefined **threshold** (`L_max = 1000` characters) are clipped: only the initial and final `L_max/2` characters are preserved, separated by a `... TRUNCATED ...` marker. This ensures the model receives both the **beginning and final portions of the output** while discarding redundant intermediate iterations. This encourages more concise tool usage and provides the model with the segments of the output that typically contain the most relevant information. \n### 3.2.3. Adaptive Timeouts\nTo ensure that inefficient or infinite loops do not deplete the problem's time budget, we implement an adaptive timeout strategy for code execution. This strategy balances the need for rapid feedback on simpler problems with the requirement for long-running computations on more complex ones: \n- **Iterative Optimization**: If a code execution triggers a timeout, the error is fed back into the model's context. This explicitly signals the model to optimize its algorithmic approach (e.g., moving from a brute-force to a more efficient mathematical simulation).\n- **Exponential Backoff**: Each consecutive timeout for a given problem allows for a slightly longer execution window for the subsequent attempt, capped at twice the initial duration. This prevents inefficient code from stalling the pipeline while still allowing complex computations to complete.\n\nThe **execution timeout** for each call is determined by the following formula:\n\n$$Texec = \\min( \\min(Tinit \\cdot 1.3^n, 2 \\cdot Tinit), Tremaining )$$\n\nWhere: \n- `Tinit` is the starting execution timeout (set to `8s`);\n- `n` is the number of consecutive timeouts for the current problem;\n- `Tremaining` is the residual time allocated to the specific problem.\n\n\nThe selection of `Tinit=8s` and the growth factor of `1.3` is driven by an empirical balance between code complexity and session latency. A baseline of `8s` is sufficient for the majority of standard mathematical scripts (e.g., symbolic manipulations or short loops). The exponential scaling factor of `1.3` is specifically calibrated to allow the execution limit to double after exactly three consecutive timeouts. Capping the growth at `2 * Tinit` prevents unoptimized or runaway scripts from depleting the global time budget, which is a critical risk in time-constrained environments. Furthermore, we hypothesize that if a model fails to produce an efficient solution within three attempts (and nearly doubling the initial timeout), the bottleneck is likely structural rather than purely computational. Beyond this threshold, additional time yields diminishing returns, as the model is encouraged to shift toward an alternative reasoning strategy or a more efficient mathematical simulation rather than marginally optimizing failing code.\nThe interaction between the LLM and the execution environment is managed via a dedicated worker process; the detailed operational logic of this Jupyter worker is provided in *Algorithm 1* (see Appendix).\n\n## 3.3. Dynamic Time Management Across Problems\nThe total execution time is partitioned across all 50 problems to ensure robustness against varying problem difficulties. After accounting for the initial setup overhead, including environment initialization and model loading, we implement a **dynamic time-budgeting algorithm**. The budget for a given problem, `Tp`, is determined by:\n\n$$Tp = \\max( \\min(Tpool, Tavg \\cdot Cmax), Tavg \\cdot Cmin )$$\n\nWhere: \n- `Tpool` is the total remaining time after subtracting the reserved buffer for all future problems (`Tavg * Cmin` for each remaining problem);\n- `Tavg` represents the baseline allocation, calculated as the initial total available time divided by the total number of problems;\n- `Cmax` is a scaling constant for upper bound (2.1);\n- `Cmin` is a scaling constant for lower bound (0.86).\n\nThis mechanism ensures that a single outlier (an extremely difficult problem) cannot deplete the resources required for the rest of the test set. Furthermore, it allows simpler problems to conclude early and return their unused budget to the global pool, thereby granting additional computational time to high-complexity cases without risking a global submission timeout.\nThe coefficients `Cmin` and `Cmax` were empirically selected to balance risk and performance. A `Cmin` of 0.86 ensures that even in the worst-case scenario, every problem is guaranteed approximately 85% of the baseline average time. Conversely, a `Cmax` of 2.1 allows the solver to spend more than double the average time on difficult problems without destabilizing the overall schedule. This upper bound was also found to be sufficient for the model to reach the maximum effective depth of its context window. This dynamic approach ensures that the \"time-to-solution\" is maximized for challenging problems while maintaining a zero-failure rate regarding the global 5-hour deadline. The detailed operational logic is provided in *Algorithm 2* (see Appendix).\n\n## 3.4. Lightweight Role-Based CoT Prompting with Robust Format Recovery\nThe prompts used for solving mathematical problems are intentionally **minimal** and **role-based**. Since gpt-oss-120b is natively optimized for multi-level CoT reasoning, overly verbose or complex prompts can introduce unwanted bias or lead the model toward suboptimal reasoning paths. Instead, we leveraged the model's role-based hierarchy to enforce constraints while preserving its inherent problem-solving flexibility. The strategy is organized across following prompts:\n- **System Role** (Highest Priority): This prompt contains the most critical constraints that the model must follow literally. It defines the **model's persona** as a \"rigorous world-class math competitor\" and strictly dictates the **output format** (a single integer between 0 and 99999 within a \\boxed{} delimiter).\n- **Developer Role**: This role provides **\"soft\" guidance** rather than rigid instructions. The used prompt suggests a **careful CoT approach** and **encourages the use of the Python tool** for verification or complex calculations. We also included a directive to **avoid guessing** and provided a **list of pre-installed libraries** to streamline tool usage. While official OpenAI best practices suggest that CoT-style prompts are unnecessary for models with built-in reasoning, our empirical results with gpt-oss-120b show that CoT prompts increase the number of correct responses for hard problems, although they generally generate longer responses for simpler tasks. An evaluation of two versions of a previous notebook revealed that the CoT version achieved a score of 39 on the Public Leaderboard, while the non-CoT version achieved 37. Furthermore, in [6] the authors achieved 99.9% accuracy on AIME 2025 using gpt-oss-120b by specifically appending \"Please reason step by step, and put your final answer within \\boxed{}.\" to the user prompt. We explicitly avoided step-by-step prompting, which can lead to excessively verbose outputs at the 'High' reasoning level (a submission replacing \"carefully\" with \"step by step\" yielded a score of 38 on the Public Leaderboard). Using the word \"carefully\" provided the best tradeoff: it encourages precision, caution, and consistency without forcing the model into the extreme verbosity of a full \"step-by-step\" instruction. This approach can help to reduce errors on difficult problems while maintaining efficiency on simpler ones.\n- **Tool Description**: A synthetic prompt defines the execution environment as a **stateful Jupyter notebook** without internet access. It explicitly instructs the model to use `print()` for output, preventing empty execution results.\n- **User Role**: To avoid instruction confusion, the user role contains only the **raw text of the mathematical problem**.\n### 3.4.1. Prompt Templates\n**SYSTEM**: \"*You are a rigorous world-class math competitor. You must return the final answer in \\boxed{}. The final answer must be a single integer (digits only) between 0 and 99999 inclusive.*\"\n\n**DEVELOPER**: \"*Reason carefully to solve the problem and use the Python tool when necessary. You have access to math, numpy, sympy, mpmath, decimal, itertools, and pulp. Never guess.*\"\n\n**TOOL DESC**: \"*Use this tool to execute Python code. The environment is a stateful Jupyter notebook. You must use print() to output results. Internet access is off.*\"\n\n**USER**: \"*{problem}*\"\n\n### 3.4.2. Format Recovery\nTo convert the model's natural language output into the required competition format, the system employs a **multi-stage extraction pipeline**. It first attempts to extract the answer within standard LaTeX delimiters. If no match is found, it falls back to a secondary search for internal tags typically generated by the model's final reasoning tokens. The extraction utilizes the following regular expressions:\n- **Primary Regex** (Standard):  `oxed\\s*\\{[^\\d-]*(-?[0-9,]+\\.?[0-9]*)[^\\d]*\\}`\n- **Fallback Regex** (Internal Tag):  `assistantfinal\\s*[^\\n\\d-]*(-?[0-9,]+\\.?[0-9]*)[^\\d]*`\n\nIn cases where multiple matches occur within a single reasoning path, the system processes them in reverse chronological order (from the most recent to the first). This heuristic assumes that the model's final conclusion, often following a self-correction or a summary step, is more likely to be accurate than initial estimates. For each extracted candidate, a normalization function is applied to ensure compliance with the competition's constraints:\n- **Sanitization**: Commas (frequently used as thousands separators) are removed to prevent parsing errors.\n- **Rounding and Casting**: Candidates are rounded to the nearest integer to resolve floating-point artifacts or minor calculation residues from the Python tool.\n- **Modular Arithmetic**: A modulo `100,000` operation is applied. This ensures the output falls within the required `[0, 99999]` range, effectively handling cases where the model calculates a correct large value but omits the competition-specific modulus in its final response.\n\nA candidate is considered a valid final answer only if it results in an integer within the specified range. If a reasoning path concludes without a tool call and fails to yield a valid answer, a **self-correction loop** is triggered to **recover a valid formatted answer**. A follow-up prompt is appended to the conversation to guide the model:\n\n**USER** (Recovery): \"*The previous response did not produce a valid final answer. Continue solving the problem. Remember that the final answer must be a single integer (digits only) between 0 and 99999 inclusive, and must be placed in \\boxed{}.*\"\n\nTo prevent infinite loops and manage the time budget, this recovery attempt is limited to a single iteration; if a second failure occurs, the trace is terminated.\n\n## 3.5. Self-Consistency with Consensus-Based Early Termination and Confidence-/Entropy-Based Tie-Breaking\nWhereas our configuration supports a maximum concurrency of 7.52x, we initialize **7 parallel reasoning paths per problem** to maintain a stable and efficient Self-Consistency pipeline. To enhance accuracy and minimize computational redundancy, we implement an advanced **voting** mechanism that integrates **confidence/entropy-based tie-breaking**, **consensus-driven early termination**, and a **fallback to tool outputs**.\n### 3.5.1. Confidence-/entropy-based tie-breaking\nStarting from the second completed reasoning path, the system applies a **majority vote** each time a new answer is generated. In the event of a tie, where multiple candidates share the same maximum frequency, we apply a scoring metric to select the most reliable candidate (i.e., the one with the highest score). The score for a candidate answer `a`, denoted as `S`<sub>`tie,a`</sub>, is calculated as:\n\n$$S_{tie, a} = \\sum_{i \\in \\text{Paths}(a)} S_{a, i}$$\n\nWhere `S`<sub>`a,i`</sub> represents the individual score of reasoning path `i` that yielded answer `a`:\n\n$$S_{a, i} = p_i \\cdot (1 - H_{g, i}) \\cdot C_{g, i}$$\n\nWhere:\n\n- `p`<sub>`i`</sub> is a coefficient set to `0.75` if path `i` required Format Recovery (indicating a failure in the initial formatting), and `1.0` otherwise. As reported in the Main results section, paths requiring recovery are statistically less reliable.\n- `H`<sub>`g,i`</sub> is the mean entropy of the entire reasoning path `i`, considering the top `20` tokens for each generation step (inspired by [6]):\n\n$$H_{g, i} = \\frac{\\sum_{t=1}^{L} \\sum_{j=1}^{20} - \\exp(lp_{t,j}) \\log_2(\\exp(lp_{t,j}))}{L \\cdot \\log_2(20)}$$\n\n- `C`<sub>`g,i`</sub> is the mean confidence of the entire reasoning path `i` (inspired by [6]):\n\n$$C_{g, i} = \\exp\\left(\\frac{1}{L} \\sum_{t=1}^{L} lp_t\\right)$$\n\n- `lp`<sub>`t,j`</sub> is the log-probability of the `j-th` top candidate token at generation step `t`;\n- `lp`<sub>`t`</sub> is the log-probability of the token selected at generation step `t`;\n- `L` is the length of reasoning path, in tokens.\n\n### 3.5.2. Consensus-Based Early Termination\nTo optimize the inference budget, the system evaluates the consensus of the leading answer after each vote. If the agreement among reasoning paths is sufficiently robust, the process terminates early. We define four hierarchical levels of consensus based on answer frequency, the number of active tasks, and the remaining time budget.\n- **Strong Consensus**: Triggered when an answer holds an absolute majority or a lead that cannot be mathematically overtaken by remaining tasks:\n`max_vote > max(2, active_tasks/2) or max_vote > still_running_tasks + second_high_frequency` \n- **Uncontested Consensus**: Triggered when the leader holds at least half of the active tasks and a clear margin over the second candidate:\n`max_vote >= max(2, active_tasks // 2) and max_vote - 1 > second_high_frequency`\n- **Mature Consensus**: Activated after 50% of the problem's time budget has elapsed, requiring a leader with at least 2 votes:\n`max_vote >= max(2, active_tasks // 2) and max_vote > second_high_frequency and elapsed_time > available_time * 0.5`\n- **Emergent Consensus**: A lower-threshold trigger used after 75% of the time budget has passed to ensure a result is returned under uncertainty:\n`max_vote >= max(2, active_tasks // 2 - 1) and max_vote - 1 > second_high_frequency and elapsed_time > available_time * 0.75`\n\nWhere:\n- `max_vote` is the frequency of the current best answer (max frequency among answers);\n- `active_tasks` includes both running tasks and completed tasks that have already produced a valid answer (i.e., excluding only those that terminated without producing a valid answer);\n- `still_running_tasks` is the number of still running tasks;\n- `second_high_frequency` is the frequency of the second best answer;\n- `available_time` is the available time for the current problem;\n- `elapsed_time` is the elapsed time from the start of the inference for the current problem.\n\nIn all cases, at least 2 valid votes are required before triggering any consensus condition, to prevent early termination on potentially noisy single-path results.\n\n### 3.5.3. Fallback to Tool Outputs \nIf all reasoning paths conclude without a valid formatted answer (often due to model timeouts during the final CoT steps), the system performs a vote on the last valid numerical output returned by the Python interpreter within each reasoning path. This fallback mechanism significantly improves robustness; empirical analysis shows that the model frequently computes the correct value via TIR (as shown in the Main results section) but may fail to encapsulate it in the required \\boxed{} format if the execution limit is reached.\n\n## 3.6. Adaptive pruning of less promising reasoning paths\nTo optimize computational efficiency for problems requiring extended reasoning chains, we implement an **early pruning strategy** designed to **terminate less promising reasoning paths**, inspired by the DeepConf framework [6]. When the elapsed time for a problem reaches a predefined fraction of its allocated budget, and the number of active paths still exceeds a given threshold, the system evaluates all paths and prunes the lowest-scoring ones. This mechanism reallocates GPU resources to the remaining high-scoring paths, allowing them to reach greater logical depth within the residual time. In our implementation, pruning is triggered when the elapsed time exceeds `60%` of the allocated budget and more than 75% of the initial reasoning paths remain active.\nEach reasoning path `i` is evaluated using a composite score `S`<sub>`i`</sub> that integrates global and local token-level statistics. The pruning score is defined as:\n\n$$S_i = p_i \\cdot (1 - H_{g, i}) \\cdot (1 - H_{tail, i}) \\cdot C_{g, i} \\cdot C_{tail, i}$$\n\nWhere `p`<sub>`i`</sub>, `H`<sub>`g,i`</sub> and `C`<sub>`g,i`</sub> are the same as defined in Section 3.5.1, while `H`<sub>`tail,i`</sub> and `C`<sub>`tail,i`</sub> are analogous to `H`<sub>`g,i`</sub> and `C`<sub>`g,i`</sub>, but are computed using only the last `2048` tokens of the reasoning path (inspired by [6]).\n\nThis scoring function effectively penalizes paths exhibiting high uncertainty (entropy) or low probability (confidence). While global metrics (`H`<sub>`g,i`</sub>, `C`<sub>`g,i`</sub>) provide an overview of the path's stability, the inclusion of tail metrics (`H`<sub>`tail,i`</sub>, `C`<sub>`tail,i`</sub>) is critical for detecting real-time \"hallucinations\" or logical instabilities (e.g., repetitive loops) that often emerge late in the generation process. By monitoring these fluctuations, the system can terminate decaying reasoning chains and focus the remaining temporal budget on the most robust candidates, maximizing the effectiveness of the Self-Consistency pool under strict time constraints. These combined metrics improve the accuracy of identifying and pruning reasoning paths that are likely to produce incorrect answers (as shown in the Main Results section).\n\n# 4. Main Results\nThe proposed methodology was implemented and evaluated within the Kaggle competition environment (Python notebook, snapshot of 2025-11-07) , leveraging an NVIDIA H100 GPU accelerator. The software stack relies on the following dependencies:\n- **AIMO3 dataset** [1]: Provides the official competition environment and reference problem sets.\n- **gpt-oss-120b** [7]: Serves as the foundational LLM for all inference tasks.\n- **openai-harmony** [8]: Ensures that inference-time chat templates remain fully consistent with the model’s original training format.\n- **vLLM** [9]: A high-throughput inference engine used to deploy the model efficiently on the H100 GPU, optimizing memory usage and generation latency.\n- **NumPy** [10]: Used for numerical operations and to resolve minor dependency conflicts.\n- **PuLP** [11]: Invoked via the Python tool for solving linear programming and mathematical optimization subproblems when required.\n\nThe following sections describe the experimental setup in detail, including the local validation strategy, default hyperparameter configurations, and an in-depth analysis of performance across multiple experimental runs, with a particular focus on ablation studies, overall performance and comparison with state of the art.\n\n## 4.1. System Architecture and Execution Logic\nThe gpt-oss-120b model is loaded into GPU memory at the beginning of execution and persists throughout the entire inference process. To accelerate the initialization phase, model artifacts are first copied into RAM using multiprocessing, **reducing load time from approximately 900s to ~250s**. During this stage, all environment variables required for vLLM optimization and logging are configured.\nTo ensure strict compliance with competition time constraints and to prevent resource contention, the system’s core logic is decoupled into isolated processes using the multiprocessing library. These processes communicate via standardized queues, enabling robust and fault-tolerant execution.\nThe overall architecture is organized as follows:\n- **Main Process**: Responsible for global configuration, LLM deployment, initialization of the Python tool environment, and dynamic time management across the problem set. It executes a high-level control loop that orchestrates problem ingestion and final result collection.\n- **Inference Engine**: Each problem is handled using a dedicated thread pool that manages parallel reasoning paths. These threads interact with an OpenAI-compatible inference API (via vLLM), stream responses in real time, monitor elapsed time for early termination, and implement pruning of low-scoring paths. This component also handles log-probability extraction, final answer parsing, and computation of performance metrics.\n- **Agentic Integration**: The inference process interleaves text generation with Python tool execution. Each reasoning path is associated with a stateful Jupyter notebook instance running in a separate process, ensuring full isolation.\n\nDetailed pseudocode for system orchestration and inference workflows is provided in *Algorithm 3* and *Algorithm 4* in the Appendix.\n\n## 4.2. Validation Dataset\nFor local testing, validation, and hyperparameter optimization, we employ a high-quality mathematical reasoning dataset comprising **75 problems**. This benchmark was specifically curated for the AIMO3 competition, with a focus on evaluating reasoning reliability through executable Python-based TIR (see `imo-benchmark.csv` in [15]). In alignment with the competition requirements, each problem is associated with a ground-truth integer answer within the range `[0, 99999]`.\nThe primary motivation for selecting this dataset is its high level of difficulty. This complexity is critical for accurately measuring performance gains during the optimization process. In contrast to simpler benchmarks, where many problems can be solved through shallow reasoning, this dataset provides a strong discriminative signal, enabling a clear assessment of the effectiveness of advanced reasoning strategies and test-time optimization techniques.\n\n## 4.3. Hyperparameters and Experimental Configuration\nSeveral parameters were inspired by high-performing public notebooks [12][13][14], which achieved strong results on both reference problems and the public leaderboard. To evaluate the individual contribution of each optimization strategy, we perform a series of controlled experimental runs. Each run isolates a specific component by disabling it while keeping all other parameters constant, following a standard ablation study methodology.\nThe primary hyperparameters used across all runs are summarized in *Table 1* in the Appendix. While the validation set consists of 75 problems (compared to 50 in the public/private leaderboard), the configuration remains identical to our final competition submission, with the total time budget scaled proportionally (7.5 hours for validation vs. 5 hours for submission).\n\nAdditional vLLM optimizations were applied to reduce latency and memory overhead, including chunked prefill, prefix caching, asynchronous scheduling, and reduced CUDA graph capture size and sequence limits. Standard values were retained for top_p and top_k. All runs in Section 4.4 use this configuration unless otherwise specified. Additional implementation details are available in the submission notebook ([16] refers to the submission notebook, [17] refers to required dependencies, [21] refers to Google Colab version of submission notebook).\n\n## 4.4. Experimental Runs and Comparative Settings\nTo rigorously evaluate the impact of each architectural component, we conducted a series of experimental runs, described in *Table 2*. Each run is based on the \"final_submission\" configuration, with the deactivation of a specific feature to isolate its effect on performance, except for the \"baseline\" run, where all new optimizations are disabled, and the \"time_constraints_disabled\", where only time constraints are removed.\n\n##### Table 2: Experimental Runs\n| Run Name | Description |\n| --- | --- |\n| time_constraints_disabled | Removes time constraints to the final submission to assess the model's unconstrained capability ceiling |\n| final_submission | Configuration used for the final submission, including all optimizations |\n| early_break_disabled | Disables dynamic pruning of low-scoring reasoning paths |\n| early_termination_disabled | Disables the consensus-driven early termination mechanism |\n| medium_reasoning | Reduces the reasoning level of gpt-oss-120b from HIGH to MEDIUM |\n| dynamic_time_management_disabled | Uses static time allocation (average time per problem instead of dynamic time management) |\n| python_tool_disabled | Uses pure Chain-of-Thought (CoT) reasoning without Python tool integration |\n| baseline |  Baseline before new optimizations |\n\n\nThe **baseline** run represents the most advanced configuration achievable using standard practices within the competition's constraints, characterized by:\n- **Chain-of-Thought** (CoT): Utilization of the native \"HIGH\" reasoning level of gpt-oss-120b;\n- **Self-Consistency**: A standard `k=7` parallel sampling approach with majority voting;\n- **Time Allocation**: Static average time per problem;\n- **Pure Linguistic Inference**: Deactivation of the Python tool integration, dynamic pruning of low-scoring reasoning paths, and consensus-driven early termination mechanism.\n\nIt is important to note that while gpt-oss-120b natively supports Tool-Integrated Reasoning (TIR), the official implementation (requiring gpt-oss>=0.0.5 and Python 3.12) proved incompatible with the Kaggle H100 environment (Python 3.11.13). Consequently, the baseline represents the model's unassisted reasoning limit, while our work introduces a custom-built, compatible TIR orchestration layer.\n\nEach run generates a detailed telemetry log capturing key metrics for every reasoning path (runs are available in [18], while generated logs are available in [19]). These logs are aggregated and analyzed to compute per-run performance statistics as well as global reasoning trends, which are presented in the following charts and tables (statistics and charts logic are available in [20]).\n\n## 4.5. Experimental Results and Analysis\nThe following sections present a detailed analysis of the performance metrics obtained from the experimental runs described above. Results are evaluated across multiple dimensions, including ablation studies designed to isolate the contribution of each component and overall accuracy compared against the state-of-the-art baseline.\nIn particular, we analyze how individual test-time optimization strategies affect final accuracy. These results provide a comprehensive view of the system’s behavior, demonstrating how each component contributes to solving complex mathematical problems under strict time and resource constraints.\n\n### 4.5.1. Ablation Studies\nThis section mainly evaluates the individual contribution of each optimization strategy to the overall system performance. By systematically deactivating specific components, we isolate their impact on accuracy, providing empirical justification for the architectural choices described in Section 3.\n\n#### 4.5.1.1. Distribution of Reasoning Path Outcomes per Experimental Run\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fa534f8cf678921b130b1bd54de970db6%2Fof%20incomplete%20wrong%20and%20correct%20reasoning%20paths%20per%20run.png?generation=1776729740190033&alt=media)\nThe chart illustrates the distribution of incomplete, incorrect, and correct reasoning paths across the different experimental configurations. This global metric aggregates all individual traces generated for every problem, regardless of the final consensus answer.\nThe data demonstrates that TIR and dynamic time management significantly improve the yield of correct reasoning paths. Conversely, the HIGH reasoning level is primarily responsible for reducing the incidence of logical fallacies and incorrect outputs. The early break logic provides a marginal gain in the number of correct paths by reallocating resources to more promising chains.\nAs expected, removing time constraints altogether results in the highest proportion of correct paths, establishing the model's theoretical \"capability ceiling.\" Interestingly, disabling consensus-based early termination appears to slightly increase the count of correct paths; however, this is likely an artifact of redundant computations on simpler problems that would have otherwise terminated early, rather than a genuine improvement in solving more complex tasks.\n\n#### 4.5.1.2. Comparative Accuracy Metrics: pass@7, cons@7, and conf_cons@7\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F9503d0ccc3e12c6632d7d4bfb4711391%2Fpass7%20cons7%20and%20conf_conf7%20accuracy%20per%20run.png?generation=1776729780368012&alt=media)\nThe chart compares three distinct accuracy metrics across each experimental run:\n- **pass@k** (k=7): Indicates the probability that at least one of the 7 reasoning paths produces the correct answer. This serves as the upper bound of the model's potential.\n- **cons@k** (k=7): Represents the accuracy achieved through standard majority voting among the 7 paths.\n- **conf_cons@k** (k=7): Our proposed metric which, while following the majority voting logic, employs the confidence- and entropy-based tie-breaking mechanism described in Section 3.5.1 when a consensus is not reached.\n\nThe results demonstrate that the conf_cons@7 metric consistently outperforms the standard cons@7, although a gap remains compared to the pass@7 theoretical maximum. Consistent with previous observations, Python tool integration provides the most significant accuracy gain. However, each supplementary technique contributes to a cumulative improvement in the final score, most notably the dynamic time management and HIGH reasoning level, followed by the incremental gains from early break and early termination logic. Finally, removing time constraints establishes a higher accuracy ceiling, confirming that the model's performance is currently limited more by the inference budget than by its intrinsic reasoning capabilities.\n\nRegarding the gain provided by the Python tool integration, while the used validation set employed is tool-oriented, the benefits of TIR will partially transfer to more \"abstract\" domains, albeit with a shift in how the tool is utilized. For instance:\n- Symbolic Algebra & Geometry: By leveraging libraries like sympy, the model can offload complex algebraic manipulations or coordinate geometry calculations to a deterministic solver. This minimizes \"calculation drift\" in long CoT sequences, where models often make small sign errors or arithmetic slips.\n- Verification, not just Solution: Even in proof-based or symbolic problems, TIR acts as a powerful verifier. The model can write scripts to test specific cases or validate intermediate numerical properties, providing a feedback loop that pure CoT lacks.\n- Logical Structuring: Writing code forces the model to decompose abstract problems into discrete, executable steps. This \"algorithmic thinking\" often helps maintain a coherent logical flow even in pure proof tasks, reducing the likelihood of circular reasoning or vague hand-waving.\n\nAs for the performance gains driven by dynamic time management, there is room for further optimization. As reported in Section 3.3., it is based on the scaling constants `Cmin` and `Cmax`. Initially, the parameter `Cmax=2.1` was empirically selected to allow the model to reach its maximum effective context window depth on difficult problems. The following table summarizes additional configurations evaluated during the final phases of the competition:\n| Cmin | Cmax | Public LB Scores | Mean Score |\n| --- | --- | --- | --- |\n| 0.88 | 2.2 | 37 | 37.0 |\n| 0.86 | 2.1 | 39, 37, 38, 43 | 39.25 (Final Submission) |\n| 0.85 | 2.0 | 36 | 36.0 |\n| 0.80 | 2.0 | 39 | 39.0 |\n| 0.80 | 2.1 | 42, 41 | 41.5 |\n\nWhile the selected final submission (`Cmin=0.86`, `Cmax=2.1`) achieved the highest peak score of 43/50, subsequent analysis suggests that a lower floor (`Cmin=0.80`) paired with `Cmax=2.1` yields a more stable mean performance (41.5).\nThe configuration `(0.80, 2.1)` was identified very close to the competition deadline, consequently, we prioritized the `(0.86, 2.1)` configuration for the final submission as it had already demonstrated high-ceiling potential in earlier runs.\nThese results indicate that performance is sensitive to the `Cmin` floor. A lower `Cmin` grants the system more flexibility to reallocate time from \"easy\" problems to \"hard\" ones, whereas an excessively high `Cmax` may lead to diminishing returns if the model exceeds its useful reasoning depth.\n\nMathematical reasoning tasks are sensitive to problem ordering and stochastic sampling, and variance estimates are crucial to distinguish architectural gains from statistical noise. The experimental runs were conducted near the competition deadline to provide a reproducible and objective summary of each technique’s behavior on a high-difficulty public dataset. We acknowledge that these specific local runs reflect a single execution. Due to the significant computational intensity—each 75-problem run requiring approximately 7.5 hours on an NVIDIA H100 GPU—and strict hardware availability constraints, conducting multiple full-scale repetitions was not feasible within the remaining timeframe. \nHowever, the significance of the observed performance gaps is supported by the following factors:\n- Noise Reduction by Design: We utilized a 75-problem \"High-Difficulty\" dataset to provide a more discriminative signal than standard benchmarks. Furthermore, Dynamic Time Management mitigates variance related to problem ordering by optimizing resource allocation, while Self-Consistency (`k=7`) reduces the impact of stochastic sampling.\n- Consistency with Historical Evidence: The performance trends in our ablation studies align with the findings from months of internal testing and Public Leaderboard submissions. In every run, the removal of core components (TIR, HIGH reasoning level, or Dynamic Time Management) resulted in a logical and consistent degradation of accuracy.\n- Public Leaderboard Correlation: To provide a broader perspective on variance, we compared the Public LB scores of our \"Final Submission\" against the \"Early Break Disabled\" configuration (the configuration with the smallest accuracy gap in local tests, 0.55 vs 0.51).\n| Notebook Configuration | Public LB Scores | Mean Score |\n| --- | --- | --- |\n| Final Submission | 39, 37, 38, 43 | 39.25 |\n| Early Break Disabled | 36, 38 | 37 |\n\nAs shown, the Final Submission consistently maintains a higher mean score on the Public Leaderboard, mirroring the gap observed in our local experimental runs. The substantial gap between the Baseline (17/75) and the Final Submission (41/75) in local validation represents a nearly 2.4x improvement. Such a significant margin strongly suggests that the gains are driven by architectural optimizations rather than mere stochastic fluctuations.\nWhile we agree that additional runs would further refine these estimates, the convergence of local results, Public Leaderboard data, and ablation consistency provides strong evidence for the effectiveness of the proposed techniques. \n\n#### 4.5.1.3. Effectiveness of Error Detection Metrics for Path Pruning\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fd6b8d4ef1100854418395f55909038a5%2FCorrect%20selection%20of%20wrong%20answers%20()%20by%20chosing%20the%20worst%20value%20of%20different%20metrics.png?generation=1776729854362148&alt=media)\nThis chart evaluates the capability of different token-level metrics to correctly identify incorrect reasoning paths within \"ambiguous\" problems (defined as those where the model generated both correct and incorrect answers). By selecting the path with the worst value for a given metric, we measure how frequently that metric successfully points to a wrong answer.\nThe results indicate that tail entropy is the most reliable indicator of a failing reasoning chain, achieving the highest precision in identifying incorrect paths. This is followed by global mean entropy, tail confidence, and mean confidence. These findings empirically justify the composite \"early_break_score\" used in our pruning logic (Section 3.6). By using this metric, the system can effectively detect late-stage hallucinations or logical instabilities, allowing for the strategic termination of suboptimal paths and the reallocation of computational budget to more promising candidates.\n\n#### 4.5.1.4. Tie-breaking Success Rate by Metric Aggregation\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fb9ceb877d71d35ec7b4cefa680537dc2%2FTie-breaking%20success%20rate%20()%20per%20summed%20metric.png?generation=1778966896557181&alt=media)\nThis chart illustrates the effectiveness of various metrics when used to resolve ties in \"ambiguous\" problems (those containing both correct and incorrect paths where no clear majority exists). The success rate is measured by selecting the answer with the highest aggregate score, where the score is the sum of the metric values across all paths yielding that specific answer.\nWhile the selected final submission utilized a tie_break_score based on global mean confidence and global mean entropy (Section 3.5.1), subsequent analyses reveal that alternative metrics may offer superior discriminative power. In particular, incorporating local confidence bottlenecks and reasoning-path length can produce substantially stronger tie-breaking performance.\n| Metric | Formula |\n| --- | --- |\n| Revised tie_break_score_A | $$(1 - \\text{length\\_perc}) \\cdot \\text{min\\_conf}$$ |\n| Revised tie_break_score_B | $$\\text{tie\\_break\\_score} \\cdot (1 - \\text{length\\_perc}) \\cdot \\text{min\\_conf}$$ |\n| Revised tie_break_score_C | $$\\text{tie\\_break\\_score} \\cdot (1 - \\text{length\\_perc}) \\cdot \\text{min\\_conf} \\cdot \\text{tail\\_conf}$$ |\n\nHere, `length_perc` denotes the ratio between the generated response length and the model context limit (response_length / max_model_len).\nThese results suggest that localized confidence failures are more informative than global averages. Metrics such as mean_conf and mean_entropy can remain relatively stable even when a reasoning trajectory contains a critical logical error. In contrast, min_conf and tail_conf act as bottleneck indicators: a single low-confidence transition often coincides with a hallucinated deduction or unstable reasoning step and can act as a \"pivot point\" leading to reasoning divergence.\nThe inverse correlation between reasoning-path length and correctness is also notable. For Olympiad-style mathematical problems, successful solutions tend to emerge from relatively concise reasoning chains, whereas excessively long trajectories are more likely to exhibit reasoning drift, repetition, or self-inconsistent exploration.\nThese results suggest that combining global stability metrics with local confidence statistics and trajectory-length regularization may provide a more robust tie-breaking strategy for adaptive reasoning systems.\n\n#### 4.5.1.5. Reliability Analysis of the Format Recovery Mechanism\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F81ad1a4852a908d9f57d0444e443ab52%2FCorrect%20and%20wrong%20answers%20()%20which%20used%20format-recovery%20mechanism.png?generation=1776730054933917&alt=media)\nThe chart illustrates the distribution of correct and incorrect answers for reasoning paths that required the Format Recovery mechanism during inference. The data reveals a significant correlation between formatting failures and logical errors: reasoning paths necessitating recovery are nearly twice as likely to produce an incorrect answer compared to those that adhere to the requested format natively. This empirical evidence justifies our decision to incorporate a penalty coefficient for recovered paths within both the tie-breaking and early-break scoring functions (Sections 3.5.1 and 3.6). By discounting these structurally weaker traces, the system increases the probability of selecting the most robust and consistent reasoning chains as the final output.\n\n#### 4.5.1.6. Accuracy of the Tool-Output Fallback Mechanism\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2F86ad830e51b650eff4617779595a3d12%2FGuessed%20correct%20answers%20()%20by%20last%20tool%20valid%20execution.png?generation=1776730097700401&alt=media)\nThis chart evaluates the correspondence between the final valid integer output from the Python interpreter and the ground-truth answer across all reasoning path of experimental runs. The data demonstrates that utilizing the last valid tool output as a fallback is a highly effective strategy for problems that reach the execution timeout before a formal conclusion can be generated.\nIn many high-complexity cases, the model successfully computes the correct value via a tool call in the final stages of reasoning, but lacks the remaining temporal budget to synthesize the final Chain-of-Thought (CoT) and the required LaTeX formatting. \nOn the 75-problem validation set, excluding the python_tool_disabled and baseline ablations (which do not use the Python tool), the tool-output fallback mechanism was triggered 45 times in total. A fallback event occurs when all 7 reasoning paths fail to produce a correctly formatted final answer, but at least one reasoning path generated a valid numerical result during a Python tool execution. Among these 45 fallback activations, the mechanism recovered the correct answer 3 times, corresponding to a conditional accuracy of approximately 6.67% once the fallback fires.\nAlthough the conditional success rate is relatively low, the fallback was intentionally designed as a last-resort recovery mechanism rather than a primary selection strategy. In these cases, the standard extraction and aggregation pipeline had already failed completely, meaning that without the fallback the system would deterministically output an incorrect answer. Consequently, even a small number of successful recoveries translates directly into measurable score improvements. Importantly, the fallback introduces essentially no additional inference-time cost, since it only reuses numerical outputs already produced during earlier Python tool executions rather than generating new reasoning trajectories. This empirically justifies our implementation of a consensus-based vote on tool outputs (Section 3.5.3) when no reasoning path reaches a natural termination within the allotted time.\n\n#### 4.5.1.7. Aggregate Token Generation and Reasoning Length\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F23110311%2Fbd19d9e9ea9f5db56bf1b739f841a479%2FGlobal%20length%20of%20reasoning%20paths%20per%20run.png?generation=1776730147413787&alt=media)\nThe chart illustrates the total length (in tokens) of all reasoning paths generated across each experimental run. The following observations can be made:\n- **Reasoning Depth**: The MEDIUM reasoning level demonstrates significantly higher conciseness, as expected, though at the cost of the logical depth required for Olympiad-level problems.\n- **Computational Efficiency**: The integration of the Python tool and early break logic markedly reduces the total token count. TIR allows the model to outsource complex calculations to a deterministic interpreter rather than performing verbose step-by-step arithmetic. Simultaneously, the early break mechanism prunes suboptimal paths, preventing the waste of the inference budget on low-probability outcomes.\n- **Resource Optimization**: Conversely, consensus-based early termination and dynamic time management may increase the total token generation. Without early termination, the system would remain idle or complete redundant traces instead of initiating inference on the next problem with maximum parallelism. Furthermore, dynamic management allows more difficult problems to reach their full reasoning potential rather than being prematurely terminated by a static timeout, thereby maximizing the utilization of the available context window.\n\n### 4.5.2. Overall Performance and Comparison with State of the Art\nThe integration of the strategies discussed in the previous sections culminated in a robust mathematical solver. This framework effectively raised the model's capability ceiling by optimizing the inference process. To quantify this gain, we compared our final submission against a standard state-of-the-art (SOTA) baseline. This baseline represents the most advanced configuration achievable using standard practices within the competition's constraints, as described in Section 4.4.\n\nIn local validation (on selected hard problems), our final submission achieved a score of **41/75**, which increased to **47/75** when time constraints were removed. In comparison, the initial baseline score was **17/75**.\n\nOn the AIMO3 Public Leaderboard, our selected final submission achieved a maximum score of **43/50** and a mean score of **39.25/50** (based on four submissions with range 37-43). \n\nOn the AIMO3 Private Leaderboard, our selected final submission achieved a score of **42.0/50**, ranking 373rd out of 4,138.\n\nThese results could be further improved by increasing the number of parallel paths per problem and expanding the context window on more powerful hardware.\n\n# 5. Conclusion and Future Work\nIn this work, we presented a novel strategy designed for the AIMO3 competition. By integrating a custom-built, fault-tolerant Tool-Integrated Reasoning (TIR) layer with adaptive test-time optimizations, including dynamic time management, lightweight role-based CoT prompting with robust format recovery, Self-Consistency with consensus-based early termination and confidence-/entropy-based tie-breaking, adaptive pruning of less promising reasoning paths, we successfully extended the mathematical reasoning capabilities of the gpt-oss-120b model.\nOur experimental results demonstrate that the bottleneck in automated mathematical problem-solving often lies in the efficiency of the inference process, rather than just the model's intrinsic knowledge. The transition from a standard baseline to our optimized strategy yielded a significant performance gain, confirming that a deterministic execution environment paired with strategic test-time optimizations can achieve state-of-the-art results.\nMoving forward, we identify several promising avenues for improvement:\n- **Hyperparameter Optimization**: While the current parameters were derived empirically, future work will focus on a more rigorous tuning process. Additionally, combining voting techniques that utilize different sampling parameters could further stabilize predictions.\n- **Process-based Reward Models** (PRM): Integrating learned reward models could refine pruning and tie-breaking logic, allowing the system to detect subtle logical fallacies that current token-level or entropy-based metrics might miss.\n- **Multi-model Ensembles**: Exploring architectures where different specialized models collaborate via the same orchestration layer could establish a new performance ceiling for automated mathematical reasoning.\n\n# References\n[1] Simon Frieder, Sam Bealing, Philip Vonderlind, Sida Li, Arsenii Nikolaiev, Geoff C. Smith, Kevin Buzzard, Timothy Gowers, Peter J. Liu, Po-Shen Loh, Lester Mackey, Leonardo de Moura, Dan Roberts, D. Sculley, Terence Tao, David Balduzzi, Simon Coyle, Alex Gerko, Ryan Holbrook, Addison Howard, and XTX Markets. AI Mathematical Olympiad - Progress Prize 3. https://kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3, 2025. Kaggle.\n\n[2] Ivan Moshkov, Darragh Hanley, Ivan Sorokin, Shubham Toshniwal, Christof Henkel, Benedikt Schifferer, Wei Du, Igor Gitman. AIMO-2 Winning Solution: Building State-of-the-Art Mathematical Reasoning Models with OpenMathReasoning dataset, 2025. URL https://arxiv.org/pdf/2504.16891.\n\n[3] Heng Lin and Zhongwen Xu. Understanding Tool-Integrated Reasoning, 2025. URL https://arxiv.org/pdf/2508.19201.\n\n[4] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Brian Ichter, Fei Xia, Ed H. Chi, Quoc V. Le, Denny Zhou. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models, 2023. URL https://arxiv.org/pdf/2201.11903.\n\n[5] Xuezhi Wang, Jason Wei, Dale Schuurmans, Quoc Le, Ed H. Chi, Sharan Narang, Aakanksha Chowdhery, Denny Zhou. Self-consistency improves chain of thought reasoning in language models, 2023. URL https://arxiv.org/pdf/2203.11171.\n\n[6] Yichao Fu, Xuewei Wang, Yuandong Tian, Jiawei Zhao. Deep think with confidence, 2025. URL https://arxiv.org/pdf/2508.15260.\n\n[7] OpenAI. gpt-oss-120b & gpt-oss-20b Model Card, 2025. URL https://arxiv.org/pdf/2508.10925, https://huggingface.co/openai/gpt-oss-120b, https://www.kaggle.com/models/danielhanchen/gpt-oss-120b/Transformers/default/1.\n\n[8] openai-harmony 0.0.8. URL https://pypi.org/project/openai-harmony/0.0.8/.\n\n[9] vllm 0.11.2. URL https://pypi.org/project/vllm/0.11.2/, https://docs.vllm.ai/projects/recipes/en/latest/OpenAI/GPT-OSS.html#troubleshooting, https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken, https://openaipublic.blob.core.windows.net/encodings/cl100k_base.tiktoken.\n\n[10] numpy 2.2.0. URL https://pypi.org/project/numpy/2.2.0/.\n\n[11] PuLP 3.3.0. https://pypi.org/project/PuLP/3.3.0/\n\n[12] ShelterW. [Way to 30+/50] GPT-OSS - w/ python tool. URL https://www.kaggle.com/code/shelterw/way-to-30-50-gpt-oss-w-python-tool?scriptVersionId=285192299\n\n[13] Andreas Bisiadis. AIMO 3 | GPT-OSS-120B (with tools). URL https://www.kaggle.com/code/andreasbis/aimo-3-gpt-oss-120b-with-tools?scriptVersionId=290379281\n\n[14] parthenos. [44/50] LET ME (over)COOK!!!. URL https://www.kaggle.com/code/nihilisticneuralnet/44-50-skill-optional-luck-zaroori?scriptVersionId=291499043\n\n[15] wenliangtlh. AIMO3-High-Difficulty-Tool-Calling-Dataset. URL https://www.kaggle.com/datasets/wenliangtlh/aimo3-high-difficulty-tool-calling-dataset\n\n[16] Potrhino. AIMO3-v3, version 11 (final submission notebook). URL https://www.kaggle.com/code/potrhino/aimo3-v3?scriptVersionId=302225896\n\n[17] Potrhino. AIMO3-dependencies-v1, version 10 (dependencies of final submission notebook). URL https://www.kaggle.com/code/potrhino/aimo3-dependencies-v1?scriptVersionId=297334166\n\n[18] Potrhino. AIMO3-v3-v11-runs (validation runs notebook for main results). URL https://www.kaggle.com/code/potrhino/aimo3-v3-v11-runs?scriptVersionId=313133192\n\n[19] Potrhino. AIMO3-local-logs (validation results dataset). URL https://www.kaggle.com/datasets/potrhino/aimo3-local-logs\n\n[20] Potrhino. AIMO3-v3-v11-results (validation stats & charts notebook). URL https://www.kaggle.com/code/potrhino/aimo3-v3-v11-results?scriptVersionId=313200617\n\n[21] Potrhino. potrhino-aimo3-v3.ipynb (Google Colab version of final submission notebook). https://colab.research.google.com/drive/1vXAcdEiVcTM7oeQTFcsZsfQ6-ms33TK5?usp=sharing\n\n\n\n# Appendix\n\n## Table 1: Hyperparameters\n| Param | Value | Note |\n| --- | --- | --- |\n| device | cuda | Enables NVIDIA H100 GPU acceleration required to run gpt-oss-120b |\n| dtype | auto | Uses default precision (bfloat16) |\n| kv-cache-dtype | fp8_e4m3 | Reduces memory footprint vs. bf16, enabling higher parallelism with negligible precision loss |\n| gpu_memory_utilization | 0.97 | Maximizes GPU memory usage during inference |\n| max_model_len | 64*1024 | Balances reasoning depth and VRAM constraints |\n| enable_tool | True | Enables Python tool usage during reasoning |\n| reasoning | HIGH | Activates the highest CoT reasoning level |\n| temperature | 1.0 | Balances stochasticity for diverse Self-Consistency sampling |\n| min_p | 0.02 | Filters low-probability tokens while preserving diversity |\n| reasoning_paths | 7 | Number of parallel reasoning paths for majority voting |\n| max_time | int(5*60*60*1.5 - 3.5*60) | Total available time budget |\n| problems_number | 50+25 | Total number of problems in validation |\n| enable_dynamic_time_management | True | Enables adaptive per-problem time allocation |\n| min_time_coef | 0.86 | Lower bound for time allocation scaling |\n| max_time_coef | 2.1 | Upper bound for time allocation scaling |\n| top_logprobs | 20 | Used to compute entropy based on top-20 token probabilities [6] |\n| group_logprobs_len | 2048 | Window size for tail entropy/confidence estimation [6] |\n| enable_early_break | True | Enables pruning of low-scoring reasoning paths |\n| execution_timeout | 8 | Initial execution timeout (seconds) for Python tool calls |\n| max_tool_step | 200 | Maximum number of tool calls per reasoning path |\n| max_tool_output_len | 1000 | Maximum tool output length before truncation |\n| max_tool_error | 5 | Maximum number of tool errors before environment reset |\n| precision | 100000 | Numerical precision for Python tool environment |\n| int_max_digits | 1000000 | Maximum integer size supported for Python tool environment |\n| recursion_limit | 2000 | Maximum recursion depth for Python tool environment |\n| enable_early_termination | True | Enables consensus-based early termination |\n\n## Algorithm 1: Python Tool Execution Process\n```\n    Initialize Jupyter kernel session\n    Configure Environment:\n        - Pre-import libraries (math, numpy, sympy, etc.)\n        - Set high float precision and integer max_digits\n        - Increase recursion depth limit\n    \n    While True:\n        Receive {Python_code, available_time} from Main Process\n        \n        If Python_code is None:\n            Shutdown Kernel and Exit\n            \n        If Python_code is \"CLEAN\":\n            Restart Jupyter Kernel and re-initialize environment\n            Return empty confirmation\n            \n        Else:\n            # Determine execution limit using Adaptive Timeout logic\n            T_limit = Calculate_Timeout(available_time, consecutive_timeouts)\n            \n            # Execute code in the stateful session\n            Output = Execute_in_Jupyter(Python_code, timeout=T_limit)\n            \n            # Post-process Output (Output Length Control)\n            If length(Output) > THRESHOLD:\n                Output = Truncate_Center(Output, max_length=THRESHOLD)\n                \n            Return Output\n```\n\n## Algorithm 2: Dynamic time management\n```\n    #Init constants\n    START_TIME = time.now() \n    ...initialization logic...\n    INIT_OVERHEAD = time.now() - START_TIME\n    TOTAL_CLOCK = int(5*60*60 - 3.5*60) #5 hours with a safety margin of 3.5 minutes (in seconds)\n    DEADLINE = START_TIME + TOTAL_CLOCK\n    TOTAL_PROBLEMS = 50\n    C_min = 0.86 \n    C_max = 2.1 \n    T_avg = (TOTAL_CLOCK - INIT_OVERHEAD) / TOTAL_PROBLEMS \n\n    #Main loop\n    processed_problems = 0\n    for each incoming problem P:\n        # Reserve time for all future problems\n        remaining_problems = TOTAL_PROBLEMS - processed_problems - 1\n        reserved_buffer = remaining_problems * (T_avg  * C_min)\n        # Calculate current budget\n        T_pool = DEADLINE - time.now() - reserved_buffer\n        # Apply elastic constraints\n        available_time = max( min(T_pool, T_avg * C_max), T_avg * C_min )\n        # Final problem consumes all remaining time\n        if remaining_problems == 0:\n            available_time = DEADLINE - time.now()\n        #Solve the problem within available_time\n        solve(P, time_limit=available_time)\n        processed_problems += 1\n```\n\n## Algorithm 3: Main process logic\n```\n    Init global configurations\n    Spawn Process \"PM\": Load LLM into memory\n    Spawn Process Pool \"PTP\": Stateful Python Tool environments (one per parallel path)\n    \n    For each incoming problem \"P\":\n        If \"P\" is None: \n            Shutdown \"PTP\" pool and \"PM\" process\n            Break\n            \n        Compute available time \"T\" # Via Dynamic Time Management logic\n        Init \"AG\": List for valid reasoning path answers\n        Init \"ATG\": List for fallback tool-only answers\n        Init Stop Event \"S\": For early termination\n        Init Global Metrics \"GM\": For cross-thread pruning/scoring\n\n        Start Thread Pool \"TP\":\n            Execute parallel inference on \"P\" using \"PM\" (LLM) and \"PTP\" (Tools)\n            \n        Init \"best_answer\" to 0\n        Init \"max_vote\" to 0\n        For each completed thread \"j\" in \"TP\":\n            Get response metrics \"A_j\"\n            If \"A_j\" contains a valid extracted answer:\n                Add \"A_j\" to \"AG\"\n                # Update Best Answer and relative vote using Self-Consistency + Tie-Break\n                \"best_answer\", \"max_vote\" = SmartVote(\"AG\")\n                \n                If Consensus-Based Early Termination criteria met:\n                    Signal Stop Event \"S\" to halt remaining threads\n                    Break\n            Else:\n                # Fallback: check if the last Python tool output is a valid number\n                If \"AT_j\" contains valid tool result:\n                    Add \"AT_j\" to \"ATG\"\n        \n        # Final Fallback: If no reasoning path finished, vote on Tool outputs\n        If \"max_vote\" == 0 and \"ATG\" is not empty:\n            \"best_answer\", \"max_vote\" = SmartVote(\"ATG\")\n            \n        Shutdown Thread Pool \"TP\" (cleanup)\n        Return \"best_answer\"\n```\n\n## Algorithm 4: Thread-Level Inference Logic\n```\n    Init conversation \"C\" with role-based prompts and tool definitions\n    Init \"available_steps\" = 200\n    Init \"FormatRecoveryEnabled\" = True\n    Init \"response_text\", \"logprobs\", \"top_logprobs\" as empty\n    \n    While \"available_steps\" > 0:\n        If context_window_exhausted: # Safety margin of 4096 to allow final answer/tool output\n            Break  \n            \n        Open Response Stream \"RS\" from LLM\n        For each chunk in \"RS\":\n            If Stop_Event \"S\" is set or global_time_limit reached:\n                Break\n            \n            Update \"response_text\", \"logprobs\", and \"top_logprobs\"\n            \n            # Adaptive Pruning Check (every 2048 tokens)\n            If Pruning_Enabled and tokens_since_last_check > 2048:\n                Compute reasoning metrics (Entropy/Confidence)\n                Update Global Metrics \"GM[i]\"\n                If pruning_criteria_met: # Based on elapsed time, active tasks and relative score\n                    Break\n        \n        If Stop_Event \"S\" is set: Break\n\n        Extract Numerical Answer \"A_j\"\n        If \"A_j\" is valid: \n            Break # Success: Answer found\n            \n        if global_time_limit reached or pruning_criteria_met:\n            break\n\n        Update conversation \"C\" with current reasoning step (reasoning, tool call)\n        \n        If current response contains a Tool Call:   \n            Extract generated Python code\n            Execute code in Jupyter session \"PTP[i]\" -> Get result \"RES\"\n            Update conversation \"C\" with Tool Output\n            If \"RES\" is a valid integer answer:\n                Save as Fallback Tool Answer \"AT_j\"\n        Else: # No tool call and no valid answer found\n            If \"FormatRecoveryEnabled\":\n                Update \"C\" with a new User Prompt for Format recovery\n                \"FormatRecoveryEnabled\" = False # Only one recovery attempt allowed\n            Else:\n                Break # Failed to recover format\n                \n        \"available_steps\" -= 1\n\n    Clean Jupyter Session \"PTP[i]\"\n    Compute final response metrics (Mean/Tail Entropy, Confidence, etc.)\n    Return Metrics and Candidate Answers (\"A_j\", \"AT_j\")\n```",
      "votes": 2
    },
    {
      "id": 3459195,
      "postDate": "2026-05-17T13:29:30.877Z",
      "content": "<p>Edited on May 17th 2026 for the rebuttal phase:</p>\n<ul>\n<li><strong>Abstract &amp; Section 4.5.2</strong>: Added the official Private Leaderboard score and final ranking.</li>\n<li><strong>Section 3.4</strong>: Expanded the discussion on the empirical use of CoT-style prompting versus non-CoT alternatives for gpt-oss-120b, reporting key performance trade-offs on the Public Leaderboard.</li>\n<li><strong>Section 4.5.1.2</strong>: <ul>\n<li>Added a qualitative discussion addressing the generalization of Tool-Integrated Reasoning (TIR) benefits to abstract, non-tool-oriented domains (e.g., symbolic algebra, geometry proofs) through formalization and verification loops.</li>\n<li>Integrated detailed hyperparameter configurations for the dynamic time-management system (analyzing <code>Cmin</code> and <code>Cmax</code> variants) and provided a dedicated ablation study table comparing their Public LB mean scores.</li>\n<li>Expanded the discussion on the statistical significance of local results, adding a direct correlation table between local validation and Public Leaderboard configurations (including the Early Break Disabled run, which is the configuration with the smallest accuracy gap in local tests) to address stochastic variance. Explicitly noted hardware and computational constraints as limitations for multi-run repetitions.</li></ul></li>\n<li><strong>Section 4.5.1.4</strong>: Integrated a post-hoc analysis of the revised tie_break_score. Added the formulas for the three new variants, reported their relative measured accuracy in a dedicated chart, and discussed why local confidence bottlenecks and trajectory-length regularization provide a more robust strategy.</li>\n<li><strong>Section 4.5.1.6</strong>: Added details regarding the tool-output fallback mechanism, including its exact trigger frequency (45 times on the validation set) and its conditional recovery accuracy (6.67%).</li>\n</ul>",
      "rawMarkdown": "Edited on May 17th 2026 for the rebuttal phase:\n- **Abstract & Section 4.5.2**: Added the official Private Leaderboard score and final ranking.\n- **Section 3.4**: Expanded the discussion on the empirical use of CoT-style prompting versus non-CoT alternatives for gpt-oss-120b, reporting key performance trade-offs on the Public Leaderboard.\n- **Section 4.5.1.2**: \n\t- Added a qualitative discussion addressing the generalization of Tool-Integrated Reasoning (TIR) benefits to abstract, non-tool-oriented domains (e.g., symbolic algebra, geometry proofs) through formalization and verification loops.\n\t- Integrated detailed hyperparameter configurations for the dynamic time-management system (analyzing `Cmin` and `Cmax` variants) and provided a dedicated ablation study table comparing their Public LB mean scores.\n\t- Expanded the discussion on the statistical significance of local results, adding a direct correlation table between local validation and Public Leaderboard configurations (including the Early Break Disabled run, which is the configuration with the smallest accuracy gap in local tests) to address stochastic variance. Explicitly noted hardware and computational constraints as limitations for multi-run repetitions.\n- **Section 4.5.1.4**: Integrated a post-hoc analysis of the revised tie_break_score. Added the formulas for the three new variants, reported their relative measured accuracy in a dedicated chart, and discussed why local confidence bottlenecks and trajectory-length regularization provide a more robust strategy.\n- **Section 4.5.1.6**: Added details regarding the tool-output fallback mechanism, including its exact trigger frequency (45 times on the validation set) and its conditional recovery accuracy (6.67%).\n"
    },
    {
      "id": 3457775,
      "postDate": "2026-05-14T10:16:54.900Z",
      "content": "<p>Adding to the comments from <a href=\"https://www.kaggle.com/sambealing\" target=\"_blank\">@sambealing</a> below, I have a few additional questions:</p>\n<ol>\n<li><p><strong>CoT</strong>: Why did you choose to use CoT-style prompting with a model that has already been extensively trained for reasoning? The official OpenAI <a href=\"https://developers.openai.com/api/docs/guides/reasoning-best-practices\" target=\"_blank\">reasoning best practices</a> recommends avoiding CoT-style prompts for models with built-in reasoning capabilities, since they already reason internally. Did you also test your approach with a different prompt format that does not explicitly encourage CoT-style reasoning?</p></li>\n<li><p><strong>Time Management</strong>: Time management is a crucial part of this competition, with many possible areas for improvement. Since you present an adaptive time-management system as a key component, it would be helpful to see ablations comparing different strategies and configurations.</p></li>\n<li><p><strong>Variance on Local Evaluations</strong>: As we have seen in AIMO3, variance has a large impact on notebook scores due to problem difficulty and random ordering. Did you run your experiments multiple times and record local variance? I could only find reported averages for the public leaderboard scores, but not for the individual configurations tested on your 75-problem evaluation dataset. Adding variance estimates would allow readers to better assess the statistical significance of the differences between configurations.</p></li>\n</ol>",
      "rawMarkdown": "Adding to the comments from @sambealing below, I have a few additional questions:\n\n1. **CoT**: Why did you choose to use CoT-style prompting with a model that has already been extensively trained for reasoning? The official OpenAI [reasoning best practices](https://developers.openai.com/api/docs/guides/reasoning-best-practices) recommends avoiding CoT-style prompts for models with built-in reasoning capabilities, since they already reason internally. Did you also test your approach with a different prompt format that does not explicitly encourage CoT-style reasoning?\n\n2. **Time Management**: Time management is a crucial part of this competition, with many possible areas for improvement. Since you present an adaptive time-management system as a key component, it would be helpful to see ablations comparing different strategies and configurations.\n\n3. **Variance on Local Evaluations**: As we have seen in AIMO3, variance has a large impact on notebook scores due to problem difficulty and random ordering. Did you run your experiments multiple times and record local variance? I could only find reported averages for the public leaderboard scores, but not for the individual configurations tested on your 75-problem evaluation dataset. Adding variance estimates would allow readers to better assess the statistical significance of the differences between configurations.",
      "replies": [
        {
          "id": 3458928,
          "postDate": "2026-05-17T00:28:42.783Z",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/philipvonderlind\" target=\"_blank\">@philipvonderlind</a> ,</p>\n<p>thank you for your time and for these insightful questions.</p>\n<p>Please find my detailed responses to each point below.</p>\n<h3>1. <strong>CoT</strong>:</h3>\n<p>While official OpenAI best practices suggest that CoT-style prompts are unnecessary for models with built-in reasoning, my empirical results with gpt-oss-120b tell a more nuanced story. In local runs, I observed that CoT prompts increased the number of correct responses for the hardest problems, although they generally generated longer responses for simpler tasks compared to formats that do not explicitly encourage CoT. To evaluate this, I submitted two versions of a previous notebook that differed only in the \"User\" prompt, but used a fixed configuration for \"System\", \"Developer\" and \"Tool\", as following:</p>\n<ul>\n<li><strong>System</strong>: <em>\"You are a rigorous and precise math expert.\"</em></li>\n<li><strong>Developer</strong>: <em>\"Solve the problem and use the Python tool when necessary. You must return the final answer inside \\boxed{}. The final answer is an integer between 0 and 99999 inclusive.\"</em></li>\n<li><strong>Tool</strong>: <em>\"Use this tool to execute Python code. The environment is a stateful Jupyter notebook. You must use print() to output results.\"</em></li>\n<li><strong>User (Non-CoT version)</strong>: <em>\"{problem}\\n\\nYou have access to <code>math</code>, <code>numpy</code>, <code>sympy</code> and <code>mpmath</code> to solve the problem.\"</em></li>\n<li><strong>User (CoT version)</strong> (<a href=\"https://arxiv.org/html/2601.19302v1#S3):\" target=\"_blank\">https://arxiv.org/html/2601.19302v1#S3):</a> <em>\"{problem}\\n\\nPhase 1 (Formalization):\\nIdentify givens and target. Write the key equations.\\nPhase 2 (Adaptive Solving):\\nSolve via CoT (think step-by-step), PoT (compute with code), direct calculation, or elimination.\\nVerify your solution, then return your final answer.\"</em></li>\n</ul>\n<p>The CoT version achieved a score of <strong>39</strong> on the Public Leaderboard, while the Non-CoT version achieved a score of <strong>37</strong>.\nFurthermore, in <a href=\"https://arxiv.org/pdf/2508.15260\" target=\"_blank\">https://arxiv.org/pdf/2508.15260</a> the authors achieve 99.9% accuracy on AIME 2025 using gpt-oss-120b by specifically appending <em>\"Please reason step by step, and put your final answer within \\boxed{}.\"</em> to the user prompt (Section <em>\"F EXPERIMENTAL SETTINGS\"</em>).</p>\n<p>I also tested several other prompting strategies:</p>\n<ul>\n<li>Replacing <em>\"carefully\"</em> with <em>\"step by step\"</em> in the developer prompt of final submission achieved a score of <strong>38</strong> on the Public Leaderboard.</li>\n<li>Removing the developer prompt in favor of a very verbose system/tool description (similar to high-scoring public notebooks) also yielded a <strong>38</strong> on the Public Leaderboard.</li>\n<li>I experimented with other styles such as \"Chain of Draft\" (<a href=\"https://arxiv.org/pdf/2502.18600)\" target=\"_blank\">https://arxiv.org/pdf/2502.18600)</a>, \"Thoughts Are All Over the Place\" (<a href=\"https://arxiv.org/pdf/2501.18585\" target=\"_blank\">https://arxiv.org/pdf/2501.18585</a>) and prompt used in AIMO Progress Prize 2.</li>\n</ul>\n<p>Ultimately, I found that using the word \"carefully\" provided the best tradeoff. It encourages precision, caution, and consistency without forcing the model into the extreme verbosity of a full \"step-by-step\" instruction. This approach can help to reduces errors on difficult problems while maintaining efficiency on simpler ones.</p>\n<h3>2. <strong>Time management</strong>:</h3>\n<p>The dynamic time management system was designed to mitigate the inefficiency of static allocation, where simple problems can waste budget and complex ones are cut short. Our ablation study confirms that the final_submission (dynamic) significantly outperforms the dynamic_time_management_disabled (static) run, which relies on a fixed average time per problem.\nThe dynamic time management is based on the scaling constants <code>Cmin</code> and <code>Cmax</code> (Section 3.3.). Initially, the parameter <code>Cmax=2.1</code> was empirically selected to allow the model to reach its maximum effective context window depth on difficult problems. The following table summarizes additional configurations evaluated during the final phases of the competition:</p>\n<table>\n<thead>\n<tr>\n<th>Cmin</th>\n<th>Cmax</th>\n<th>Public LB Scores</th>\n<th>Mean Score</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>0.88</td>\n<td>2.2</td>\n<td>37</td>\n<td>37.0</td>\n</tr>\n<tr>\n<td>0.86</td>\n<td>2.1</td>\n<td>39, 37, 38, 43</td>\n<td>39.25 (Final Submission)</td>\n</tr>\n<tr>\n<td>0.85</td>\n<td>2.0</td>\n<td>36</td>\n<td>36.0</td>\n</tr>\n<tr>\n<td>0.80</td>\n<td>2.0</td>\n<td>39</td>\n<td>39.0</td>\n</tr>\n<tr>\n<td>0.80</td>\n<td>2.1</td>\n<td>42, 41</td>\n<td>41.5</td>\n</tr>\n</tbody>\n</table>\n<p>While the selected final submission (<code>Cmin=0.86</code>, <code>Cmax=2.1</code>) achieved the highest peak score of <strong>43/50</strong>, subsequent analysis suggests that a lower floor (<code>Cmin=0.80</code>) paired with <code>Cmax=2.1</code> yields a more stable mean performance (<strong>41.5</strong>).\nThe configuration <code>(0.80, 2.1)</code> was identified very close to the competition deadline, consequently, we prioritized the <code>(0.86, 2.1)</code> configuration for the final submission as it had already demonstrated high-ceiling potential in earlier runs.\nThese results indicate that performance is sensitive to the <code>Cmin</code> floor. A lower <code>Cmin</code> grants the system more flexibility to reallocate time from \"easy\" problems to \"hard\" ones, whereas an excessively high <code>Cmax</code> may lead to diminishing returns if the model exceeds its useful reasoning depth.\nWe agree that further systematic ablations on these hyperparameters could define a more precise \"Pareto front\" for time-constrained mathematical reasoning.</p>\n<h3>3. <strong>Variance on Local Evaluations</strong>:</h3>\n<p>We appreciate the emphasis on variance. Mathematical reasoning tasks are indeed sensitive to problem ordering and stochastic sampling, and variance estimates are crucial to distinguish architectural gains from statistical noise.\nThe experimental runs reported in Section 4.5 were conducted near the competition deadline to provide a reproducible and objective summary of each technique’s behavior on a high-difficulty public dataset. We acknowledge that these specific local runs reflect a single execution. Due to the significant computational intensity—each 75-problem run requiring approximately 7.5 hours on an NVIDIA H100 GPU—and strict hardware availability constraints, conducting multiple full-scale repetitions was not feasible within the remaining timeframe.\nHowever, we believe the significance of the observed performance gaps is supported by the following factors:</p>\n<p></p><ul>\n<li><strong>Noise Reduction by Design</strong>: We utilized a 75-problem \"High-Difficulty\" dataset to provide a more discriminative signal than standard benchmarks. Furthermore, Dynamic Time Management mitigates variance related to problem ordering by optimizing resource allocation, while Self-Consistency (<code>k=7</code>) reduces the impact of stochastic sampling.</li>\n<li><strong>Consistency with Historical Evidence</strong>: The performance trends in our ablation studies align with the findings from months of internal testing and Public Leaderboard submissions. In every run, the removal of core components (TIR, HIGH reasoning level, or Dynamic Time Management) resulted in a logical and consistent degradation of accuracy.</li>\n<li><strong>Public Leaderboard Correlation</strong>: To provide a broader perspective on variance, we compared the Public LB scores of our \"Final Submission\" against the \"Early Break Disabled\" configuration (the configuration with the smallest accuracy gap in local tests, 0.55 vs 0.51 (Section 4.5.1.2.)).<p></p>\n<table>\n<thead>\n<tr>\n<th>Notebook Configuration</th>\n<th>Public LB Scores</th>\n<th>Mean Score</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Final Submission</td>\n<td>39, 37, 38, 43</td>\n<td>39.25</td>\n</tr>\n<tr>\n<td>Early Break Disabled</td>\n<td>36, 38</td>\n<td>37</td>\n</tr>\n<tr>\n<td></td></tr></tbody></table></li></ul>\n\n\n\n\nAs shown, the Final Submission consistently maintains a higher mean score on the Public Leaderboard, mirroring the gap observed in our local experimental runs.\n\n\n\n\nThe substantial gap between the Baseline (<strong>17/75</strong>) and the Final Submission (<strong>41/75</strong>) in local validation represents a nearly <strong>2.4x</strong> improvement. Such a significant margin strongly suggests that the gains are driven by architectural optimizations rather than mere stochastic fluctuations.\n\n\n\n\nWhile we agree that additional runs would further refine these estimates, the convergence of local results, Public Leaderboard data, and ablation consistency provides strong evidence for the effectiveness of the proposed techniques. However, this remains a valuable direction for future work.\n\n\n\n\n",
          "rawMarkdown": "Hi @philipvonderlind ,\n\nthank you for your time and for these insightful questions.\n\nPlease find my detailed responses to each point below.\n\n### 1. **CoT**:\n\nWhile official OpenAI best practices suggest that CoT-style prompts are unnecessary for models with built-in reasoning, my empirical results with gpt-oss-120b tell a more nuanced story. In local runs, I observed that CoT prompts increased the number of correct responses for the hardest problems, although they generally generated longer responses for simpler tasks compared to formats that do not explicitly encourage CoT. To evaluate this, I submitted two versions of a previous notebook that differed only in the \"User\" prompt, but used a fixed configuration for \"System\", \"Developer\" and \"Tool\", as following:\n- **System**: *\"You are a rigorous and precise math expert.\"*\n- **Developer**: *\"Solve the problem and use the Python tool when necessary. You must return the final answer inside \\\\boxed{}. The final answer is an integer between 0 and 99999 inclusive.\"*\n- **Tool**: *\"Use this tool to execute Python code. The environment is a stateful Jupyter notebook. You must use print() to output results.\"*\n- **User (Non-CoT version)**: *\"{problem}\\n\\nYou have access to `math`, `numpy`, `sympy` and `mpmath` to solve the problem.\"*\n- **User (CoT version)** (https://arxiv.org/html/2601.19302v1#S3): *\"{problem}\\n\\nPhase 1 (Formalization):\\nIdentify givens and target. Write the key equations.\\nPhase 2 (Adaptive Solving):\\nSolve via CoT (think step-by-step), PoT (compute with code), direct calculation, or elimination.\\nVerify your solution, then return your final answer.\"*\n\nThe CoT version achieved a score of **39** on the Public Leaderboard, while the Non-CoT version achieved a score of **37**.\nFurthermore, in https://arxiv.org/pdf/2508.15260 the authors achieve 99.9% accuracy on AIME 2025 using gpt-oss-120b by specifically appending *\"Please reason step by step, and put your final answer within \\boxed{}.\"* to the user prompt (Section *\"F EXPERIMENTAL SETTINGS\"*).\n\nI also tested several other prompting strategies:\n- Replacing *\"carefully\"* with *\"step by step\"* in the developer prompt of final submission achieved a score of **38** on the Public Leaderboard.\n- Removing the developer prompt in favor of a very verbose system/tool description (similar to high-scoring public notebooks) also yielded a **38** on the Public Leaderboard.\n- I experimented with other styles such as \"Chain of Draft\" (https://arxiv.org/pdf/2502.18600), \"Thoughts Are All Over the Place\" (https://arxiv.org/pdf/2501.18585) and prompt used in AIMO Progress Prize 2.\n\nUltimately, I found that using the word \"carefully\" provided the best tradeoff. It encourages precision, caution, and consistency without forcing the model into the extreme verbosity of a full \"step-by-step\" instruction. This approach can help to reduces errors on difficult problems while maintaining efficiency on simpler ones.\n\n### 2. **Time management**: \n\nThe dynamic time management system was designed to mitigate the inefficiency of static allocation, where simple problems can waste budget and complex ones are cut short. Our ablation study confirms that the final_submission (dynamic) significantly outperforms the dynamic_time_management_disabled (static) run, which relies on a fixed average time per problem.\nThe dynamic time management is based on the scaling constants `Cmin` and `Cmax` (Section 3.3.). Initially, the parameter `Cmax=2.1` was empirically selected to allow the model to reach its maximum effective context window depth on difficult problems. The following table summarizes additional configurations evaluated during the final phases of the competition:\n| Cmin | Cmax | Public LB Scores | Mean Score |\n| --- | --- | --- | --- |\n| 0.88 | 2.2 | 37 | 37.0 |\n| 0.86 | 2.1 | 39, 37, 38, 43 | 39.25 (Final Submission) |\n| 0.85 | 2.0 | 36 | 36.0 |\n| 0.80 | 2.0 | 39 | 39.0 |\n| 0.80 | 2.1 | 42, 41 | 41.5 |\n\nWhile the selected final submission (`Cmin=0.86`, `Cmax=2.1`) achieved the highest peak score of **43/50**, subsequent analysis suggests that a lower floor (`Cmin=0.80`) paired with `Cmax=2.1` yields a more stable mean performance (**41.5**).\nThe configuration `(0.80, 2.1)` was identified very close to the competition deadline, consequently, we prioritized the `(0.86, 2.1)` configuration for the final submission as it had already demonstrated high-ceiling potential in earlier runs.\nThese results indicate that performance is sensitive to the `Cmin` floor. A lower `Cmin` grants the system more flexibility to reallocate time from \"easy\" problems to \"hard\" ones, whereas an excessively high `Cmax` may lead to diminishing returns if the model exceeds its useful reasoning depth.\nWe agree that further systematic ablations on these hyperparameters could define a more precise \"Pareto front\" for time-constrained mathematical reasoning.\n\n### 3. **Variance on Local Evaluations**: \n\nWe appreciate the emphasis on variance. Mathematical reasoning tasks are indeed sensitive to problem ordering and stochastic sampling, and variance estimates are crucial to distinguish architectural gains from statistical noise.\nThe experimental runs reported in Section 4.5 were conducted near the competition deadline to provide a reproducible and objective summary of each technique’s behavior on a high-difficulty public dataset. We acknowledge that these specific local runs reflect a single execution. Due to the significant computational intensity—each 75-problem run requiring approximately 7.5 hours on an NVIDIA H100 GPU—and strict hardware availability constraints, conducting multiple full-scale repetitions was not feasible within the remaining timeframe.\nHowever, we believe the significance of the observed performance gaps is supported by the following factors:\n- **Noise Reduction by Design**: We utilized a 75-problem \"High-Difficulty\" dataset to provide a more discriminative signal than standard benchmarks. Furthermore, Dynamic Time Management mitigates variance related to problem ordering by optimizing resource allocation, while Self-Consistency (`k=7`) reduces the impact of stochastic sampling.\n- **Consistency with Historical Evidence**: The performance trends in our ablation studies align with the findings from months of internal testing and Public Leaderboard submissions. In every run, the removal of core components (TIR, HIGH reasoning level, or Dynamic Time Management) resulted in a logical and consistent degradation of accuracy.\n- **Public Leaderboard Correlation**: To provide a broader perspective on variance, we compared the Public LB scores of our \"Final Submission\" against the \"Early Break Disabled\" configuration (the configuration with the smallest accuracy gap in local tests, 0.55 vs 0.51 (Section 4.5.1.2.)).\n| Notebook Configuration | Public LB Scores | Mean Score |\n| --- | --- | --- |\n| Final Submission | 39, 37, 38, 43 | 39.25 |\n| Early Break Disabled | 36, 38 | 37 |\n\nAs shown, the Final Submission consistently maintains a higher mean score on the Public Leaderboard, mirroring the gap observed in our local experimental runs.\nThe substantial gap between the Baseline (**17/75**) and the Final Submission (**41/75**) in local validation represents a nearly **2.4x** improvement. Such a significant margin strongly suggests that the gains are driven by architectural optimizations rather than mere stochastic fluctuations.\nWhile we agree that additional runs would further refine these estimates, the convergence of local results, Public Leaderboard data, and ablation consistency provides strong evidence for the effectiveness of the proposed techniques. However, this remains a valuable direction for future work.\n"
        }
      ]
    },
    {
      "id": 3457749,
      "postDate": "2026-05-14T09:14:51.057Z",
      "content": "<p>Hi, thank you for your submission to the Writeup Prize. <a href=\"https://www.kaggle.com/philipvonderlind\" target=\"_blank\">@philipvonderlind</a> and I will post some questions below that help us in assessing your submission more closely, as described in the <a href=\"https://www.kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3/discussion/689703\" target=\"_blank\">updated discussion post</a>.</p>\n<ol>\n<li><strong>Better tie-breaking metrics (§4.5.1.4):</strong> You found that reasoning-path length and minimum token confidence are stronger discriminators than your final <code>mean_conf · (1-mean_entropy)</code> aggregation. Did you have a chance to resubmit with the revised scoring function before the deadline, and if not, do you have any data of how it might affect performance on other benchmarks?</li>\n<li><strong>Tool-fallback fire rate (§3.5.3):</strong> §4.5.1.6 evaluates the tool-output fallback's accuracy, but I couldn't see the actual fire rate. On your 75-problem validation set, on what fraction did all 7 reasoning paths fail to produce a formatted final answer (i.e. when the fallback actually fires), and how often does the fallback then pick the correct answer?</li>\n<li><strong>TIR-friendly validation set:</strong> Your 75-problem set is sourced from a problem set specifically focussed on tool-calling. Do you think the TIR gains you report would transfer to problem types where tool use is less natural (e.g. pure symbolic algebra, geometry proofs), or could the gains concentrate on problems that are already tool-friendly?</li>\n</ol>\n<p>Look forward to reading your responses on these.</p>",
      "rawMarkdown": "Hi, thank you for your submission to the Writeup Prize. @philipvonderlind and I will post some questions below that help us in assessing your submission more closely, as described in the [updated discussion post](https://www.kaggle.com/competitions/ai-mathematical-olympiad-progress-prize-3/discussion/689703).\n\n1. **Better tie-breaking metrics (§4.5.1.4):** You found that reasoning-path length and minimum token confidence are stronger discriminators than your final `mean_conf · (1-mean_entropy)` aggregation. Did you have a chance to resubmit with the revised scoring function before the deadline, and if not, do you have any data of how it might affect performance on other benchmarks?\n2. **Tool-fallback fire rate (§3.5.3):** §4.5.1.6 evaluates the tool-output fallback's accuracy, but I couldn't see the actual fire rate. On your 75-problem validation set, on what fraction did all 7 reasoning paths fail to produce a formatted final answer (i.e. when the fallback actually fires), and how often does the fallback then pick the correct answer?\n3. **TIR-friendly validation set:** Your 75-problem set is sourced from a problem set specifically focussed on tool-calling. Do you think the TIR gains you report would transfer to problem types where tool use is less natural (e.g. pure symbolic algebra, geometry proofs), or could the gains concentrate on problems that are already tool-friendly?\n\nLook forward to reading your responses on these.\n",
      "replies": [
        {
          "id": 3458925,
          "postDate": "2026-05-17T00:11:20.943Z",
          "content": "<p>Hi <a href=\"https://www.kaggle.com/sambealing\" target=\"_blank\">@sambealing</a> ,</p>\n<p>thank you for your time and for these insightful questions. </p>\n<p>Please find my detailed responses to each point below.</p>\n<h3>1. <strong>Better tie-breaking metrics</strong>:</h3>\n<p>Unfortunately, I completed the tie-breaking analysis only after the competition deadline, so I was unable to submit a revised scoring function to the Public Leaderboard. However, post-hoc analysis on the experimental runs described in Section 4.5.1.4 indicates that the original aggregation (described in Section 3.5.1.) was not the most discriminative signal for selecting among candidate reasoning paths.\nIn particular, incorporating local confidence bottlenecks and reasoning-path length produced substantially stronger tie-breaking performance:</p>\n<table>\n<thead>\n<tr>\n<th>Metric</th>\n<th>Tie-breaking accuracy</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Original tie_break_score</td>\n<td>0.492</td>\n</tr>\n<tr>\n<td>Revised tie_break_score_A <code>(1−length_perc)⋅min_conf</code></td>\n<td>0.542</td>\n</tr>\n<tr>\n<td>Revised tie_break_score_B <code>tie_break_score⋅(1−length_perc)⋅min_conf</code></td>\n<td>0.610</td>\n</tr>\n<tr>\n<td>Revised tie_break_score_C <code>tie_break_score⋅(1−length_perc)⋅min_conf⋅tail_conf</code></td>\n<td>0.661</td>\n</tr>\n</tbody>\n</table>\n<p>Here, <code>length_perc</code> denotes the ratio between the generated response length and the model context limit (response_length / max_model_len).\nThese results suggest that localized confidence failures are more informative than global averages. Metrics such as mean_conf and mean_entropy can remain relatively stable even when a reasoning trajectory contains a critical logical error. In contrast, min_conf and tail_conf act as bottleneck indicators: a single low-confidence transition often coincides with a hallucinated deduction or unstable reasoning step.\nThe inverse correlation between reasoning-path length and correctness was also notable. For Olympiad-style mathematical problems, successful solutions tended to emerge from relatively concise reasoning chains, whereas excessively long trajectories were more likely to exhibit reasoning drift, repetition, or self-inconsistent exploration.\nThese results, summarized in the accompanying chart, suggest that combining global stability metrics with local confidence statistics and trajectory-length regularization may provide a more robust tie-breaking strategy for adaptive reasoning systems.\n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F23110311%2F566687e5063e21dec95c4570a1294636%2FTie-breaking%20success%20rate%20()%20per%20summed%20metric.png?generation=1778976268035266&amp;alt=media\" alt=\"\"></p>\n<h3>2. <strong>Tool-fallback fire rate</strong>:</h3>\n<p>On the 75-problem validation set, excluding the python_tool_disabled and baseline ablations (which do not use the Python tool), the tool-output fallback mechanism was triggered <strong>45</strong> times in total.\nA fallback event occurs when all 7 reasoning paths fail to produce a correctly formatted final answer, but at least one reasoning path generated a valid numerical result during a Python tool execution.\nAmong these 45 fallback activations, the mechanism recovered the correct answer <strong>3</strong> times, corresponding to a conditional accuracy of approximately <strong>6.67%</strong> once the fallback fires.\nAlthough the conditional success rate is relatively low, the fallback was intentionally designed as a last-resort recovery mechanism rather than a primary selection strategy. In these cases, the standard extraction and aggregation pipeline had already failed completely, meaning that without the fallback the system would deterministically output an incorrect answer.\nConsequently, even a small number of successful recoveries translates directly into measurable score improvements. Importantly, the fallback introduces essentially no additional inference-time cost, since it only reuses numerical outputs already produced during earlier Python tool executions rather than generating new reasoning trajectories.</p>\n<h3>3. <strong>TIR-friendly validation set</strong>:</h3>\n<p>While the validation set was indeed tool-oriented, I believe the benefits of TIR would partially transfer to more \"abstract\" domains, albeit with a shift in how the tool is utilized. For instance:</p>\n<ul>\n<li><strong>Symbolic Algebra &amp; Geometry</strong>: By leveraging libraries like <code>sympy</code>, the model can offload complex algebraic manipulations or coordinate geometry calculations to a deterministic solver. This minimizes \"calculation drift\" in long CoT sequences, where models often make small sign errors or arithmetic slips.</li>\n<li><strong>Verification, not just Solution</strong>: Even in proof-based or symbolic problems, TIR acts as a powerful verifier. The model can write scripts to test specific cases or validate intermediate numerical properties, providing a feedback loop that pure CoT lacks.</li>\n<li><strong>Logical Structuring</strong>: Writing code forces the model to decompose abstract problems into discrete, executable steps. This \"algorithmic thinking\" often help in maintaining a coherent logical flow even in pure proof tasks, reducing the likelihood of circular reasoning or vague hand-waving.</li>\n</ul>\n<p>Therefore, while the magnitude of the gain might vary depending on the problem type, I expect the system to maintain a competitive edge even on benchmarks where tool-use is less intuitive.</p>",
          "rawMarkdown": "Hi @sambealing ,\n\nthank you for your time and for these insightful questions. \n\nPlease find my detailed responses to each point below.\n\n\n### 1. **Better tie-breaking metrics**: \n\nUnfortunately, I completed the tie-breaking analysis only after the competition deadline, so I was unable to submit a revised scoring function to the Public Leaderboard. However, post-hoc analysis on the experimental runs described in Section 4.5.1.4 indicates that the original aggregation (described in Section 3.5.1.) was not the most discriminative signal for selecting among candidate reasoning paths.\nIn particular, incorporating local confidence bottlenecks and reasoning-path length produced substantially stronger tie-breaking performance:\n| Metric | Tie-breaking accuracy |\n| --- | --- |\n| Original tie_break_score | 0.492 |\n| Revised tie_break_score_A `(1−length_perc)⋅min_conf` | 0.542 |\n| Revised tie_break_score_B `tie_break_score⋅(1−length_perc)⋅min_conf` | 0.610 |\n| Revised tie_break_score_C `tie_break_score⋅(1−length_perc)⋅min_conf⋅tail_conf` | 0.661 |\n\nHere, `length_perc` denotes the ratio between the generated response length and the model context limit (response_length / max_model_len).\nThese results suggest that localized confidence failures are more informative than global averages. Metrics such as mean_conf and mean_entropy can remain relatively stable even when a reasoning trajectory contains a critical logical error. In contrast, min_conf and tail_conf act as bottleneck indicators: a single low-confidence transition often coincides with a hallucinated deduction or unstable reasoning step.\nThe inverse correlation between reasoning-path length and correctness was also notable. For Olympiad-style mathematical problems, successful solutions tended to emerge from relatively concise reasoning chains, whereas excessively long trajectories were more likely to exhibit reasoning drift, repetition, or self-inconsistent exploration.\nThese results, summarized in the accompanying chart, suggest that combining global stability metrics with local confidence statistics and trajectory-length regularization may provide a more robust tie-breaking strategy for adaptive reasoning systems.\n![](https://www.googleapis.com/download/storage/v1/b/kaggle-forum-message-attachments/o/inbox%2F23110311%2F566687e5063e21dec95c4570a1294636%2FTie-breaking%20success%20rate%20()%20per%20summed%20metric.png?generation=1778976268035266&alt=media)\n\n\n### 2. **Tool-fallback fire rate**: \n\nOn the 75-problem validation set, excluding the python_tool_disabled and baseline ablations (which do not use the Python tool), the tool-output fallback mechanism was triggered **45** times in total.\nA fallback event occurs when all 7 reasoning paths fail to produce a correctly formatted final answer, but at least one reasoning path generated a valid numerical result during a Python tool execution.\nAmong these 45 fallback activations, the mechanism recovered the correct answer **3** times, corresponding to a conditional accuracy of approximately **6.67%** once the fallback fires.\nAlthough the conditional success rate is relatively low, the fallback was intentionally designed as a last-resort recovery mechanism rather than a primary selection strategy. In these cases, the standard extraction and aggregation pipeline had already failed completely, meaning that without the fallback the system would deterministically output an incorrect answer.\nConsequently, even a small number of successful recoveries translates directly into measurable score improvements. Importantly, the fallback introduces essentially no additional inference-time cost, since it only reuses numerical outputs already produced during earlier Python tool executions rather than generating new reasoning trajectories.\n\n\n### 3. **TIR-friendly validation set**: \n\nWhile the validation set was indeed tool-oriented, I believe the benefits of TIR would partially transfer to more \"abstract\" domains, albeit with a shift in how the tool is utilized. For instance:\n- **Symbolic Algebra & Geometry**: By leveraging libraries like `sympy`, the model can offload complex algebraic manipulations or coordinate geometry calculations to a deterministic solver. This minimizes \"calculation drift\" in long CoT sequences, where models often make small sign errors or arithmetic slips.\n- **Verification, not just Solution**: Even in proof-based or symbolic problems, TIR acts as a powerful verifier. The model can write scripts to test specific cases or validate intermediate numerical properties, providing a feedback loop that pure CoT lacks.\n- **Logical Structuring**: Writing code forces the model to decompose abstract problems into discrete, executable steps. This \"algorithmic thinking\" often help in maintaining a coherent logical flow even in pure proof tasks, reducing the likelihood of circular reasoning or vague hand-waving.\n\nTherefore, while the magnitude of the gain might vary depending on the problem type, I expect the system to maintain a competitive edge even on benchmarks where tool-use is less intuitive."
        }
      ]
    }
  ],
  "complete": true,
  "source": "live",
  "fetched_at": "2026-10-20T04:19:32Z",
  "competition_id": 118448,
  "competition_slug": "ai-mathematical-olympiad-progress-prize-3",
  "team_id": 14802138,
  "solution_url": "/competitions/ai-mathematical-olympiad-progress-prize-3/writeups/potrhino-adaptive-test-time-optimization"
}