Manuel B. Garcia

Manuel B. Garcia serves as the Senior Director for Educational Technology and Digital Learning at FEU Institute of Technology, Manila, Philippines. Read More

Contact Info

1607, FEU Tech Building,
P. Paredes St, Sampaloc,
Manila, Philippines
mbgarcia@feutech.edu.ph

Follow Me

What Should Researchers Archive So Others Can Reproduce AI-Assisted Code Later?

Saving an AI-generated script is not enough to ensure that others can reproduce a research analysis years later. Learn which code, data, software environments, verification records, and AI-assistance documentation researchers should preserve, and how to create an identifiable archival release.

734
Archiving AI-Assisted Research Code Guide 734 of 1196
01 · The Question

What Must You Preserve So Someone Can Rerun Your AI-Assisted Analysis Years Later?

You have completed a research project using Python scripts developed partly with generative AI. The scripts clean the dataset, calculate questionnaire scores, perform statistical analyses, and generate the figures included in your manuscript.

You upload the final scripts to a repository and consider the research materials archived. Three years later, another researcher downloads the files but cannot reproduce the analysis. Several packages have changed, the original dataset is missing, and the scripts contain references to directories that existed only on your computer.

The AI assistant that helped generate the code may also have changed or become unavailable. What should have been archived to prevent these problems? More importantly, which materials are essential for reproducing the analysis, and which provide additional transparency about how the software was developed?

02 · The Short Answer

Archive the Executable Workflow, Not Just the AI-Generated Scripts

In Brief

Researchers should archive the exact code used to produce their reported findings, the relevant input data or authorized access arrangements, software dependencies, computational environment specifications, execution instructions, verification tests, and sufficient documentation to reconstruct the analysis. Consequential AI prompts, model information, and development records should also be preserved when they are relevant to provenance, methodological decisions, or applicable disclosure requirements.

Not every AI conversation or intermediate code draft must be included in a public archive. The appropriate archival package depends on the research design, confidentiality obligations, software licensing, and the extent to which external services or AI models are necessary to execute the workflow.

03 · What You Need to Know

What Belongs in a Reproducible Archive of AI-Assisted Research Code?

Archiving Is Different From Saving a Working Copy

Researchers frequently maintain working directories containing scripts, datasets, temporary files, and evolving outputs. These directories support day-to-day development but are not necessarily suitable for long-term preservation.

An archival release should identify the materials associated with a particular research output and provide enough context for another qualified researcher to understand and, where permitted, execute the analysis.

Archiving therefore involves selection, documentation, version identification, and appropriate preservation arrangements. Merely uploading a directory does not establish that its contents are complete or usable.

The Turing Way emphasizes that reproducible computational research requires access to the relevant code, data, and environment information. The archival record should reflect those dependencies.

1. Preserve the Exact Source Code Used for the Reported Results

The most important code artifact is the version actually used to generate the findings reported in the manuscript.

Research code often changes after analysis, during peer review, or while preparing subsequent publications. A repository's latest revision may therefore differ from the version associated with an earlier paper.

Researchers should identify the relevant Git commit, tag, or release and preserve the corresponding source files.

This includes analytical scripts, preprocessing functions, locally developed modules, and configuration files required to execute the workflow.

Appropriate version control of AI-generated code changes makes it easier to establish which implementation produced each set of results.

The archive should not depend on the original AI system being able to regenerate the code. The accepted executable implementation should already be preserved.

2. Preserve Input Data or Document How They Can Be Accessed

Code cannot reproduce an analysis without the relevant input data.

Researchers should preserve the dataset version used for the original analysis, including the variables and records that entered the computational workflow.

Where practical, the archive should also document the relationship between raw data, cleaned data, and derived analytical datasets.

However, research data may contain confidential participant information, commercially restricted materials, or records governed by institutional agreements.

Public archiving is not always permissible.

When data cannot be released openly, researchers should provide appropriate metadata, data dictionaries, access conditions, or controlled-access procedures. Synthetic or example datasets may help demonstrate code execution, although they do not necessarily permit reproduction of the original findings.

