Patent Description:
In a reinforcement learning system, an agent interacts with an environment by performing actions that are selected by the reinforcement learning system in response to receiving observations that characterize the current state of the environment.

Some reinforcement learning systems select the action to be performed by the agent in response to receiving a given observation in accordance with an output of a neural network.

Some neural networks are deep neural networks that include one or more hidden layers in addition to an output layer.

This specification generally describes a reinforcement learning system that selects actions to be performed by a reinforcement learning agent interacting with an environment. In order for the agent to interact with the environment, the system receives data characterizing the current state of the environment and selects an action to be performed by the agent in response to the received data. Data characterizing a state of the environment will be referred to in this specification as an observation.

In some implementations, not covered by the claims, the environment is a simulated environment and the agent is implemented as one or more computer programs interacting with the simulated environment. For example, the simulated environment may be a video game and the agent may be a simulated user playing the video game. As another example, the simulated environment may be a motion simulation environment, e.g., a driving simulation or a flight simulation, and the agent is a simulated vehicle navigating through the motion simulation. In these implementations, the actions may be control inputs to control the simulated user or simulated vehicle.

The environment is a real-world environment and the agent is a mechanical agent interacting with the real-world environment. For example, the agent may be a robot interacting with the environment to accomplish a specific task. As another example, the agent may be an autonomous or semi-autonomous vehicle navigating through the environment. In these implementations, the actions may be control inputs to control the robot or the autonomous vehicle.

The invention is defined in the independent claims <NUM>, <NUM> and <NUM>. Preferred embodiments are defined in the remaining, dependent, claims.

On <NPL>) disclosed learning intrinsic rewards for policy-gradient based reinforcement learning agents, by iteratively and simultaneously updating policy parameters and intrinsic reward parameters, using the chain rule to compute gradients.

The embodiments described herein apply meta-learning (and in particular, meta-gradient reinforcement learning) to learn an optimum return function G so that the training of the system is improved. This provides a more effective and efficient means of training a reinforcement learning system as the system is able to converge on an optimum set of one or more policy parameters θ more quickly by training the return function G as it goes. In particular, the return function G is made dependent on the one or more policy parameters θ and a meta-objective function J' is used that is differentiated with respect to the one or more return parameters η to improve the training of the return function G.

Meta-learning can be considered the act of training a system to learn more effectively. The meta-objective J' can therefore be considered an objective to improve learning functionality of the reinforcement learning neural network. Specifically, the meta-objective function J' is a function for optimizing the return parameters η for the reinforcement learning neural network. The meta-objective function J' serves the goal of identifying the return function that maximises overall performance in the agent. This is directly measured by a meta-objective focused exclusively on optimising returns - in other words, a policy gradient objective. For instance, the meta-objective function may calculate the error (e.g. mean-squared error) between the return function and the value function utilised by the agent to determine actions, and the system may be configured to update the return parameters to reduce (e.g. minimise) the error.

Retrieving the experiences τ comprises the system generating the experiences (i.e. the reinforcement learning neural network may form part of the system) or accessing the experiences, e.g. from storage or from an external system. That is, the experiences may be generated online by the reinforcement learning system itself or may be obtained from an external reinforcement learning neural network. Updating the policy parameters θ could therefore comprise sending the updated policy parameters θ' to the external reinforcement neural network or updating the reinforcement neural network that forms part of the overall system.

A variety of different types of return function G may be utilised based on a variety of different types of reinforcement learning. For instance, the return function G may be a return function in a stochastic gradient ascent method or could act as a target in a Q-learning method.

The first and second sets of experiences may be the same. Alternatively, the first and second sets of experiences may comprise different experiences. Using different experiences for updating the one or more return parameters to those used for updating the one or more policy parameters (holding back training data for use in training the return function) improves the training by avoiding overfitting.

Updating the one or more return parameters utilizes a differential of the one or more updated policy parameters with respect to the one or more return parameters. The differential of the meta-objective function J' with respect to the one or more return parameters η makes use of partial derivatives, breaking the differential into two components, the first component being a differential of the meta-objective function J' with respect to the one or more updated policy parameters θ', and the second component being a differential of the one or more updated policy parameters θ' with respect to the one or more return parameters η. This therefore allows the system to make use of the updated (improved) policy parameters θ' when updating the one or more return parameters η and thereby improves the effectiveness of the training.

The one or more policy parameters define the functioning of the reinforcement learning neural network (one or more parameters that define the actions taken by the neural network). The one or more return parameters define how returns are determined based on the rewards.

The one or more processors are further configured to iteratively: retrieve updated experiences generated by the reinforcement neural network using the one or more updated policy parameters and the one or more updated return parameters; further update the one or more policy parameters based on a first set of the updated experiences using the one or more updated return parameters; and further update the one or more return parameters based on the further updated policy parameters and a second set of the updated experiences via the gradient ascent or descent method, until an end condition is reached.

Accordingly, the system iteratively updates the one or more policy parameters and the one or more return parameters to converge on an optimal policy. By updating the one or more return parameters during the training of the one or more policy parameters, the system is able to improve the calculated returns and can therefore train the policy more accurately and using fewer training episodes (more efficiently).

The one or more return parameters may be updated each time that the policy parameters are updated. This provides a computationally simpler and more efficient mechanism for training the system.

