Concepts / Eligibility Traces in Reinforcement Learning

Eligibility Traces in Reinforcement Learning

An eligibility trace is the temporary synaptic record that makes an earlier event eligible to be changed when a later reinforcement signal arrives.

  • Programming

The Delayed-Reward Problem

A reinforcement-learning system may need to connect two events separated in time: an earlier synaptic event and a later reinforcement signal. The central question is how the system can preserve enough information about the earlier event for the later reward to affect the appropriate synapse. Miller's 1981 Law-of-Effect-like proposal addressed this problem with synaptically local contingent eligibility traces.

Key point

An eligibility trace is the temporary synaptic record that makes an earlier event eligible to be changed when a later reinforcement signal arrives.

Sensory eventearlier eventSynapseeligibility traceReinforcement signallater signalSynaptic changeeligible synapse affectedmarksremains eligible foracts on
How does an earlier synaptic event become temporarily eligible and then receive a later reinforcement-related change?

A Synapse Becomes Eligible

In Miller's proposal, eligibility is local to a synapse. An earlier sensory or synaptic event does not immediately need to produce the final learning change. Instead, that event can leave the synapse temporarily eligible. If a reinforcement signal arrives afterward, the signal can be related to the synapse that was previously marked. The trace therefore addresses temporal credit assignment: it helps connect a later outcome with an earlier event.

Worked example

Tracing One Earlier Event

Suppose a sensory event is followed by activity at one synapse, and a reinforcement signal arrives later. How does a contingent eligibility trace organize the learning sequence?

  1. 1
    Earlier event

    The sensory event and associated synaptic activity occur first.

  2. 2
    Temporary eligibility

    The synapse retains a local eligibility trace rather than being treated as unrelated to the later outcome.

  3. 3
    Later reinforcement

    A reinforcement signal arrives after the earlier synaptic event.

  4. 4
    Credit assignment

    The later signal can affect the synapse because that synapse was previously made eligible.

Result

The trace supplies a time-bridging link between the earlier synaptic event and the later reinforcement signal.

Earlier eventsynaptic activityEligibility tracetemporary local stateRewardlater reinforcementSynaptic updateeligible synapseleavesbridges toreinforces
What changes over time at a synapse before, during, and after reinforcement?

Miller's Sensory Analyzer

Miller's proposal also included a sensory analyzer unit with a critic-like role. The important function is not merely sensing input. The analyzer supplied reinforcement signals to neurons, providing the signal that could guide changes at synapses that had become eligible. This anticipates a central feature later associated with actor-critic architectures: one part of the system contributes behavior, while a critic-like mechanism supplies information related to reinforcement.

Sensory informationSensory analyzercritic-like unitReinforcement signalto neuronsEligible synapseslocal tracesentersprovidesreinforces
How does sensory information flow into Miller's analyzer, and how does its reinforcement-related signal affect eligible synapses?

The Hedonistic Synapse

Seung's hedonistic synapse gives the learning problem a synapse-level interpretation. The synapse changes its neurotransmitter release probability according to which event is followed by reward: release or failure to release. The relevant distinction is between synaptic activity and the probability of the synapse's future neurotransmitter release. A hedonistic synapse therefore expresses learning as a reward-dependent change in release probability, rather than treating every synaptic event as an identical outcome.

Release eventor failure to releaseRewardfollows eventRelease probabilitychanged according tooutcomemay be followed bychanges
How does reward alter a hedonistic synapse's release probability, and how is that different from the release event itself?
Worked example

Release Versus Failure to Release

What does the hedonistic-synapse idea track when reward follows a synaptic event?

  1. 1
    Observe the synaptic event

    The synapse either releases neurotransmitter or fails to release it.

  2. 2
    Observe the later outcome

    The system determines whether reward follows that release or failure to release.

  3. 3
    Adjust the synapse

    The synapse changes its neurotransmitter release probability according to the relationship between the event and the reward.

Result

The learned variable is release probability, and its adjustment depends on whether reward followed release or failure to release.

Historical Connections

