Conductance observatory
Runs in your browser · Biophysics · inference · action

An embodied nervous system

The articulated animal

Follow sensory evidence through conductance-based inference and descending motor control, as genuine Hodgkin–Huxley spikes recruit muscles and move an articulated body.

Starting
Waiting for the simulation

Body and environment

An articulated animal

Opposing muscles bend the three joints, while the body's interactions with its surroundings determine how those movements become travel.

Recorded pathFood and touchVisual samplingWaiting for trajectory samples

Food is collected when the head centre enters a patch's amber capture ring, adding up to 16 percentage points to the energy reserve before the consumed patch is replaced. Reaching zero energy ends the run, while its recorded state remains available for inspection and export. The energy ledger is an abstract task reserve with rates measured per simulated second, while the HH currents retain their separate electrical units.

Energy reserve
—
Food collected
—
Selected policy
—
Motor spikes
—

Where the prediction error flows

Conductance inference

Sensory and prior pathways contribute currents towards different predicted voltages, with their conductances setting how strongly each influences the estimate.

Voltage represents an estimated state, conductance represents its precision and current carries the precision-weighted mismatch.
Sensory currentPrior current
Reduced inference objective—
Proprioceptive mismatch—

Learning how this body responds

Adaptive response model

The animal compares the joint state it predicted with the state it subsequently senses, using this residual to update its estimate of how opposing muscle activation moves each joint. These estimates inform its predictions and rollouts, while the neural membrane equations and supplied body layout retain their defined roles.

Waiting for learning measurements

Recent adaptive RMSE
—
Recent fixed-model RMSE
—
Parameter updates
—
Estimated response parameters for each joint
JointRetention aResponse b

qnext = a q + b(mleft − mright), with estimates shown ± one parameter standard deviation. RMSE describes recent one-step prediction errors from the ongoing run.

Actual membrane voltage

Motor neuron 0

Each trace records the selected neuron's integrated membrane dynamics, so its action potentials arise from sodium, potassium and leak currents while the separate raster preserves the timing of spikes across the motor circuit.

Voltage and spike times share the simulation clock; the raster shows recent recorded events.

Predicted movements

Expected free energy

Each candidate trajectory is evaluated for its predicted outcomes and information gain, with the selected policy supplying the next descending movement expectations.

Selected futureAlternativesBlocked at perceived wall

Blocked forecasts stop at perceived walls; the full scored paths remain in the export.

Candidate policy scores
PolicyGInfo.P

Change the mechanism

Live perturbations

Change a parameter and follow its effects through neural activity, sensory inference and the movement of the body.

Scales the maximal sodium conductance of the motor neurons.
Changes inhibitory coupling between opposing motor populations.
Changes the influence of the mismatch between expected and sensed joint state.
Changes the weight assigned to visual evidence in state estimation.
Changes the contribution of expected information to policy evaluation.
Changes how strongly neural activation is translated into muscle force.

Behaviour and internal state

Inside this animal: from conductance to behaviour

This model connects a small set of sensory observations to conductance-based state estimation, explicit policy evaluation and a spiking motor circuit, allowing us to follow how an electrical mismatch can influence a muscle and change the evidence available on the next step. The guide separates these mechanisms so that we can inspect what each contributes, including the parts represented by graded membrane dynamics and the parts implemented algorithmically.

The complete sensing and movement loop
The architecture of the articulated animalThe body supplies sensory observations to six graded inference compartments, whose estimated states inform explicit policy evaluation. Selected joint expectations drive six Hodgkin–Huxley motor neurons through a proprioceptive comparator, and their spikes recruit muscles that move the body. A separate adaptive response model updates predictions using observed movement residuals. Body and environmentHead, three joints and opposing musclesMovement emerges through resistive drag Vision, touch and proprioceptionGeometric visual features and contactSensed joint state and body movement Six graded inference compartmentsSensory and prior conductancesEstimated states and derived uncertainty Explicit EFE policy evaluation14 supplied movement policies10 forward · 2 reverse · 2 pivots Descending joint expectationsSupplied swim and pivot targetsCompared with proprioceptive feedback Six HH motor neuronsThree opponent pairs with inhibitionE/I comparator current shapes spiking Muscle recruitmentSpikes → NMJ activation → joint force Adaptive joint-response modelObserved − predicted joint state Proprioceptive feedback Movement evidence Adapts model predictions
Green pathways show the sensing and control loop, purple identifies the conductance-based spiking motor stage and amber identifies explicit algorithms. The adaptive response model uses movement evidence to update predictions and rollouts, while the supplied neural anatomy remains fixed.

