Demo 1 · Outcome devaluation

Train a lever-press response over several sessions, then test it when the outcome is still valued or has been devalued (made worthless). Early in training the response is goal-directed and collapses under devaluation; with more training a stimulus–response habit takes over and persists.

baselinetest responding100%
After 6 sessions, habitual weight is 45% and goal-directed weight is 55%. Because the outcome is still valued, both systems drive the response at roughly baseline (100%).

Demo 2 · How automaticity grows

Repeating a behavior in a stable context raises its automaticity along a negatively accelerated curve — steep at first, then flattening. Context consistency sets how fast the curve climbs. The model is A(n) = 1 − e−kn, fitted by Lally et al. (2010).

95% plateau0%50%100%0306090120day
At 100% context consistency the growth rate is k = 0.05/day. On day 21, automaticity is 61% of its asymptote. Reaching the 95% plateau takes 66 days. At full consistency this matches the ~66-day median Lally et al. reported.

Demo 3 · Which system is in control?

Both controllers are always present; arbitration weights each by its reliability. Over-training makes the habit reliable; a volatile environment makes the goal-directed model unreliable. A softmax over the two reliabilities sets the share of control.

habitual 40%goal-directed 60%share of behavioral control
habitual (model-free)goal-directed (model-based)
Habit reliability 0.60, goal-directed reliability 0.70. Arbitration assigns 40% of control to the habit and 60% to the goal-directed system, so the goal-directed controller dominates. Shift either slider to see control hand off between the two systems.