IdeaEarlier eventLater signalLearning consequence
Contingent eligibility traceEarlier synaptic eventReinforcement signalThe locally eligible synapse can be affected
Reward-modulated STDPSynaptic activityReward-related modulationThe source connects it with the general features of eligibility-based reward learning
Actor-critic methodPast behavior or synaptic eventTD errorThe source identifies TD error as a later actor-critic development

These are historical and conceptual connections, not a claim that the mechanisms are identical.

The shared question across these ideas is how to connect a past event with a later reinforcement signal. The source connects Miller's proposal with the general features of reward-modulated STDP and connects the later actor-critic architecture with TD error. The useful comparison is therefore structural: an earlier synaptic or behavioral event is related to an eligibility-like record, a later reward-related signal arrives, and learning uses the relationship between the two. This relationship should not be mistaken for proof that all three approaches implement the same mechanism.

Bacterial chemotaxis belongs here as a metaphor for the problem of using consequences to guide future behavior. It should not be confused with the neural learning mechanisms themselves. The mechanisms discussed in this article are eligibility traces, reinforcement signals, reward-dependent synaptic release probability, reward-modulated STDP, and actor-critic use of TD error. The metaphor helps frame the learning question; it does not replace the variables and synaptic mechanisms used in those proposals.

Eligibility Traces in TD(λ)

Added by the IKSHA team to go beyond the source course material.

Miller's proposal described a synapse keeping a temporary record so that a later reward could still change it. The same idea is used today in temporal-difference learning, where it is called an eligibility trace. A one-step method, TD(0), updates only the state it has just left, so a reward at the end of a long chain takes many episodes to reach the start. A trace lets one reward update every recently visited state at once.

Each state s has a trace e(s), a number that is 1 when the state is visited and then shrinks by a factor of γ λ on every following step. The parameter λ (lambda), between 0 and 1, sets how long the memory lasts. After each step the algorithm computes one TD error and applies it to every state in proportion to its trace.

Formula
Formula
Formula
Formula

The first update shrinks the trace of every state, the second adds 1 to the state just visited, and the third moves every state's value by the TD error times that state's own trace.

At the two ends of the range the method is familiar. With λ = 0 the trace vanishes after one step and the update is TD(0). With λ = 1 the trace decays only by γ and the combined updates over an episode match the Monte Carlo update, which waits for the full return.

A Three-State Walk, Step by Step

Added by the IKSHA team to go beyond the source course material.

Worked example

One episode with γ = 0.9, λ = 0.8, α = 0.5

A chain goes A, then B, then C, then ends. The only reward is 1, received on leaving C. All values start at 0. Apply the trace updates for the whole episode and report the total change to each value.

  1. 1
    Leave A

    The TD error is 0 + 0.9 * 0 - 0 = 0. The trace of A becomes 1. Nothing changes yet.

  2. 2
    Leave B

    The TD error is 0 again. Traces: A has decayed to 0.9 * 0.8 = 0.72 and B is 1. Nothing changes yet.

  3. 3
    Leave C

    The TD error is 1 + 0 - 0 = 1. Traces: A is 0.72 * 0.72 = 0.5184, B is 0.72 and C is 1.

  4. 4
    Apply the error

    Each value changes by α δ e(s) = 0.5 * 1 * e(s), giving A 0.2592, B 0.36 and C 0.5.

Result

One reward at the end updated all three states, with the closest state changing most. TD(0) would have updated only C (by 0.5), and the Monte Carlo update would give A 0.405, B 0.45 and C 0.5.

python
Output (expected)
{'A': 0.2592, 'B': 0.36, 'C': 0.5}
Notes on the code
  • delta is the TD error for the step just taken
  • Every trace decays by gamma * lam, then the visited state gets +1
  • Each value is moved by alpha * delta * its own trace
  • Values are held fixed during the episode, so this is the offline version that matches the forward view

