Introduction
Large Language Model (LLM) agents have demonstrated remarkable reasoning capabilities, yet they remain largely static once deployed. Unlike humans, who refine their strategies through trial and error, most agents are "frozen" in time, repeating the same mistakes unless manually updated. FLEX (Forward Learning from EXperience) introduces a paradigm shift: a gradient-free framework that allows agents to evolve continuously by building and inheriting a structured "experience library."
The Challenge of Static Agents
Traditional methods for updating LLMs, such as gradient-based fine-tuning, face significant practical hurdles:
- Computational Cost: Back-propagation is resource-intensive and slow for real-time adaptation.
- Catastrophic Forgetting: Updating weights for new tasks often degrades performance on previously learned ones.
- Closed-Source Constraints: Many state-of-the-art models (e.g., GPT-4, Claude) are accessible only via APIs, making weight updates impossible for end-users.
FLEX bypasses these issues by shifting the locus of learning from internal parameters to external semantic memory.
The FLEX Framework: Learning Without Gradients
FLEX re-imagines agent evolution as a Meta-MDP (Markov Decision Process). Instead of updating model parameters ($\theta$), the system evolves an Experience Library ($\mathcal{E}$).
Hierarchical Experience Evolution
The framework operates across two distinct layers:
- Exploration (Base-level): An "Actor" agent explores reasoning paths, while a "Critic" provides semantic feedback on failures. This "Dual Scaling" approach allows the agent to refine its answers iteratively during a single task.
- Evolution (Meta-level): An "Updater" agent distills successful trajectories and failures into a Hierarchical Experience Library. This library categorizes insights into strategic principles, reasoning patterns, and specific instances, maintaining a "Golden Zone" for best practices and a "Warning Zone" for common pitfalls.
During inference, the agent utilizes Contextualized Retrieval to pull relevant high-level strategies from its library, guiding its reasoning process without needing to see the exact same problem twice.
Experimental Evaluation
The researchers benchmarked FLEX across three demanding scientific domains, achieving substantial gains with a total cost of less than $100 for training and evaluation:
- Mathematics: On the AIME25 (Olympiad-level) benchmark, FLEX boosted Claude-Sonnet-4's accuracy from 40.0% to 63.3%.
- Chemistry: In chemical retrosynthesis (USPTO50k), performance improved from 20% to 30%.
- Biology: On ProteinGym, generalist LLMs equipped with FLEX matched or exceeded the performance of specialized protein language models by learning specific "micro-strategies."
Key Insights
The Scaling Law of Experience
A pivotal discovery of the study is that agent performance scales predictably with the size of the experience library. Similar to how LLM performance scales with parameter count and data volume, FLEX demonstrates a power-law relationship between the number of "experience items" and task accuracy.
Experience Inheritance
Because the experience library is stored as human-readable text, it is model-agnostic. This enables "Experience Inheritance," where a library generated by a superior model (like Claude-3.5-Sonnet) can be instantly utilized by a different model (like DeepSeek-V3), providing an immediate performance boost without further training.
Conclusion
FLEX demonstrates that continuous evolution does not require changing a model's weights. By focusing on semantic memory and structured experience, FLEX provides a cost-effective, scalable, and interpretable path toward agents that truly learn from their environment. Future work aims to build universal experience libraries, creating a collective intelligence shared across diverse AI agents.
Summary updated