FEP-Agent: Active-Inference-Guided LLM Agent Self-Evolution with Semantic Memory

Minghao Chen, Xinyi Hu, Zhou Yu, Yufei YinNeurIPS 2026

TL;DR

Current LLM agents adapt to new environments mostly by passively hoarding past experiences into text memory, lacking a principled way to actively test what they don't understand. Inspired by cognitive neuroscience’s Free Energy Principle, FEP-Agent gives LLM agents genuine curiosity: they actively probe uncertain buttons and rules during a task, then consolidate only the genuinely useful lessons afterward. Without updating a single model weight, this turns static LLMs into nimble, self-evolving learners across web, mobile, and embodied worlds.

What Problem Does This Paper Address?

Drop an LLM agent into an unfamiliar app or website, and you usually face two expensive choices: hire human experts to hand-craft prompts and workflows, or burn through compute fine-tuning the model on massive task datasets.

Recently, researchers found a clever middle ground: memory-based self-evolution. Instead of updating neural weights, agents save successful trajectories or distilled rules into an external text bank to read later. However, current memory systems have two big blind spots:

  1. They are heuristic: Rules for what to store, update, or delete are mostly ad-hoc guesswork.
  2. Acting and learning are decoupled: While executing a task, the agent only tries to win using what it already knows. It acts as a passive collector of experience rather than a scientist poking an ambiguous UI element just to see how the world works.

Biological brains don't learn passively—animals actively explore to resolve ambiguity. The authors ask: can we mathematically ground LLM agents in that same biological loop?

Methods

The authors translate Active Inference (derived from Karl Friston’s Free Energy Principle, which posits that brains act and learn to minimize "surprise" or prediction error) from numerical probabilities into natural language reasoning. Here, a frozen LLM acts as the reasoning engine, while an evolving Structured Semantic Memory serves as the learnable parameters of the agent's world model.

Figure 1: Overview: FEP-Agent instantiates the classic Active Inference loop into two distinct timescales handled by two LLM agents: (1) Online: the Worker approximately minimizes EFE for action selection, balancing goal-directed exploitation with curiosity-driven exploration; (2) Offline: the Builder uses a VFE-guided objective for knowledge updates. Both agents share a Semantic Memory K that serves as the learnable component of the generative model.

