← Back to Research
Preprint · Not Peer Reviewed
What a Month of Agent-Driven Training on AWS Trainium Taught Us: Persistent SQL Memory for Autonomous Machine Learning Research
Tarun Kumar Chawdhury1,*
1 DLYog Lab Research Services LLC
November 2026  ·  DLYOG-TR-2026-008
Code and data: github.com/dlyog/af-research-v2
Demo film: youtu.be/IFIL-WXEPYE  ·  Experiments video: youtu.be/gtcJSlZ42v0

Abstract

Coding agents such as Claude Code and OpenAI Codex can now run machine-learning experiments around the clock, but what they try, what works and what fails ends up scattered across logs, notes and lost sessions. We report a month-long campaign in which agents trained a GPT-style language model from scratch on AWS Trainium2 under a fixed 30-minute budget, with a SQLite database of every run serving as the loop's memory. Over 415 recorded full-budget runs, the validation score fell from the AWS starter baseline's 1.263 bits per byte to 0.953, 24.6% lower, with 62 runs promoted to preserved submissions along the way. From that experience we built AutonomousFrontier, an open-source framework that routes every experiment through one command, records settings, code changes, logs, scores and agent sessions in SQLite, keeps human feedback in force across agents, distils histories into shareable tables of lessons, and helps port CUDA training code to Trainium. We then tested whether lessons from the campaign help a fresh agent that cannot see the original code. In a matched development pilot with one search per arm, an agent given 30 frozen lessons reached 1.083 bits per byte on Trainium against 1.191 for an agent without them, and 1.250 against 1.319 on an NVIDIA DGX GB10. An earlier short-run study with weaker knowledge and restrictive feedback found the opposite, and we report it in full. The framework, the original 415-run database and all study evidence are released under Apache 2.0.

Keywords — autonomous research, research agents, experiment memory, SQLite, Claude Code, Codex, AWS Trainium, Neuron, NVIDIA DGX, language-model pre-training, human feedback, Model Context Protocol

Demo film (5:42). AutonomousFrontier on an NVIDIA DGX (GB10) and an AWS trn2.3xlarge, driven from a Mac: youtu.be/IFIL-WXEPYE


1. Introduction

An agent that runs experiments is only as good as what it remembers. In September 2026 we entered the AWS Trainium Frontier challenge, which asks participants to train a language model from scratch on AWS Trainium within a fixed time budget and drive down validation bits per byte. We did most of the work with coding agents: Claude Code and OpenAI Codex edited the training script, launched runs on a trn2.3xlarge, read the results and chose what to try next, under human direction.

The starter kit ships a Trainium version of autoresearch [13], in which an agent edits one training file, runs a short experiment and keeps or reverts the change. That loop is a good start. After a few hundred runs, though, its memory, made of Markdown notes, log files and git history, stopped serving us. Sessions ended, agents changed, usage limits ran out mid-thought, and every new session had to reconstruct which learning rates had been tried, which code changes had helped and which ideas had already failed.

So we moved the memory into SQL. Every run became a row: its settings, its parent, its score, its throughput and which of the training script's functional blocks it changed. Agents queried that table before choosing the next experiment. Diagnostics were written as immutable rows. Over the campaign the database grew to 415 full-budget runs, and the model improved from 1.263 to 0.953 bits per byte.

This paper reports what we learned. Section 3 describes the campaign and its database. Section 4 describes AutonomousFrontier, the framework we built from it so that others can run the same kind of loop on NVIDIA GPUs, AWS Trainium and Apple silicon. Section 5 reports the experiments we ran to ask a harder question: do lessons distilled from one campaign help a fresh agent on new hardware or new data? The answer so far is mixed, and we report the negative evidence alongside the positive.

2. Literature Review

Letting language models run machine-learning research end to end has moved quickly. The AI Scientist [15] generates ideas, writes and runs code and drafts papers. MLAgentBench [10] and MLE-bench [4] evaluate agents on machine-learning engineering tasks and Kaggle competitions. AlphaEvolve [16] pairs language models with automated evaluators to discover better algorithms. Karpathy's autoresearch [13] reduced the idea to its core: an agent, one editable training file, a fixed five-minute budget and one scalar score. Our work starts from that setting and asks what the agent should remember.

