AIRepr: An Analyst-Inspector Framework for Evaluating Reproducibility of LLMs in Data Science
Qiuhai Zeng, Claire Jin, Xinyue Wang, Yuhan Zheng, Qunhua Li
TL;DR
AIRepr introduces an Analyst-Inspector framework to rigorously evaluate reproducibility of LLM-generated data analyses by testing whether an independent inspector can reproduce the analyst's workflow and conclusions from the workflow alone. The approach formalizes reproducibility with sufficiency and completeness concepts and proposes RoT and RReflexion prompting to enhance workflow clarity and fidelity. Across 1,032 tasks from three benchmarks and 15 analyst-inspector pairs, the study shows that higher workflow reproducibility correlates with improved accuracy and that reproducibility-focused prompts boost both metrics, with RoT and RReflexion delivering substantial gains. The framework proves robust to inspector choice and supports scalable, transparent human-AI collaboration in data science; the authors also release code publicly to facilitate adoption and further research.
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, e.g. 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 Analyst-Inspector framework for automatically evaluating and improving the reproducibility 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.