The animal's visual system supplies a small set of geometric features, while contact receptors and proprioception provide information about encounters and body configuration. Six graded compartments integrate this evidence with prior predictions, representing target direction, proximity on the two sides, head bend and body speed through their membrane voltages.

The resulting estimates and visual range cues inform fourteen candidate policies whose predicted consequences are evaluated through expected free energy, spanning ten forward travelling-wave swimming gaits, two reverse gaits and two asymmetric pivot templates. The selected policy supplies a trajectory of expected joint states that local motor circuitry compares with proprioceptive feedback, producing currents that affect the six HH motor neurons and the muscles recruited by their spikes.

When food is visible, policy preferences favour proximity to the patch while accounting for contact risk, effort and the predicted ability to track the supplied joint targets. Head direction still affects the visual likelihood and expected information, with no separate preference for centring the food in the head's view.

Alongside these graded estimates, the animal keeps a local map of food-presence probabilities positioned through its own motion sensing, with genuinely empty visual observations reducing those probabilities through Bayesian updates. During search, expected free energy values both the prospect of finding food and the information available in uncertain areas, while retaining what has already been learned about inspected empty space.

This discovery map is an explicit algorithmic belief and memory component receiving local visual ranges and own-motion signals, while visible-food approach continues through the existing six graded compartments and HH-actuated gaits. Search policies are evaluated against the accumulated map belief, so repeated views of the same empty space do not receive a renewed food or wall information bonus.

A selected policy is held for one complete 0.9 Hz gait cycle, approximately 1.11 seconds, with a new choice made at a natural phase boundary so that the movement forecast corresponds to a physically completed cycle. Sensing and food-memory observations continue every 20 ms during this commitment, while the HH motor equations retain their 0.05 ms integration step.

Search rollouts extend 84 simulated seconds, compared with eight seconds when food is visible, allowing approximately a quarter-turn of the calibrated pivot to be evaluated for the observations it could reveal. The supplied gait motion means are measured through the actual HH-actuated body, linking these approximate forecasts to the circuit and mechanics used during movement. These approximate forecasts retain signed forward and lateral motion in the proprioceptive body frame, obtain future head orientation from predicted joint shape and apply a five-unit contact-risk threshold consistent with the physical body capsule, including the lateral motion produced by the pivot templates. Known-wall feasibility prevents a forecast from earning food-discovery or information value beyond an impossible crossing of a perceived barrier.

This first nervous system contains six graded inference compartments and six spiking motor neurons, with explicit algorithms for policy evaluation, food-discovery memory and response-model learning. The distinctions matter because they make it possible to test each proposed connection between physiology and inference without assuming that every computation has already been implemented by a spiking network.

How conductance becomes a prediction-error term
Conductance-weighted sensory and prior contributionsSensory evidence and a prior prediction are converted to effective equilibrium voltages using excitatory and inhibitory conductances. Their currents depend on the difference between each effective voltage and the compartment's present voltage. The membrane integrates these weighted mismatches into an estimated state. Sensory evidence yE/I balance → effective voltage EᵧCombined conductance gᵧ ∝ precision Prior prediction μₚE/I balance → effective voltage EₚCombined conductance gₚ ∝ precision Graded inference compartmentC dV/dt = gᵧ(Eᵧ − V) + gₚ(Eₚ − V)Voltage V → estimated state μFixed-input equilibrium → weighted mean Iᵧ = gᵧ(Eᵧ − V) Iₚ = gₚ(Eₚ − V)
The effective equilibrium voltage is produced by a mixture of conductances with fixed excitatory and inhibitory reversal potentials, allowing a changing prediction to be represented without assigning a changing physical reversal potential to a receptor.

Evidence, confidence and electrical influence

Each pathway contributes a current proportional to the difference between its effective equilibrium voltage and the compartment's current estimate, with its conductance determining the strength of that influence. When voltage encodes the estimated state and conductance is proportional to precision, the sensory current is proportional to the familiar precision-weighted residual πᵧ(y − μ).

Iᵧ = gᵧ(Eᵧ − V) ∝ πᵧ(y − μ)

Under the model's Gaussian and linear-encoding assumptions, the combined membrane dynamics approach the precision-weighted mean of the observation and prior, providing an explicit correspondence between a current balance and a defined inference calculation.

Why opposing currents can remain visible

The observation and prior need not agree, so their currents can remain individually nonzero while cancelling at the compartment's equilibrium. The current panel therefore plots sensory and prior contributions separately, allowing a settled estimate to be distinguished from a lack of input.

