cd /news/large-language-models/remember-don-t-re-read-stateful-reac… · home topics large-language-models article
[ARTICLE · art-28973] src=arxiv.org ↗ pub= topic=large-language-models verified=true sentiment=↑ positive

Remember, Don't Re-read: Stateful ReAct Agents for Token-Efficient Autonomous Experimentation

Researchers reformulated the autoresearch pattern as a stateful ReAct agent using LangGraph, achieving 90% fewer tokens on hyperparameter tuning and 52% fewer on code optimization compared to stateless designs. The stateful agent operates within a fixed-size conversation window, reducing token costs from O(n) to O(1) per iteration while maintaining optimization quality.

read1 min views1 publishedJun 16, 2026

arXiv:2606.14945v1 Announce Type: new Abstract: The autoresearch pattern enables autonomous experimentation by having a large language model (LLM) iteratively modify code to optimize a target metric. Its stateless design, however, reconstructs experimental context from scratch at every iteration, incurring $O(n)$ token cost per iteration and $O(n^{2})$ total. This work reformulates the pattern as a stateful ReAct agent using LangGraph, where typed persistent state carries experimental history across iterations via a tool-calling interface. Two benchmarks are evaluated: hyperparameter tuning (15 iterations, small per-iteration observations) and code performance optimization (40 iterations, large per-iteration observations containing full source code and benchmark results). On hyperparameter tuning, the stateful agent consumes 90% fewer tokens (2{,}492 vs.\ 24{,}465). On code optimization, the stateful agent consumes 52% fewer tokens (627K vs.\ 1{,}275K) while achieving comparable optimization quality on both tasks. The token reduction is structural: the stateless agent re-reads the full history at $O(n)$ cost per iteration, while the stateful agent operates within a fixed-size conversation window at $O(1)$ cost. This paper describes the architecture in sufficient detail for practitioners to implement a stateful autoresearch agent for their own workflows.

── more in #large-language-models 4 stories · sorted by recency
── more on @langgraph 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/remember-don-t-re-re…] indexed:0 read:1min 2026-06-16 ·