NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Agnostics: Learning to Synthesize Code in Any Programming Language with a Universal Reinforcement Learning Environment

Aleksander Boruch-Gruszecki, Yangtian Zi, Zixuan Wu, Tejas Oberoi, Carolyn Jane Anderson, Joydeep Biswas, Arjun Guha

Abstract

Large Language Models (LLMs) demonstrate exceptional proficiency in high-resource programming languages like Python, yet their performance often collapses when applied to low-resource or specialized languages such as Julia, Fortran, and OCaml. This performance gap is driven by data scarcity and the "engineering tax"—the significant manual effort required to build language-specific test harnesses for reinforcement learning. This paper introduces Agnostics, a language-agnostic post-training pipeline that treats code correctness as a property of observable Input/Output (I/O) behavior. By utilizing a universal execution sandbox and Group Relative Policy Optimization (GRPO), Agnostics enables models to learn the mechanics of any programming language with minimal per-language configuration. Our results show that small, open-weight models (e.g., Qwen-3 4B) trained with Agnostics can rival or outperform models ten times their size in low-resource environments, setting new state-of-the-art benchmarks for models under 16B parameters.

1. Introduction: The Engineering Tax

The disparity in LLM coding performance is largely a function of training data volume. While common datasets contain hundreds of gigabytes of Python code, specialized languages essential to scientific computing and data science—such as Fortran or R—may have less than 2GB available.

Beyond data scarcity, a secondary bottleneck exists in the post-training phase. Improving a model through Reinforcement Learning with Verifiable Rewards (RLVR) typically requires a "test harness": a complex suite of language-specific unit tests and execution environments. Building these for every niche language creates a prohibitive "engineering tax." Agnostics addresses this by standardizing the verification process, allowing reinforcement learning to be applied across the entire spectrum of programming languages without custom engineering for each.

2. The Agnostics Pipeline

The Agnostics framework shifts the focus from language-specific syntax to universal observable behavior. The pipeline consists of three primary components:

2.1 Data Reformulation

To eliminate the need for complex function-call signatures, the authors use a frontier LLM to rewrite existing datasets (such as MBPP) into a standardized I/O format. Instead of completing a function, the model is tasked with writing a standalone program that reads from standard input and writes to standard output. This transformation makes the problem format identical across all programming languages.

2.2 Universal Verifier

The system employs a language-agnostic execution sandbox built on OCI containers. Adding support for a new language requires only a minimal YAML configuration (4-5 lines) specifying the compilation and execution commands. This allows the verifier to judge solutions in any language by comparing the program's output against expected ground-truth values.

2.3 Reinforcement Learning with Verifiable Rewards (RLVR)

The pipeline utilizes Group Relative Policy Optimization (GRPO), the algorithm popularized by DeepSeek-R1. During training, the model generates multiple candidate solutions and receives a binary reward (1 for correct output, 0 for incorrect). This process forces the model to internalize the syntax and logic of the target language through trial and error, effectively bridging the gap left by sparse pre-training data.

3. Benchmarking and Datasets

To evaluate the framework, the authors introduced several "language-agnostic" versions of established benchmarks:

  • Ag-MBPP-X: A reformulated version of Mostly Basic Programming Problems.
  • Ag-Codeforces-X: Derived from competitive programming tasks.
  • Ag-LiveCodeBench-X: A multi-language benchmark designed to mitigate data contamination by using recent problems.

Crucially, the models were also tested on MultiPL-E to determine if I/O-based training generalizes back to standard function-completion tasks.

4. Key Results and Insights

4.1 Performance Leaps in Low-Resource Languages

Agnostics-trained models demonstrated significant improvements in languages where base models previously failed. In OCaml and Fortran, where base models often yielded near-zero accuracy, Agnostics pushed performance to 7% and 15% respectively. A Qwen-3 4B model trained via Agnostics frequently outperformed 16B to 70B parameter models in languages like Lua, Julia, and R.

4.2 Generalization and Error Correction

Qualitative analysis indicates that Agnostics helps models overcome "shallow" errors, such as syntax mistakes or incorrect library usage. By resolving these fundamental hurdles, the model's latent reasoning capabilities—developed during pre-training on high-resource languages—can finally be applied to the target language. Furthermore, the training generalized well; models trained on I/O tasks showed improved performance on standard MultiPL-E function tasks, proving they learned the underlying logic of the language rather than just output formatting.

4.3 Efficiency vs. Distillation

The study found that RL-based training via Agnostics is significantly more effective than traditional distillation (training a small model on a larger model's outputs) or simple rejection sampling. The verifiable reward signal provides a stronger learning signal for mastering language mechanics.

5. Limitations and Future Work

While Agnostics democratizes RL for programming, it currently focuses on tasks verifiable via standard I/O. This covers algorithmic and competitive programming but does not yet extend to complex software engineering tasks involving multi-file projects or specific external APIs. Additionally, due to hardware constraints, the current study focused on models up to 8B parameters. Future work will explore scaling this approach to 70B+ models and expanding the data format to cover a broader range of software engineering challenges.

6. Conclusion

Agnostics provides a scalable, low-effort path to achieving high performance in any programming language. By removing the "engineering tax" associated with language-specific verification, it enables small, open-weight models to punch significantly above their weight class, ensuring that the benefits of LLM-assisted coding are not restricted to a handful of high-resource languages.

Summary updated

BibTeX
@inproceedings{boruchgruszecki2026agnostics,
  author = {Aleksander Boruch-Gruszecki and Yangtian Zi and Zixuan Wu and Tejas Oberoi and Carolyn Jane Anderson and Joydeep Biswas and Arjun Guha},
  title = {{Agnostics: Learning to Synthesize Code in Any Programming Language with a Universal Reinforcement Learning Environment}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=mjDT60Ffms},
}
Figure