Code availability is not enough: schemas for documenting and extending data analysis

A decision‑oriented schema bridges the gap between code and manuscript, letting researchers document, reproduce, and extend analyses using natural‑language descriptions and LLM‑generated scripts.

Code availability is not enough: schemas for documenting and extending data analysis

Introduction

Reproducibility in data analysis often hinges on sharing code, yet code alone rarely conveys the full reasoning behind each analytical choice. The paper Code availability is not enough: schemas for documenting and extending data analysis proposes a lightweight, natural‑language schema that captures every decision in a study—from data cleaning to model specification. By treating the schema as an intermediate representation, large language models (LLMs) can automatically generate, validate, and modify analysis scripts, turning a static manuscript into a living, extensible artifact.

A decision‑centric schema as a bridge

The authors define a schema as a structured collection of textual decision statements. Each entry records what was done (e.g., "impute missing values using median imputation") and why (e.g., "to preserve the central tendency without inflating variance"). This format serves two purposes:

  1. Documentation – Readers see a concise, self‑contained narrative of every analytical step, independent of implementation details.
  2. Automation – An LLM consumes the schema and emits executable code that mirrors the described decisions. Because the schema is language‑agnostic, the same set of decisions can be rendered in Python, R, or other environments.

The workflow therefore consists of three stages:

  • Authoring: Researchers write the schema alongside the manuscript, optionally adding an alternative file that lists plausible variations (e.g., different covariates or model families).
  • Generation: An LLM reads the schema (and any alternatives) and produces corresponding scripts, which can be run to verify results or explore the multiverse of analyses.
  • Validation: The generated code is executed, and its outputs are compared to the reported findings, ensuring fidelity.

Demonstrations of the workflow

The paper showcases two case studies:

  1. Reproducing a published regression on heaped smoking data – The authors built a schema that captured the original authors’ decisions. The LLM‑generated script reproduced the published estimates exactly. When a reviewer suggested an alternative covariate set, the authors added it to the alternative file; the LLM instantly produced a new script, and the resulting estimates were obtained without manual re‑coding.
  2. A reproducibility check on the many‑analysts football study – No schema was provided initially. By reverse‑engineering the published manuscript into a decision schema, the authors could generate code that replicated the original analysis and highlighted discrepancies, illustrating how the schema can serve as a diagnostic tool even when the original authors did not supply one.

These examples illustrate two key benefits: speed (automated script generation eliminates tedious transcription) and extensibility (readers can propose and test new analytical paths by editing the alternative file).

Practical implications for researchers

  • Standardized documentation: Adopting a decision schema encourages authors to think explicitly about each analytical choice, reducing hidden assumptions.
  • Facilitating peer review: Reviewers can request alternative specifications in the schema, receive automatically generated code, and assess robustness without deep programming effort.
  • Enabling multiverse analyses: By enumerating plausible alternatives, researchers can present a spectrum of results, fostering transparency about analytical flexibility.
  • Tool integration: The schema format is simple enough to be stored as a JSON or YAML file, making it compatible with existing version‑control and workflow tools.

Closing thoughts

Code availability remains a cornerstone of reproducible research, but without clear documentation of why each line of code exists, the scientific narrative stays fragmented. The decision‑oriented schema proposed by Zhang and Peng offers a practical middle ground: a human‑readable ledger of analytical choices that LLMs can translate into runnable scripts. By embedding this schema into the publication pipeline, the community can move from static code snapshots toward dynamic, extensible analyses that are both reproducible and readily adaptable to new questions.

Source

Read original source

Why we picked this

The arXiv paper on schemas for documenting data analysis is a core AI/ML research contribution.

← Back to all articles