Sub topic 4
Why Rewards Help the Link Form
This chapter assumes you know what a habit is, the difference between goal-directed and habitual control, and how a cue in a stable context can trigger a response. It also assumes you can read short Python snippets. You don't need any neuroscience.
Earlier chapters described a habit as a link between a cue and a response. This chapter covers what builds that link in the first place. The short answer is that outcomes matter early on, and repetition matters more later.
The role of outcomes in learning a link
A cue-response link doesn't appear on its own. When someone first does an action in a context, the action is usually goal-directed. They do it because they expect something good to follow. If something good does follow, the link between that context and that action gets stronger.
Edward Thorndike described this in 1911 as the law of effect. Responses followed by satisfying outcomes in a situation become more likely in that situation. Responses followed by unpleasant outcomes become less likely.
The reward is not part of the cue or the response. It is a signal that tells the learning system that this pairing is worth keeping. The sequence looks like this:
Prediction error: the core mechanism
Learning theories describe the comparison step with a quantity called reward prediction error. It is the difference between what you got and what you expected.
- A positive error means the outcome was better than expected. The link strengthens a lot.
- A zero error means the outcome matched the expectation. The link barely changes.
- A negative error means the outcome was worse than expected. The link weakens.
This explains a pattern you may have seen. A new routine feels rewarding at first and then the thrill fades, even though you keep doing it. Once the outcome is fully expected, the error shrinks toward zero and the reward adds less to the link.
Research on dopamine neurons in animals is consistent with this account. Those neurons fire more when a reward is unexpected and less when it is predicted. In humans the evidence comes mostly from brain imaging and is less direct. Treat the neural story as supporting evidence, not as proof of how each person's habits form.
A small model of prediction error
The snippet below tracks the strength of a cue-response link (0 to 1). Each day the action is followed by a reward worth 1. The link moves toward the reward by a fraction of the error.
def update_link(link, reward, rate=0.3):
"""Return (error, new_link) after one rewarded or unrewarded trial."""
error = reward - link
return error, link + rate * error
link = 0.0
for day in range(1, 5):
error, link = update_link(link, reward=1.0)
print(day, round(error, 3), round(link, 3))It prints:
1 1.0 0.3
2 0.7 0.51
3 0.49 0.657
4 0.343 0.76The error shrinks each day, so the gains shrink too. This matches the levelling-off curve from the chapter on repetition and habit strength. In this model, reward-driven learning alone produces that curve.
What counts as a reward
"Reward" is broader than a treat or a prize. For habit formation it helps to separate several kinds.
| Kind of reward | Example | Typical timing | Notes |
|---|---|---|---|
| Intrinsic | Enjoying the walk itself | During the action | Tends to predict persistence in field studies |
| Immediate feedback | A tick on a tracker, a satisfying sound | Seconds after | Works because it is close in time to the action |
| Relief | Feeling less restless after exercise | Minutes after | A reduction in discomfort can reinforce as well as pleasure can |
| Extrinsic | Money, points, a treat | Varies | Can start a behaviour, but may not carry it once removed |
| Distant benefit | Better health in a year | Weeks to years | Motivates the goal, but is too late to train the link |
The last row matters most for design. Long-term benefits are a good reason to start an action, but they are too far from the action to work as the learning signal. The learning system pairs the action with what happens soon after it.
Timing and contingency
Two properties decide how well a reward builds the link.
- Delay. The longer the gap between response and outcome, the weaker the learning. In animal studies, delays of even a few seconds weaken learning. In humans the effect is softer, because we can bridge gaps with memory and language, but shorter gaps still help.
- Contingency. The outcome has to depend on the action. If the same good thing happens whether or not you act, there is nothing for the link to learn.
Rewards matter less once the habit is formed
Here is the part that surprises many learners. Reward helps build the link, but it does not have to keep paying out for the link to persist.
The classic test is outcome devaluation. A rat learns to press a lever for a food pellet. Then the pellet is made unappealing, for example by pairing it with illness. A goal-directed animal stops pressing, because the outcome is no longer wanted. After extensive training, many animals keep pressing anyway. The response now runs on the cue and the context, not on the expected value of the outcome.
Human studies show similar patterns, though results are more mixed and depend on the task and how long training lasted.
The next snippet separates two quantities. The first is an expected value that follows the reward. The second is a habit strength that grows with repetition only. This is a deliberate simplification, since in real learning reward also speeds up acquisition. It is meant only to show why the two can diverge.
def simulate(training_days=30, extra_days=10, value_rate=0.1, habit_rate=0.05):
value = 0.0 # expected value of the outcome; follows the reward
habit = 0.0 # habit strength; grows each time the action is performed
results = {}
for day in range(1, training_days + extra_days + 1):
reward = 1.0 if day <= training_days else 0.0 # outcome devalued after training
value += value_rate * (reward - value)
habit += habit_rate * (1 - habit) # action still performed daily
results[day] = (round(value, 3), round(habit, 3))
return results
results = simulate()
print("day 30:", results[30])
print("day 40:", results[40])It prints:
day 30: (0.958, 0.785)
day 40: (0.334, 0.871)After the reward stops, the expected value falls from 0.958 to 0.334 in ten days, while habit strength keeps rising. If the person goes on acting in the same context, the action is now carried mostly by the habit.
Putting reward to use
The mechanism suggests a few concrete practices for building a habit.
- Attach a reward to the action itself. Choose a version of the behaviour you can enjoy, such as a podcast you save for your walk. The enjoyment then arrives during the action and not weeks later.
- Add immediate feedback when the real payoff is distant. Marking a calendar or ticking a box gives a signal within seconds. It is a small reward, but it is well timed.
- Make sure the reward depends on the action. Rewarding yourself with something you would have had anyway does not create contingency.
- Keep extrinsic rewards small and temporary. Large external rewards can shift your reason for acting from "I like this" to "I do this for the prize." When the prize ends, the motivation may go with it. This is sometimes called the overjustification effect. Evidence for it is mixed across studies, but it is a known risk.
- Prefer a context that stays the same. The link forms between the reward-paired action and a specific context. A stable cue gives the link something to attach to.
Common errors
- Treating the long-term goal as the reward. Health or savings are too delayed to train the link. Add a near-term signal.
- Rewarding the wrong step. If you reward yourself for planning to exercise, you may strengthen planning more than exercising. Reward the target action, soon after it.
- Using a punishment-heavy approach. Negative outcomes can weaken a response, but they also tend to produce avoidance of the context. That is a poor way to build a new routine.
- Expecting the thrill to last. A fading reward feeling is predicted by prediction error. It does not mean the habit has failed.
What is uncertain
The picture above is well supported in animal learning and reasonably supported in human laboratory tasks. Evidence from real-world habit building is thinner. Field studies of everyday behaviours such as exercise or eating suggest that enjoyment and repetition both matter, but they cannot cleanly separate the two. The models in this chapter are illustrations of the mechanism and not measurements of anyone's actual habit strength.
Exercise
In the first snippet, the reward stays at 1.0 every day, yet the link grows by less each day. Explain why, using the term prediction error.
Show answer
The link moves by a fixed fraction of the prediction error, which is the reward minus the current link strength. As the link approaches 1, the same reward of 1.0 is increasingly well predicted, so the error shrinks (1.0, 0.7, 0.49, 0.343). A smaller error produces a smaller update, so the curve levels off.
Exercise
You want to build a habit of doing ten minutes of stretching each evening. The real benefit is better flexibility in a few months. Name two changes that would make the reward better suited to forming the link, and say which property of reward each one improves.
Show answer
Examples: (1) Tick a box on a tracker right after stretching, which shortens the delay between response and outcome. (2) Pair the stretching with a show or music you enjoy only during it, which makes the reward depend on the action (contingency) and arrive during the action. Flexibility in months is too delayed to act as the learning signal.
Exercise
A person trains daily for 30 days and gets a reward each time. The reward is then removed, but they keep acting in the same context. Using the second snippet's results, what does the model say happens to expected value and to habit strength, and what does this suggest about why the action continues?
Show answer
Expected value falls from 0.958 to 0.334 within ten days because it follows the reward. Habit strength keeps rising, from 0.785 to 0.871, because it grows with repetition in the context. The action can continue because the cue-response link is carrying it, so it no longer depends on the expected outcome. The model is a simplification and not a measurement.