Automating Computational Reproducibility in Social Science: Comparing Prompt-Based and Agent-Based Approaches
Syed Mehtab Hussain Shah, Frank Hopfgartner, Arnim Bleier
TL;DR
Computational reproducibility in social science remains challenging due to missing dependencies and fragile execution contexts. The authors compare two AI-enabled repair strategies—prompt-based large language models and autonomous agent-based repair—using a synthetic benchmark of five reproducible R studies with injected failures in Dockerized environments. Prompt-based repairs achieve 31-79% success depending on context and error complexity, while agent-based workflows reach 69-96% success, demonstrating the superior ability of agents to diagnose, modify, and re-run analyses. The study provides a controlled, post-publication repair framework for direct method comparison and highlights practical implications for integrating AI-assisted reproducibility tools into research workflows. Overall, agent-based approaches with execution access can substantially reduce manual debugging and improve reproducibility across diverse error types in computational social science.
Abstract
Reproducing computational research is often assumed to be as simple as rerunning the original code with provided data. In practice, missing packages, fragile file paths, version conflicts, or incomplete logic frequently cause analyses to fail, even when materials are shared. This study investigates whether large language models and AI agents can automate the diagnosis and repair of such failures, making computational results easier to reproduce and verify. We evaluate this using a controlled reproducibility testbed built from five fully reproducible R-based social science studies. Realistic failures were injected, ranging from simple issues to complex missing logic, and two automated repair workflows were tested in clean Docker environments. The first workflow is prompt-based, repeatedly querying language models with structured prompts of varying context, while the second uses agent-based systems that inspect files, modify code, and rerun analyses autonomously. Across prompt-based runs, reproduction success ranged from 31-79 percent, with performance strongly influenced by prompt context and error complexity. Complex cases benefited most from additional context. Agent-based workflows performed substantially better, with success rates of 69-96 percent across all complexity levels. These results suggest that automated workflows, especially agent-based systems, can significantly reduce manual effort and improve reproduction success across diverse error types. Unlike prior benchmarks, our testbed isolates post-publication repair under controlled failure modes, allowing direct comparison of prompt-based and agent-based approaches.