Alternatively, the one or more return parameters may be kept fixed over a number of updates of the one or more policy parameters. In this case, the one or more return parameters may then be updated through backpropagation through time.

Updating the one or more return parameters comprises applying a further return function as part of the meta-objective function and evaluating the updated policy in terms of the returns from the further return function when applied to the second set of experiences. This comprises the goal of maximizing the total returns from the further return function with respect to the one or more return parameters. The further return function G' is a function that calculates returns from rewards based on one or more further return parameters η'. The further return function is considered a meta-return function with meta-return parameters (or, more generally, meta-parameters). The further return function acts as a means of training the reinforcement learning neural network to improve the return function G. The further return function may be different to the return function. The further return parameters are kept fixed during training.

Updating of the one or more policy parameters may apply one or more of a policy and a value function that are conditioned on the one or more return parameters. Conditioning the policy and/or the value function based on the one or more return parameters makes the training method more stable. As the return function changes during training, the policy or value function may become invalid. This may lead to the collapse of the value estimation policy. By conditioning the policy and/or the value function on the one or more return parameters, the agent is enforced to learn universal policies and/or value functions for various sets of return parameters. This allows the method to freely shift the meta-parameters without needing to wait for the approximator to "catch up".

The conditioning may be via an embedding of the one or more return parameters. The embedding may form one or more embedded return parameters by inputting the one or more parameters into an embedding function. The one or more embedded return parameters may represent the one or more parameters using hidden (latent) variables. Specifically, the policy and value function may be conditioned as: <MAT> where:.

The one or more parameters consist of at least one of a discount factor of the return function and a bootstrapping factor of the return function. The return function may apply the discount factor γ to provide a discounted return. This discounted return may comprise a weighted sum of the rewards, with the discount factor defining the decay of the weighted sum. Optimising the discount factor has been found to be a particularly effective method of improving the efficiency and accuracy of reinforcement learning. Equally, the return function might apply the bootstrapping factor λ to a geometrically weighted combination of returns (a bootstrapping parameter return function, or λ-return). The return function may calculate a weighted combination of returns, with each return being estimated over multiple steps (e.g. being a decaying weighted sum of rewards). Optimising the bootstrapping factor (potentially in combination with the discount factor) leads to more efficient and accurate reinforcement learning.

The one or more processors may be further configured to: update the one or more policy parameters for the reinforcement learning neural network based on the second set of the experiences; and update the one or more return parameters of the return function based on the one or more updated policy parameters and the first set of the experiences, wherein the one or more return parameters are updated via the gradient ascent or descent method. This improves the efficiency and effectiveness of training by repeating the update steps but swapping over the sets of experiences that are used for each update. As mentioned above, using different sets of experiences avoids overfitting. Nevertheless, this reduces the amount of training data that may be used for each update. To improve data efficiency, the first and second sets can be swapped over after the updates, so that the second set experiences can then be used to train the policy and the second set of experiences can then be used to train the return function.

That is, the first set of experiences is used for updating the one or more policy parameters and the performance of this is validated by evaluating the meta-objective function using the second set of experiences. The roles of the first and second sets of experiences can then be swapped so that the second set of experiences are used for updating the one or more policy parameters and the performance of this update can be validated by evaluating the meta-objective function on the first set of experiences. In this way, the proposed method does not require any extra data other than the data used to train the one or more policy parameters in order to conduct the meta learning update to the one or more return parameters.

The differentiated meta-objective function is: <MAT> where:.

The above formula is the equivalent of formula (<NUM>) described later in this specification.

The system may be configured to calculate the differentiated meta-objective function based on a differential of the updated policy parameters θ' with respect to the return parameters η, dθ'/dη, calculated by adding a differential of an update function with respect to the return parameters, df(τ, θ, η)/dη, the update function being for updating the policy, to a differential of the policy parameters θ with respect to the return parameters η, dθ/dη.

The differential of the updated policy parameters θ' with respect to the return parameters η, dθ'/dη, may be calculated using an accumulative trace to ≈ dθ/dη such that: <MAT> where:.

The differential of the update function with respect to the return parameters, may be calculated via: <MAT> where:.

In other words, the differential of the updated policy parameters with respect to the return parameters may be calculated via: <MAT>.

The updating of the one or more return parameters may make use of: <MAT> where:.

This evaluates the updated policy in terms of the total returns under η' when measured on the second set of experiences τ'.

The one or more further return parameters are kept fixed. This allows the gradient with respect to the one or more return parameters to be obtained.

Updating the one or more return parameters may comprises calculating: <MAT> where.

The above formula is the equivalent of formulas (<NUM>) to (<NUM>) described later in this specification.

Accordingly, the updating of the one or more return parameters applies a gradient ascent method based on the gradient of the meta-objective function with respect to the one or more return parameters.

The subject matter described in this specification can be implemented in particular embodiments so as to realize one or more of the following advantages.

Implementations of the system facilitate improved training of reinforcement learning systems by applying meta-learning to train the reward functions of reinforcement learning systems. The methods described herein utilise a meta-objective function that is dependent on the one or more policy parameters of the system being trained. The meta-objective function is differentiated to obtain a meta-gradient is used to adapt the nature of the return, online, whilst interacting and learning from the environment.

