Temporal difference learning explained

Temporal difference (TD) learning refers to a class of model-free reinforcement learning methods which learn by bootstrapping from the current estimate of the value function. These methods sample from the environment, like Monte Carlo methods, and perform updates based on current estimates, like dynamic programming methods.

While Monte Carlo methods only adjust their estimates once the final outcome is known, TD methods adjust predictions to match later, more accurate, predictions about the future before the final outcome is known.[1] This is a form of bootstrapping, as illustrated with the following example:

Suppose you wish to predict the weather for Saturday, and you have some model that predicts Saturday's weather, given the weather of each day in the week. In the standard case, you would wait until Saturday and then adjust all your models. However, when it is, for example, Friday, you should have a pretty good idea of what the weather would be on Saturday – and thus be able to change, say, Saturday's model before Saturday arrives.

Temporal difference methods are related to the temporal difference model of animal learning.[2] [3] [4] [5] [6]

Mathematical formulation

The tabular TD(0) method is one of the simplest TD methods. It is a special case of more general stochastic approximation methods. It estimates the state value function of a finite-state Markov decision process (MDP) under a policy

\pi

. Let

V\pi

denote the state value function of the MDP with states

(St)t\inN

, rewards

(Rt)t\inN

and discount rate[7]

\gamma

under the policy

\pi

:

V\pi(s)=Ea

infty
\left\{\sum
t=0
tR
\gamma
t+1

|S0=s\right\}.

We drop the action from the notation for convenience.

V\pi

satisfies the Hamilton-Jacobi-Bellman Equation:
\pi(s)=E
V
\pi

\{R1+\gamma

\pi(S
V
1)|S

0=s\},

so

R1+\gamma

\pi(S
V
1)
is an unbiased estimate for

V\pi(s)

. This observation motivates the following algorithm for estimating

V\pi

.

The algorithm starts by initializing a table

V(s)

arbitrarily, with one value for each state of the MDP. A positive learning rate

\alpha

is chosen.

We then repeatedly evaluate the policy

\pi

, obtain a reward

r

and update the value function for the current state using the rule:

V(St)\leftarrow(1-\alpha)V(St)+\underbrace{\alpha}learningrate[\overbrace{Rt+1+\gammaV(St+1)}TheTDtarget]

where

St

and

St+1

are the current and next states, respectively. The value

Rt+1+\gammaV(St+1)

is known as the TD target, and

Rt+1+\gammaV(St+1)-V(St)

is known as the TD error.

TD-Lambda

TD-Lambda is a learning algorithm invented by Richard S. Sutton based on earlier work on temporal difference learning by Arthur Samuel. This algorithm was famously applied by Gerald Tesauro to create TD-Gammon, a program that learned to play the game of backgammon at the level of expert human players.

The lambda (

λ

) parameter refers to the trace decay parameter, with

0\leqslantλ\leqslant1

. Higher settings lead to longer lasting traces; that is, a larger proportion of credit from a reward can be given to more distant states and actions when

λ

is higher, with

λ=1

producing parallel learning to Monte Carlo RL algorithms.

In neuroscience

The TD algorithm has also received attention in the field of neuroscience. Researchers discovered that the firing rate of dopamine neurons in the ventral tegmental area (VTA) and substantia nigra (SNc) appear to mimic the error function in the algorithm.[2] The error function reports back the difference between the estimated reward at any given state or time step and the actual reward received. The larger the error function, the larger the difference between the expected and actual reward. When this is paired with a stimulus that accurately reflects a future reward, the error can be used to associate the stimulus with the future reward.

Dopamine cells appear to behave in a similar manner. In one experiment measurements of dopamine cells were made while training a monkey to associate a stimulus with the reward of juice.[8] Initially the dopamine cells increased firing rates when the monkey received juice, indicating a difference in expected and actual rewards. Over time this increase in firing back propagated to the earliest reliable stimulus for the reward. Once the monkey was fully trained, there was no increase in firing rate upon presentation of the predicted reward. Subsequently, the firing rate for the dopamine cells decreased below normal activation when the expected reward was not produced. This mimics closely how the error function in TD is used for reinforcement learning.

The relationship between the model and potential neurological function has produced research attempting to use TD to explain many aspects of behavioral research.[9] [10] It has also been used to study conditions such as schizophrenia or the consequences of pharmacological manipulations of dopamine on learning.[11]

See also

Notes

  1. Sutton . Richard S. . Learning to predict by the methods of temporal differences . Machine Learning . 1 August 1988 . 3 . 1 . 9–44 . 10.1007/BF00115009 . 207771194 . en . 1573-0565. free .
  2. Schultz, W, Dayan, P & Montague, PR.. 1997. A neural substrate of prediction and reward. Science. 275. 5306. 1593–1599. 10.1126/science.275.5306.1593. 9054347. 10.1.1.133.6176. 220093382 .
  3. Montague. P. R.. Dayan. P.. Sejnowski. T. J.. 1996-03-01. A framework for mesencephalic dopamine systems based on predictive Hebbian learning. The Journal of Neuroscience. 16. 5. 1936–1947. 0270-6474. 8774460. 6578666. 10.1523/JNEUROSCI.16-05-01936.1996.
  4. Montague. P.R.. Dayan. P.. Nowlan. S.J.. Pouget. A.. Sejnowski. T.J.. 1993. Using aperiodic reinforcement for directed self-organization. Advances in Neural Information Processing Systems. 5. 969–976.
  5. Montague. P. R.. Sejnowski. T. J.. 1994. The predictive brain: temporal coincidence and temporal order in synaptic learning mechanisms. Learning & Memory. 1. 1. 1–33. 10.1101/lm.1.1.1 . 1072-0502. 10467583. 44560099 . free.
  6. Book: Sejnowski. T.J.. Dayan. P.. Montague. P.R.. Proceedings of the eighth annual conference on Computational learning theory - COLT '95 . Predictive Hebbian learning . 1995. 15–18. 10.1145/225298.225300. 0897917235. 1709691 . free.
  7. Discount rate parameter allows for a time preference toward more immediate rewards, and away from distant future rewards
  8. Schultz, W. . 1998 . Predictive reward signal of dopamine neurons . Journal of Neurophysiology . 80 . 1 . 1–27. 10.1152/jn.1998.80.1.1 . 9658025 . 10.1.1.408.5994 . 52857162 .
  9. Dayan, P. . 2001 . Motivated reinforcement learning . Advances in Neural Information Processing Systems . 14 . 11–18 . MIT Press .
  10. Tobia, M. J., etc. . 2016 . Altered behavioral and neural responsiveness to counterfactual gains in the elderly . Cognitive, Affective, & Behavioral Neuroscience . 16 . 3 . 457–472. 10.3758/s13415-016-0406-7 . 26864879 . 11299945 . free .
  11. Smith, A., Li, M., Becker, S. and Kapur, S. . 2006 . Dopamine, prediction error, and associative learning: a model-based account . Network: Computation in Neural Systems . 17 . 1 . 61–84 . 10.1080/09548980500361624 . 16613795. 991839 .

Works cited

Further reading

External links