Common Mistakes

  • Common mistake

    Treating an eligibility trace as the reinforcement signal itself.

    What it looks like

    Calling the local trace the critic's reward signal.

    Why it fails

    The trace marks an earlier synaptic event, while Miller's critic-like sensory analyzer provides reinforcement signals to neurons.

    Do this instead

    Keep the roles distinct: eligibility identifies a synapse that can receive later credit, and the analyzer supplies the reinforcement-related signal.

  • Common mistake

    Assuming that a later reward automatically changes every synapse.

    What it looks like

    Applying the same reinforcement effect to synapses that had no relevant earlier event.

    Why it fails

    Miller's rule is described as using synaptically local contingent eligibility traces.

    Do this instead

    Ask which synapse was made eligible by the earlier event before assigning credit.

  • Common mistake

    Confusing release probability with a single release event.

    What it looks like

    Describing the hedonistic synapse as simply releasing whenever reward occurs.

    Why it fails

    The hedonistic synapse changes its neurotransmitter release probability according to whether reward follows release or failure to release.

    Do this instead

    Separate the event that occurred from the learned probability governing future release.

  • Common mistake

    Claiming that Miller's proposal and actor-critic methods are identical.

    What it looks like

    Replacing the historical proposal with a modern actor-critic implementation without qualification.

    Why it fails

    The source presents Miller's proposal as anticipating an important actor-critic feature and connects later actor-critic methods with TD error.

    Do this instead

    Describe them as historically and conceptually connected through the problem of linking past events to later reinforcement.

  • Common mistake

    Treating bacterial chemotaxis as the neural learning rule.

    What it looks like

    Using the metaphor as if it directly defined eligibility traces or TD error.

    Why it fails

    The metaphor and the learning mechanisms are different levels of explanation.

    Do this instead

    Use chemotaxis only to frame the consequence-guided learning problem, then return to the neural variables.

Check Your Understanding

MEDIUM

A synapse is active during an earlier sensory event. A reinforcement signal arrives later. Explain why a contingent eligibility trace is useful, identify the role of the critic-like sensory analyzer, and state what variable changes in the hedonistic-synapse proposal.

Hints
  • Start with the time gap between the earlier synaptic event and the later reinforcement signal.
  • Distinguish the local eligibility trace from the analyzer's reinforcement signal.
  • Name neurotransmitter release probability as the hedonistic synapse's changing variable.

What do you think happens?

Which description best separates the eligibility trace from the critic-like analyzer?

  • The trace supplies reinforcement, while the analyzer stores synaptic eligibility.

  • The trace marks an earlier synaptic event, while the analyzer supplies a reinforcement-related signal.

  • The trace changes release probability, while the analyzer is the release event itself.

Reveal answer
Answer:

The trace marks an earlier synaptic event, while the analyzer supplies a reinforcement-related signal.

Miller's proposal gives the trace and the critic-like sensory analyzer different roles: local eligibility connects an earlier event to later credit, while the analyzer provides reinforcement signals to neurons.

The Mechanism in One Pass

  1. 1
    An earlier sensory or synaptic event occurs.
  2. 2
    A synaptically local contingent eligibility trace makes the relevant synapse temporarily eligible.
  3. 3
    Miller's critic-like sensory analyzer supplies a reinforcement signal to neurons.
  4. 4
    The later reinforcement signal can affect the synapse whose earlier activity left it eligible.
  5. 5
    In the hedonistic-synapse proposal, reward changes neurotransmitter release probability according to whether reward follows release or failure to release.
  6. 6
    Reward-modulated STDP and actor-critic methods, including the use of TD error, are connected by the same broad problem of assigning later reinforcement to earlier events.
Key point

The essential idea is delayed credit assignment: eligibility preserves a local connection to the past, and reinforcement supplies information about the later consequence.

Key Takeaways

  • Miller's 1981 Law-of-Effect-like rule used synaptically local contingent eligibility traces to connect earlier synaptic events with later reinforcement.
  • Miller's sensory analyzer had a critic-like role because it supplied reinforcement signals to neurons.
  • A hedonistic synapse changes neurotransmitter release probability according to whether reward follows release or failure to release.
  • Reward-modulated STDP and actor-critic methods are related to this historical work through the problem of linking past events with later reinforcement; actor-critic methods use TD error.
  • Bacterial chemotaxis is a metaphor for consequence-guided learning, not the neural learning mechanism itself.

Related concepts

More concepts starting with E