Watch Out

Do not publish identifiable participant data, confidential records, API credentials, or restricted datasets merely to make a computational archive publicly accessible. Reproducibility must be pursued within the ethical, legal, and contractual conditions governing the research materials.

3. Preserve Software Dependencies and Environment Specifications

Research scripts depend on programming languages, packages, libraries, and sometimes external executables or system-level components.

These dependencies may change or become unavailable over time. A script that runs successfully today may fail in a future environment because of changes in package interfaces, default behavior, or compatibility.

Researchers should archive the relevant environment specification, such as a verified Python requirements file, Conda environment record, R lock file, or container definition.

For more complex workflows, additional information about operating systems, numerical libraries, hardware, and external tools may be necessary.

AI can assist with creating reproducible software environment files, but generated configurations should be validated against the environment that produced the research results.

The archive should preserve verified information rather than a plausible dependency list inferred retrospectively from the code.

4. Preserve Dependency Versions, Not Just Package Names

A list containing only package names may be insufficient for long-term reconstruction.

For example, a script that requires a statistical package may behave differently after that package introduces new defaults or changes its computational implementation.

Researchers should preserve the relevant version information and, where appropriate, resolved dependency records.

Transitive dependencies can also matter. These are packages installed indirectly because another package requires them.

A carefully prepared dependency record for research code should distinguish verified requirements from inferred or uncertain information.

For long-term preservation, researchers should also consider whether package repositories, container images, or other external resources will remain accessible.

5. Archive Execution Instructions That Another Researcher Can Follow

A reproducible archive needs instructions explaining how its contents are used.

A README file should ordinarily identify the purpose of the project, required software, directory structure, input files, execution sequence, and expected outputs.

Instructions should explain how to reconstruct the environment and execute the analysis without relying on undocumented knowledge held by the original developer.

For example, a project may require preprocessing before statistical estimation. If the scripts must be executed in a particular order, that order should be explicit.

Researchers should also remove or document dependencies on local file paths, personal directories, and hidden configuration files.

A useful test is whether a collaborator can execute the workflow using only the archived materials and the documented access arrangements.

6. Preserve Unit Tests and Other Verification Evidence

Archiving the code allows others to inspect what was written. Preserving tests provides additional information about what the code was expected to do.

Unit tests can document the intended behavior of questionnaire-scoring functions, data transformations, classification rules, and other consequential operations.

Researchers should preserve the relevant tests, expected outcomes, and instructions for running them.

Where tests were generated with AI assistance, their expectations should be reviewed independently. A passing test suite is not sufficient evidence if the tests reproduce the same incorrect assumptions as the code.

Maintaining unit tests for AI-generated research functions can help future users determine whether a reconstructed environment preserves the intended computational behavior.

Integration tests and end-to-end checks may also be useful when the analysis involves multiple interconnected components.

7. Preserve Reference Outputs for Comparison

Researchers should consider archiving the tables, numerical results, and other outputs associated with the verified analytical release.

These outputs provide a reference against which future executions can be compared.

For example, a collaborator may rerun a regression script and compare the estimated coefficients, standard errors, and sample size with the archived results.

Not every output must be preserved. Temporary files and redundant intermediate artifacts may add little value.

The priority is to retain outputs that help establish whether the analysis has been reconstructed successfully.

For stochastic or numerically sensitive computations, researchers should document the criteria used to judge agreement. Exact numerical identity may not be appropriate across all platforms.

8. Preserve Random Seeds and Relevant Computational Settings

Some research workflows involve random sampling, simulation, bootstrapping, or machine-learning procedures.

These analyses may produce different outputs when executed repeatedly unless relevant sources of randomness are controlled.

Researchers should record random seeds, data-splitting procedures, algorithm settings, and other configurations that affect the results.

Where multiple random-number generators or parallel computing systems are involved, one seed may not control every source of variation.

Even with recorded seeds, exact numerical agreement may depend on software versions, hardware, and algorithm implementations.

