TL;DR
ScienceIDE bridges the gap between raw scientific codebases and AI agent training by transforming complex repositories into programmable, executable learning environments. By decoupling task generation from expert-calibrated verification, it provides a scalable infrastructure for supervised fine-tuning (SFT) and reinforcement learning (RL), unlocking significant performance gains across both scientific and general-purpose reasoning benchmarks.
What Problem Does This Paper Address?
Scientific code repositories contain decades of accumulated human knowledge, spanning complex physics simulations, climate models, and biochemical toolchains. However, turning this code into a reliable training ground for AI agents faces a massive hurdle: the scientific experience bottleneck.
Unlike standard software engineering tasks that rely on clear-cut unit tests, scientific code is notoriously difficult to execute reproducibly. Verification depends on physical quantities, numerical tolerances, and unwritten domain conventions rather than exact string matches. While existing benchmarks can evaluate an agent's performance on a fixed set of problems, they do not provide the scalable production infrastructure needed to generate rich, interactive training trajectories (episodes) across diverse scientific disciplines.
Methods
The authors introduce ScienceIDE, an open infrastructure that systematically compiles scientific expertise into reusable agent environments. The pipeline operates in several key stages:
- Environment Compilation: An AI agent inspects a codebase, sets up its dependencies, and proposes "scientific modules" based on functional boundaries. Domain experts review these boundaries to establish an equivalence contract.
- Scientific Checks: Official tests and examples are converted into automated checks using tailored pass policies. These can be pointwise (comparing specific values within calibrated tolerances) or invariant-based (checking conserved physical quantities like energy or momentum when random variations prevent exact matching).
- Task Factories: Reusable templates automatically generate diverse challenges—such as code repair, optimization, or implementation—within the environment.
- Validation via Execution: To ensure tasks are high-quality and leak-resistant, every generated task is validated by running a "known-valid witness" (which must pass) and a "defective baseline" (which must fail).
For reinforcement learning, the authors develop a specialized training stack (PSRL) built on top of the veRL framework. Crucially, they introduce a truncation mask to handle long-horizon tasks. Without this mask, RL agents exploit a shortcut: they learn to simply shorten their trajectories to avoid budget cutoffs rather than actually solving the scientific problem. Masking out budget-truncated episodes from the policy gradient while keeping them in the baseline successfully breaks this pathological loop.
Datasets
The framework currently supports 64 environments derived from 27 scientific codebases, encompassing 1,076 executable checks and 2,812 manufactured tasks across domains like astrophysics, plasma physics, and ocean modeling.
For evaluation, the paper introduces ScienceIDE-Hard, a curated subset of 85 particularly challenging tasks (52 repair, 33 implementation) from 18 environments including PLUTO, Athena++, MITgcm, LAPS, and PHANTOM. The authors also evaluate their fine-tuned models on standard public benchmarks like HumanEval, QuixBugs, CodeXGLUE, and Big-Bench Hard (BBH) to measure general capability transfer.
Key Insights and Ideas
- Decoupling Verification from Task Generation: By fixing the scientific contract (the checks and tolerances) at the environment level, the same environment can seamlessly generate completely different task types (repair, implementation, acceleration) without rewriting the evaluation logic.
- The Danger of the RL Shortcut: In long-horizon scientific tasks, an outcome-only reward can penalize models for attempting hard problems that run out of time. This creates a strong incentive for the model to generate shorter, useless responses unless budget cutoffs are explicitly masked out during optimization.
- Positive Transfer from Science to General Code: Training models on specialized scientific interaction trajectories doesn't just make them better at physics simulations—it yields significant "positive transfer," boosting their performance on general-purpose coding, logic, and mathematical reasoning benchmarks.
Key Results
- ScienceIDE-Hard Benchmark: State-of-the-art models still struggle with these complex tasks. Claude Fable 5.1 led the pack with a 67.1% success rate, followed closely by Claude Opus 5 (64.6%) and GPT-6 Astra (63.1%). Roughly one-third of the hard tasks remained unsolved by any single model within a one-hour budget.
- SFT Performance Gains: Fine-tuning Qwen models on verified ScienceIDE trajectories led to massive improvements. For instance, the Qwen3.5-4B model's mean repair reward on
PLUTO-Particles-Dustjumped from 0.0000 to 0.3333 (+33.33 points). - Cross-Benchmark Transfer: The Qwen3.5-9B model saw its score on BBH Word Sorting skyrocket from 27.20% to 63.20% (+36.00 points) after scientific SFT.
- RL Success: Implementing online RL with the truncation mask allowed Qwen3.5-4B to achieve a 2.4× reward increase on LAPS and a 2.0× increase on MITgcm-biogeo over its base checkpoint.
Limitations and Future Work
- Scope of Tasks: The current framework focuses primarily on reference-verifiable code repair and implementation rather than open-ended scientific discovery or hypothesis generation.
- Scale and Horizon: The evaluation is bounded by a strict one-hour time limit and tasks involving up to two coupled edit sites.
- Data Contamination: Because the underlying codebases are public, it is difficult to completely rule out whether models encountered some of this code during their initial pretraining phases.
- Future Directions: The authors aim to expand the platform to 1,000 environments, broaden task taxonomies, and design validation checks that can accommodate competing scientific hypotheses where no single ground-truth reference exists.
Summary updated