Echo Lab Active inference under echolocation, the same dials, a different sensor

A sibling of the Precision Lab. Same agent, same mazes, same three dials, but now the agent perceives the world by emitting a ping each step and reading back the echoes from walls up to two cells away in every direction. The goal still pulses at a fixed tile, and the agent still navigates to it, but it disambiguates its position from a longer-range sensor instead of feeling only its immediate neighbors. Everything runs in your browser.

Mathematical basis: Polzin et al. 2026, DOI 10.5281/zenodo.19785799 Vanilla JS, zero dependencies Behavioral interpretations = hypothesis Model math = implemented & verified
Start here

The agent is not blind. It is listening to the room.

Watch an agent feel its way through a maze using echoes that reach two cells out, then watch one dial give it resolve. About a minute, no math required. It is the fastest way to see how a longer-range sensor reshapes the same active-inference loop.

What's happening
Press Step, or watch the breakthrough above, to begin.
Why it might matter interpretation
Each setting of the dials describes a different way of meeting the world, a pattern, not a diagnosis.
Under the hood
γ_A 1.00 · γ_B 1.00 · T 2.00, model idle
The maze, and what the agent believes
Blue shading = how strongly the agent believes it is on that tile.
Numbers = the route it is planning right now.
@ = where the agent actually is.
Pulsing tile = the echo source the agent is heading toward.
Wall
Open tile
Start
Echo source
Strong belief
Weak belief
What the agent is weighing
How much it favors each next move
Why it prefers its best plan, EFE breakdown
Run a step to see the breakdown.
Epistemic, expected uncertainty about what it will sense.
Pragmatic, distance from preferred outcomes, and from the goal.
Lower total = a more attractive plan. π* = the plan it favors most.
Step log
Press Step or Auto-run to begin.
Maze & episode
Maze world
Planning depth 2
How many moves ahead the agent plans.
How it picks a move
0
Steps
,
Belief H
,
G(π*)
Precision dials
Drag a dial, the maze responds live.
Trust in the senses · γA 1.00
Moderate, observations moderately diagnostic
How much the agent trusts its echo readings. Low = noisy returns, ambiguous bearings; high = crisp echoes, decisive localization. (Power-law exponent on the A matrix.)
Trust in actions · γB 1.00
Moderate, dynamics moderately trusted
How much it trusts that its actions do what it expects. Low = the world feels unpredictable. (Power-law exponent on the B matrices.)
Commitment to a plan · T 2.00
Moderate, mixed exploration and exploitation
How sharply it commits to its best plan. Low = decisive; high = nearly random. (Temperature in π = σ(−G/T).)
Behavioral regime
Balanced
Default settings. The agent balances what it senses against what it expects, and commits to plans moderately.
hypothesis A computational pattern, a baseline, not a clinical category.
How This Could Be Wrong, Falsification & Critical Tests

Model predicts (testable in this lab)

  • Low γA → more random walks. Lower sensory precision should increase wall-hit rate and reduce goal-finding efficiency across repeated episodes.
  • Very low γB (< 0.2) → flatter policy posterior. At extremely low transition precision, EFE spread between policies collapses (verified: spread 0.26 at γB=0.1 vs 1.08 at γB=1.0). The effect is non-monotonic at intermediate values on a near-deterministic maze.
  • Low T → shorter path to goal (when γA is high). Decisive policy commitment with reliable observations should minimize steps to goal.

Disconfirmation conditions

  • If behavior does not change when γA changes → observation model has no effect on this topology. Would suggest the wall-signature-based A matrix is degenerate.
  • If low T + low γA outperforms high γA → the "trust your sensors" logic is inverted. This would challenge the model's normative interpretation.
  • If γB visibly changes behavior on this maze → note: the B matrix here is nearly deterministic (0.97/0.03). Large γB effects would mean even small transition noise matters more than expected.

Competing explanations

  • Random seed. At high T, differences between runs are dominated by sampling noise. Use Argmax mode to eliminate stochasticity and isolate the deterministic model structure.
  • Maze topology, not precision. The corridor layout may force similar trajectories regardless of precision. Swap mazes to test whether topology or precision drives the behavioral difference.

Known degenerate regimes

  • γB on a near-deterministic maze: The B matrix entries (0.97/0.03) mean γB has a smaller effect here than on a truly stochastic world. This is correct behavior, not a bug. [OBSERVED IN REPO, sweep script Part 3]
  • Very low γA + very high T: Policy posterior becomes fully uniform. The model degrades to random walk. No meaningful inference occurs. This is the "failure to infer" regime, not a pathology, it is a limit case of the model.

Try this experiment

  • Set γA=0.2, T=0.5 → observe rigid wall-hitting. Then set γA=2.0, T=0.5 → observe efficient goal-seeking. The contrast is the precision effect.
  • Set γA=1.0, T=0.5 → argmax. Then γB=0.1 → does the policy posterior flatten? Compare the EFE bar spreads.
How far this goes, and where it breaks

What you can trust here

implemented The precision dials and the predict-act loop, belief update, expected free energy, policy selection, are translated from a verified Elixir POMDP engine, checked with MC=400 samples across six levels of each dial.

implemented Expected free energy really does split into an epistemic part (uncertainty) and a pragmatic part (preference), and both shift with the dials exactly as shown.

Where the metaphor ends

hypothesis The behavioral names, "rigid despite noise," "uninformed wandering", resemble patterns discussed in the active inference mental-health literature (Friston, Adams). A resemblance is an interpretation, not a measurement.

not a claim Nothing here is pharmacological, diagnostic, or therapeutic. The maze agent is not a person; a dial is not a brain state.

This is a computational model you can think with, not a clinical tool.

Two disclosed extensions. First, the verified engine places the agent's preferences over observations only, and the goal observation appears just at the goal tile, so a short-horizon planner has no pull toward a distant goal and stalls a few tiles short. The lab adds a prior preference over hidden states, Ppref(s) ∝ exp(−γ·distance-to-goal), and includes it in expected free energy as expected surprise, −Eq[ln Ppref(s)], exactly the form of the existing observation preference. This is a standard active-inference construct (a goal prior); it modifies the agent's generative model, not the precision-weighting math (unchanged) and not the maze worlds (pure geometry). Second, this Echo Lab replaces the adjacent-cell wall signature with a range-extended echo signature: each of the four cardinal bits fires if a wall lies within two cells along that ray (the first wall returns the echo). The 64-observation space and all matrix shapes are identical to the Precision Lab, only the meaning of the wall bits changes. For the adjacent-only sensor, see the Precision Lab. Read the "verified" label precisely: the inference and precision machinery is the verified translation; the goal-state prior and the echo observation model are the lab's additions.

The dials are mathematical properties of an idealized agent in a toy maze. They do not correspond to any person's neural state, psychology, brain chemistry, or diagnostic category. The behavioral "regimes" describe an algorithm, they are not diagnoses, prognoses, or treatment recommendations.

This tool does not diagnose, treat, advise on, or substitute for any mental health assessment or intervention. If you are seeking mental health support, please contact a qualified healthcare professional.

Active inference is a modeling framework; its application to mental health is an open scientific question. The mathematical foundations are reviewed in Polzin et al. 2026, an unrefereed preprint with Layer 2 expert review pending.

How firmly the agent commits to its best move
drifts, commits to nothingfully committed