Skip to content
DraconiticResearch
Search Sources API
277,308 studies31 sourcesUpdated 16 min ago
PreprintarXiv licencearXiv

Inference after coding agents

Abstract

Empirical research is changing rapidly as AI coding agents are becoming increasingly proficient in every step of it, from writing code to manipulating data. We argue that while the potential of coding agents for science is vast, their use in hypothesis testing poses a substantial threat to classical inference, as these agents enable a supercharged form of selective inference. In particular, we argue that coding agents carrying out empirical research introduce a new type of post-selection inference that combines human-like, open-ended search over an implicit space of estimators with programmatic replayability of both the selection and the estimation process. Indeed, we find that on simulated data with zero effects, four frontier agents report significant p-values between 54% and 98% of the time when asked to produce a compelling finding. We propose a simple procedure for detecting and correcting these distortions. After an agent has completed its analysis, we reset and replay it on subsamples of the data to estimate the agent's relative probability of selecting that analysis when it looks statistically favorable. For agents with stable selection behavior, the resulting corrected test is asymptotically valid and consistent conditional on selection. Importantly, the correction is learned from the black-box agent's actual choices rather than a model of how it searches, so it remains valid even as AI technology continues to evolve rapidly. In simulations, the correction robustly lowers the high false rejection rates to near the nominal 5%. We illustrate the method on applications from two published papers.

Related

  1. Coding Agents for Coding Theory
    Abraham Yeung
    arXivPreprintCC BY 4.0Full textGeneral mathematicsarXiv
  2. Unmasking shortcut solutions of coding agents on partial differential equations
    Jiale Linghu, Yangshuai Wang
    arXivPreprintarXiv licenceFull textNumerical analysis & scientific computingarXiv
  3. Do Coding Agents Deceive Us? Detecting and Preventing Cheating via Capped Evaluation with Randomized Tests
    Thanawat Lodkaew, Johannes Ackermann, Soichiro Nishimori +3
    arXivPreprintCC BY 4.0Full text4 citedStatisticsarXiv
  4. GTDD: Generative Test-Driven Development for AI Coding Agents with Adversarial Testing
    Masahiro Kato
    arXivPreprintCC BY-NC-ND 4.0Full textStatisticsarXiv
  5. ControlHarbor: A Benchmark for Control Design by Coding Agents
    Jieqiang Wei, Fahad Ali, Jonny Reichwald +1
    arXivPreprintCC BY 4.0Full textDynamical systemsarXiv
BibTeX
@misc{gunsilius2026inference,
  title = {{Inference after coding agents}},
  author = {Florian Gunsilius and David Van Dijcke and Kaspar Wüthrich},
  howpublished = {arXiv},
  year = {2026},
  month = nov,
  doi = {10.48550/arxiv.2611.23174},
  eprint = {2611.23174},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.23174},
}
RIS
TY  - UNPB
TI  - Inference after coding agents
AU  - Florian Gunsilius
AU  - David Van Dijcke
AU  - Kaspar Wüthrich
PY  - 2026
DA  - 2026/11/17
PB  - arXiv
DO  - 10.48550/arxiv.2611.23174
UR  - https://arxiv.org/abs/2611.23174
AB  - Empirical research is changing rapidly as AI coding agents are becoming increasingly proficient in every step of it, from writing code to manipulating data. We argue that while the potential of coding agents for science is vast, their use in hypothesis testing poses a substantial threat to classical inference, as these agents enable a supercharged form of selective inference. In particular, we argue that coding agents carrying out empirical research introduce a new type of post-selection inference that combines human-like, open-ended search over an implicit space of estimators with programmatic replayability of both the selection and the estimation process. Indeed, we find that on simulated data with zero effects, four frontier agents report significant p-values between 54% and 98% of the time when asked to produce a compelling finding. We propose a simple procedure for detecting and correcting these distortions. After an agent has completed its analysis, we reset and replay it on subsamples of the data to estimate the agent's relative probability of selecting that analysis when it looks statistically favorable. For agents with stable selection behavior, the resulting corrected test is asymptotically valid and consistent conditional on selection. Importantly, the correction is learned from the black-box agent's actual choices rather than a model of how it searches, so it remains valid even as AI technology continues to evolve rapidly. In simulations, the correction robustly lowers the high false rejection rates to near the nominal 5%. We illustrate the method on applications from two published papers.
ER  -