Archival documentation should therefore identify the relevant settings and explain any known limits to deterministic reproduction.

9. Preserve Consequential AI-Assistance Records

AI-assisted research programming introduces additional provenance information that may be useful for understanding how the code was developed.

Researchers may wish to preserve the AI tool and model used, significant prompts, relevant generated responses, and consequential human corrections.

However, the archival importance of these records depends on the role AI played in the project.

If AI merely explained a syntax error, the interaction may have limited relevance to reproducing the final analysis.

If AI proposed a missing-data procedure or generated an important analytical function, the interaction may help explain a consequential development decision.

Researchers should therefore preserve AI prompts relevant to research code development when they contribute meaningfully to the research record.

Model information may also be valuable, particularly when AI behavior itself is being studied. In such cases, documenting the AI model and available version information can be essential to interpreting the experiment.

10. Distinguish AI Development Records From AI Runtime Dependencies

Not every AI-assisted project requires the original AI model to remain available.

Suppose AI generated a Python function that was subsequently reviewed, corrected, and saved. If the function executes independently, reproducing the analysis ordinarily requires the final code and its computational environment, not access to the model that generated it.

The situation changes when the research workflow calls an AI model during execution.

For example, a script may submit participant responses to a hosted language model for classification. In that case, the model or service is part of the computational workflow itself.

AI used during code development The model helped create or modify code that can subsequently execute without the model.
AI used during code execution The analytical workflow requires model inference or another AI service to generate research outputs.

Runtime AI dependencies may require additional records, including model identifiers, prompts, inference settings, service versions, and authorized inputs and outputs.

If the original model is unavailable, exact reconstruction of its earlier behavior may be impossible. Researchers should document that limitation rather than assume a newer model is an equivalent replacement.

11. Archive the Research Software License and Reuse Conditions

Researchers should identify the conditions under which others may access, modify, or redistribute the archived code.

A software license can clarify permitted reuse, but researchers should ensure that they have the necessary rights to distribute the materials included in the archive.

AI-assisted development may raise additional questions when generated code resembles third-party implementations or incorporates material subject to licensing restrictions.

Researchers should review relevant code origins and dependencies rather than assume that AI-generated material is automatically free of intellectual-property concerns.

Where the project contains restricted software or proprietary components, the archive should explain the applicable access conditions.

12. Use a Stable Archival Release Rather Than Only a Changing Repository

Development repositories are useful for collaboration and version control, but they may continue changing after publication.

Researchers should preserve an identifiable release corresponding to the results reported in a particular manuscript.

Repositories such as Zenodo can assign persistent identifiers to deposited research software. Software Heritage provides another approach to preserving source-code artifacts.

A persistent identifier can make a release easier to cite, but it does not automatically guarantee that every external dependency or dataset remains available.

The archival record should identify the relevant code revision and include or reference the materials necessary to reconstruct the workflow.

Researchers should also consider the retention, preservation, and access policies of the selected repository.

What Is the Minimum Useful Archival Package?

The necessary materials depend on the complexity and purpose of the research, but a useful baseline can be summarized as follows.

Archival component Why it matters Typical priority
Exact analytical source code Preserves the implementation that produced the results Essential
Input data or authorized access information Supports reconstruction of the analysis Essential where data are required
Environment and dependency records Supports software reconstruction Essential for dependency-based workflows
README and execution instructions Explains how to run the analysis Essential
Verification tests and reference outputs Supports checking reconstructed behavior Strongly recommended
Random seeds and computational settings Documents sources of output variation Essential when relevant
AI prompts and model information Documents consequential AI contributions Context-dependent
License and access conditions Clarifies permitted reuse and restrictions Strongly recommended

The archive should be evaluated as a coherent package rather than a collection of unrelated files. Its usefulness depends on whether the materials can be connected to the reported analysis.

04 · A Practical Example

Preparing an Archival Release for an AI-Assisted Educational Research Analysis

Hypothetical Example