Memory for language-model agents has mostly been studied as text. Reflexion [19] keeps verbal self-reflections between attempts; Generative Agents [18] store an observation stream and retrieve by recency, importance and relevance; MemGPT [17] pages context in and out like an operating system; Voyager [20] accumulates a library of executable skills. Experiment trackers such as MLflow [21] record runs, parameters and metrics for humans. AutonomousFrontier sits between the two: a structured, queryable record of every experiment, designed to be read by the agent before every decision, and shared by every agent that works on the same problem.

The starter model is a GPT in the style of nanoGPT [14] and the modded-nanoGPT speedrun [11], trained with the Muon optimizer [12] for matrix parameters and AdamW for the rest. Training data is ClimbMix [7], and transfer tests use TinyStories [8]. The score is validation bits per byte, a tokenizer-independent measure also used to report results on The Pile [9]. Trainium is programmed through PyTorch on the AWS Neuron SDK, with custom kernels in the Neuron Kernel Interface [1]. Agents also reach the framework through the Model Context Protocol [3], which we used for small-business tool calling in earlier work [6].

3. The Campaign

3.1 Task and Hardware

The task is the challenge's: pre-train a language model from scratch on ClimbMix web text with an 8,192-entry BPE tokenizer, within a 30-minute training budget on one trn2.3xlarge (Trainium2, four logical NeuronCores), and minimise validation bits per byte on a fixed evaluation. Data preparation, tokenizer and the scoring code are fixed; everything else, from architecture and optimizer to the data loader, the training loop and custom NKI kernels, may change. The AWS starter baseline [2] is a 59.6-million-parameter GPT trained with Muon and AdamW. It scored 1.263187 bits per byte, stopping at its 1,000-step cap after 65.5 million tokens.

3.2 The Loop

Each iteration followed the same pattern. The agent read the current goal and the human's standing instructions, queried the experiment database for what had been tried near the current champion, formed one hypothesis, edited the training script, ran it for the full budget and recorded the result. A run that beat the champion became the new champion and the parent of the next experiments. Agents worked in shifts: Claude Code recorded 322 of the runs, OpenAI Codex 83, and a third agent configuration 10. When one agent hit a usage limit, another took over from the database, not from the previous agent's context.

3.3 The Database

