Preprint · 2026

CodeDistiller: Automatically Generating Code Libraries for Scientific Coding Agents

Peter Jansen, Samiah Hassan, Pragnya Narasimha

VenuearXiv
DOI10.48550/arXiv.2512.01089
URLhttp://arxiv.org/abs/2512.01089
TopicsReplicHAI / Agentic reproduction: systems & benchmarks
TagsComputer Science - Artificial Intelligence
archiveIDarXiv:2512.01089
extraarXiv:2512.01089 [cs.AI]
libraryCatalogarXiv.org
shortTitleCodeDistiller

Abstract

Automated Scientific Discovery (ASD) systems can help automatically generate and run code-based experiments, but their capabilities are limited by the code they can reliably generate from parametric knowledge alone. As a result, current systems either mutate a small number of manually-crafted experiment examples, or operate solely from parametric knowledge, limiting quality and reach. We introduce CodeDistiller, a system that automatically distills large collections of scientific Github repositories into a vetted library of working domain-specific code examples, allowing ASD agents to expand their capabilities without manual effort. Using a combination of automatic and domain-expert evaluation on 250 materials science repositories, we find the best model is capable of producing functional examples for 74% of repositories, while our downstream evaluation shows an ASD agent augmented with a CodeDistiller generated library produces more accurate, complete, and scientifically sound experiments than an agent with only general materials-science code examples. We also evaluate LLM-as-a-judge ratings against domain-expert ratings in an A/B testing paradigm, finding moderate agreement and suggesting that inexpensive proxy metrics may be feasible for evaluating scientific discovery systems at scale.

BibTeX

@misc{jansen_codedistiller_2026,
	title = {{CodeDistiller}: {Automatically} {Generating} {Code} {Libraries} for {Scientific} {Coding} {Agents}},
	shorttitle = {{CodeDistiller}},
	url = {http://arxiv.org/abs/2512.01089},
	doi = {10.48550/arXiv.2512.01089},
	abstract = {Automated Scientific Discovery (ASD) systems can help automatically generate and run code-based experiments, but their capabilities are limited by the code they can reliably generate from parametric knowledge alone. As a result, current systems either mutate a small number of manually-crafted experiment examples, or operate solely from parametric knowledge, limiting quality and reach. We introduce CodeDistiller, a system that automatically distills large collections of scientific Github repositories into a vetted library of working domain-specific code examples, allowing ASD agents to expand their capabilities without manual effort. Using a combination of automatic and domain-expert evaluation on 250 materials science repositories, we find the best model is capable of producing functional examples for 74\% of repositories, while our downstream evaluation shows an ASD agent augmented with a CodeDistiller generated library produces more accurate, complete, and scientifically sound experiments than an agent with only general materials-science code examples. We also evaluate LLM-as-a-judge ratings against domain-expert ratings in an A/B testing paradigm, finding moderate agreement and suggesting that inexpensive proxy metrics may be feasible for evaluating scientific discovery systems at scale.},
	urldate = {2026-11-05},
	publisher = {arXiv},
	author = {Jansen, Peter and Hassan, Samiah and Narasimha, Pragnya},
	month = may,
	year = {2026},
	note = {arXiv:2512.01089 [cs.AI]},
	keywords = {Computer Science - Artificial Intelligence},
}