IMPLEMENTATIONSource Checked · Sep 20, 2026Mission: When can we trust an agent to act?

AutoResearch: Autonomous AI Research Agent Conducting Iterative ML Experiments

Verified GitHub Repository · karpathy/autoresearch
GitHub repository preview for karpathy/autoresearch
Andrej Karpathy
VERIFIED PRACTITIONER

Andrej Karpathy

Founder, Eureka Labs | Former Director of AI at Tesla & OpenAI Founding Member

ARCHITECTURAL REFLECTION & SIGNIFICANCE

AutoResearch represents Andrej Karpathy's visionary exploration into recursive autonomous scientific discovery using foundation models. While classical machine learning workflows rely heavily on human researchers to hand-craft architectural variations and manually inspect training logs, AutoResearch constructs an autonomous closed-loop agent capable of executing the entire scientific loop end-to-end.

The system functions by initializing an LLM research agent with a baseline PyTorch code repository and a target metric (such as validation perplexity on a downstream dataset). The agent autonomously inspects the codebase, drafts a structured technical hypothesis, modifies Python AST abstract syntax trees to implement new layer variants or optimizers, schedules a short multi-epoch training run, parses output metrics, and decides whether to keep or discard the change.

This workflow establishes a paradigm for compounding automated research: rather than replacing human researchers, it transforms the researcher into an orchestrator who defines high-level scientific goals while autonomous agents navigate the vast combinatorial space of hyperparameter and architectural optimizations 24/7.

Crucially, AutoResearch avoids hallucinated research progress by enforcing empirical feedback verification. Hypotheses are only accepted if the resulting training run demonstrates statistically significant loss reduction on unseen validation data under identical compute ceilings.

CORE INNOVATIONS & ENGINEERING TAKEAWAYS
Autonomous Scientific Loop

Hypothesis generation -> Code editing -> GPU training -> Metric analysis -> Git commit loop.

Dynamic Code Generation

AST manipulation and guarded file editing ensuring syntactically sound PyTorch modifications.

Empirical Feedback Verification

Uses real validation loss curves rather than LLM self-evaluation to verify hypotheses.

Sandboxed Safety Constraints

Enforces compute budgets and execution timeouts to prevent runaway divergence or infinite loops.

ARCHITECTURAL EXECUTION PIPELINE
Phase 1

Hypothesis & Literature Synthesis

Agent analyzes existing repository structure, identifies bottlenecks in convergence, and formulates a specific algorithmic hypothesis.

LLM ReasoningPrompt ChainsHypothesis Engine
Phase 2

Code Refactor & AST Patching

Agent writes targeted code patches modifying model architectures, activation functions, or learning rate schedules.

Python ASTDiff ApplicationSyntax Validation
Phase 3

Sandboxed Training Execution

Dispatches a bounded training job with fixed compute ceilings, tracking loss convergence and GPU memory consumption in real time.

PyTorch ExecutionSubprocess SandboxingLoss Monitoring
Phase 4

Empirical Analysis & Versioning

Compares new validation metrics against baseline; automatically commits winning experiments to Git branch or rolls back regressions.

Git AutomationsMetric Regression CheckScientific Report
COMPUTATION & MODEL RUNTIME CONTEXT

PyTorch 2.4, LLM function calling, Automated Evaluation Loop, Python AST manipulation, TensorBoard metric parsing.

SYSTEM PROFILE & SPECIFICATIONS
Primary FocusAutonomous Machine Learning Research & Experimentation
Core Agent ModelFrontier LLM with Tool Use / Function Calling (Claude 3.5 Sonnet / GPT-4o)
Execution EnvironmentPyTorch 2.4+, Linux CUDA Cluster, Docker Sandbox
LicenseOpen Source Research Prototype
Safety BoundaryIsolated Subprocess Execution & AST Dry-Run
Verification StandardGitHub Code Repository & Empirical Benchmark Logs
SCOPE, CONSTRAINTS & KNOWN LIMITATIONS

Requires sandboxed execution environments to prevent arbitrary code execution risks during dynamic model definition; experiments can diverge if loss curves suffer from exploding gradients without bounded learning rate search spaces.

FREQUENTLY ASKED TECHNICAL QUESTIONS
How does AutoResearch prevent the agent from executing malicious or broken code?

AutoResearch runs generated Python modifications within isolated subprocesses and sandboxed container environments with strict execution timeouts and compute quotas. Any script that fails syntax parsing or throws runtime exceptions is immediately aborted, logged, and reverted without corrupting the core codebase.

What types of architectural modifications can the agent discover?

The agent can explore novel combinations of activation functions, layer normalization placement (pre-LN vs post-LN vs RMSNorm), learning rate schedules, attention head configurations, and weight initialization strategies. Because the evaluation is grounded in real validation metrics, only provably advantageous modifications are retained.

What differentiates AutoResearch from automated hyperparameter search like Optuna or Ray Tune?

While tools like Optuna perform black-box parameter sweeps within human-defined bounds, AutoResearch generates and tests novel Python code and algorithmic logic. It can invent new loss functions, implement custom attention masking schemes, or re-architect residual pathways, operating at the semantic level of a research scientist.

VERIFICATION PROTOCOL & ATTRIBUTION AUDIT

This proof of work artifact was source-checked on Sep 20, 2026 by the AI Experts Directory editorial team. Our source review confirms that public code repositories, research papers, and technical artifacts directly corroborate Andrej Karpathy's active contributions. For full verification criteria, read our editorial methodology.

Inspect original artifact sources

Review raw code repositories, benchmark datasets, and technical citations directly on github.com.

Open Primary Source