FEP-Agent splits Active Inference across two distinct agents and timescales:

  • Online Worker Agent (Curiosity + Execution): Interacting in a standard ReAct-style loop, the Worker approximates minimizing Expected Free Energy (EFE). At each step, it proposes candidate plans and implicitly weighs Pragmatic Value (will this finish the user's goal?) against Epistemic Value (how uncertain am I about what happens next?). If a mechanism is unclear—say, whether a fridge must be opened before cooling bread—and the step budget allows, the Worker intentionally branches out to test the hypothesis.
  • Offline Builder Agent (Memory Consolidation): After a task finishes, the Builder reviews the trajectory with hindsight to minimize Variational Free Energy (VFE). It scans for moments of "surprise" (where predictions failed) to update memory. Crucially, to prevent memory bloat, it runs Counterfactual Validation: before saving a new rule, it asks, "Had we known this rule earlier, would our prediction error actually have dropped?"
  • Brain-Inspired Semantic Memory: Memory is split into Entities (objects), Rules (marked Clear or Unclear), and Skills (reusable policies). Instead of rigid (subject, relation, object) knowledge graph triplets, nodes use flexible Wikipedia-style citations (e.g., [[Login Button]]) and are grouped into overlapping communities, allowing multi-faceted concepts to belong to multiple contexts simultaneously.
Figure 2: An illustration of the Worker trajectory in ALFWorld. At each step, the Worker outputs (zt, predt, plant, at). Under the EFE-guided policy objective, the Worker might trigger an explo- ration branch for uncertain mechanisms.

Datasets

No new benchmarks were introduced; FEP-Agent was evaluated on three established, diverse agent benchmarks:

  • WebArena: 684 realistic web automation tasks across self-hosted Reddit, Shopping, Admin, GitLab, and Multi-site environments.
  • AndroidWorld: 116 mobile control tasks spanning 20 real-world Android apps using screenshots and accessibility trees.
  • ALFWorld: 135 text-based embodied household planning tasks across six categories (e.g., Clean, Heat, Put two).

Key Insights and Ideas

  • Don't make LLMs do probability math: The authors first tried an Explicit Solver where the LLM assigned numerical probabilities to future rollouts to compute free energy. It flopped (dropping WebArena performance by 4.9%) because uncalibrated LLMs are terrible at raw probability estimation. Asking the LLM to use ordinal confidence scores (1–5) and balance exploration qualitatively worked far better.
  • Emergent exploration-to-exploitation shift: Nobody hard-coded a decaying $\epsilon$-greedy schedule. Yet on ALFWorld, the agent naturally explored heavily during early tasks, resolved its Unclear Rules into Clear Rules, and dropped exploration steps to zero by task 21—right as test accuracy hit 100%.
  • Wiki-links beat triplets for procedural knowledge: Replacing Wiki-style associative links with standard triplet Knowledge Graphs cost 2.1% accuracy, as triplets struggle to express multi-entity conditionals like "clicking [[Button A]] after filling [[Form B]] triggers [[Popup C]]".

Key Results

FEP-Agent achieved state-of-the-art results across all three benchmarks:

  • WebArena: Reached 62.9% overall success with Gemini-2.5-pro (beating AutoManual at 54.7% and ReasoningBank at 53.9%), with a massive jump on complex GitLab tasks (66.1% vs. 50.0%). With Gemini-2.5-flash, it scored 53.1% vs. ReAct's 40.5%.
  • AndroidWorld: Achieved 78.4% with Gemini-2.5-pro, outperforming specialized GUI-finetuned models like UI-TARS-2 (73.3%) and Gemini 2.5 Computer Use (69.7%).
  • ALFWorld: Scored 91.1% with GPT-4o-mini (vs. G-Memory's 88.8%) and a perfect 100.0% across all six task types with Gemini-2.5-flash.
Table 1: Experiment results on WebArena benchmark. Success rates are reported on 5 subsets for two different backbone LLMs.

Limitations and Future Work

While a full "Limitations" section is not included in the main text (which ends at page 10 before the appendices), the authors highlight two practical constraints within their methodology:

  • Intractable exact inference: Computing true probability densities in natural language space is intractable, forcing the framework to rely on prompt-driven qualitative surrogates rather than exact Bayesian math.
  • Calibration bottlenecks: Off-the-shelf LLMs fail at explicit numerical rollout scoring without specialized fine-tuning, restricting how faithfully Expected Free Energy can be calculated online. Future directions are not explicitly discussed in the main text.

Summary updated

Abstract

Enabling language model agents to autonomously adapt to new environments remains a fundamental challenge. While recent memory-augmented approaches have achieved promising results, they are largely heuristic in design and treat task execution and knowledge construction as decoupled processes. Inspired by how biological systems rapidly adapt through principled acting and learning, we propose $\textbf{FEP-Agent}$, a framework that guides LLM agent self-evolution with the $\textit{Free Energy Principle (FEP)}$. Our system instantiates the two components of Active Inference into: a Worker agent that approximately minimizes $\textit{Expected Free Energy (EFE)}$ during online interaction, balancing goal-directed exploitation with curiosity-driven exploration to probe uncertain environmental dynamics; and a Builder agent whose post-execution updates are guided by $\textit{Variational Free Energy (VFE)}$, updating a knowledge base while controlling complexity through counterfactual validation. To support scalable knowledge in open-ended environments, we introduce a structured semantic memory that employs associative linking and overlapping communities for efficient retrieval. The excellent results across multiple LLM-agent benchmarks show that FEP-Agent supports effective self-evolution.
BibTeX
@inproceedings{chen2026fep,
  author = {Minghao Chen and Xinyi Hu and Zhou Yu and Yufei Yin},
  title = {{FEP-Agent: Active-Inference-Guided LLM Agent Self-Evolution with Semantic Memory}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=YaCXhGOZpn},
}
Figure