Concepts / Nonstationary k-armed Bandit Task

Nonstationary k-armed Bandit Task

Associative search requires both discovering good actions and linking them to the situations where they work.

  • Programming

A Moving Target

Suppose a learner repeatedly chooses among several actions and receives an immediate reward after each choice. If the task is not always the same, an action that worked well a moment ago may no longer be the best choice. The learner is facing a moving target: the true action values can change randomly from step to step.

values changevalues changeStep 1Action A bestStep 2Action B bestStep 3Action C best
How do changing true action values make an old estimate misleading?

Associative Search

Associative search combines two jobs. First, the learner must discover which actions tend to produce good outcomes. Second, the learner must connect those actions to the situations in which they work. The connection is learned through trial and error rather than being supplied in advance.

A situation clue changes what the learner can remember and use. Without a clue, rewards from different tasks may look as though they came from one undifferentiated changing task. With a clue, the learner can distinguish the current situation and use experience from that situation when it appears again.

guides choiceguides choiceSituation clue Arecognized situationAction 1worked in situation ASituation clue Brecognized situationAction 2worked in situation B
How does a situation clue map the learner to an action that has worked in that situation?

Separating Two Situations

Imagine that one bandit task is signaled by a red clue and another is signaled by a green clue. The clues identify the current situation but do not reveal the action values.

Without clues: The learner receives outcomes from both tasks but has no information identifying which task is active. The observations therefore look like evidence from one changing task.

With clues: The learner can keep the red-situation experience conceptually separate from the green-situation experience and connect each recognized situation with an action that has worked there.

What the clue does not do: The clue identifies the situation; it does not reveal which action has the highest value. That action still has to be discovered through trial and error.

The clue makes it possible to learn a situation-dependent policy rather than treating every changing reward as coming from one undifferentiated task.

From Feedback to Choice

The learning cycle is feedback-driven. The learner observes the current situation, selects an action, receives an immediate reward, and uses that outcome to improve its action-value information for future choices. When a situation clue is available, the relevant experience is tied to that situation instead of being pooled with every other situation.

conditionsproducesupdatesinfluences next choiceCurrent situationclue if availableAction choicetrial and errorImmediate rewardoutcomeAction-value estimateupdated experience
How does immediate reward feedback influence later action choices?

Three Learning Problems

Problem typeSituation informationEffect of an actionMain learning requirement
Basic k-armed banditNo distinguishing situation clue in the described taskAffects only the immediate rewardDiscover which action currently gives better rewards
Associative searchA clue identifies the current situationAffects only the immediate reward in the described versionDiscover good actions and associate them with the situations where they work
Full reinforcement learningSituations are part of the problemActions also determine the next situationLearn action choices while accounting for how actions affect later situations and consequences

Associative search sits between the other two cases. It goes beyond a basic k-armed bandit because the learner must condition its action on the current situation. It remains simpler than full reinforcement learning because, in the version described here, an action affects only the immediate reward and does not also determine the next situation.

adds situation conditioningadds next-situation effectsk-armed banditaction to immediate rewardAssociative searchsituation and action torewardFull reinforcementlearningaction also affects nextsituation
What differs among a bandit with no situations, associative search with situation-action mappings, and full reinforcement learning?

Why Fast Change Hurts

A nonstationary method is not automatically effective at every rate of change. If the true action values change rapidly, an estimate based on earlier feedback can become misleading before the learner has enough time to use it. The learner is then trying to learn from evidence about a target that has already moved.

An Estimate That Ages Quickly

Consider a learner that has repeatedly found Action A useful. The true action values then change rapidly, and Action B becomes better.

Past experience: The learner's experience supports Action A because that action worked well earlier.

The task changes: The true action values change, so Action A is no longer necessarily the best choice.

The old estimate misleads: If the learner relies too heavily on earlier observations, it may continue favoring Action A even though the current situation favors another action.

Rapid nonstationarity makes learning difficult because useful past evidence becomes outdated quickly.

  • Assuming that a situation clue reveals the best action.

    The clue identifies the current situation but does not reveal the action values.

    Fix: Use the clue to select the relevant situation-specific experience, then continue discovering effective actions through trial and error.

  • Treating associative search as an ordinary stationary bandit.

    The learner should connect actions with the situations where they work.

    Fix: Condition the action choice on the recognized situation.

  • Calling every changing bandit problem full reinforcement learning.

    In the described associative version, actions affect only immediate rewards and not the next situation.

    Fix: Reserve the full reinforcement learning comparison for problems in which actions also determine the next situation.

  • Assuming that handling nonstationarity guarantees good performance under rapid change.

    Rapid change can make learned estimates outdated before they are useful.

    Fix: Treat the rate of change as a separate difficulty from identifying the current situation.

Check Your Model

MEDIUM

A learner receives a distinctive clue for each currently active bandit task. The clue identifies the task, but the action values can still change rapidly. Explain what problem the clue solves, what problem remains, and why this task is associative search rather than full reinforcement learning.

Hints
  • Separate identifying the current situation from estimating action values.
  • Ask whether an action changes only the immediate reward or also the next situation.
  • Mention the role of trial and error in learning the situation-action association.

What do you think happens?

If two different bandit tasks produce changing rewards but no clue identifies which task is active, should the learner treat their observations as separate situation-specific experiences?

  • Yes, because the learner can always infer the task from the reward
  • No, the observations look like one undifferentiated changing task
  • Yes, because changing rewards automatically identify the situation
Reveal answer

Answer: No, the observations look like one undifferentiated changing task.

Without a distinguishing clue, the learner has no information that separates the tasks. With a clue, it can associate experience with the recognized situation.

Key Takeaways

  1. Associative search requires discovering effective actions and linking them to the situations where they work.
  2. A distinguishing clue lets the learner separate experience from different bandit tasks and learn a situation-dependent policy.
  3. The described task remains bandit-like because actions affect only immediate rewards, unlike full reinforcement learning where actions also determine the next situation.
  4. Rapid changes in true action values can make earlier estimates misleading.
  5. A situation clue addresses task identification; it does not by itself solve rapid nonstationarity.

Key Takeaways

  • Associative search combines trial-and-error action discovery with situation-action association.
  • Situation clues prevent experience from different tasks from being treated as one undifferentiated changing task.
  • Associative search is more structured than a basic k-armed bandit but simpler than full reinforcement learning.
  • Rapidly changing action values make old estimates unreliable, even when a learner is designed for nonstationary tasks.