Archiving a Student Engagement Analysis

A researcher uses AI-assisted Python scripts to investigate the association between online learning engagement and academic performance. The study includes questionnaire scoring, data cleaning, regression analysis, and visualization.

Step 1: Identify the final analytical revision

The researcher selects the Git commit used to generate the manuscript's final tables and figures and creates an identifiable release.

Step 2: Organize the code

The archive includes the data-cleaning, scoring, analysis, and visualization scripts, together with the configuration files required to execute them.

Step 3: Address data access

Because the original dataset contains protected student information, the public archive includes a data dictionary and authorized access instructions rather than identifiable participant records. A synthetic dataset is provided to demonstrate the workflow.

Step 4: Preserve the environment

The researcher includes a verified environment file, the Python version, and relevant external software requirements.

Step 5: Include verification materials

The archive contains independently reviewed scoring tests, workflow checks, and permitted reference outputs for comparison.

Step 6: Document AI assistance

A concise log identifies consequential AI-generated functions, available model information, and significant human corrections. Routine or confidential interactions are handled according to the project's retention and access requirements.

Step 7: Test the archival package

A collaborator reconstructs the environment and executes the workflow using the synthetic data. Authorized personnel separately verify reproduction of the original results within the approved data environment.

Step 8: Deposit the release

The researcher deposits the permitted materials in an appropriate repository and records the release identifier in the manuscript's research availability statement.

The public archive allows other researchers to inspect the code and demonstrate its execution without exposing protected participant information.

It does not permit unrestricted reproduction of the original statistical findings because the underlying dataset remains controlled. The researcher should describe this limitation accurately rather than claim that all results are publicly reproducible.

05 · What Researchers Often Get Wrong

Common Mistakes When Archiving AI-Assisted Research Code

Misconception

Uploading the Final Script Is Enough for Long-Term Reproducibility

A script may depend on missing data, packages, external software, or undocumented execution steps. Researchers should preserve the broader computational workflow rather than only the source file.

Misconception

The Latest Repository Version Must Reproduce the Published Results

Research software may continue changing after publication. The archive should identify the exact revision associated with the reported findings.

Misconception

Every AI Prompt Must Be Published With the Code

Consequential AI interactions may warrant preservation, but routine conversations do not automatically belong in a public archive. Confidentiality, methodological relevance, and applicable requirements should guide retention and disclosure.

Misconception

Using a Persistent Identifier Guarantees Reproducibility

A DOI or other persistent identifier improves citation and retrieval, but it does not establish that the archive contains complete, executable, or scientifically correct materials.

Misconception

Reproducibility Requires Public Release of All Participant Data

Confidentiality and legal restrictions may prevent open data release. Researchers can provide appropriate metadata, controlled-access arrangements, and permitted demonstration materials while acknowledging limitations on independent reproduction.

Misconception

AI-Generated Code Requires the Original AI Model Forever

If the final code executes independently, the original model is ordinarily not required to rerun the analysis. Model preservation becomes more consequential when AI inference is part of the runtime workflow or the model-generation process is itself being studied.

06 · What This Means for You

Archive What Another Researcher Needs to Reconstruct the Actual Analysis

The appropriate archival package depends on whether AI merely helped develop the code or remains part of the analysis during execution.

Researchers should begin by identifying the computational pathway from input data to reported findings, then preserve the materials necessary to reconstruct that pathway.

A simple decision framework

If AI generated code that now executes independently
Prioritize the final verified code, environment, data specifications, tests, and execution instructions.
If the analysis calls an AI model during execution
Preserve available model identifiers, prompts, inference settings, authorized outputs, and relevant service dependencies.
If the dataset contains protected information
Use authorized storage and access arrangements, with public metadata or demonstration materials where appropriate.
If the software depends on complex or fragile environments
Preserve verified lock files, container configurations, and additional system information as needed.
If the code supports a published manuscript
Create a stable release linked to the exact reported results and test the archival package before deposit.