The memory is one SQLite file. Its main table holds one row per full-budget run: the run name, its lineage family, the 42 training-script constants that varied across the campaign (parsed from each run's own source, including five values written inline as literals), the measured outcomes (parameters, FLOPs per token, steps, tokens, training seconds, tokens per second) and the score. Constants alone cannot see code changes, yet several of the largest gains were exactly that, so a second table splits each run's script by syntax tree into eleven functional blocks (imports and config, runtime, NKI kernels, loss head, architecture, optimizer, checkpoint and evaluation, data sampler, schedule, profiling and training loop) and stores two hashes per block. One hash normalises comments and whitespace; the other also zeroes every numeric literal. A change to the first but not the second is a retuned value; a change to both is a structural code change. Further tables hold the inferred lineage of each run, block-level changes against its parent, 16 short runs and 229 diagnostics: kernel timings, near-tie re-evaluations and failed attempts. Diagnostic rows are protected by triggers that refuse updates and deletes, so a later session cannot quietly rewrite an earlier observation.

Figure 1. The research loop with SQL memory
Humangoal and standing feedback
▼
AgentClaude Code or Codex
▼
Ask memorywhat was tried, what helped
▼
One hypothesisedit train.py, run on the node
▼
SQLite recordsettings, code blocks, log, score, session
Every run and every read of memory carries the agent session that made it.

3.4 What the Campaign Found

The database records 415 full-budget runs between 15 September and 1 October 2026, in four lineage families. Sixty-two runs were promoted to preserved submissions. The best, oa454_gate_bias_on66, scored 0.952867 bits per byte: 0.310 below the starter baseline (24.6%). It has 276.9 million parameters and trained 4,472 steps on 586 million tokens within the budget. The distilled recipe attributes about three quarters of the gain to a model redesign and a new data loader, and the rest to many small refinements. Table 1 lists selected milestones.

All scores in this paper are from our own runs, recorded in the database. The challenge's public leaderboard scored submissions separately: there our best submission reached 0.9576, just outside the top ten. We recorded our experiments in detail in a video made right after the challenge ended, including a live session on the Trainium VM; it announced this paper as planned: youtu.be/gtcJSlZ42v0.

RunBPBChange against its predecessor
AWS starter baseline1.263259.6M parameters, 1,000-step cap
torch_loss1.0319earliest preserved submission, 113M parameters
c10_nowaste0.9883sampler rewritten to train on every token
c18_bigvocab262k0.9739bigram table enlarged to 262,144 entries, 210M parameters
oa154_bigram524k0.9670bigram table doubled to 524,288 entries, 277M parameters
oa220_pipelined_loop0.9615pipelined training loop
oa331_flash_fwd_custom0.9591custom flash-attention kernel
oa373_stack_embed_strided_ce0.9556NKI embedding and cross-entropy gradient kernels
oa413_attn_outgate_fused0.9536attention output gate
oa454_gate_bias_on660.9529best run

Table 1. Selected milestones among the 62 preserved submissions, in date order (lower is better). Changes are read from each run's code and settings in the database.

The recurring lesson was that on Trainium, throughput is model quality. The baseline's best-fit document packing discarded about 39% of tokens; rewriting the sampler to cut every document stream into full rows was one of the largest single gains. In our later Trainium runs, scalar learning-rate changes triggered recompilation and slowed steps several-fold, which keeping the schedule as a device tensor avoided. Kernel work mattered only when it raised steps per budget.

4. AutonomousFrontier

The campaign's tooling was a set of scripts around one database. AutonomousFrontier [5] turns it into a framework that anyone can install and point at their own machines. A Mac acts as the controller and holds the database; execution nodes are reached over SSH and need only bash and an existing PyTorch environment. Tested nodes are an NVIDIA DGX with a GB10, an AWS trn2.3xlarge and an Apple M2.

  • One command for every experiment. af run copies the profile's training script to a node, runs it, follows its log and records settings, diff against the parent, log, score and model in af.db. Runs live on the node and survive the laptop sleeping; af wait does the waiting over SSH, so the agent does not spend tokens watching a run.
  • Memory as named questions and SQL. af q tried MATRIX_LR, af q best, af q untried and read-only af sql return short tables instead of logs. Every read is traced to the session that made it.
  • Human feedback in force. af feedback add records an instruction that every agent sees in its briefing until a human switches it off.
  • Sessions on the record. af claude and af codex start the real coding agent with a briefing of the goal, metric, node, feedback and memory; every run and memory read carries the session, agent and version, so results stay comparable as agents improve.
  • Tables of Knowledge. af knowledge distill turns a history into lessons with evidence and confidence, without code, diffs or run names, and af knowledge serve shares them over HTTP and MCP.
  • CUDA to Trainium. af migrate scan lists CUDA-only code with the Neuron alternative; af migrate start has an agent port a copy; af migrate parity runs both side by side.
  • Observability and MCP. A local Control Center shows nodes, runs, diffs, memory and feedback live. af mcp exposes the workspace to Claude Desktop and the Codex app as 15 tools.
  • The original history. af history queries and browses the campaign database read-only, alongside a derived database that adds each run's training code and untested transfer hypotheses for DGX and Apple silicon.

The command-line tool uses only the Python standard library; the Control Center adds Flask and Waitress. A test suite of 72 tests runs without PyTorch. For this release we installed version 0.4.0 into a clean environment, connected the DGX and ran a three-minute baseline, which scored 1.967478 bits per byte, matching the 1.968 recorded in the demo film.

5. Experiments

The campaign shows that an agent loop with SQL memory can make steady progress. It does not show that memory caused that progress, or that the lessons travel. We ran three studies to probe this, each with fresh workspaces and fresh agent sessions.

5.1 Supplied Knowledge and Reference Code

First we asked whether a fresh agent given the campaign's knowledge, including its recipe and a reference implementation, could reach the campaign's result on the same task and carry it to new data and hardware. Each condition had one scored full run. On Trainium ClimbMix, Claude with the full knowledge reached 0.952625, effectively reproducing the champion, while a Codex agent without knowledge reached 1.199107. On TinyStories on Trainium, knowledge reached 0.436024 against a control of 0.563052 and a baseline of 0.616353. On the DGX GB10, the CUDA reference reached 1.090510 and a second initialisation seed 1.089602 (mean 1.090056, n=2), against 1.306824 for a Codex control and 1.313652 for the baseline. These are positive results for the complete workflow, but the knowledge arms trained a 277M-parameter model from supplied code, while the TinyStories and DGX controls kept the original 59.6M-parameter design, so they cannot isolate memory from reference code and capacity.

5.2 Generalised Memory Pilot

The cleaner question is whether lessons alone help. We froze 30 conditional lessons distilled from the original history, with their evidence and confidence, and without winning code, component code, winning values or a complete recipe. A memory agent received these lessons; a control agent did not. Both used the same Codex client and options, the same baseline, instructions and allowed changes, and both were limited to two 180-second checks and one 1,800-second full run. An operating-system barrier denied both arms access to historical repositories, packaged knowledge and earlier agent sessions. Because validation rounding depends on evaluation batch size, all final checkpoints were re-scored with identical evaluation settings declared before any full score was known.

NodeBaselineControlMemoryGap
Trainium21.2631871.1907481.0826239.1%
DGX GB101.3136521.3192461.2504345.2%

Table 2. Common-evaluation bits per byte, one independent search per arm. Gap is memory relative to control.

Memory scored better on both nodes. On Trainium the memory arm came within 14.3% of the baseline, passing the predeclared 10% threshold, while the control passed only 5%. On the DGX neither arm reached 5%, and the control finished slightly worse than the baseline. Lessons learned on Trainium therefore carried some value to a different chip, without any of the original code. Effort did not fall: on Trainium both arms used all three attempts, and on the DGX the memory arm used three against the control's two. The memory arm on Trainium also read far more context (8.8 million input tokens against 3.4 million).

5.3 Earlier Negative Evidence

Before the pilot, we compared plain autoresearch (A) with an early version of AutonomousFrontier (B) on three new datasets on Trainium, two Claude Code sessions per condition, eight 180-second runs each. B used weaker knowledge and restrictive human feedback. Plain autoresearch reached the better score on every dataset (Table 3). We read this as evidence that knowledge which constrains the agent, or which is not specific enough to act on, can cost more than it gives, and it shaped the lessons format used in the pilot.

DatasetA1A2B1B2
TinyStories0.61230.68720.76860.7074
WikiText1.28141.29801.53451.6800
Python code1.30501.10951.32301.5055

Table 3. Best bits per byte per session in the short-run study. A: plain autoresearch. B: early AutonomousFrontier with old knowledge and feedback.

5.4 CUDA-to-Neuron Migration

Finally, a fresh Codex session ported a nanoGPT training script written for CUDA to Trainium with af migrate. The port ran natively on four Neuron workers and completed a full 30-minute run on TinyStories at 0.943926 bits per byte, with the model and data preparation unchanged from the GPU reference. The GPU reference scored 1.465221 on the DGX, but with a 2,000-step warmup it never finished warming up in the budget; we report the port as a working migration, not as a speed or quality comparison.

6. Discussion

6.1 What Worked

  • A record that outlives the agent. Agents changed many times during the campaign. Because the memory was a database rather than a conversation, each new session started from every earlier result.
  • Code changes as data. Splitting the script into blocks with value and structure hashes let agents and humans ask which kind of change helped, not only which number.
  • Immutable evidence. Write-once diagnostics and preserved raw scores kept later sessions honest about earlier observations.
  • Waiting outside the model. Runs live on the node and the wait happens over SSH, with a notification on completion, so the agent spends no tokens while a 30-minute run trains.
  • Lessons without code. In the pilot, 30 lessons without any winning code were associated with better final scores on both chips.

6.2 Limitations

  • Small samples. The pilot has one independent search per arm, on tasks we had already inspected. It is a development result, not a confirmatory one, and supports no claim of statistical significance.
  • No representation comparison. We have not compared the same lessons delivered as SQL with the same lessons delivered as Markdown, so we make no claim that SQL itself is better than equivalent text.
  • Confounds. In Section 5.1 knowledge arrived with reference code and a larger model. The Trainium baseline stopped early at its step cap, so baseline-relative thresholds are not time-matched. Agents ignored instructions to wait in the foreground and read logs repeatedly. The exact backend model behind each client was not verified, and remote isolation was procedural.
  • Effort. Memory did not reduce the number of attempts, and on Trainium it increased context use.

6.3 Implications

For anyone running agents on long experimental campaigns, our experience suggests three practical rules. Keep the record outside the agent, in a form any agent can query. Record code changes, not only settings. And treat distilled lessons as hypotheses for the agent to test, not as constraints: in our short-run study, the version that constrained the agent scored worse than plain autoresearch on all three datasets.

7. Conclusion

Over a month on AWS Trainium2, coding agents working from a shared SQLite memory improved a language model from 1.263 to 0.953 validation bits per byte across 415 recorded runs. We have released that history, a framework that makes the same loop available on NVIDIA GPUs, Trainium and Apple silicon, and the evidence from our first tests of whether its lessons transfer. Lessons without code helped a fresh agent on Trainium and on a DGX in a small matched pilot; an earlier, more restrictive version did not help. We hope the data and the tools let others test these questions at the scale they deserve.

8. Future Work

  • Repeat the matched pilot with several independent searches per arm and balanced launch order, on reserved tasks never inspected during development.
  • Complete the missing cells: lessons transferred to a new dataset on Trainium, and to new data and new hardware together.
  • Deliver identical lessons as SQL and as Markdown to test whether the representation matters.
  • Predeclare a fully time-budgeted baseline and measure search effort and agent cost to each threshold.
  • Enforce foreground waits and verify backend model identity in every session.
  • Collect Tables of Knowledge from other users and hardware through the knowledge server.

Appendix A: Data and Reproduction

Campaign database. knowledge/chip-history/original-experiments.db is byte-identical to the campaign's database (SHA-256 beginning d1fed291010b1ffe).

TableRowsContents
experiments415one row per full-budget run: 42 settings, outcomes, score, family, author, date
short_runs16short checks, kept apart from full-budget scores
code_blocks4,326eleven functional blocks per run with code and structure hashes
code_blocks_vs_parent4,219block-level changes against each run's parent, with notes
lineage385inferred parent of each run
diagnostics229immutable kernel timings, re-evaluations and failed attempts

Derived database. knowledge.db keeps those tables and adds 1,218 captured training-script files (811 distinct) and, for each run, transfer hypotheses for DGX and Apple silicon marked as inferred and untested.

Query it.

pipx install git+https://github.com/dlyog/af-research-v2
git clone https://github.com/dlyog/af-research-v2 && cd af-research-v2
af history sql "SELECT run, family, val_bpb FROM experiments
                WHERE chip='neuron' ORDER BY val_bpb LIMIT 10"
af history serve        # browse it at http://127.0.0.1:8781

Study evidence. study/full30/ holds the supplied-knowledge and migration study (Sections 5.1 and 5.4), study/memory_transfer/ the generalised-memory pilot with its protocol, frozen lessons, evaluation amendment, thresholds, provenance and an offline inspector (Section 5.2), and study/transfer/ the short-run study (Section 5.3). Every attempt, including failures, is in each study's evidence ledger.

Films. The framework demo, recorded on the DGX and Trainium nodes: https://youtu.be/IFIL-WXEPYE. Our detailed experiments video, recorded right after the challenge ended, covering the research loop, what moved the score, what did not work, a live Neuron session and our leaderboard history: https://youtu.be/gtcJSlZ42v0. Both use AI-generated narration.

Disclosure

Human Conceptualized, AI Assisted. The research idea, the experiments and their direction are human. AI assistance has been used in this research, including to write code, run experiments, analyse results and produce the demo film and its narration. AI can make mistakes, so readers should always validate the findings with their own research.

This is independent research. No funding or sponsorship was received for this work, and no endorsement by any organization is claimed. The starter baseline, training and data-preparation code come from the AWS Neuron trainium-frontier starter kit under the Apache License 2.0.

How to Cite

Chawdhury, T. K. (2026). What a Month of Agent-Driven Training on AWS Trainium Taught Us: Persistent SQL Memory for Autonomous Machine Learning Research (Technical Report DLYOG-TR-2026-008). DLYog Lab Research Services LLC. https://www.dlyog.com/papers/AutonomousFrontierSQLMemory

@techreport{chawdhury2026autonomousfrontier,
  title       = {What a Month of Agent-Driven Training on AWS Trainium Taught Us: Persistent SQL Memory for Autonomous Machine Learning Research},
  author      = {Chawdhury, Tarun Kumar},
  institution = {DLYog Lab Research Services LLC},
  number      = {DLYOG-TR-2026-008},
  year        = {2026},
  month       = {11},
  url         = {https://www.dlyog.com/papers/AutonomousFrontierSQLMemory}
}

References

  1. Amazon Web Services. Neuron Kernel Interface (NKI) documentation. AWS Neuron SDK. Accessed November 2026. [AWS]
  2. Amazon Web Services (2026). AWS Trainium Frontier starter kit (train.py, prepare.py, tokenizer), Apache License 2.0.
  3. Anthropic (2024). Model Context Protocol specification. [MCP]
  4. Chan, J. S., et al. (2024). MLE-bench: Evaluating Machine Learning Agents on Machine Learning Engineering. International Conference on Learning Representations 2025. arXiv:2410.07095. [arXiv]
  5. Chawdhury, T. K. (2026). AutonomousFrontier: Persistent SQL Memory for Autonomous Machine Learning Research, version 0.4.0. Software, Apache-2.0. [GitHub]
  6. Chawdhury, T. K. (2026). What Our Experience Says About MCP Tool Calling for Small Businesses: An Intelligent Router with a Small Model Is All You Need (DLYOG-TR-2026-007). DLYog Lab Research Services LLC. [DLYog]
  7. Diao, S., et al. (2025). Nemotron-CLIMB: CLustering-based Iterative Data Mixture Bootstrapping for Language Model Pre-training. Advances in Neural Information Processing Systems 2025. arXiv:2504.13161. [arXiv]
  8. Eldan, R., & Li, Y. (2023). TinyStories: How Small Can Language Models Be and Still Speak Coherent English? arXiv:2305.07759. [arXiv]
  9. Gao, L., et al. (2020). The Pile: An 800GB Dataset of Diverse Text for Language Modeling. arXiv:2101.00027. [arXiv]
  10. Huang, Q., Vora, J., Liang, P., & Leskovec, J. (2023). MLAgentBench: Evaluating Language Agents on Machine Learning Experimentation. Proceedings of the 41st International Conference on Machine Learning, PMLR 235: 20271–20309. arXiv:2310.03302. [arXiv]
  11. Jordan, K., et al. (2024). modded-nanogpt. GitHub repository. [GitHub]
  12. Jordan, K., et al. (2024). Muon: An optimizer for hidden layers in neural networks. [Blog]
  13. Karpathy, A. (2026). autoresearch. GitHub repository. [GitHub]
  14. Karpathy, A. (2022). nanoGPT. GitHub repository. [GitHub]
  15. Lu, C., Lu, C., Lange, R. T., Foerster, J., Clune, J., & Ha, D. (2024). The AI Scientist: Towards Fully Automated Open-Ended Scientific Discovery. arXiv:2408.06292. [arXiv]
  16. Novikov, A., et al. (2025). AlphaEvolve: A coding agent for scientific and algorithmic discovery. arXiv:2506.13131. [arXiv]
  17. Packer, C., et al. (2023). MemGPT: Towards LLMs as Operating Systems. arXiv:2310.08560. [arXiv]
  18. Park, J. S., et al. (2023). Generative Agents: Interactive Simulacra of Human Behavior. Proceedings of UIST 2023. arXiv:2304.03442. [arXiv]
  19. Shinn, N., et al. (2023). Reflexion: Language Agents with Verbal Reinforcement Learning. Advances in Neural Information Processing Systems, 36. arXiv:2303.11366. [arXiv]
  20. Wang, G., et al. (2023). Voyager: An Open-Ended Embodied Agent with Large Language Models. arXiv:2305.16291. [arXiv]
  21. Zaharia, M., et al. (2018). Accelerating the Machine Learning Lifecycle with MLflow. IEEE Data Engineering Bulletin, 41(4), 39–45.