# Inference after coding agents

arXiv: https://arxiv.org/abs/2611.23174 · HTML: https://mlsanity.com/paper/2611.23174/

## Key facts

- No citing papers in the map yet (data through 24 Nov 2026).
- Placed in Web, search, and research agents, one of 16 directions in LLM agents and tool use.
- Builds on 12 of its 85 references that are in the map.
- Submitted 17 Nov 2026, announced 18 Nov 2026.

## Placed in

- LLM agents and tool use / [Web, search, and research agents](https://mlsanity.com/agents/web-search-and-research-agents/)

## Builds on (most cited first, 12 of 12)

- [SWE-Bench Pro: Can AI Agents Solve Long-Horizon Software Engineering Tasks?](https://mlsanity.com/paper/2509.16941/) (2025)
- [Optimal Inference After Model Selection](https://mlsanity.com/paper/1410.2597/) (2014)
- [Automated Hypothesis Validation with Agentic Sequential Falsifications](https://mlsanity.com/paper/2502.09858/) (2025)
- [Probably Approximately Correct Labels](https://mlsanity.com/paper/2506.10908/) (2025)
- [The Agentic Garden of Forking Paths](https://mlsanity.com/paper/2607.01507/) (2026)
- [FUSE: Ensembling Verifiers with Zero Labeled Data](https://mlsanity.com/paper/2604.18547/) (2026)
- [Inference conditional on selection: a review](https://mlsanity.com/paper/2604.09779/) (2026)
- [Selective inference is easier with p-values](https://mlsanity.com/paper/2411.13764/) (2024)
- [Nonstandard Errors in AI Agents](https://mlsanity.com/paper/2603.16744/) (2026)
- [Black-box Selective Inference via Bootstrapping](https://mlsanity.com/paper/2203.14504/) (2022)
- [Inference after black box selection](https://mlsanity.com/paper/1901.09973/) (2019)
- [Flexible Selective Inference with Flow-based Transport Maps](https://mlsanity.com/paper/2506.01150/) (2025)

## Abstract (arXiv)

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.