The displayed posterior variance is calculated from the model's combined precision, which provides a useful uncertainty readout without implying that the voltage trace itself is sampling the full posterior distribution. The reduced inference objective should fall during a fixed-input settling test, although it can increase when the moving animal receives new evidence.

How descending expectations recruit real spikes and muscles
From proprioceptive mismatch to opposing motor neuronsExpected joint state and sensed joint state enter a conductance comparator. Its signed mismatch influences opposing HH motor neurons, whose actual spikes inhibit their opponent and recruit neuromuscular activation. Opposing muscles create joint force that changes the next proprioceptive observation. Expected joint stateDescending target trajectory Sensed joint stateProprioceptive feedback E/I conductance comparatorTarget − proprioceptive stateBounded drive to the motor pair HH motor neuron · leftNa⁺, K⁺ and leak dynamicsSpikes recruit left muscle activation HH motor neuron · rightNa⁺, K⁺ and leak dynamicsSpikes recruit right muscle activation Spike-driveninhibition Repeated for joints 1, 2 and 3Six motor neurons → six muscle activations
The diagram shows one opposing pair, with the same organisation repeated at each joint. The comparator uses an explicit encoding of proprioceptive error, while the downstream spike waveforms and synaptic inhibition follow the conductance-based motor equations.

Each selected policy supplies joint targets for a forward swim, a reverse swim or an asymmetric pivot, and their expected configuration is compared with the body state returned by proprioception. An E/I conductance comparator converts the bounded mismatch into input to the opposing motor neurons, making it possible to change the influence of feedback and observe how that changes spiking and movement.

The reverse gaits change the direction of the travelling wave, allowing withdrawal to arise through the same HH motor neurons, muscles and drag mechanics as forward swimming. Their selection follows the ordinary EFE comparison, so a reverse movement is favoured when its predicted withdrawal or resulting view is useful within the same evaluation used for the other candidates.

Action potentials arise from the motor neurons' HH membrane equations, with emitted spikes contributing to neuromuscular activation and inhibitory conductance in the opposing neuron. The resulting muscle forces bend the articulated body, whose movement through resistive drag supplies the next visual and proprioceptive observations, completing the physical loop.

The voltage selector and overlay allow the six recorded motor waveforms to be examined together, while the raster preserves their actual event times. Display highlights briefly persist so that events remain visible, although this visual hold does not change the recorded duration or timing of an action potential.

What the response model learns from its own movement

The adaptive model predicts the next joint state from the current state and the difference between opposing muscle activations, then uses the discrepancy between its prediction and the subsequent observation to update its response parameters. This is online system identification from sensory prediction errors, with the learned response informing subsequent model predictions and policy rollouts.

qₜ₊₁ = a qₜ + b(mₗ − mᵣ) + prediction error

The retention term a describes how much of the present joint state persists, while the response term b describes how strongly opposing muscle activation changes that state over one model step. The learning panel shows these estimates and their parameter uncertainty alongside recent prediction errors, with a fixed reference model providing a comparison under the same ongoing conditions.

Freezing updates leaves the current learned model available to the animal, allowing its behaviour to be inspected without continuing to change its parameters, while restarting begins a new animal and parameter history with the current perturbations and learning setting retained. A normal restart preserves the play/pause state, while restarting an energy-depleted run resumes the animal with a replenished reserve. Because the displayed RMSE is calculated from recent one-step predictions during the ongoing run, it describes online prediction performance rather than performance on an independent held-out test.

The adaptive response model is an explicit learning algorithm, while the neural circuit contains fixed equations and supplied connections. Changes in its parameters should therefore be described as learning the body's response, without interpreting them as STDP, the development of new neurons or a fully neurally implemented world model.

Which parts of the model are implemented at each level
LevelImplemented mechanismWhat it allows us to inspect
Sensory evidenceGeometric visual features, contact and proprioceptionHow noisy and incomplete observations change inferred states
State estimationSix graded compartments with E/I conductance poolingVoltage-encoded estimates and precision-weighted mismatch currents
Policy evaluationExplicit EFE scoring of ten forward swims, two reverse swims and two pivot templatesThe influence of preferred outcomes and expected information gain
Motor systemSix HH motor neurons, reciprocal inhibition and neuromuscular activationHow excitability, feedback and inhibition change muscle recruitment
EmbodimentThree joints, opposing muscles and resistive dragHow neural output becomes motion and new sensory evidence
Response learningOnline estimation from observed movement residualsChanges in predictions and rollouts as the body's response is estimated
Open the illustrated architecture report

Membrane voltages, spike times and trajectory samples are recorded by the simulation, while the diagrams provide an explanatory view of the model's supplied structure.