Template:Short description Template:Machine learning
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.Template:Sfnp
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.<ref name="RSutton-1988">Template:Cite journal</ref> 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.<ref name="RSutton-1988" />
Temporal difference methods are related to the temporal difference model of animal learning.<ref name="WSchultz-1997">Template:Cite journal</ref><ref name=":0">Template:Cite journal</ref><ref name=":1">Template:Cite journal</ref><ref name=":2">Template:Cite journal</ref><ref name=":3">Template:Cite book</ref>
Mathematical formulationEdit
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 <math>\pi</math>. Let <math>V^\pi</math> denote the state value function of the MDP with states <math>(S_t)_{t\in\mathbb{N}}</math>, rewards <math>(R_t)_{t\in\mathbb{N}}</math> and discount rate<ref>Discount rate parameter allows for a time preference toward more immediate rewards, and away from distant future rewards</ref> <math>\gamma</math> under the policy <math> \pi </math>:Template:Sfnp
- <math>V^\pi(s) = E_{a \sim \pi}\left\{\sum_{t=0}^\infty \gamma^tR_{t+1}\Bigg| S_0=s\right\}.
</math> We drop the action from the notation for convenience. <math>V^\pi</math> satisfies the Hamilton-Jacobi-Bellman Equation:
- <math>V^\pi(s)=E_{\pi}\{R_1 + \gamma V^\pi(S_1)|S_0=s\},</math>
so <math>R_1 + \gamma V^\pi(S_1)</math> is an unbiased estimate for <math>V^\pi(s)</math>. This observation motivates the following algorithm for estimating <math>V^\pi</math>.
The algorithm starts by initializing a table <math>V(s)</math> arbitrarily, with one value for each state of the MDP. A positive learning rate <math>\alpha</math> is chosen.
We then repeatedly evaluate the policy <math>\pi</math>, obtain a reward <math>r</math> and update the value function for the current state using the rule:Template:Sfnp
- <math> V(S_t) \leftarrow (1 - \alpha) V(S_t) + \underbrace{\alpha}_{\text{learning rate}} [ \overbrace{R_{t+1} + \gamma V(S_{t+1})}^{\text{The TD target}} ]</math>
where <math>S_t</math> and <math>S_{t+1}</math> are the current and next states, respectively. The value <math> R_{t+1} + \gamma V(S_{t+1})</math> is known as the TD target, and <math> R_{t+1} + \gamma V(S_{t+1}) - V(S_t)</math> is known as the TD error.
TD-LambdaEdit
TD-Lambda is a learning algorithm invented by Richard S. Sutton based on earlier work on temporal difference learning by Arthur Samuel.Template:Sfnp 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.Template:Sfnp
The lambda (<math>\lambda</math>) parameter refers to the trace decay parameter, with <math>0 \leqslant \lambda \leqslant 1</math>. 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 <math>\lambda</math> is higher, with <math>\lambda = 1</math> producing parallel learning to Monte Carlo RL algorithms.Template:Sfnp
In neuroscienceEdit
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.<ref name="WSchultz-1997"/><ref name=":0" /><ref name=":1" /><ref name=":2" /><ref name=":3" /> 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.<ref name="WSchultz-1998">Template:Cite journal</ref> 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.<ref name="PDayan-2001">Template:Cite journal</ref><ref>Template:Cite journal</ref> It has also been used to study conditions such as schizophrenia or the consequences of pharmacological manipulations of dopamine on learning.<ref name="ASmith-2006">Template:Cite journal</ref>
See alsoEdit
NotesEdit
<references/>
Works citedEdit
Further readingEdit
- Template:Cite book See final chapter and appendix.
- Template:Cite journal
External linksEdit
- Connect Four TDGravity Applet (+ mobile phone version) – self-learned using TD-Leaf method (combination of TD-Lambda with shallow tree search)
- Self Learning Meta-Tic-Tac-Toe Example web app showing how temporal difference learning can be used to learn state evaluation constants for a minimax AI playing a simple board game.
- Reinforcement Learning Problem, document explaining how temporal difference learning can be used to speed up Q-learning
- TD-Simulator Temporal difference simulator for classical conditioning