Labs · Plasticity

Learning from a reward signal.

Two input patterns, two LIF neurons, and a reward button. limbic-critic turns your reward or penalty into neuromodulator levels. plasticity-lab steps a neuromod network with them, and neuromod's reward-modulated STDP decides which synapses change. This lab is separate from the homepage and loads its own WebAssembly package.

UNAVAILABLE · Rust/WASM

Present a pattern, then reward or penalize it.

Pattern A drives input channels 0 and 1; pattern B drives channels 2 and 3. While a pattern is on, neuromod records the timing of input and output spikes in per-synapse eligibility traces. A reward, even a few steps later, makes limbic-critic emit dopamine, and dopamine converts those traces into weight changes. A penalty emits norepinephrine instead: it lowers the input gain for that step and changes no weight. A reward pays out every trace that is still alive, including traces an earlier pattern left in the same episode; “New episode” clears them.

Session
Seed 17. Every step is deterministic for a seed; Reset starts the same session again.
Network
2 LIF neurons, 4 input channels, equal-share weights of 0.5000, threshold 0.1200. R-STDP eligibility τ 100 steps, reward learning rate 8.
Crates
limbic-critic 0.3.0, plasticity-lab at c80fac2 (critic bridge), neuromod 0.7.0.
Runs in
The labs WebAssembly package, which the homepage never loads.

The live lab needs JavaScript and WebAssembly. Without them, the scripted session below is the complete record: it is the same Rust code’s output, rendered at build time.

Scope

What is enabled, exactly.

Enabled

  • Reward shaping: limbic-critic's stateless SimpleCritic::try_assess. The lab reports objective +1 for a reward and −1 plus stress 1 for a penalty; the critic maps a positive objective to dopamine (0 to 1) and stress to norepinephrine. Serotonin and acetylcholine stay 0 because the lab reports no volatility or surprise.
  • Modulator hand-off: plasticity-lab's bridge::to_neuromodulators copies the vector into neuromod unchanged.
  • Training steps: plasticity-lab's train_step_with_modulators_and_rng, one seeded step at a time.
  • Reward-modulated STDP in neuromod: every step decays and accumulates one eligibility trace per synapse from input and output spike timing; positive dopamine converts traces into weight changes (at 0.5 × dopamine × the reward learning rate); each neuron's weights are then renormalized to an L1 budget of 2.0, so one pattern gains what the other loses. Renormalization runs every step and can move a weight by float rounding alone; the lab labels those steps.
  • Modulator effects on dynamics in neuromod: dopamine moves the firing threshold toward its target, and norepinephrine scales the input gain down to as little as 10 %.
  • Episodes: neuromod's reset clears spike times, membranes, traces, and modulators, and keeps weights and thresholds. The scripted session starts each episode this way, so a reward credits only that episode's pattern.
  • Frozen probe: plasticity-lab's run_eval_with_rng on a copy of the network.

Not enabled, or not provided by these crates

  • limbic-critic is a reward-shaping map, not an actor-critic: there is no policy, no learned value function, and no temporal-difference backup. Its TDCritic (an average of objective changes) is not used.
  • No penalty-driven weakening. neuromod changes weights only when dopamine is positive, so a penalty withholds reinforcement rather than reversing it.
  • The reward is your input. Nothing here predicts or learns a reward, and the network chooses no action.
  • plasticity-lab's scalar RewardMapping and its batch run_session APIs are not used, because they bypass limbic-critic.
  • No encoder, topology, or Izhikevich bank: the two patterns are fixed stimulus vectors feeding one layer of two LIF neurons.
  • Both neurons start identical and see the same input, so they stay identical. This lab shows credit assigned to input channels, not competition between neurons.
  • No checkpointing. The session lives in this tab; Reset replays from the seed.

Scripted session · seed 17

The same session, step by step.

Rendered when this page was built from the committed golden, which the adapter's Rust test generates natively. Tests replay it through the labs WebAssembly package and require every value to match; “Run scripted session” above does the same in your browser. Each episode presents a pattern for three steps, waits two quiet steps, then gives the reward input on a third quiet step.

24 steps, 4 episodes
Step Episode Pattern Reward input Dopamine Norepinephrine Input spikes LIF spikes Weights
1 1 Pattern A — 0.00 0.00 ch 0 ch 1 LIF 0 LIF 1 no weight changed
2 1 Pattern A — 0.00 0.00 ch 0 ch 1 LIF 0 LIF 1 no weight changed
3 1 Pattern A — 0.00 0.00 ch 0 LIF 0 LIF 1 no weight changed
4 1 Quiet — 0.00 0.00 none none no weight changed
5 1 Quiet — 0.00 0.00 none none no weight changed
6 1 Quiet Reward 1.00 0.00 none none 8 weights · largest |Δw| 0.0522
7 2 Pattern B — 0.00 0.00 ch 2 ch 3 LIF 0 LIF 1 no weight changed
8 2 Pattern B — 0.00 0.00 ch 2 LIF 0 LIF 1 no weight changed
9 2 Pattern B — 0.00 0.00 ch 2 ch 3 LIF 0 LIF 1 no weight changed
10 2 Quiet — 0.00 0.00 none none no weight changed
11 2 Quiet — 0.00 0.00 none none no weight changed
12 2 Quiet Penalty 0.00 1.00 none none no weight changed
13 3 Pattern A — 0.00 0.00 ch 0 ch 1 LIF 0 LIF 1 no weight changed
14 3 Pattern A — 0.00 0.00 ch 0 ch 1 LIF 0 LIF 1 no weight changed
15 3 Pattern A — 0.00 0.00 ch 1 LIF 0 LIF 1 no weight changed
16 3 Quiet — 0.00 0.00 none none no weight changed
17 3 Quiet — 0.00 0.00 none none no weight changed
18 3 Quiet Reward 1.00 0.00 none none 8 weights · largest |Δw| 0.0470
19 4 Pattern B — 0.00 0.00 ch 2 ch 3 LIF 0 LIF 1 no weight changed
20 4 Pattern B — 0.00 0.00 ch 2 LIF 0 LIF 1 no weight changed
21 4 Pattern B — 0.00 0.00 ch 2 ch 3 LIF 0 LIF 1 no weight changed
22 4 Quiet — 0.00 0.00 none none no weight changed
23 4 Quiet — 0.00 0.00 none none no weight changed
24 4 Quiet Penalty 0.00 1.00 none none no weight changed
Weights after the session (change from 0.5000)
Neuronch 0 Ach 1 Ach 2 Bch 3 BThreshold
LIF 0 0.5973 +0.09730.5974 +0.09740.4026 −0.09740.4026 −0.0974 0.1418
LIF 1 0.5973 +0.09730.5974 +0.09740.4026 −0.09740.4026 −0.0974 0.1418
Frozen probe: LIF spikes in 6 steps per pattern
NeuronA beforeB beforeA afterB after
LIF 0 3 3 3 2
LIF 1 3 3 3 2

Two rewarded episodes of pattern A moved weight from channels 2–3 to channels 0–1, and the frozen probe then fires more for A than for B. Both penalized episodes of pattern B changed no weight. This is one seed of a tiny synthetic task, not a benchmark. Regenerate the golden with cargo +1.98.1 test --manifest-path crates/neuromorphic-adapter/Cargo.toml --locked --features plasticity --test plasticity_session regenerate_plasticity_golden -- --ignored --exact.