OpenCodeReasoning-II : A Simple Test Time Scaling Approach via Self-Critique
Wasi Uddin Ahmad, Somshubra Majumdar, Aleksander Ficek, Sean Narenthiran · 2025
Read OpenCodeReasoning-II : A Simple Test Time Scaling Approach via Self-Critique by Wasi Uddin Ahmad, Somshubra Majumdar, Aleksander Ficek, Sean Narenthiran (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-09075.txt.
Introduction
Wasi Uddin Ahmad and co-authors release a large code reasoning data set in a 2025 paper. Models that write code improve when trained on questions paired with worked solutions and critiques. Such training data has been scarce at scale. Their set, OpenCodeReasoning-II, holds about two and a half million triples of question, solution, and critique, drawn from roughly 35,000 distinct programming questions.
Training runs in two stages. First the model learns to generate code, then it learns generation and critique together. The resulting open models matched or beat the best prior open distilled models at code generation. Pairing the generator with its own critic lifted contest coding scores further. The team also extends a known coding benchmark to support C++ tests.
Catalog record
| CREATOR | Wasi Uddin Ahmad, Somshubra Majumdar, Aleksander Ficek, Sean Narenthiran |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 33 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2507-09075
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
OpenCodeReasoning-II : A Simple Test Time Scaling Approach via Self-Critique Wasi Uddin Ahmad, Somshubra Majumdar, Aleksander Ficek, Sean Narenthiran Abstract Recent advancements in reasoning-based Large Language Models (LLMs), particularly their potential through test-time scaling, have created significant opportunities for distillation in code generation and critique. However, progress in both areas fundamentally depends on large-scale, high-quality datasets. In this work, we introduce OpenCodeReasoning-II , a dataset consists of 2.5M question-solution-critique triples ( ≈ \approx 35K unique programming questions), making it nearly twice the size of the previous largest publicly available code reasoning dataset. In this work, we employ a two-stage supervised fine-tuning strategy. The first stage focuses on fine-tuning for code generation, while the second stage involves the joint training of models for both code generation and critique. Our resulting finetuned Qwen2.5-Instruct models achieve performance in code generation that either exceeds or equals the best prior open-weight distilled models. Notably, the integration of our code generation and critique models leads to significant improvements in competitive coding performance. Furthermore, we present an extension of the LiveCodeBench benchmark to specifically support the C++ programming language, thereby facilitating more comprehensive LLM evaluation using this benchmark. 1 Introduction Large language models (LLMs) have undergone rapid advancements in recent years, from chain-of-thought (CoT) prompting ( Wei et al. 2022 ) , followed by System-2 reasoning that employs test-time compute scaling approaches ( Li et al. 2025b ; Zhang et al. 2025b ) . Test-time scaling has allowed LLMs to dedicate more computational resources during inference to perform logical reasoning. The release of models like DeepSeek-R1 ( DeepSeek-AI et al. 2025 ) , which demonstrated impressive reasoning capabilities, has spurred increased interest in distilling these test-time compute capabilities into smaller fine-tuned models. This pursuit is driven by the observation that providing LLMs with more computational power during inference directly translates to tangible improvements in their outputs, particularly on complex tasks like competitive coding. As models have improved on reasoning tasks by leveraging test-time compute, a natural research question emerges: how can test-time compute be effectively scaled? Inference time scaling has been found to emerge from applying reinforcement learning on domains with verifiable outcomes such as with math and coding ( Setlur et al. 2025 ; Qu et al. 2025 ; Yu et al. 2025a ) . Other works have found benefits by scaling inference compute by using repeated sampling in parallel ( Wang et al. 2023a ; Brown et al. 2024 ; Wu et al. 2025 ) . After sampling multiples times the best solution can be selected using a variety of methods such as majority voting, reward models or LLM-as-a-judge ( Chen et al. 2024 ; Liu et al. 2025a ; Zeng et al. 2025a ; Moshkov et al. 2025 ) . Recent works have found that scaling test-time compute also results in better critique models in the form of reasoning-based judges or Generative Reward Models (GenRM’s) ( Mahan et al. 2024 ; Zhang et al. 2025a ; Liu et al. 2025b ) . Additionally, Wang et al. 2025b introduces Critique Fine-Tuning (CFT), a method that uses model-based critiques to more effectively distill reasoning capabilities than standard Supervised-Finetuning (SFT) for math problems. Our work unifies Critique Fine-Tuning (CFT) with reasoning data distillation to effectively scale test-time compute and enhance coding capabilities. Reasoning-based data distillation has proven to be a powerful technique for enhancing coding performance, often without requiring reinforcement learning ( BespokeLabs 2025 ; Penedo et al. 2025b ; OpenThoughts 2025 ; Li et al. 2025a ) . Follow-up works have found continual gains from supervised fine-tuning on increasingly larger CoT reasoning datasets ( Xu et al. 2025 ; Ahmad et al. 2025b ) . Despite the recognized benefits of critique fine-tuning and applying test-time compute to generative reward models, a significant gap persists: there are no publicly available coding datasets that specifically include reasoning-based CoT critiques. Existing datasets with critique data feature non-reasoning critiques, execution test pass-rates, or focus on different domains ( Ahmad et al. 2025a ; Ahmad et al. 2025b ; Zeng et al. 2025a ; Zhang et al. 2025a ; Wang et al. 2024d ) . Figure 1: Demonstrating performance gains on LiveCodeBench, achieved through test-time scaling by generating 10 solutions per problem and employing self-critique for selecting the final output. Self-critique led to the greatest performance boost in our finetuned model, OCR-2-32B . To bridge this gap and further leverage test-time scaling, we present OpenCodeReasoning-II , the largest publicly accessible code reasoning dataset created to date. This dataset comprises 2.5 million question-solution-critique triples originating from roughly 35,000 distinct programming problems. Both solutions and critiques are structured as reasoning CoTs, offering detailed justifications for solution generation and validation. Using this dataset, we trained models with 7B, 14B, and 32B parameters using a two-stage finetuning approach. We conduct evaluation under parallel test-time scaling and demonstrated significant improvements compared to open-weight models, as illustrated in Figure 1 . Furthermore, we contribute an extension to LiveCodeBench, with a specific focus on supporting LLM evaluation using C++. The contributions of this work can be summarized as follows: 1. We introduce OpenCodeReasoning-II , a large-scale dataset containing 1.4 million Python and 1.1 million C++ solutions, along with their corresponding critique labels, detailed reasoning traces, and execution pass rates, all derived from 35,000 unique programming questions. 2. With the aim of facilitating more comprehensive LLM evaluation in the C++ programming language, we have extended LiveCodeBench to incorporate C++ support. This enhanced benchmark is now publicly available to promote further research and development. 3. We show the effectiveness of OpenCodeReasoning-II by fine-tuning Qwen2.5-Instruct models in a two-stage process. This fine-tuning enabled our models to achieve code generation performance that surpasses or matches the leading prior open-weight distilled models. Furthermore, integrating code generation with critique through a simple test-time scaling strategy resulted in substantial gains on the LiveCodeBench benchmark, in both Python and C++. 4. We perform an in-depth analysis to provide insights on the opportunities in self-critique methods under test-time scaling, impact of data scaling, transfer between Python and C++ languages. 2 Development of OpenCodeReasoning-II and LiveCodeBench-C++ Figure 2: Overview of the OpenCodeReasoning-II development stages. 2.1 Construction of OpenCodeReasoning-II The construction of the OpenCodeReasoning-II dataset involved a four-stage approach which is demonstrated in Figure 2 . The initial stage consisted of compiling a diverse collection of competitive coding problems with unit tests from various origins. Following this, a large language model (LLM) equipped with reasoning capabilities was leveraged to produce corresponding solutions. Next, a reasoning-capable LLM was employed to generate critique for these solutions. In the final stage, we obtained execution results for a portion of the generated solutions. During stage-II and stage-III, the generated solutions and their corresponding critiques underwent a post-processing stage aimed at guaranteeing their structural consistency. 2.1.1 Programming Questions Collection To create our dataset, we drew problems from the TACO corpus ( Li et al. 2023 ) , the APPS benchmark ( Hendrycks et al. 2021 ) , the CodeContests collection ( Li et al. 2022 ) , and CodeForces problems through the OpenR1 initiative ( Penedo et al. 2025a ) . Due to the frequent overlap found in public datasets, we applied a fuzzy matching-based de-duplication method, leading to a final set of 34,799