ScienceIDE: Turning World's Scientific Codebase into Agent Learnable Environments

Hejia Geng, Zesen Huang, Haoyang Li, Wenbin Li, Koutian Wu, Zihan Zhou, Yuanbo Pang, Weihao Liu, Zigong Xu, Zhiping Li, Zongzheng Zhang, Chuanfei Dong, Jiankai Sun, Tianzhe Zheng, Fengyu Xie, Yue Ma, Yueheng Shi, Tong Xie, Zonglin Di, Xianrong Liu, Qucheng Gao, Yimin Liu, Jiaming Pan, Sheng Huang, Xiao-Han Ma, Lanqing Yuan, Zhenlin Zhu, Ziang Liu, Ziyang Xu, Junkai Wang, Kangkai Liang, Jiayi Xian, Zehong Zhao, Liuwei Xu, Jingxu Xie, Peijin Zhang, Qiang Gao, Chengyi Xing, Zhe Zhao, Xi Wang, Yaopeng Xing, Xing Meng, Zhenfei Yin, Yingcheng Wu, Ling YangarXiv 2026

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:

  1. 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.
  2. 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).
  3. Task Factories: Reusable templates automatically generate diverse challenges—such as code repair, optimization, or implementation—within the environment.
  4. 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).
The step-by-step pipeline for transforming a scientific codebase into an executable contract.

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.

ScienceIDE framework overview, domain coverage, and model evaluation on ScienceIDE-Hard.

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-Dust jumped 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

BibTeX
@misc{geng2026scienceide,
  author = {Hejia Geng and Zesen Huang and Haoyang Li and Wenbin Li and Koutian Wu and Zihan Zhou and Yuanbo Pang and Weihao Liu and Zigong Xu and Zhiping Li and Zongzheng Zhang and Chuanfei Dong and Jiankai Sun and Tianzhe Zheng and Fengyu Xie and Yue Ma and Yueheng Shi and Tong Xie and Zonglin Di and Xianrong Liu and Qucheng Gao and Yimin Liu and Jiaming Pan and Sheng Huang and Xiao-Han Ma and Lanqing Yuan and Zhenlin Zhu and Ziang Liu and Ziyang Xu and Junkai Wang and Kangkai Liang and Jiayi Xian and Zehong Zhao and Liuwei Xu and Jingxu Xie and Peijin Zhang and Qiang Gao and Chengyi Xing and Zhe Zhao and Xi Wang and Yaopeng Xing and Xing Meng and Zhenfei Yin and Yingcheng Wu and Ling Yang},
  title = {{ScienceIDE: Turning World's Scientific Codebase into Agent Learnable Environments}},
  year = {2026},
  eprint = {2609.19134},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2609.19134},
}
Figure