Part of a series on |
Machine learning anddata mining |
---|
Learning with humans |
Model diagnostics |
Reinforcement learning (RL) is an interdisciplinary area ofmachine learning andoptimal control concerned with how anintelligent agent shouldtake actions in a dynamic environment in order tomaximize a reward signal. Reinforcement learning is one of thethree basic machine learning paradigms, alongsidesupervised learning andunsupervised learning.
Reinforcement learning differs from supervised learning in not needing labelled input-output pairs to be presented, and in not needing sub-optimal actions to be explicitly corrected. Instead, the focus is on finding a balance between exploration (of uncharted territory) and exploitation (of current knowledge) with the goal of maximizing the cumulative reward (the feedback of which might be incomplete or delayed).[1] The search for this balance is known as theexploration–exploitation dilemma.
The environment is typically stated in the form of aMarkov decision process (MDP), as many reinforcement learning algorithms usedynamic programming techniques.[2] The main difference between classical dynamic programming methods and reinforcement learning algorithms is that the latter do not assume knowledge of an exact mathematical model of the Markov decision process, and they target large MDPs where exact methods become infeasible.[3]
Due to its generality, reinforcement learning is studied in many disciplines, such asgame theory,control theory,operations research,information theory,simulation-based optimization,multi-agent systems,swarm intelligence, andstatistics. In the operations research and control literature, RL is calledapproximate dynamic programming, orneuro-dynamic programming. The problems of interest in RL have also been studied in thetheory of optimal control, which is concerned mostly with the existence and characterization of optimal solutions, and algorithms for their exact computation, and less with learning or approximation (particularly in the absence of a mathematical model of the environment).
Basic reinforcement learning is modeled as aMarkov decision process:
The purpose of reinforcement learning is for the agent to learn an optimal (or near-optimal) policy that maximizes the reward function or other user-provided reinforcement signal that accumulates from immediate rewards. This is similar toprocesses that appear to occur in animal psychology. For example, biological brains are hardwired to interpret signals such as pain and hunger as negative reinforcements, and interpret pleasure and food intake as positive reinforcements. In some circumstances, animals learn to adopt behaviors that optimize these rewards. This suggests that animals are capable of reinforcement learning.[4][5]
A basic reinforcement learning agent interacts with its environment in discrete time steps. At each time stept, the agent receives the current state and reward. It then chooses an action from the set of available actions, which is subsequently sent to the environment. The environment moves to a new state and the reward associated with thetransition is determined. The goal of a reinforcement learning agent is to learn apolicy:
,
that maximizes the expected cumulative reward.
Formulating the problem as a Markov decision process assumes the agent directly observes the current environmental state; in this case, the problem is said to havefull observability. If the agent only has access to a subset of states, or if the observed states are corrupted by noise, the agent is said to havepartial observability, and formally the problem must be formulated as apartially observable Markov decision process. In both cases, the set of actions available to the agent can be restricted. For example, the state of an account balance could be restricted to be positive; if the current value of the state is 3 and the state transition attempts to reduce the value by 4, the transition will not be allowed.
When the agent's performance is compared to that of an agent that acts optimally, the difference in performance yields the notion ofregret. In order to act near optimally, the agent must reason about long-term consequences of its actions (i.e., maximize future rewards), although the immediate reward associated with this might be negative.
Thus, reinforcement learning is particularly well-suited to problems that include a long-term versus short-term reward trade-off. It has been applied successfully to various problems, includingenergy storage,[6]robot control,[7]photovoltaic generators,[8]backgammon,checkers,[9]Go (AlphaGo), andautonomous driving systems.[10]
Two elements make reinforcement learning powerful: the use of samples to optimize performance, and the use offunction approximation to deal with large environments. Thanks to these two key components, RL can be used in large environments in the following situations:
The first two of these problems could be considered planning problems (since some form of model is available), while the last one could be considered to be a genuine learning problem. However, reinforcement learning converts both planning problems tomachine learning problems.
The exploration vs. exploitation trade-off has been most thoroughly studied through themulti-armed bandit problem and for finite state space Markov decision processes in Burnetas and Katehakis (1997).[12]
Reinforcement learning requires clever exploration mechanisms; randomly selecting actions, without reference to an estimated probability distribution, shows poor performance. The case of (small) finite Markov decision processes is relatively well understood. However, due to the lack of algorithms that scale well with the number of states (or scale to problems with infinite state spaces), simple exploration methods are the most practical.
One such method is-greedy, where is a parameter controlling the amount of exploration vs. exploitation. With probability, exploitation is chosen, and the agent chooses the action that it believes has the best long-term effect (ties between actions are broken uniformly at random). Alternatively, with probability, exploration is chosen, and the action is chosen uniformly at random. is usually a fixed parameter but can be adjusted either according to a schedule (making the agent explore progressively less), or adaptively based on heuristics.[13]
Even if the issue of exploration is disregarded and even if the state was observable (assumed hereafter), the problem remains to use past experience to find out which actions lead to higher cumulative rewards.
The agent's action selection is modeled as a map calledpolicy:
The policy map gives the probability of taking action when in state.[14]: 61 There are also deterministic policies for which denotes the action that should be played at state.
The state-value function is defined as,expected discounted return starting with state, i.e., and successively following policy. Hence, roughly speaking, the value function estimates "how good" it is to be in a given state.[14]: 60
where the random variable denotes thediscounted return, and is defined as the sum of future discounted rewards:
where is the reward for transitioning from state to, is thediscount rate. is less than 1, so rewards in the distant future are weighted less than rewards in the immediate future.
The algorithm must find a policy with maximum expected discounted return. From the theory of Markov decision processes it is known that, without loss of generality, the search can be restricted to the set of so-calledstationary policies. A policy isstationary if the action-distribution returned by it depends only on the last state visited (from the observation agent's history). The search can be further restricted todeterministic stationary policies. Adeterministic stationary policy deterministically selects actions based on the current state. Since any such policy can be identified with a mapping from the set of states to the set of actions, these policies can be identified with such mappings with no loss of generality.
Thebrute force approach entails two steps:
One problem with this is that the number of policies can be large, or even infinite. Another is that the variance of the returns may be large, which requires many samples to accurately estimate the discounted return of each policy.
These problems can be ameliorated if we assume some structure and allow samples generated from one policy to influence the estimates made for others. The two main approaches for achieving this arevalue function estimation anddirect policy search.
Value function approaches attempt to find a policy that maximizes the discounted return by maintaining a set of estimates of expected discounted returns for some policy (usually either the "current" [on-policy] or the optimal [off-policy] one).
These methods rely on the theory of Markov decision processes, where optimality is defined in a sense stronger than the one above: A policy is optimal if it achieves the best-expected discounted return fromany initial state (i.e., initial distributions play no role in this definition). Again, an optimal policy can always be found among stationary policies.
To define optimality in a formal manner, define the state-value of a policy by
where stands for the discounted return associated with following from the initial state. Defining as the maximum possible state-value of, where is allowed to change,
A policy that achieves these optimal state-values in each state is calledoptimal. Clearly, a policy that is optimal in this sense is also optimal in the sense that it maximizes the expected discounted return, since, where is a state randomly sampled from the distribution of initial states (so).
Although state-values suffice to define optimality, it is useful to define action-values. Given a state, an action and a policy, the action-value of the pair under is defined by
where now stands for the random discounted return associated with first taking action in state and following, thereafter.
The theory of Markov decision processes states that if is an optimal policy, we act optimally (take the optimal action) by choosing the action from with the highest action-value at each state,. Theaction-value function of such an optimal policy () is called theoptimal action-value function and is commonly denoted by. In summary, the knowledge of the optimal action-value function alone suffices to know how to act optimally.
Assuming full knowledge of the Markov decision process, the two basic approaches to compute the optimal action-value function arevalue iteration andpolicy iteration. Both algorithms compute a sequence of functions () that converge to. Computing these functions involves computing expectations over the whole state-space, which is impractical for all but the smallest (finite) Markov decision processes. In reinforcement learning methods, expectations are approximated by averaging over samples and using function approximation techniques to cope with the need to represent value functions over large state-action spaces.
Monte Carlo methods[15] are used to solve reinforcement learning problems by averaging sample returns. Unlike methods that require full knowledge of the environment's dynamics, Monte Carlo methods rely solely on actual orsimulated experience—sequences of states, actions, and rewards obtained from interaction with an environment. This makes them applicable in situations where the complete dynamics are unknown. Learning from actual experience does not require prior knowledge of the environment and can still lead to optimal behavior. When using simulated experience, only a model capable of generating sample transitions is required, rather than a full specification oftransition probabilities, which is necessary fordynamic programming methods.
Monte Carlo methods apply to episodic tasks, where experience is divided into episodes that eventually terminate. Policy and value function updates occur only after the completion of an episode, making these methods incremental on an episode-by-episode basis, though not on a step-by-step (online) basis. The term "Monte Carlo" generally refers to any method involvingrandom sampling; however, in this context, it specifically refers to methods that compute averages fromcomplete returns, rather thanpartial returns.
These methods function similarly to thebandit algorithms, in which returns are averaged for each state-action pair. The key difference is that actions taken in one state affect the returns of subsequent states within the same episode, making the problemnon-stationary. To address this non-stationarity, Monte Carlo methods use the framework of general policy iteration (GPI). While dynamic programming computesvalue functions using full knowledge of theMarkov decision process (MDP), Monte Carlo methods learn these functions through sample returns. The value functions and policies interact similarly to dynamic programming to achieveoptimality, first addressing the prediction problem and then extending to policy improvement and control, all based on sampled experience.[14]
The first problem is corrected by allowing the procedure to change the policy (at some or all states) before the values settle. This too may be problematic as it might prevent convergence. Most current algorithms do this, giving rise to the class ofgeneralized policy iteration algorithms. Manyactor-critic methods belong to this category.
The second issue can be corrected by allowing trajectories to contribute to any state-action pair in them. This may also help to some extent with the third problem, although a better solution when returns have high variance is Sutton'stemporal difference (TD) methods that are based on the recursiveBellman equation.[16][17] The computation in TD methods can be incremental (when after each transition the memory is changed and the transition is thrown away), or batch (when the transitions are batched and the estimates are computed once based on the batch). Batch methods, such as the least-squares temporal difference method,[18] may use the information in the samples better, while incremental methods are the only choice when batch methods are infeasible due to their high computational or memory complexity. Some methods try to combine the two approaches. Methods based on temporal differences also overcome the fourth issue.
Another problem specific to TD comes from their reliance on the recursive Bellman equation. Most TD methods have a so-called parameter that can continuously interpolate between Monte Carlo methods that do not rely on the Bellman equations and the basic TD methods that rely entirely on the Bellman equations. This can be effective in palliating this issue.
In order to address the fifth issue,function approximation methods are used.Linear function approximation starts with a mapping that assigns a finite-dimensional vector to each state-action pair. Then, the action values of a state-action pair are obtained by linearly combining the components of with someweights:
The algorithms then adjust the weights, instead of adjusting the values associated with the individual state-action pairs. Methods based on ideas fromnonparametric statistics (which can be seen to construct their own features) have been explored.
Value iteration can also be used as a starting point, giving rise to theQ-learning algorithm and its many variants.[19] Including Deep Q-learning methods when a neural network is used to represent Q, with various applications in stochastic search problems.[20]
The problem with using action-values is that they may need highly precise estimates of the competing action values that can be hard to obtain when the returns are noisy, though this problem is mitigated to some extent by temporal difference methods. Using the so-called compatible function approximation method compromises generality and efficiency.
An alternative method is to search directly in (some subset of) the policy space, in which case the problem becomes a case ofstochastic optimization. The two approaches available are gradient-based and gradient-free methods.
Gradient-based methods (policy gradient methods) start with a mapping from a finite-dimensional (parameter) space to the space of policies: given the parameter vector, let denote the policy associated to. Defining the performance function by under mild conditions this function will be differentiable as a function of the parameter vector. If the gradient of was known, one could usegradient ascent. Since an analytic expression for the gradient is not available, only a noisy estimate is available. Such an estimate can be constructed in many ways, giving rise to algorithms such as Williams's REINFORCE method[21] (which is known as the likelihood ratio method in thesimulation-based optimization literature).[22]
A large class of methods avoids relying on gradient information. These includesimulated annealing,cross-entropy search or methods ofevolutionary computation. Many gradient-free methods can achieve (in theory and in the limit) a global optimum.
Policy search methods may converge slowly given noisy data. For example, this happens in episodic problems when the trajectories are long and the variance of the returns is large. Value-function based methods that rely on temporal differences might help in this case. In recent years,actor–critic methods have been proposed and performed well on various problems.[23]
Policy search methods have been used in therobotics context.[24] Many policy search methods may get stuck in local optima (as they are based onlocal search).
Finally, all of the above methods can be combined with algorithms that first learn a model of theMarkov decision process, the probability of each next state given an action taken from an existing state. For instance, the Dyna algorithm learns a model from experience, and uses that to provide more modelled transitions for a value function, in addition to the real transitions.[25] Such methods can sometimes be extended to use of non-parametric models, such as when the transitions are simply stored and "replayed" to the learning algorithm.[26]
Model-based methods can be more computationally intensive than model-free approaches, and their utility can be limited by the extent to which the Markov decision process can be learnt.[27]
There are other ways to use models than to update a value function.[28] For instance, inmodel predictive control the model is used to update the behavior directly.
Both the asymptotic and finite-sample behaviors of most algorithms are well understood. Algorithms with provably good online performance (addressing the exploration issue) are known.
Efficient exploration of Markov decision processes is given in Burnetas and Katehakis (1997).[12] Finite-time performance bounds have also appeared for many algorithms, but these bounds are expected to be rather loose and thus more work is needed to better understand the relative advantages and limitations.
For incremental algorithms, asymptotic convergence issues have been settled.[clarification needed] Temporal-difference-based algorithms converge under a wider set of conditions than was previously possible (for example, when used with arbitrary, smooth function approximation).
This sectionneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources in this section. Unsourced material may be challenged and removed.(October 2022) (Learn how and when to remove this message) |
Research topics include:
The following table lists the key algorithms for learning a policy depending on several criteria:
Algorithm | Description | Policy | Action space | State space | Operator |
---|---|---|---|---|---|
Monte Carlo | Every visit to Monte Carlo | Either | Discrete | Discrete | Sample-means of state-values or action-values |
TD learning | State–action–reward–state | Off-policy | Discrete | Discrete | State-value |
Q-learning | State–action–reward–state | Off-policy | Discrete | Discrete | Action-value |
SARSA | State–action–reward–state–action | On-policy | Discrete | Discrete | Action-value |
DQN | Deep Q Network | Off-policy | Discrete | Continuous | Action-value |
DDPG | Deep Deterministic Policy Gradient | Off-policy | Continuous | Continuous | Action-value |
A3C | Asynchronous Advantage Actor-Critic Algorithm | On-policy | Discrete | Continuous | Advantage (=action-value - state-value) |
TRPO | Trust Region Policy Optimization | On-policy | Continuous or Discrete | Continuous | Advantage |
PPO | Proximal Policy Optimization | On-policy | Continuous or Discrete | Continuous | Advantage |
TD3 | Twin Delayed Deep Deterministic Policy Gradient | Off-policy | Continuous | Continuous | Action-value |
SAC | Soft Actor-Critic | Off-policy | Continuous | Continuous | Advantage |
DSAC[44][45][46] | Distributional Soft Actor Critic | Off-policy | Continuous | Continuous | Action-value distribution |
Associative reinforcement learning tasks combine facets of stochastic learning automata tasks and supervised learning pattern classification tasks. In associative reinforcement learning tasks, the learning system interacts in a closed loop with its environment.[47]
This approach extends reinforcement learning by using a deep neural network and without explicitly designing the state space.[48] The work on learning ATARI games by GoogleDeepMind increased attention todeep reinforcement learning orend-to-end reinforcement learning.[49]
Adversarial deep reinforcement learning is an active area of research in reinforcement learning focusing on vulnerabilities of learned policies. In this research area some studies initially showed that reinforcement learning policies are susceptible to imperceptible adversarial manipulations.[50][51][52] While some methods have been proposed to overcome these susceptibilities, in the most recent studies it has been shown that these proposed solutions are far from providing an accurate representation of current vulnerabilities of deep reinforcement learning policies.[53]
By introducingfuzzy inference in reinforcement learning,[54] approximating the state-action value function withfuzzy rules in continuous space becomes possible. The IF - THEN form of fuzzy rules make this approach suitable for expressing the results in a form close to natural language. Extending FRL with Fuzzy Rule Interpolation[55] allows the use of reduced size sparse fuzzy rule-bases to emphasize cardinal rules (most important state-action values).
In inverse reinforcement learning (IRL), no reward function is given. Instead, the reward function is inferred given an observed behavior from an expert. The idea is to mimic observed behavior, which is often optimal or close to optimal.[56] One popular IRL paradigm is named maximum entropy inverse reinforcement learning (MaxEnt IRL).[57] MaxEnt IRL estimates the parameters of a linear model of the reward function by maximizing the entropy of the probability distribution of observed trajectories subject to constraints related to matching expected feature counts. Recently it has been shown that MaxEnt IRL is a particular case of a more general framework named random utility inverse reinforcement learning (RU-IRL).[58] RU-IRL is based onrandom utility theory and Markov decision processes. While prior IRL approaches assume that the apparent random behavior of an observed agent is due to it following a random policy, RU-IRL assumes that the observed agent follows a deterministic policy but randomness in observed behavior is due to the fact that an observer only has partial access to the features the observed agent uses in decision making. The utility function is modeled as a random variable to account for the ignorance of the observer regarding the features the observed agent actually considers in its utility function.
Multi-objective reinforcement learning (MORL) is a form of reinforcement learning concerned with conflicting alternatives. It is distinct from multi-objective optimization in that it is concerned with agents acting in environments.[59][60]
Safe reinforcement learning (SRL) can be defined as the process of learning policies that maximize the expectation of the return in problems in which it is important to ensure reasonable system performance and/or respect safety constraints during the learning and/or deployment processes.[61] An alternative approach is risk-averse reinforcement learning, where instead of theexpected return, arisk-measure of the return is optimized, such as theconditional value at risk (CVaR).[62] In addition to mitigating risk, the CVaR objective increases robustness to model uncertainties.[63][64] However, CVaR optimization in risk-averse RL requires special care, to prevent gradient bias[65] and blindness to success.[66]
Self-reinforcement learning (or self-learning), is a learning paradigm which does not use the concept of immediate reward after transition from to with action. It does not use an external reinforcement, it only uses the agent internal self-reinforcement. The internal self-reinforcement is provided by mechanism of feelings and emotions. In the learning process emotions are backpropagated by a mechanism of secondary reinforcement. The learning equation does not include the immediate reward, it only includes the state evaluation.
The self-reinforcement algorithm updates a memory matrix such that in each iteration executes the following machine learning routine:
Initial conditions of the memory are received as input from the genetic environment. It is a system with only one input (situation), and only one output (action, or behavior).
Self-reinforcement (self-learning) was introduced in 1982 along with a neural network capable of self-reinforcement learning, named Crossbar Adaptive Array (CAA).[67][68] The CAA computes, in a crossbar fashion, both decisions about actions and emotions (feelings) about consequence states. The system is driven by the interaction between cognition and emotion.[69]
Efficient comparison of RL algorithms is essential for research, deployment and monitoring of RL systems. To compare different algorithms on a given environment, an agent can be trained for each algorithm. Since the performance is sensitive to implementation details, all algorithms should be implemented as closely as possible to each other.[70] After the training is finished, the agents can be run on a sample of test episodes, and their scores (returns) can be compared. Since episodes are typically assumed to bei.i.d, standard statistical tools can be used for hypothesis testing, such asT-test andpermutation test.[71] This requires to accumulate all the rewards within an episode into a single number—the episodic return. However, this causes a loss of information, as different time-steps are averaged together, possibly with different levels of noise. Whenever the noise level varies across the episode, the statistical power can be improved significantly, by weighting the rewards according to their estimated noise.[72]
{{cite book}}
: CS1 maint: location missing publisher (link)