AIR epr: An Analyst-Inspector Framework for Evaluating Reproducibility of LLM s in Data Science (2025)

Abstract: Large language models (LLMs) are increasingly used to automate data analysis through executable code generation. Yet, data science tasks often admit multiple statistically valid solutions—for example, different modeling strategies—making it critical to understand the reasoning behind analyses, not just their outcomes. While manual review of LLM-generated code can help ensure statistical soundness, it is labor-intensive and requires expertise. A more scalable approach is to evaluate the underlying workflows—the logical plans guiding code generation. However, it remains unclear how to assess whether an LLM-generated workflow supports reproducible implementations.To address this, we present **AIRepr**, an **A**nalyst–**I**nspector framework for automatically evaluating and improving the **repr**oducibility of LLM-generated data analysis workflows. Our framework is grounded in statistical principles and supports scalable, automated assessment. We introduce two novel reproducibility-enhancing prompting strategies and benchmark them against standard prompting across 15 analyst–inspector LLM pairs and 1,032 tasks from three public benchmarks. Our findings show that workflows with higher reproducibility also yield more accurate analyses, and that reproducibility-enhancing prompts substantially improve both metrics. This work provides a foundation for transparent, reliable, and efficient human–AI collaboration in data science. Our code is publicly available: [https://github.com/Anonymous-2025-Repr/LLM-DS-Reproducibility](https://github.com/Anonymous-2025-Repr/LLM-DS-Reproducibility)

## introduction large language models (llms) are increasingly used to automate data analysis by generating executable code @xcite @xcite . with recent advances in reasoning @xcite and tool use @xcite , llms are achieving impressive performance on a wide range of data science tasks, from exploratory analysis @xcite to predictive modeling @xcite , often approaching or even surpassing human-level accuracy on benchmark datasets @xcite . however, data science is not just about producing an answer. many tasks admit multiple valid analytical paths @xcite : different statistical tests, feature selection, or modeling strategies can yield distinct yet equally defensible conclusions @xcite . even when ground truth labels exist, rigorous analysis is necessary to avoid critical pitfalls such as missing preprocessing choices or inappropriate distributional assumptions @xcite . consequently, accuracy alone is an insufficient metric of the quality of a data science solution. understanding how an answer is reached, i.e. the workflow of the analysis, is essential for ensuring validity, transparency, and reproducibility @xcite . human data scientists are trained to uphold high standards of reproducibility @xcite @xcite , not only by writing correct code but by documenting their analytical steps and rationales (e.g. data processing steps, model specifications) in methods sections or technical reports @xcite . these practices reflect a broad view of reproducibility -one that values transparency, clarity, and completeness of the information necessary for others to replicate and verify the work, just as much as correctness. though llms can generate syntactically valid code and articulate underlying high-level reasoning, verifying the soundness of these outputs still demands time-intensive manual inspection by experts. if the ai analyst's conclusion is independently reproducible-meaning the workflow provides complete and sufficient details for the generated code-then human analysts can focus on evaluating the soundness of the workflow without manually verifying the code. however, if the ai solution fails the reproducibility check, the solution needs to be revised before being submitted for human review. a more scalable alternative is to focus on evaluating the underlying workflow -the structured sequence of reasoning steps and details that compose an analysis -over the code itself (figure 1 ). if workflows are expressed clearly and accurately, they can serve as a reproducible and inspectable artifact in their own right, enabling reviewers or collaborators to assess methodological soundness without sifting through implementation details (example in to bridge this gap, we propose the analystinspector framework to automatically evaluate and enhance the reproducibility of llm-generated data analysis workflows, reducing dependence on manual code verification. in this framework, an independent inspector model attempts to reproduce the analysis based solely on the workflow produced by the analyst model. if the inspector can reproduce functionally equivalent code and arrive at the same conclusion, this indicates that the workflow contains all necessary details without relying on implicit assumptions or analyst-specific knowledge. our analyst-inspector framework offers a practical and principled approach for evaluating llmgenerated data science workflows, with several key advantages. (a) human-aligned and intuitive: it reflects how human reviewers typically evaluate analyses by reading methodological descriptions rather than inspecting code line-by-line. (b) statistically grounded: the framework requires work-flows not only to be faithful @xcite , accurately reflecting the analysis steps, but also to satisfy the classical statistical properties of sufficiency and completeness @xcite , meaning they must include all necessary information (sufficiency) while excluding irrelevant or extraneous details (completeness). (c) generalizable and lightweight: the core mechanism of checking whether one llm can independently reproduce another's analysis based on its generated workflow is broadly applicable across tasks and domains, without requiring labeled training data or complex infrastructure. using this framework, we systematically evaluate 15 combinations of five llms as analysts and three llms as inspectors across 1,032 diverse data analysis tasks drawn from three benchmark datasets. we propose two novel reproducibilityenhancing prompting strategies and benchmark them against two standard baselines to assess their impact on analysis reproducibility and accuracy. our study finds that increased reproducibility significantly correlates with higher accuracy in llmgenerated analyses, and that prompts explicitly emphasizing reproducibility improve analysis quality. these findings provide strong directions for advancing transparent and robust human-ai collaboration in data science. ## workflow reproducibility reproducibility in data analysis depends on transparent workflows that clearly document key steps, such as data processing, modeling choices, and parameter settings, so others can reproduce results through independent implementation @xcite . we define workflow reproducibility as a property of the workflow reflecting how well it supports independent generation of code that faithfully implements the original analysis it describes. that is, it captures the alignment between what the workflow describes and what is actually implemented. to evaluate workflow reproducibility, we introduce an analyst-inspector framework for llmgenerated workflows: an llm analyst produces a data science solution, and a separate llm inspector attempts to independently reproduce the results using only the workflow and minimal context (e.g., dataset filepaths). workflows that enable successful reproduction demonstrate strong fidelity between documentation and implementation. this mirrors the reproducibility standard for publishing scientific research, where methods sections must be sufficient for independent replication, and facilitates human-ai collaboration by shifting human oversight from labor-intensive manual code inspection to high-level reasoning about logic and assumptions made in the workflow (figure 1 ). ## conclusion in this work, we introduce airepr, an analystinspector framework designed to rigorously evaluate and enhance the reproducibility of llmgenerated data analysis workflows. our systematic evaluation demonstrates that enforcing reproducibility criteria on workflows can improve the accuracy of analyses, underscoring the value of explicit and transparent reasoning in ai-driven data science. embedding reproducibility principles through our rot and rreflexion strategies substantially boosts both reproducibility and accuracy across five llms, outperforming standard cot prompting, and demonstrating that reproducibility is not only a desirable property but a practical means of improving performance. error analysis further revealed that inspector feedback in our rot and rreflexion strategies effectively reduces common causes of irreproducibility, such as omissions, misspecifications, and unnecessary steps that introduce ambiguity. we also find that airepr is robust to the choice of inspector model. while some models, like claude-3.5-sonnet, may overrate their own outputs, others such as gpt-4o and o3-mini provide more consistent and unbiased evaluations, making them more suitable for inspection. the airepr framework is broadly applicable to llm-based systems that generate both workflows and executable code. by introducing an inspector to independently verify analyst outputs, users can implement a lightweight reproducibility check before relying on results. this approach may extend to real-world tools with similar structures, such as microsoft copilot analyst or perplexity lab, as a modular addition for improving trust and reliability in automated data analysis. overall, airepr promotes more transparent, reliable, and efficient human-ai collaboration, enhancing the integrity and usability of automated data analysis.