Long-context midtraining raises selected coding scores
Priming Base Models for Agentic Post-Training: An Open Midtraining Recipe · arXiv:2610.22019
In plain words
Models that work on coding tasks with tools need to handle whole repositories and interactions with those tools. The paper introduces a training stage between a model’s initial training and later training on examples of desired responses. It gives the model long software documents and some records of agent interactions.
After the same later training, the tested Nemotron models improved on some coding-task tests, including a clear gain on one long-task test for the larger model. Results varied by test, so the recipe is not shown to help every score or every model family.
The research
How can a coding model encounter whole repositories and tool interactions before post-training, when initial training often uses shorter contexts and later supervised training is largely synthetic?
The paper tests whether a separate, long-context stage can help prepare base models for agentic coding without relying on base-model proxy measures to predict later performance.
The recipe trains base models on long software-engineering data and some agent traces before post-training, then tests coding results after the same SFT.
The authors train base models for hundreds of billions of tokens at long context, mostly on natural software-engineering data with a smaller share of agent traces. They compare midtrained models with their starting checkpoints after the same full SFT, measuring success on coding tasks.
For Lightning-LC, 500 billion midtraining tokens raise pass@1, the mean success rate across sampled rollouts for each task, on SWE-bench Verified from 60.7% to 64.5%; for Super, 280 billion tokens raise it on DeepSWE from 11.7% to 15.7%.
These results show selected post-SFT gains, while Super’s Multilingual and Pro scores do not show consistent improvement.
The benchmark comparisons are single runs, and the authors note that differences of one or two points may reflect run-to-run variation.
The recipe was tested on Nemotron models, mainly for agentic coding, with an agent-focused SFT blend; the short, single-seed reinforcement-learning check does not show that midtraining increases what reinforcement learning can add.
What the evidence shows
- Prepare models for coding
The paper presents an open midtraining recipe, a training stage between initial pretraining and post-training, for base models intended for agentic coding. The question is how to expose a model to long software-engineering material and agent interactions before later training.
The authors evaluate the recipe by testing coding-task success after supervised fine-tuning (SFT), training further on examples paired with desired responses.
- Compare after equal training
The main comparison gives a midtrained model and its starting checkpoint the same full SFT, then measures success on coding tasks. Pass@1 is the mean success rate across sampled rollouts for each task.
For Nemotron 3.5 Lightning-LC, 500 billion midtraining tokens raise pass@1 on SWE-bench Verified, a test of fixing software issues, from 60.7% to 64.5%.
- Results vary across tests
The larger Nemotron 3.5 Super model also improves on some tests after full SFT: its pass@1 rises from 11.7% to 15.7% on DeepSWE, which tests longer coding tasks, and from 72.9% to 74.3% on SWE-bench Verified.
Its Multilingual and Pro scores are lower after full SFT, but the authors do not treat those as consistent declines because short-SFT scores were level with or slightly above the base.
- Test the trace contribution
A separate early experiment on Nemotron 3.5 Lightning-8K compares the full blend with midtraining on natural software-engineering data alone, using the same 100 billion token midtraining budget and full SFT. The full blend scores higher on SWE-bench Verified, Multilingual, and Terminal-Bench.
In this tested setup, the contrast supports a contribution from agent traces beyond natural-data-only midtraining; it does not settle their effect in other settings.
- Use direct outcome measures
Base-model measures of file-state reconstruction and cross-file code modeling also improve, but the authors find that these measures do not reliably predict post-training results. They therefore use post-SFT coding tests to judge the recipe’s effect.
This evidence supports selected gains for the tested Nemotron models, while the single-run comparisons and narrow training and model coverage limit broader conclusions.
Deep
- Original paper authors
- Soumye Singhal, Joseph Jennings, Ka Shun Shum, Alexander Bukharin, Khushi Bhardwaj
- Submitted to arXiv
- License
- arXiv non-exclusive