Where Should an Agent Direct Its Interoceptive Attention?

active-inferenceattentionhomeostasisinteroception

Where Should an Agent Direct Its Interoceptive Attention?

Imagine an agent that is hungry, thirsty, and running short of oxygen. It has to decide what to do next, but there is a prior problem. Which of those internal signals should it measure most carefully?

Our SAB 2026 paper studies a deliberately small answer. At each step, the agent makes the bodily channel that currently appears most urgent more reliable. The other channels become slightly less reliable, and the total sensing budget stays fixed. We call this κ-attention.

In our gridworld, that one change raises learning-phase survival from 19.9% to 41.4% across eleven layouts. This is a 21.5 percentage-point improvement, or a little more than twice the uniform agent’s survival rate. Pointing the same extra precision at the least-needed channel instead reduces survival to 14.4%.

The paper has been accepted at SAB 2026, From Animals to Animats 18. This post is its web companion. It starts with the intuition, then opens up the implementation, interactive demo, supporting analyses, and the parts of the interpretation that need more care than a twelve-page paper allowed.

What is the idea?

The usual action-selection question is familiar. Should an agent seek food, water, or safety? We ask what comes just before it. If an agent cannot sense every bodily variable equally clearly, where should it spend its limited sensing capacity?

The uniform agent divides its budget equally. Each of four channels reports the correct body level with probability 0.65. The attentive agent gives probability 0.90 to whichever channel its current body-state belief says is most needed. The other three receive about 0.567 each. Both allocations sum to the same total, 2.60.

The same total precision, divided two ways

Each bar is one interoceptive channel. In the selective snapshot, hunger is currently the most-needed channel. The attended channel can change on the next step.

Uniform allocation

Every channel is equally reliable.

K = 2.60

Selective allocation

One channel becomes clearer, while the others become slightly noisier.

K = 2.60

This is a redistribution, not an increase in capacity. The comparison therefore asks whether the pattern of precision matters when the total amount does not change.

There is one implementation detail worth stating early. In these experiments, κ sets both the reliability of the interoceptive observation emitted by the simulated body and the precision of the matching likelihood inside the agent. The clean interpretation is therefore limited sensing capacity directed towards one channel at a time. The experiment does not isolate a purely internal change in prediction-error weighting under an otherwise fixed sensory stream.

What is AffectWorld?

AffectWorld is a 6 × 6 foraging gridworld. Hunger and thirst fall by one level on every step and become lethal at zero. Food restores hunger and water restores thirst. A third, non-lethal suffocation channel falls while the agent is on water and recovers elsewhere, which creates a reason not to remain on a water tile indefinitely. Episodes last at most 60 steps.

The agent receives its position, the resource at its current cell, and noisy readings of its body. It learns the relevant observation likelihoods online while planning over a three-step horizon. The paper uses twelve layouts ranging from easy to far-resource cases.

Representative AffectWorld layouts from the easy, medium, and far tiers, with start-to-resource distances annotated
Representative layouts from the three difficulty tiers. The headline analysis pools eleven layouts. L01 is reported separately because of a post-hoc behavioural failure under a learned world model. Including it would increase, rather than reduce, the attentive agent’s advantage.

Why are there four interoceptive channels when the agent has only three active needs? The fourth is an inert control. Its underlying state remains constant, so it carries no useful need signal and a need-aligned selector should almost never attend it. It helps test whether an uninformative channel can create the result by itself.

How does κ-attention work?

The loop has five steps. The agent receives noisy body readings, updates its beliefs about the underlying body levels, converts those beliefs into a need score, selects the largest score, and reallocates κ before the next observation and policy evaluation. The selector never reads the true body state. It uses the agent’s own posterior, which means a badly miscalibrated agent can direct its precision to the wrong place.

The κ-attention architecture, where one precision-shaped likelihood feeds both the belief update and policy evaluation
The same precision-shaped likelihood is used in two places. It affects the body-state belief update and the predicted observations used to evaluate policies. Everything else is matched across the main agents.
What does κ mean mathematically?

For channel mm, κ is the probability that the categorical observation equals the true body level. The remaining probability is divided equally across the other five levels.