More specifically, the update to the return function is applied after the one or more policy parameters have been updated. The gradient of the policy parameters with respect to the one or more return parameters indicates how the meta-parameters affect the policy parameter(s). The method is therefore able to measure the performance of the updated policy parameter(s) on a second sample of experiences to improve the parameter(s) of the return function.

This provides improved performance of the system when trained and allows the system to be trained more efficiently using a smaller amount of training data. For instance, by learning an improved return function as the system trains, the system is able to converge on an optimal set of policy parameters quicker, using fewer updates. As improved rewards are used during training, the final trained system is also displays more accurate and effective learned behaviours.

Implementations of the system may be trained online, on a stream of data, or offline, using stored data, or both. The system can automatically adapt its training to particular training tasks, learning to perform these tasks better. This helps to automate the training process and enables implementations of the system to be used across a wider range of different tasks without necessarily needing to be tuned or adapted to a particular task. The proposed approach is adaptable for use with almost all current reinforcement learning systems, since the return is always utilized in agent updates and almost all current reinforcement learning updates include differentiable functions of the return. This includes, for instance, value-based methods like Q(λ), policy-gradient methods, or actor-critic algorithms like A3C (<NPL>) or IMPALA (<NPL>.

The implementations described herein relate to reinforcement learning systems.

In broad terms a reinforcement learning system is a system that selects actions to be performed by a reinforcement learning agent interacting with an environment. In order for the agent to interact with the environment, the system receives data characterizing the current state of the environment and selects an action to be performed by the agent in response to the received data. Data characterizing a state of the environment is referred to in this specification as an observation. Optionally the observation at a time step may include data from a previous time step e.g., the action performed at the previous time step, the reward received at the previous time step, and so forth.

The environment is a real-world environment and the agent is an electromechanical agent interacting with the real-world environment. For example, the agent may be a robot or other static or moving machine interacting with the environment to accomplish a specific task, e.g., to locate an object of interest in the environment or to move an object of interest to a specified location in the environment or to navigate to a specified destination in the environment; or the agent may be an autonomous or semi-autonomous land or air or sea vehicle navigating through the environment.

In these implementations, the observations may include, for example, one or more of images, object position data, and sensor data to capture observations as the agent interacts with the environment, for example sensor data from an image, distance, or position sensor or from an actuator. In the case of a robot or other mechanical agent or vehicle the observations may similarly include one or more of the position, linear or angular velocity, force, torque or acceleration, and global or relative pose of one or more parts of the agent. The observations may be defined in <NUM>, <NUM> or <NUM> dimensions, and may be absolute and/or relative observations. For example in the case of a robot the observations may include data characterizing the current state of the robot, e.g., one or more of: joint position, joint velocity, joint force, torque or acceleration, and global or relative pose of a part of the robot such as an arm and/or of an item held by the robot. The observations may also include, for example, sensed electronic signals such as motor current or a temperature signal; and/or image or video data for example from a camera or a LIDAR sensor, e.g., data from sensors of the agent or data from sensors that are located separately from the agent in the environment.

In these implementations, the actions may be control inputs to control the robot, e.g., torques for the joints of the robot or higher-level control commands; or to control the autonomous or semi-autonomous land or air or sea vehicle, e.g., torques to the control surface or other control elements of the vehicle or higher-level control commands; or e.g. motor control data. In other words, the actions can include for example, position, velocity, or force/torque/acceleration data for one or more joints of a robot or parts of another mechanical agent. Action data may include data for these actions and/or electronic control data such as motor control data, or more generally data for controlling one or more electronic devices within the environment the control of which has an effect on the observed state of the environment. For example in the case of an autonomous or semi-autonomous land or air or sea vehicle the actions may include actions to control navigation e.g. steering, and movement e. g braking and/or acceleration of the vehicle.

In some implementations, not covered by the claims, the environment is a simulated environment and the agent is implemented as one or more computers interacting with the simulated environment. For example the simulated environment may be a simulation of a robot or vehicle and the reinforcement learning system may be trained on the simulation. For example, the simulated environment may be a motion simulation environment, e.g., a driving simulation or a flight simulation, and the agent is a simulated vehicle navigating through the motion simulation. In these implementations, the actions may be control inputs to control the simulated user or simulated vehicle. A simulated environment can be useful for training a reinforcement learning system before using the system in the real world. In another example, the simulated environment may be a video game and the agent may be a simulated user playing the video game. Generally in the case of a simulated environment the observations may include simulated versions of one or more of the previously described observations or types of observations and the actions may include simulated versions of one or more of the previously described actions or types of actions.

In a further example, not covered by the claims, the environment may be a protein folding environment such that each state is a respective state of a protein chain and the agent is a computer system for determining how to fold the protein chain. In this example, the actions are possible folding actions for folding the protein chain and the result to be achieved may include, e.g., folding the protein so that the protein is stable and so that it achieves a particular biological function. When the agent is a mechanical agent, as covered by the claims, it may perform or control the protein folding actions selected by the system automatically without human interaction. The observations include direct or indirect observations of a state of the protein.

In a similar example, not covered by the claims, the environment may be a drug design environment such that each state is a respective state of a potential pharma chemical drug and the agent is a computer system for determining elements of the pharma chemical drug and/or a synthetic pathway for the pharma chemical drug. The drug/synthesis may be designed based on a reward derived from a target for the drug, for example in simulation. When the agent is a mechanical agent, as covered by the claims, it may perform or control synthesis of the drug.

In the case of an electronic agent, not covered by the claims, the observations may include data from one or more sensors monitoring part of a plant or service facility such as current, voltage, power, temperature and other sensors and/or electronic signals representing the functioning of electronic and/or mechanical items of equipment. In some applications the agent may control actions in a real-world environment including items of equipment, for example in a facility such as: a data center, server farm, or grid mains power or water distribution system, or in a manufacturing plant or service facility. The observations may then relate to operation of the plant or facility. For example additionally or alternatively to those described previously they may include observations of power or water usage by equipment, or observations of power generation or distribution control, or observations of usage of a resource or of waste production. The agent may control actions in the environment to increase efficiency, for example by reducing resource usage, and/or reduce the environmental impact of operations in the environment, for example by reducing waste. For example the agent may control electrical or other power consumption, or water use, in the facility and/or a temperature of the facility and/or items within the facility. The actions may include actions controlling or imposing operating conditions on items of equipment of the plant/facility, and/or actions that result in changes to settings in the operation of the plant/facility e.g. to adjust or turn on/off components of the plant/facility.

In some further applications, not covered by the claims, the environment is a real-world environment and the agent manages distribution of tasks across computing resources e.g. on a mobile device and/or in a data center. In these implementations, the actions may include assigning tasks to particular computing resources. As a further example, not covered by the claims, the actions may include presenting advertisements, the observations may include advertisement impressions or a click-through count or rate, and the reward may characterize previous selections of items or content taken by one or more users.

The reinforcement learning system may be implemented as one or more computer programs on one or more computers in one or more locations in which the systems, components, and techniques described herein are implemented.

<FIG> illustrates a reinforcement learning system. The reinforcement learning system <NUM> comprises an agent <NUM> that determines actions based on a policy <NUM>. Each time an action is determined, it is output to an environment <NUM> being controlled by the agent <NUM>. The action updates a state of the environment <NUM>. The updated state is returned to the reinforcement learning system <NUM> along with an associated reward for the action. These are used by the reinforcement learning system <NUM> to determine the next action. In general, the reward is a numerical value. The reward can be based on any event or aspect of the environment <NUM>. For example, the reward may indicate whether the agent <NUM> has accomplished a task (e.g., navigating to a target location in the environment <NUM>) or the progress of the agent <NUM> towards accomplishing a task.

The interaction of the agent <NUM> with the environment <NUM> over one or more time steps is represented by a "trajectory" (<IMG>. , sequence) of experience tuples, where each experience tuple corresponds to a respective time step. An experience tuple corresponding to a time step may include: (i) an observation characterizing the state of the environment at the time step, (ii) an action that was selected to be performed by the agent at the time step, (iii) a subsequent observation characterizing a subsequent state of the environment subsequent to the agent performing the selected action, (iv) a reward received subsequent to the agent performing the selected action, and (v) a subsequent action that was selected to be performed at the subsequent time step.

The policy <NUM> defines how the system performs actions based on the state of the environment. As the system <NUM> is trained based on a set of experiences <NUM>, the policy <NUM> followed by the agent <NUM> is updated by assessing the value of actions according to an approximate value function, or return function to improve the expected return from the actions taken by the policy <NUM>. This is typically achieved by a combination of prediction and control to assess the success of the actions performed by the agent <NUM>, sometimes referred to as the "return". The return is calculated based on the rewards received following a given action. For instance, the return might be an accumulation of multiple reward values over multiple time steps.

Some of the parameters used to define how the system learns are the discount factor γ and the bootstrapping parameter λ. These parameters are discussed in more detail below, with reference to equations (<NUM>) and (<NUM>).

The discount factor γ determines the time-scale of the return. A discount factor close to γ = <NUM> provides a long-sighted goal that accumulates rewards far into the future, while a discount factor with a value close to γ = <NUM> provides a short-sighted goal that prioritises short-term rewards. Even in problems where long-sightedness is desired, it is frequently observed that discount factor values of γ < <NUM> achieve better results, especially during early learning. It is known that many algorithms converge faster with lower discounts factor values, but too low a discount factor value can lead to sub-optimal policies. In practice it can therefore be better to first optimise for a short-sighted horizon, e.g., with γ = <NUM> at first, and then to repeatedly increase the discount factor value at later stages.

The return may also be bootstrapped to different time horizons. An n-step return accumulates rewards over n time-steps before then adding the value function at the nth time-step. The λ-return is a geometrically weighted combination of n-step returns. In either case, the parameters n or λ may be important to the performance of the algorithm, trading off bias and variance, and therefore an efficient selection of these parameters is desirable.

<FIG> illustrates a reinforcement learning system applying meta-learning according to the present specification. Here, the return function itself is learned, in addition to the policy, by treating it as a parametric function with tuneable meta-return parameters, or meta-parameters, η. Such meta-parameters η may for instance include the discount factor γ, or the bootstrapping parameter λ. For the avoidance of doubt, the "meta-return parameters" and "return-parameters" described thus far are equivalent to the "meta-parameters" η described hereafter.

The meta-parameters η are adjusted during the agent's interaction with the state or environment, allowing the return to both adapt to the specific problem, and also to dynamically adapt over time to the changing context of learning. A practical gradient-based meta-learning method is therefore described herein and it is shown that this can improve performance on large-scale deep reinforcement learning applications.

Returning to <FIG>, the present reinforcement learning system <NUM> is similar to that of <FIG>, in that it comprises an agent <NUM> that determines actions based on a policy <NUM> and experiences <NUM>. The policy <NUM> is defined by policy parameters <NUM> which may be stored in local memory. The agent <NUM> is implemented using a neural network.

The reinforcement learning system <NUM> also comprises a policy training module <NUM> and a return function training module <NUM>. The policy training module <NUM> is configured to update the policy parameters <NUM> to train the policy <NUM>. The policy parameters <NUM> are updated based on a return that is calculated based on experiences <NUM> using a return function <NUM> that is defined by return parameters <NUM>. The return parameters <NUM> may be stored in local memory.

The reinforcement learning system <NUM> also comprises a return function training module <NUM>. The return function training module <NUM> is configured to update the return parameters <NUM> based on experiences <NUM> using a meta-objective function <NUM>. By updating (training) the return function, the system is able to learn a better return function, thereby improving the training of the policy. This allows a more accurate policy to be reached more quickly and more efficiently.

In one embodiment, the return function training module <NUM> is configured to update the return parameters to reduce the error in the return parameters. This may be relative to the value function that is utilised by the agent <NUM> to determine an expected return from an action (and thereby determine the action that provides the highest expected return). For instance, the meta-objective function might calculate the mean-squared error between the return and the value for one or more experiences and the return function training module <NUM> might be configured to update the return parameters to reduce (minimise) this mean-squared error.

As mentioned, the reinforcement learning system <NUM> comprises a policy <NUM>, the policy <NUM> comprising one or more policy parameters <NUM>, a return function <NUM>, the return function <NUM> comprising one or more return parameters <NUM>, and a value function. The system <NUM> retrieves a plurality of experiences <NUM> from a reinforcement neural network (where the reinforcement neural network may or may not form a part of the system <NUM>) configured to control an agent interacting with an environment to perform a task in an attempt to achieve a specified result based on the one or more policy parameters <NUM> for the reinforcement learning neural network.

Each of the plurality of experiences <NUM> comprises an observation characterizing a state of the environment, an action performed by the agent in response to the observation and a reward received in response to the action.

In some implementations, the system <NUM> may generate the experiences <NUM> (i.e. the reinforcement learning neural network may form part of the system <NUM>). Alternatively, the system <NUM> may access the plurality of experiences <NUM>, e.g. from storage or from an external system. In this latter implementation, as the policy parameters <NUM> are updated, these are shared with the neural network to train the neural network.

In the present embodiment, the system <NUM> is configured such that the plurality of experiences <NUM> are separated into a first set of experiences, and a second set of experiences, where each of the first and second set of experiences are used in conjunction with return parameters <NUM> (also referred to as meta-return parameters or meta parameters) to update policy parameters <NUM> of the policy <NUM>. This may be achieved, for example, using the policy training module <NUM>. The meta-objective function <NUM> is then utilised to adjust the return parameters <NUM>. This may be achieved, for example, using the return function training module <NUM>. This process may be repeated a number of times, to iteratively update the policy parameters and the return parameters.

When implemented, a processor may store the agent <NUM> that receives the experiences <NUM>. The policy training module <NUM> of the processor may update the policy parameters <NUM> based on the experiences <NUM>, and this in turn updates the policy <NUM> carried out by the agent <NUM>. The return function training module <NUM> of the processor may then adjust the return parameters <NUM> stored in memory. The updated return parameters may be accessed by the policy training module <NUM>. This therefore iteratively updates the policy <NUM> and the return function <NUM>.

<FIG> illustrates the procedure <NUM> taken by the system <NUM> in optimising the policy <NUM> and the return function <NUM>. In step <NUM>, the plurality of experiences <NUM> are retrieved by the system <NUM>. In some implementations, the system <NUM> may generate the experiences <NUM> (i.e. the reinforcement learning neural network <NUM> may form part of the system <NUM>). Alternatively, the system <NUM> may retrieve the plurality of experiences from an external system comprising the policy parameters. In this latter scenario, each time the policy parameters <NUM> are updated, they are sent to the external system for use in generating the next set of experiences. For instance, the plurality of experiences <NUM> may be generated online by the reinforcement learning system <NUM> itself or may be obtained from an external reinforcement learning neural network <NUM>.

In step <NUM>, the policy parameters <NUM> are then updated using an update function <NUM>, and based on the first set of experiences 250a of the plurality of experiences <NUM>, to form updated policy parameters.

In step <NUM>, the updated policy parameters are cross-validated based on the second set of experiences of the plurality of experiences <NUM>, the meta-objective function <NUM>, and the return function <NUM>.

In step <NUM>, return-parameters are updated based on the cross-validation of the updated policy parameters and the meta-objective function <NUM> to form one or more meta-parameters <NUM>, which then update the update function and the return function <NUM>. In subsequent parameter updates, the existing meta-parameters <NUM> from the previous update are updated based on the most recent cross-validation.

Then, in step <NUM>, the system determines whether an end criterion has been reached. The end criterion might be a maximum number of iterations or a predetermined performance level. The performance level might be a performance of the policy (e.g. a predefined accumulated reward or return) or the performance of the return function (e.g. error of the return function relative to ground truth returns). If the end criterion has not been reached, the system <NUM> returns to step <NUM> for a new iteration for a new parameter update. If the end criterion has been met then the system <NUM> completes training and outputs a result in step <NUM>.

The output might be an optimised policy (set of policy parameters) or an optimised return function (set of return parameters), as determined in the most recent iteration. The policy can be utilised to implement the trained agent. The return function can be utilised to help train further reinforcement learning agents more efficiently.

As discussed previously, the advantage of updating the policy parameters using a first set of experiences, before cross-validating the updated policy parameters using a second set of experiences is that this avoids overfitting and reduces the amount of training data used for each iterative update.

In more detail, the value function vθ(S) and the policy πθ(A|S) <NUM> are approximated by a neural network with parameters θ <NUM>. In order to better approximate the value function and the policy <NUM>, the method includes an update function, <MAT> that adjusts parameters from a sequence of experience τt = {St, At, Rt+<NUM>,. }, where S represents states, A represents actions, R represents rewards, and t represents the number of parameter updates that have been performed. The nature of the update function f is determined by the return parameters, or the meta-parameters η <NUM>.

The meta-gradient reinforcement learning approach described in this specification is based on the principle of online cross-validation, using successive samples of experience. The underlying reinforcement learning method is applied to the first set of experiences τ, and its performance is measured using a second set of experiences τ'. Specifically, the method starts with policy parameters θ <NUM>, and applies the update function to the first set of experiences τ, resulting in new parameters θ'. The gradient dθ/dη of these updates then indicates how the meta-parameters η <NUM> affected these new policy parameters θ'. The method then measures the performance of the new policy parameters θ' on a subsequent, independent second set of experiences τ', utilising a differentiable meta-objective J'(τ', θ', η'). When validating the performance on the second set of experiences τ', a fixed meta-parameter η' in J' is used as a reference value. In this way, a differentiable function of the meta-parameters η is formed, and the gradient of η can be obtained by taking the derivative of meta-objective J' with respect to η and applying the chain rule: <MAT>.

The parameters form an additive sequence so the gradient of the policy parameter updates dθ'/dη can be expressed as <MAT> where I is the identity matrix.

The gradient ∂f(τ, θ , η)/ ∂θ is large, and can be approximated using an accumulative trace to z ≈ dθ/dη, such that <MAT> That is, the gradient of the updated policy parameters θ' with respect to the return parameters η (dθ'/dη approximated as z') can be calculated iteratively, by adding to the previous gradient z (the gradient of the policy parameters θ with respect to the return parameters η), the gradient of the update function (evaluated on the first set of experiences τ using the policy parameters θ and the return parameters η) with respect to the return parameters η (∂f(τ, θ , η)/∂η).

The gradient of formula (<NUM>) may be defined using fixed meta-parameters η, or be adapted online. In order to make this adaptation, the parameter µ ∈ [<NUM>,<NUM>] decays the trace and focuses on only recently made updates. For instance, choosing µ = <NUM> results in a trace that considers only the immediate effects of the meta-parameters η on the policy parameters θ.

Then, the meta-parameters η <NUM> may be updated to updated
meta-parameters to optimise the meta-objective function J' <NUM>.

Here, β is the learning rate for updating the meta-parameters η <NUM>.

This update may be done for example by applying a stochastic gradient descent to update the meta-parameters η in the direction of the meta-gradient. Alternatively, the meta-objective function J' may be optimised by any other known gradient ascent or decent method.

The updated meta-parameters may then serve as the meta-parameters η <NUM> for the next iteration upon retrieval of the next plurality of experiences <NUM>.

The following potential implementations consider the situation where the meta-parameters η <NUM> are used for prediction using a temporal-difference update, and the situation where the meta-parameters <NUM> are used for control, where this is achieved using a canonical actor-critic update function and a policy gradient meta-objective. The skilled reader will appreciate that many other alternative implementations using this meta-gradient approach to reinforcement learning would also be possible.

<FIG> illustrates the steps <NUM> in updating and applying the one or more meta-parameters η to the return function G. This procedure forms one implementation of step <NUM> shown previously in <FIG>, after the policy parameters θ have been updated to updated policy parameters θ' and cross-validated.

In step <NUM>, the gradient of the return function G <NUM> with respect to the one or more meta-parameters η <NUM> is determined.

In step <NUM>, the gradient of the update function f with respect to the one or more meta-parameters η <NUM> is determined.

In step <NUM>, the gradient of the meta-objective function J' <NUM> with respect to the one or more meta-parameters η <NUM> is determined.

In addition to the steps shown in <FIG>, and depending on the choice of meta-objective function J(τ, θ, η) chosen for the system <NUM>, the gradient of the value function with respect to the policy parameters <NUM> (i.e. ∂vθ(S)/∂θ) may also be calculated to determine the gradient of the update function f with respect to the one or more meta-parameters η <NUM>.

Therefore, the meta-gradient can be assessed for the one or more meta-parameters η <NUM>, and the one or more meta-parameters η <NUM> can be adjusted accordingly in step <NUM> to ensure the optimum return function G, forming updated meta-parameters. These updated meta-parameters can then be used as the meta-parameters η <NUM> in the subsequent update iteration (where it is concluded that the optimum return function has not been reached).

In more detail, the return function Gη(τt) <NUM> is defined as a function of an episode or a truncated n-step sequence of experience, i.e. τt = {St, At, Rt+<NUM>,. As discussed earlier, the nature of the return function Gη is determined by the one or more meta-parameters η.

The n-step return function Gη <NUM> accumulates rewards over a sequence and then bootstraps from the value function, so that <MAT> where η = {γ, n}.

The bootstrapping parameter λ return function, or λ-return, is a geometric mixture of n-steps, so the return function Gη can be redefined as <MAT> where η = {γ, λ}. The λ-return has the advantage of being fully differentiable with respect to both meta-parameters γ and λ <NUM>.

In this case, the meta-parameters η chosen, γ and λ, may be considered to act as gates or conditions that cause the return to terminate (γ = <NUM>), bootstrap (λ = <NUM>), or to continue onto the next step (γ = <NUM> or λ = <NUM>).

Conventionally, a typical reinforcement learning algorithm would hand-select the meta-parameters η, such as the discount factor γ and bootstrapping parameter λ, and these would be held fixed throughout training. However, in the reinforcement learning system described herein, the return function G is parameterized by meta-parameters η which may then be differentiated in order to understand the dependence of the return function G on η. This, in turn, allows the gradient of the update function f with respect to the meta-parameters η, ∂f/∂η, to be determined, and therefore the meta-gradient of the meta-objective function J', ∂J'(τ', θ', η')/∂η can also be determined. This allows for the system to assess which return function G <NUM> results in the optimal performance, and adjust the meta-parameters η <NUM> accordingly according to formulas (<NUM>) to (<NUM>).

In a particular implementation of the system <NUM>, the canonical TD(λ) algorithm for prediction may be used for making a prediction about the optimum return function based on the meta-parameters η <NUM> chosen. The objective of the TD(λ) algorithm is to minimise the squared error between the value function approximator vθ(S) and the λ-return Gη(τ), <MAT>.

Here, τ is the first set of experiences starting with a starting state S, and ∂J(τ, θ, η)/∂θ is a semi-gradient. For instance the λ-return is treated as a constant.

The TD(λ) update function f(τ, θ, η) applies stochastic gradient descent to update the agent's policy parameters θ <NUM> to descend the gradient of the objective with respect to the policy parameters θ <NUM>, so that <MAT>.

Here, α is the learning rate for updating the policy parameters θ. The update function f here is differentiable with respect to the meta-parameters η <NUM>, so that <MAT>.

The aim of the meta-gradient prediction in this implementation is to adjust the meta-parameters η <NUM> in the direction that achieves the best predictive accuracy. This is measured during the step described earlier and shown in step <NUM> of <FIG> where the updated policy parameters θ' are cross-validated based on a second set of experiences τ' that starts from a state S', using a mean squared error (MSE) meta-objective function J' and taking its semi-gradient, in the form <MAT>.

Therefore, the meta-gradient of the meta-objective function ∂J'(τ', θ', η')/∂θ' can be determined and implemented in conjunction with formulas (<NUM>) to (<NUM>) to arrive at the necessary updates for the meta-parameters η.

The meta-objective function J' in this implementation can use an unbiased and long sighted return function G <NUM>, for example using η' = {γ', λ'}, where γ' = <NUM> and λ' = <NUM>.

In a further implementation of the system <NUM>, the meta-gradients may be applied to control, such as an A2C actor-critic algorithm. In this implementation, the actor-critic update function combines both prediction and control into a single update to the policy.

The semi-gradient of the A2C meta-objective function is defined as: <MAT>.

In this formula, the first term represent a control objective that configures the policy πθ <NUM> to maximise the measured reward of the return function <NUM>. The second term represents a prediction objective that configures the value function approximator vθ to accurately estimate the return of the return function Gη(τ). The third term is a term for entropy H that regularizes the policy <NUM>, and c and d are coefficients that appropriately weight the different terms in the meta-objective function.

The A2C update function f(τ, θ, η) applies stochastic gradient descent to update the policy parameters θ <NUM>. This update function is differentiable with respect to the meta-parameters η <NUM>, so that <MAT>.

Here, α is a learning rate applied when updating the one or more policy parameters from one or more previous policy parameters.

The choice of meta-objective function <NUM> in this implementation is one that serves to ensure that the return function maximises the performance of the agent. This may be achieved using a policy-gradient objective of the form <MAT>.

Here, Gη, is a further return function that evaluates the updated policy in terms of the returns from the further return function when applied to the second set of experiences τ', vθ'(S') is the value function associated with the updated policy for the state S', and πθ'(A'|S') is the updated policy for action A' in response to state S'.

Therefore, this formula assesses the success of the updated policy parameters θ' in view of the returns computed under η' using the second set of experiences τ'.

When the updated policy parameters θ' are assessed by cross-validation using the meta-objective function in this implementation, fixed meta-parameters η' may be used that represent a good approximation of the true objective of the agent. This may comprise selecting reasonable values of η' based on values that perform well in practice.

The meta-gradient learning algorithm under this implementation can then be implemented in the following manner. First, the policy parameters θ <NUM> are updated based on the first set of experiences τ using the A2C update function shown in formula (<NUM>). This and the gradient of the update function ∂f(τ, θ, η)/∂η shown in formula (<NUM>) are accumulated into a trace z such as that shown earlier in formula (<NUM>). Then, the performance is cross-validated on the second set of experiences τ' using the policy gradient meta-objective ∂J'(τ', θ', η')/∂θ' shown in formula (<NUM>). Finally, the meta-parameters η <NUM> can then be updated according to the gradient of the meta-objective function <NUM> according to formulas (<NUM>) to (<NUM>).

One aspect of the implementation described above is that the return function Gη(τ) <NUM> is non-stationary, in that this updates throughout the training process along with the meta-parameters η <NUM>. This may lead to the value function vθ becoming inaccurate, since it may be approximating out of date returns.

For instance, the value function vθ may initially form a good approximation at the start of the training process where γ = <NUM>, but then form a poorer approximation later in the training process after γ has been adapted to γ = <NUM>.

This likewise applies to the policy π <NUM>, which also may be formed based on out of date returns.

Therefore, in order to address this non-stationary aspect of the value function vθ and the policy π <NUM>, a method similar to the universal value function approximation (UVFA) may be implemented. Here, the meta-parameters η are provided as an additional input to condition the value function vθ and the policy π <NUM>, in the form <MAT>.

Where eη is the embedding of η, [s; eη] is the concatenation of vectors s and eη, and Wη is the embedding matrix (or a row vector, for a scalar η) that is updated by backpropagation during training.

In this implementation, the agent then explicitly learns the value function vθ and the policy π <NUM> most appropriate for any given value of the meta-parameters η <NUM>. This has the advantage of allowing the meta-parameters η to be adjusted without any need to wait for the approximator to "catch up".

The approaches and various implementations of the system <NUM> described thus far can be scaled up. For instance, to improve efficiency the A2C objective and meta-objective function may be accumulated over all time-steps within an n-step set of experiences. The A2C objective function may be optimised by RMSProp without momentum. This results in a differentiable function of meta-parameters η <NUM>, and can therefore be substituted similarly to stochastic gradient descent (see formula <NUM>). As in IMPALA, an off-policy correction may be used, based on a V-trace return. For further efficient implementation, mini-sets of experiences may be computed in parallel, or sets of experiences may be reused twice for both the update function and for cross-validation. For instance, in order to reduce the data needed for meta learning, the experiences can be used for both agent training and meta learning. For example, experiences τ can be used for updating θ into θ' and the performance of this update can be validated via evaluating J' on experiences τ'. Vice versa, the roles of τ and τ' can be swapped so that experiences τ' can be used for updating θ into θ', and the performance of this update can be validated via evaluating J' on experiences τ. In this way, the proposed method does not require extra data other than the data used to train the agent parameter θ to conduct the meta learning update to η.

Embodiments of the subject matter and the functional operations described in this specification can be implemented in digital electronic circuitry, in tangiblyembodied computer software or firmware, in computer hardware, including the structures disclosed in this specification and their structural equivalents, or in combinations of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible non transitory program carrier for execution by, or to control the operation of, data processing apparatus. Alternatively or in addition, the program instructions can be encoded on an artificially generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal that is generated to encode information for transmission to suitable receiver apparatus for execution by a data processing apparatus. The computer storage medium is not, however, a propagated signal.

A computer program (which may also be referred to or described as a program, software, a software application, a module, a software module, a script, or code) can be written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.

While this specification contains many specific implementation details, these should not be construed as limitations on the scope of protection as defined by the claims, but rather as descriptions of features that may be specific to particular embodiments. Moreover, although features may be described above as acting in certain combinations, one or more features from a combination can in some cases be excised from the combination, and the combination may be directed to a subcombination or variation of a subcombination.

Particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims.

Claim 1:
A reinforcement learning system comprising one or more processors configured to:
retrieve (<NUM>) a plurality of experiences generated by a reinforcement learning neural network configured to control a mechanical agent interacting with a real-world environment to perform a task in an attempt to achieve a specified result by performing actions selected by the reinforcement learning neural network based on one or more policy parameters for the reinforcement learning neural network, each experience comprising an observation characterizing a state of the environment, an action performed by the agent in response to the observation and a reward received in response to the action; and
train the reinforcement learning neural network by:
updating (<NUM>) the one or more policy parameters for the reinforcement learning neural network based on a first set of the experiences using a return function that calculates returns based on rewards; and
updating (<NUM>) the one or more return parameters of the return function based on the one or more updated policy parameters and a second set of the experiences, wherein the one or more return parameters consist of at least one of a discount factor of the return function and a bootstrapping factor of the return function, and the one or more return parameters are updated via a gradient ascent or descent method using a meta-objective function differentiated with respect to the one or more return parameters, wherein the meta-objective function is dependent on the one or more policy parameters and the differentiated meta-objective function is: <MAT>
where:
η are the one or more return parameters; and
J'(τ', θ', η') is the meta-objective function conditioned on the second set of experiences τ', the one or more updated policy parameters θ' and one or more further return parameters η' of a further return function forming part of the meta-objective function and which are kept fixed during training, wherein the further return function may be different to the return function that calculates the returns from rewards received by the agent.