Skip to content

Agent Memory Scaling Laws for Verified Trainium Kernel Generation

Simran Kaur, Evan Becker, Benjamin Bowman, Aditya Golatkar, Alessandro Achille, Wei Xia, Stefano Soatto

cs.AI

Abstract

Coding agents, while powerful, exhibit the tendency to produce voluminous code artifacts that lead to a lack of trust and reliability. Formal verification methods mitigate this by enforcing that the agent's code satisfy a set of predetermined "contracts", where the code must pass a proof-of-correctness check to be admissible. In the limit, any language model with full support will produce a verified solution given unbounded time. Thus, time-to-solution is the principal metric that distinguishes the quality of agents in the verified setting. We study how this search cost, measured in output tokens, scales with the size of an in-context curriculum and depends on its composition. Our testbed is iterative Trainium kernel generation, using a formal verifier on Rust representations and fixed acceptance checks. Across held-out targets, task-relevant curricula exhibit an approximate power law between curriculum size and log-speedup over the measured range, and outperform generic verified code. According to the theory of stochastic dynamical systems, the power-law exponent provides an empirical estimate of the growth rate of algorithmic mutual information between curriculum and target task as the curriculum grows. Curated curricula reach about a 2.9x output-token speedup over no curriculum; the lowest measured solve cost is 52% lower, including curriculum prefill. To select examples before running the search, we evaluate a score based on how they change the likelihood of the unfinished target program, which strongly predicts downstream speedup. Curriculum also improves solve rates for weaker agents and yields faster executable kernels at a fixed search budget.

Create a lesson

Metadata

Categories
cs.AI, stat.ML