A useful final check is to ask a collaborator who did not develop the code to attempt reconstruction using the proposed archive. This often reveals missing instructions or hidden dependencies before the materials are deposited.

Researchers should also avoid assuming that an archive remains usable indefinitely simply because its files are preserved. Long-term reproducibility may require migration, dependency preservation, or updated access arrangements.

07 · A Quick Checklist

Before Archiving AI-Assisted Research Code

Confirm that the archival release contains the necessary materials:
Identify and preserve the exact source-code revision used for the reported results.
Include the relevant input data or clearly document authorized access conditions and restrictions.
Preserve verified programming-language versions, package dependencies, and environment specifications.
Document external executables, services, and other runtime requirements.
Provide a README explaining setup, execution order, input files, and expected outputs.
Preserve meaningful tests and reference results for verifying the reconstructed workflow.
Record random seeds and computational settings where relevant.
Retain consequential AI-assistance records according to their research significance and applicable requirements.
Review the archive for confidential data, credentials, licensing restrictions, and other materials that should not be publicly released.
Test the archival package and deposit an identifiable release in an appropriate preservation repository.
08 · Frequently Asked Questions

Frequently Asked Questions About Archiving AI-Assisted Research Code

What files should researchers archive with AI-generated research code?

Typically, researchers should preserve the exact analytical code, relevant data or access instructions, environment specifications, execution documentation, verification tests, and reference outputs. Consequential AI-assistance records may also be needed depending on the research context.

Do researchers need to archive every AI prompt used during coding?

Not universally. Prompts that document important analytical decisions or form part of the research methodology may warrant preservation. Routine interactions can be treated according to project-specific documentation and retention requirements.

Can research code remain reproducible if the AI model that generated it disappears?

Yes, if the preserved code executes independently and the required data, environment, and instructions remain available. Reproducing the original AI generation process is a separate objective.

Is a GitHub repository enough to archive research code?

A GitHub repository supports development and collaboration, but long-term preservation may benefit from a stable release deposited in an archival service. Researchers should also ensure that the repository contains the materials needed for reconstruction.

Should researchers assign a DOI to archived research software?

A DOI can improve discoverability and citation of an identifiable software release. It is useful when supported by the chosen repository, but it does not itself guarantee that the archived workflow is reproducible.

What if the original research data cannot be shared?

Researchers should follow confidentiality and access requirements. They may provide metadata, data dictionaries, controlled-access procedures, or synthetic demonstration data while clearly explaining the limits on reproducing the original results.

Should AI-generated tests be included in the archive?

Reviewed tests can be valuable because they document expected computational behavior. Their expected outcomes should be independently justified where consequential, particularly when AI also generated the implementation.

How can researchers check whether an archive is complete?

A practical approach is to reconstruct the workflow in a clean environment using only the archived materials and documented access arrangements. Any missing dependencies, files, or instructions should be resolved before deposit.

09 · The Bottom Line

Preserve the Computational Evidence Needed to Reproduce the Findings

The Bottom Line

Researchers should archive the exact AI-assisted code used for their findings, the necessary data or access arrangements, verified dependencies, execution instructions, computational settings, and meaningful verification materials. Consequential AI-development records should also be preserved when they support provenance or are required by the research context.

A useful archive is an identifiable, documented, and appropriately accessible computational release, not merely a collection of source files. Its quality is best judged by whether another qualified researcher can reconstruct the intended analysis within the relevant technical and ethical constraints.

10 · Sources and Further Reading

Authoritative Resources on Research Software Archiving and Reproducibility

11 · Cite this Guide

How to Cite This Guide

This guide is intended to be read, shared, and used in research, teaching, and academic work. If you draw on its ideas, explanations, or other content, please acknowledge the source by citing the guide. Doing so gives appropriate credit and helps your readers locate the original resource.

Has the Field Guide helped your research?

If a guide helped clarify a question, inform a research decision, or move your work forward, I would love to hear about your experience. Your story may also help other researchers discover the Field Guide.

Share Your Experience
Takes only a few minutes