Ao,s(m)={κmo=s(1κm)/5osA^{(m)}_{o,s} = \begin{cases} \kappa_m & o=s \\[2pt] (1-\kappa_m)/5 & o\neq s \end{cases}

At κm=1\kappa_m=1, the reading is always correct. A uniform draw over the six possible levels occurs at κm=1/6\kappa_m=1/6, not at zero. The paper operates well above that chance point.

The allocation obeys mκmK\sum_m \kappa_m \leq K with K=2.60K=2.60 and a lower floor of 0.05. The attentive channel receives κatt=0.90\kappa_{\mathrm{att}}=0.90 and each unattended channel receives κun=(2.600.90)/30.567\kappa_{\mathrm{un}}=(2.60-0.90)/3\approx0.567.

The reported planner uses the pragmatic expected-free-energy score with state information gain disabled. In other words, κ still reaches policy evaluation through the predicted-observation distribution q(oπ)=Aq(sπ)q(o\mid\pi)=Aq(s\mid\pi), but there is no separate epistemic state-information-gain term. The shared policy precision is γ=1\gamma=1.

What happened across the layout bank?

The main comparison uses 32 seeds per agent and layout, with 100 trials in each run. Learning-phase survival is the fraction of those trials that reach all 60 steps.

AgentLearning-phase survival95% confidence intervalRaw paired-bootstrap p vs uniform
Uniform precision0.199[0.158, 0.240]
κ-attention0.414[0.365, 0.463]≤ 10⁻⁴
Anti-aligned attention0.144[0.108, 0.181]0.004

The ratio, about 2.08×, is useful as a headline. The absolute gap is easier to compare across layout pools. It is +21.5 percentage points across all eleven headline layouts and +28.9 points on the five-layout easy tier. The far tier contributes a common zero for every agent, so changing the mix of layout difficulties changes the ratio even when the underlying differences do not.

Learning-phase survival is 19.9 percent for uniform precision, 41.4 percent for κ-attention, and 14.4 percent for anti-aligned attention
The headline comparison at matched total precision. The dashed line is a planning ceiling with access to the true environment dynamics, not a competing baseline.

The attentive-versus-uniform result remains clear after correcting for the primary comparisons. The anti-aligned contrast is weaker. On the easy-tier test used in the correction family, its adjusted p-value is 0.027. I would read that result as evidence that direction matters, while keeping the exact size of the below-uniform effect open to a higher-powered replication.

Why does the direction matter?

Could any uneven split help simply by breaking the symmetry of a uniform agent? The direction controls argue against that explanation.

Four need-aligned selector rules outperform uniform precision, while the anti-aligned selector performs worse
Four need-aligned rules beat uniform allocation in the exploratory selector panel. The rule that attends the least-needed channel is the only one that fails.

The cleanest control gives the attentive and anti-aligned agents exactly the same four κ values, 0.90,0.567,0.567,0.567{0.90,0.567,0.567,0.567}. Only the destination of the 0.90 changes. One agent assigns it to the channel believed to be most needed, while the other assigns it to the least needed.

A separate sweep changes how asymmetric the allocation is. The two selectors coincide at the uniform point, κatt=0.65\kappa_{\mathrm{att}}=0.65, and separate as the attended value rises. At the default of 0.90, the need-aligned rule is 44 percentage points ahead of the reversed rule. Unevenness on its own is therefore not enough.

Where does the signal do its work?

The shaped likelihood affects both state inference and policy evaluation. We can withhold it from one site at a time to ask which route carries the result.

The inference-only ablation still uses selective κ for the sampled observation and body-state update, but gives the planner a uniform likelihood. At the default prior concentration, this removes about 20 percentage points of survival relative to full κ-attention. The gap becomes much larger when the prior is rigid.

Plateau survival across six prior concentrations for full κ-attention, inference-only attention, uniform precision, and anti-aligned attention
Withholding the shaped likelihood from the planner becomes increasingly costly as the body-state prior becomes more rigid.

At α0=10\alpha_0=10, full κ-attention reaches 0.905 plateau survival. Inference-only attention falls to 0.023, close to the uniform agent at 0.000. The anti-aligned control remains intermediate at 0.492. This corrects an imprecise sentence in the fixed camera-ready text, which compares the inference-only value with the anti-aligned agent rather than the uniform agent.

The mirror ablation keeps the shaped likelihood in the planner but disables inference-stage shaping. On the smaller easy-tier sample it reaches 0.865 survival, compared with 0.696 for the full agent, with overlapping intervals. This does not show that removing inference helps. It shows that the planning route can carry the gain on its own when the prior is loose. Taken together, the ablations locate the dominant pathway in policy evaluation, while state inference matters more as the prior becomes rigid.

Can you see the mechanism yourself?

The interactive below separates a stylised explanation from the paper data. The first tab runs a simplified body-and-selector model so that the true state, current belief, selected channel, and κ allocation remain visible at every step. It deliberately does not run the full expected-free-energy planner. The second tab explores a measured κ by prior-concentration grid. The third shows measured Dirichlet summaries from the experiments.

Interactive AffectWorld κ-attention explorer
Comparative survival (steps survived this run) max 60

All three agents start from the same body and random-number seed, and use the same fixed precision budget K. They differ only in their selector — the rule that decides where the budget is allocated each step. Because κ changes sensory reliability, the realised observations differ by design. The thin horizontal line inside each bar shows the agent's belief about that channel; the coloured fill is the channel's true level. The trace strip below each agent shows the attended channel for the last 30 steps. The rollout is a stylised body-and-selector simulator: it shares the paper's depletion, noisy-categorical observation, and belief-driven selection logic, but does not run the full expected-free-energy planner — the parameter-explorer tab below shows the real grid from the paper.

Trial-level mean Δ in posterior diagonal mass

Per-channel cluster-bootstrap means with 95% CIs from per_channel_delta_ci.json (24 paired clusters; layout × seed). Δ is the change over a trial in the agent's Dirichlet posterior diagonal mass on each channel. The live sparklines show the same quantity in a stylised model, but are not replays of these trials. Bars are mean Δ; thin brackets are the 95% CI.

Fraction of clusters crossing 50% diagonal mass

From convergence_time.json (352 layout-by-seed clusters across the full n=32 broad panel). Threshold = 0.50; window = 5 trials. This is a descriptive threshold-crossing summary, not an estimated convergence rate. Median crossing trial is 5 for every agent, so only the fraction that ever crosses differs here.

The two cards above report measurements from the paper analyses. The rollout tab is a simpler explanatory model. It makes the update visible, but it should not be read as a per-step replay or as an additional experiment.

κatt (attended channel)
α0 (Dirichlet prior concentration)
low
high survival

Real grid from kappa_alpha_grid.json in the paper repo — pooled across 3 easy-tier layouts × 8 seeds per cell. The two axes: κatt, the precision the selector concentrates on the attended channel; α0, the Dirichlet prior on the body-state observation likelihood (lower → looser, higher → more rigid). The paper's canonical operating point is κatt = 0.90, α0 = 0.1. The benefit grows fastest as κatt climbs above the uniform allocation K/4 ≈ 0.65 and as the prior tightens.

The rollout tab is a stylised explanation. The parameter and measured-summary tabs use analysis files from the paper experiments.

Try the need-aligned, uniform, and anti-aligned selectors with the same seed. The agents start from the same body and random-number sequence, but κ changes which observations are likely to be correct. That difference in sensory reliability is the intervention, so the realised observation streams are not identical.

The thin line inside each body bar is the agent’s belief and the coloured fill is the true state. A large gap means that the agent is acting with a poor estimate of its own body. The per-channel sparkline shows how the learned likelihood changes during the stylised rollout. It illustrates the update, rather than replaying one of the full planner runs.

Does the attended channel learn faster?

The twelve-page paper describes the attended hunger channel as learning “about 2.4× faster”. The supplementary analysis supports a narrower claim. The attentive agent’s likelihood is more accurate from the first trial, and both agents approach their plateaus within roughly five trials. This is a difference in level, not an identified difference in convergence rate.

The higher accuracy does persist when we plot it against cumulative observation count. Up to 750 observations, where all 24 layout-by-seed clusters still contribute, the hunger-channel accuracies are 0.629 for κ-attention, 0.299 for uniform precision, and 0.524 for anti-aligned attention.

Hunger-channel likelihood accuracy and mean hunger precision plotted against cumulative observation count
The accuracy difference survives matching on observation count, so it is not explained only by longer-lived agents collecting more data. The shaded region is survivor-conditioned because some clusters end before reaching that count.

However, κ changes the distribution being sampled as well as the model trying to learn it. Over the fully paired range, mean hunger precision is 0.749 for κ-attention, 0.650 for uniform precision, and 0.586 for anti-aligned attention. The anti-aligned agent remains second in accuracy despite receiving the lowest mean hunger precision. For that reason, the result does not isolate a simple precision-to-learning-rate mechanism or provide a decisive test against preference reweighting.

The defensible conclusion is useful but more modest. Selective κ leaves a channel-specific learning trace that remains after matching the amount of data. A comparator that uses the same selector but changes preferences rather than observation precision is needed to explain exactly why.

How robust is the result?

The mechanism was tested across prior concentration, allocation strength, total budget, and a food-to-poison change in the environment.

Robustness of plateau survival across prior concentration, total precision budget, and attended-channel precision
Three exploratory robustness slices. κ-attention remains stable as the learned body-model prior becomes rigid, exceeds the uniform implementation at every tested budget, and improves as the need-aligned allocation becomes sharper.

The prior-concentration result is the clearest. κ-attention remains near 0.85 plateau survival across five orders of magnitude, while the uniform agent collapses at the rigid end. The allocation sweep also has the expected shape. Need-aligned and anti-aligned attention agree when the split is uniform and diverge as it sharpens.

The budget sweep needs a caveat. At K=4K=4, the unattended values clip at 1.0 and the nominally attended channel is no longer the most precise. The exact point at which all four dynamic values become 0.90, K=3.6K=3.6, was not plotted. The high-budget cells are therefore saturation cases, not evidence that the mechanism reverses. The uniform curve also uses the original baseline implementation, so this sweep is not a matched-architecture convergence test.

In the non-stationary test, food can turn into poison when the agent reaches it. The attentive advantage stays positive as the mutation probability rises from 0.02 to 0.10, but the absolute gap falls from 34 to 4 percentage points as the task becomes harder. The mechanism degrades rather than remaining invariant.

What can we conclude?

Within AffectWorld, a fixed sensing budget can prioritise competing needs without changing the agent’s preferences or total precision. The useful information is in the allocation pattern. A need-aligned pattern improves survival, a reversed pattern does not, and most of the advantage disappears when the planner cannot use the shaped likelihood.

That conclusion is specific. The experiments vary where a hand-written selector routes precision, but do not compare every way the same need signal could control behaviour. They show that selective interoceptive precision is one sufficient implementation of homeostatic prioritisation. They do not show that it is the only implementation, or that precision is better than changing preferences under a matched selector.

The model also couples sensory sampling to the agent’s likelihood. A future fixed-stream experiment would be needed to separate improved sensing from a purely internal change in precision weighting. A learned router would test whether need-aligned allocation emerges without writing the arg-max rule by hand. Strong miscalibration matters too, because the current selector assumes that the body-state posterior is good enough to identify the urgent channel.

Finally, this is a discrete gridworld with four channels, a three-step planning horizon, and a bounded layout bank. The far layouts defeat every tested agent, and several mechanism sweeps use smaller exploratory samples. The result supports a computational mechanism inside this setting. It does not establish a general law of biological attention or embodied intelligence.

Could this tell us anything about biology?

There is a plausible analogy to biological gain control. Work on active interoceptive inference treats the confidence assigned to bodily signals as part of perception and regulation, while experiments on AgRP circuits and insular cortex show that physiological state can gate responses to food cues.

Our model suggests a broad hypothesis. If bodily urgency changes the reliability assigned to different interoceptive channels, disrupting that modulation may be most costly while an unfamiliar environment is still being learned. This is a way to think with the model, not a claim that κ maps onto one cortical circuit or a specific clinical prediction.

How can you reproduce it?

The public code and layout snapshot contains the AffectWorld implementation, configurations, analysis-ready quick results, and a one-command reproduction entry point. The standalone supplement records the implementation details and sensitivity analyses that do not fit in the proceedings paper.

The combined arXiv release reproduces the twelve-page camera-ready paper without alteration and then appends the supplement. I will add the arXiv and proceedings links here once their public records are live.

What would I test next?

The most informative next experiment would keep the need selector fixed and change only the point at which it acts. A matched preference-reweighting agent would show whether the channel-specific learning trace depends on shaping observations, or whether selecting different actions is enough to produce it.

After that, I would replace the hand-written arg-max with a learned router and make the body-state beliefs deliberately unreliable. Those tests would ask whether need alignment can be learned, when it fails, and whether the agent can notice that it is attending to the wrong internal signal.


The paper

Interoceptive Attention as Dynamic Homeostatic Prioritization in a Foraging Agent. St John Grimbly, Nicolas Kuske, Evert A. Boonstra, Bruce A. Bassett, Charel van Hoof, Rowan Hodson, Benjamin Rosman, Ryan Smith, Mark Solms, and Jonathan P. Shock. Accepted at SAB 2026, From Animals to Animats 18, Springer LNAI. The arXiv record is in preparation.

Links: code and data · supplement · publications page

Comments, corrections, and reproduction attempts are welcome at askingwhy@stjohngrimbly.com.

St John

Written by St John

Author of the Asking Why Blog - a personal blog and website with everything I find interesting.

Comments are being migrated. Check back soon.