Patent Publication Number: US-2023144995-A1

Title: Learning options for action selection with meta-gradients in multi-task reinforcement learning

Description:
CROSS-REFERENCE TO RELATED APPLICATION 
     This application claims priority to U.S. Provisional Application No. 63/035,467, filed on Jun. 5, 2020. The disclosure of the prior application is considered part of and is incorporated by reference in the disclosure of this application. 
    
    
     BACKGROUND 
     This specification relates to reinforcement learning. 
     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. 
     Neural networks are machine learning models that employ one or more layers of nonlinear units to predict an output for a received input. Some neural networks are deep neural networks that include one or more hidden layers in addition to an output layer. The output of each hidden layer is used as input to the next layer in the network, i.e., the next hidden layer or the output layer. Each layer of the network generates an output from a received input in accordance with current values of a respective set of parameters. 
     SUMMARY 
     This specification generally describes a reinforcement learning system for controlling an agent to perform a plurality of tasks while interacting with an environment. The system learns options, where an option comprises a sequence of primitive actions performed by the agent under control of an option policy neural network. A primitive action is an action performed by the agent at a time step. In implementations the system discovers options which are useful for multiple different tasks by meta-learning, more specifically by learning rewards for training the option policy neural network whilst the agent is interacting with the environment. 
     Thus in one aspect there is described a system for controlling an agent to perform a plurality of tasks while interacting with an environment. The system is configured to, at each of a plurality of time steps, process an input comprising an observation characterizing a current state of the environment to generate an output for selecting an action e.g. one of a predetermined set of possible actions, to be performed by the agent. A task reward is received in response to the action; for some or many time steps the task reward may be zero. 
     The system may comprise a manager neural network, and a set of option policy neural networks each for selecting a sequence of actions to be performed by the agent according to a respective option policy. The manager neural network may be configured to, at a time step, e.g. at each time step when it needs to pick an option or primitive action, process the observation and data identifying one of the tasks currently being performed by the agent, e.g. a task embedding, according to parameter values of the manager neural network, to generate an output for selecting a manager action from a set of manager actions. The set of manager actions may comprise the possible (primitive) actions that can be performed by the agent, e.g. each action in a predetermined set of possible actions. The set of manager actions may comprise a set of option selection actions, each option selection action selecting one of the option policy neural networks. 
     Each option policy neural network may be configured to, at each of a succession of time steps (e.g. the time steps whilst the option is selected), process the observation for the time step, according to an option policy defined by parameter values of the option policy neural network, to generate an output for selecting an action, i.e. a primitive action, to be performed by the agent. When the selected manager action is an option selection action, the option policy neural network selected by the manager action generates its output for successive time steps until an option termination criterion is met. When the selected manager action is one of the possible (primitive) actions that can be performed by the agent the output for selecting the action is the selected manager action. 
     The system may include a set of option reward neural networks, one for each respective option policy neural network. Each option reward neural network may be configured to process the observation at a time step, according to parameter values of the option reward neural network, to generate an option reward for the respective option policy neural network. The option reward may be generated for each time step that the corresponding option is selected. 
     In implementations the system is configured to train the set of option reward neural networks and the manager neural network using the task rewards. The system may also be configured to train each of the option policy neural networks using the option reward for the respective option policy neural network. 
     The various neural networks and the training may use any model-based or model-free reinforcement learning method, for example a stochastic or deterministic policy gradient technique such as, merely by way of example, an actor-critic (A-C) method, a Trust Region Policy Optimization (TRPO) method, a Deep Deterministic Policy Gradient (DDPG) method; or a function approximation technique such as a Deep Q-Network (DQN) method. In general in this specification when an output is used to select an action or an option policy neural network the output may define the action or selection directly, or may define a score for each action or selection in a set of actions or selections, or may assign a respective probability to each action or selection e.g. by providing parameters of one or more probability distributions. The task reward may characterize progress of the agent towards completing the identified task. 
     In implementations the system is configured to train each option reward neural network using the task reward in a meta-gradient training technique, in particular a technique in which parameter values of the option reward neural network are adjusted during, i.e. based on, the agent&#39;s interaction with the environment under control of the respective option policy neural network to optimize a return from the environment. In this context a return may refers to a cumulative measure of the task rewards received by the agent, for example, a time-discounted sum of rewards in which future rewards are discounted by a discount factory when computing the return. 
     For example, after the option selection action and for a succession of time steps until the termination criterion is met, the training may comprise updating the parameter values of the manager neural network using the task rewards and updating the parameter values of the selected option policy neural network using the option reward for the respective option policy neural network. In this phase the parameters of option reward neural network may be fixed. Then, after the termination criterion is met, the training may comprise updating the parameter values of the option reward neural network for the respective option policy neural network using the task rewards. 
     The task rewards may define a manager (reinforcement learning) objective function; the option rewards may define an option policy (reinforcement learning) objective function. Gradients of the manager objective function and of the option policy objective function may each comprise a respective policy gradient. Updating the parameter values of the manager neural network may comprise backpropagating gradients of the manager objective function; similarly updating the parameter values of an option policy neural network may comprise backpropagating gradients of the option policy objective function. 
     In implementations updating the parameter values may comprise generating a trajectory comprising a sequence of one or more actions, chosen by the previously selected option policy neural network, and corresponding observations and task rewards. The parameter values of the option reward neural network for the respective option policy neural network may be updated using the task rewards obtained from the trajectory. This may involve back propagating gradients of an option reward objective function, e.g. a policy gradient objective function, based on the task rewards from the trajectory. The gradients may be back propagated into the respective option reward neural network through the respective option policy neural network e.g. through each of the time steps during which the option policy neural network operated to select a (primitive) action. 
     In some implementations the same form of estimated return may be used, e.g. in a policy gradient update, for updating the manager neural network, the option reward neural network, and where present an option termination neural network (described later). 
     In some implementations a policy gradient used for updating the manager neural network, the option reward neural network, and where present an option termination neural network (described later) also depends on a value estimate. The same value estimate may be used for updating each of these neural networks. In this context the value estimate represents a value of the environment being in the current state to successfully performing the identified task. For example it may comprise an estimate of the return for the identified task resulting from the environment being in a current state characterized by the observation. 
     In an actor-critic based implementation the manager neural network may generate the value estimate for the other neural networks trained using the task rewards e.g. based on the data identifying the task. Each option policy neural network may generate its own value estimate. In an actor-critic based implementation the manager neural network, and each option policy neural network may comprise a neural network, with a policy head to provide corresponding action selection data, and a value head to provide the value estimate. One or more of the manager neural network, an option policy neural network, and an option reward neural network may be updated based on an estimated an n-step return i.e. a return computed from n action selection time steps. 
     Some implementations of the system include a set of option termination neural networks, one for each respective option policy neural network. Each of the option termination neural networks may be configured to, at each of the time steps, process the observation according to parameter values of the option reward neural network, to generate an option termination value for the respective option policy neural network. For each option reward neural network the option termination value may determine whether the option termination criterion is met. The option reward neural network may generate an option termination value directly or indirectly e.g. it may parameterize a probability distribution from which the option termination value may be sampled. 
     The system may be configured to train the option termination neural networks using the task rewards in a meta-gradient training technique. This may be a technique in which parameter values of the option termination neural network are adjusted during i.e. based on the agents interaction with the environment under control of the respective option policy neural network, to optimize a return from the environment. 
     Thus the system may be configured to train the set of option termination neural networks, after the termination criterion is met for a respective option policy neural network, by updating the parameter values of the option reward neural network for the respective option policy neural network using the task rewards. This may comprise generating a trajectory comprising a sequence of one or more actions selected by the respective option policy neural network (i.e. that selected by the option selection action), and corresponding observations and task rewards. Parameter values of the option termination neural network for the respective option policy neural network may then be updated using the task rewards from the trajectory. This may involve back propagating gradients of an option termination objective function based on the task rewards from the trajectory through the option policy neural network and through the corresponding option termination neural network. 
     In implementations the system is configured to train the manager neural network dependent on an estimated return comprising the expected task rewards from the environment when selecting manager actions according to current parameter values of the manager neural network and on a switching cost. The switching cost encourages the manager neural network to select option policy neural networks to encourage discovery of options that are temporally extended. In implementations the switching cost is configured to reduce the task reward or return at each time step which is used to update the parameters of the manager neural network. It may comprise a small negative value. 
     The set of option policy neural networks may be implemented as a set of option policy neural network heads on a shared option policy neural network body. Similarly the set of option reward neural networks may comprise a set of option reward neural network heads on a shared option reward neural network, and the set of option termination neural networks may comprise a set of option termination neural network heads on a shared option termination neural network body. 
     In implementations only the manager neural network receives and process the data identifying the task being performed. 
     The observations may be pre-processed before being provided to the above described neural networks. For example when the observations are images, the pre-processing may use a stack of convolutional neural network layers, optionally followed by one or more fully connected neural network layers and/or one or more recurrent neural network layers, that maps the observation to a more compact representation. When the observations include additional features, e.g., proprioceptive features, these may be provided as input to the one or more fully connected layers with the output of the convolutional stack. 
     In another aspect there is described a computer-implemented method of training a system used to control an agent to perform a plurality of tasks while interacting with an environment. The system is configured to, at each of a plurality of time steps, process an input comprising an observation characterizing a current state of the environment to generate an output for selecting an action to be performed by the agent, and receive a task reward in response to the action. 
     The method may comprise obtaining an observation and task identification data identifying one of the tasks currently being performed by the agent; and processing the observation and task identification data, according to parameter values of a manager neural network, to generate an output for selecting a manager action from a set of manager actions. The set of manager actions may comprise possible actions that can be performed by the agent and a set of option selection actions, each option selection action for selecting one of a set of option policy neural networks. When the selected manager action is one of the possible actions that can be performed by the agent the method may comprise using the selected manager action to generate an output for selecting an action to be performed by the agent. When the selected manager action is an option selection action the method may comprise selecting an option policy neural network and, for successive time steps e.g. until an option termination criterion is met, processing the observation for the time step according to an option policy defined by parameter values of the selected option policy neural network, to generate the output for selecting the action to be performed by the agent. 
     The method may further comprise maintaining a set of option reward neural networks, one for each respective option policy neural network. During i.e. based processing of the observations for the successive time steps by the selected option policy neural network the method may comprise training the selected option policy neural network using option rewards generated by processing the observations according to parameter values of the respective option reward neural network; and training the manager neural network using the task rewards. Training the selected option policy neural network may comprise updating parameter values of the selected option policy neural network using the option reward from the respective option reward neural network. After processing of the observations for the successive time steps by the selected option policy neural network, e.g. after the termination condition is met, the method may train the respective option reward neural network using the task rewards. 
     In broad terms the method implements a call-and-return option execution model, training the option policy neural networks on the learned option rewards in an inner training loop, and updating the option reward neural networks in an outer training loop that updates the parameters of the option reward neural networks and, where present, the option termination neural networks, e.g. backpropagating through the inner loop updates. 
     The method may involve maintaining a set of option termination neural networks, one for each respective option policy neural network, each providing an option termination value according to parameter values of the option termination neural network, that determines whether the option termination criterion is met for the respective option policy neural network. During processing of the observations for the successive time steps by the selected option policy neural network the parameter values of the option termination neural networks (and of the option reward neural networks) may be fixed. After processing the observations for the successive time steps by the selected option policy neural network, the respective option termination neural network may be trained using the task rewards. 
     Training an option reward neural network may comprise using the (partially) trained selected option policy neural network generate a new trajectory i.e. to select one or more further actions to be performed in the environment in response to one or more observations to receive one or more task rewards. The respective option reward neural network may be trained using the task rewards received in response to the further actions. The respective option termination neural network may be trained in a similar manner. 
     In some implementations of the above described systems and methods the tasks are multiple different agent control tasks, i.e., tasks that include controlling the same mechanical agent to cause the agent to accomplish different objectives within the same real-world environment or within a simulated version of the real-world environment. 
     The agent can be, e.g., a robot or an autonomous or semi-autonomous vehicle. For example, the tasks can include causing the agent to navigate to different locations in the environment, causing the agent to locate different objects, causing the agent to pick up different objects or to move different objects to one or more specified locations, and so on. The options may define simpler sub-tasks that relate to the main tasks. 
     In more detail, in some applications 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 one or more specific tasks. As another example, the agent may be an autonomous or semi-autonomous land or air or water vehicle navigating through the environment. In these implementations, the actions may be control signals to control a physical behavior of the robot or vehicle. 
     In general 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 1, 2 or 3 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 applications the actions may be control signals 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. 
     The rewards may include e.g. one or more rewards for approaching or achieving one or more target locations, one or more target poses, or one or more other target configurations. For example for a robot a reward may depend on a joint orientation (angle) or velocity, an end-effector position, a center-of-mass position, or the positions and/or orientations of groups of body parts. Costs (i.e. negative rewards) may be similarly defined e.g. dependent upon applied force when interacting with an object, energy usage, or positions of robot body parts. 
     The system may be used to train a vehicle or robot to perform tasks such as warehouse, logistics, or factory automation tasks, e.g. collecting, placing, or moving stored goods or goods or parts of goods during their manufacture; or the tasks performed may comprise a package delivery control tasks. The actions may include actions relating to steering or other direction control actions, and the observations may include observations of the positions or motions of other vehicles or robots. A robot or vehicle may be trained in simulation before being used in a real-world environment. 
     In some applications the agent may be a static or mobile software agent i.e. a computer programs configured to operate autonomously and/or with other software agents or people to perform a task. For example the environment may be an integrated circuit routing environment and the system may be configured to learn to perform routing tasks for routing interconnection lines of an integrated circuit such as an ASIC. The rewards (or costs) may then be dependent on one or more routing metrics such as an interconnect resistance, capacitance, impedance, loss, speed or propagation delay, physical line parameters such as width, thickness or geometry, and design rules. The observations may be observations of component positions and interconnections; the actions may comprise component placing actions e.g. to define a component position or orientation and/or interconnect routing actions e.g. interconnect selection and/or placement actions. 
     In some applications the agent may be an electronic agent and 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. 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 actions in a manufacturing plant or service facility, or actions in an electrical power generation facility such as a solar or wind farm. The observations may then relate to operation of the plant or facility, e.g. 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 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. The tasks may include multiple different control tasks e.g. resource usage e.g. water or power control; environmental impact control, electrical or other power consumption control; heating, cooling or temperature control, and generally control of items within the facility. 
     In some applications the environment may be a data packet communications network environment, and the agent may comprise a router to route packets of data over the communications network. The actions may comprise data packet routing actions and the observations may comprise e.g. observations of a routing table which includes routing metrics such as a metric of routing path length, bandwidth, load, hop count, path cost, delay, maximum transmission unit (MTU), and reliability. The tasks may include packet routing tasks with rewards/costs to maximize or minimize one or more of the routing metrics. 
     In some other applications the agent is a software agent which manages distribution of compute tasks across computing resources e.g. on a mobile device and/or in a data center. In these implementations, the observations may include observations of computing resources such as compute and/or memory capacity, or Internet-accessible resources; and the actions and related tasks may include assigning compute tasks to particular computing resources. The rewards may be dependent upon e.g. utilization of computing resources, electrical power, bandwidth, and computation speed. 
     In some other applications the environment is an Internet or mobile communications environment and the agent is a software agent which manages a personalized recommendation for a user. The observations may comprise (features characterizing) previous actions taken by the user; the tasks may include actions recommending items such as content items to a user. The rewards may include an estimated likelihood that the user will respond favorably to being recommended the (content) item, or a number of recommendations received by the user (optionally within a time span); a cost may be dependent on the suitability of one or more recommended items, a cost of the recommended item(s). 
     In some further applications, the environment is a cybersecurity environment. For example, the observations may comprise data characterizing a state of a computer network or a distributed computing system, and the actions may be for tasks to defend the computer system against a cybersecurity attack e.g. by one or more other agents. 
     The subject matter described in this specification can be implemented in particular embodiments so as to realize one or more of the following advantages. 
     Some implementations of the techniques can discover options, i.e. sequences of primitive actions, which are useful for multiple tasks, including tasks with discrete actions and continuous control tasks. By contrast it can be challenging to hand-engineered a sequence of actions which is useful for more than one task. The described techniques are general, not restricted to any particular application domain, and can learn options without human supervision or domain-specific knowledge. 
     In the context of model-based reinforcement learning the described techniques can improve the speed and data efficiency of learning because they can provide updates which apply over longer sequences of actions. In the context of model-free reinforcement learning they can commit the agent to intentional behaviors comprising sequences of actions resulting in better exploration. 
     Learning the options which are useful for the multiple tasks rather than, for example, hand-designing the options helps to reduce the risk of an option slowing down learning because an option which is not useful can increase the action space. The described techniques can also reduce the risk that the manager neural network learns to perform a task using only primitive actions. Implementations of the system are able to learn the temporal scale of an option, via the option terminal values, as well as the option behavior. 
     Implementations of the system are thus able to learn a high-quality multi-task policy in an extremely stable and data efficient manner. This makes the described techniques particularly useful for tasks performed by a real-world robot or other mechanical agent, as wear and tear and risk of mechanical failure as a result of repeatedly interacting with the environment can be greatly reduced. A new and complex task can be learned using less data, collected by the system faster, and while consuming fewer computational resources than conventional techniques. By discovering and learning useful options knowledge can effectively be shared across multiple tasks in order to allow the system to effectively control the agent to perform all of the tasks. 
     Throughout this specification, processing an image, e.g., using a neural network, refers to processing intensity values associated with the pixels of the image using the neural network. 
     The details of one or more implementations of the subject matter described in this specification are set forth in the accompanying drawings and the description below. Other features, aspects, and advantages of the subject matter will become apparent from the description, the drawings, and the claims. 
    
    
     
       BRIEF DESCRIPTION OF DRAWINGS 
         FIG.  1    shows a reinforcement learning neural network system that learns options. 
         FIG.  2    shows an example process for using the system of  FIG.  1    to perform a task. 
         FIG.  3    shows an example of an inner loop process for training the system of  FIG.  1   . 
         FIG.  4    shows an example of an outer loop process for training the system of  FIG.  1   . 
     
    
    
     In the Figures like reference numerals indicate like elements. 
     DETAILED DESCRIPTION 
     This specification describes a neural network based reinforcement learning system and method that learns to discover options, i.e. sequences of primitive actions, that are re-usable across different tasks. Options that are learned in the context of one particular task can slow the learning of another, different task. The techniques described herein enable options of general utility to be discovered, facilitating learning across multiple different tasks. This is achieved by learning what rewards to provide to option policy neural networks directing the options and, in implementations, also learning when to terminate the options. 
     In implementations the tasks are agent control tasks, typically tasks that involve controlling the same mechanical agent, such as a robot, to accomplish different goals in the same real-world environment. For example the tasks may require the agent to pick up, move to a particular location, arrange, or otherwise manipulate one or more objects in the environment, or they may require the agent to navigate within the environment. In some implementations the system may be trained in a simulated version of the real-world environment and then used in the real-world environment, where it may or may not train further. A task may be specified by its goal. In general only one task is performed at a time. 
       FIG.  1    shows a reinforcement learning neural network system  100 , which may be implemented as one or more computer programs on one or more computers in one or more locations. 
     The system  100  has an output which provides control signals to an agent  102  to control actions of the agent in an environment  104 . Generally, when the agent performs an action the environment transitions from a current state to a new state, and by repeatedly causing the agent  102  to act in the environment  104  the system  100  can control the agent  102  to complete a specified task. The agent actions may be discrete actions selected from a set of possible actions, or continuous actions i.e. actions defined by a continuous variable such as motor torque or the like. 
     The system  100  also has one or more inputs to receive data from the environment. This includes data from one or more sensors which provide information characterizing a state of the environment s t  at a time t. These data are referred to as observations  106 . The data from the environment also includes task rewards, r. Generally a task reward may be a scalar numeric value characterizing progress of the agent towards the task goal. Task rewards may be received as a task progresses or only at the end of a task, e.g. to indicate successful completion (or otherwise) of the task. A reward may be positive or negative, i.e. as used herein a “reward” includes a cost. 
     In general the system  100  receives observations of the state of the environment, and processes these to provide the control signals to the agent to cause the agent to perform the task. At least whilst learning the system  100  uses the rewards to learn what control signals to provide to perform the task. 
     The system  100  is able to learn to perform multiple different tasks and, in some implementations, includes an input to receive data  110  identifying a task to be performed. The data identifying the task to be performed may come from an external source, such as a user, or it may be selected automatically e.g. by a larger system within which the system  100  is included. 
     The techniques described herein do not rely on any particular way of identifying a task. In some implementations a task may be identified by a goal, g, of the task e.g. a representation of a final state to be achieved by the task. In some other implementations a task may simply be identified by a label (and the particular rewards received may vary by task). 
     The system  100  includes a manager neural network  120 , a set of option policy neural networks  130 , a set of option reward neural networks  140  and, optionally, a set of option termination neural networks  150 . Functions of the neural networks are described below. 
     At least during training the system  100  also includes a training engine  160 . The training engine operates to implement a training process, e.g. as described later, to update parameters of the neural networks. 
     The training engine trains the manager neural network  120  and the option policy neural networks  130  based on their respective rewards, using reinforcement learning. The training engine also trains the option reward neural networks  140  and the option termination neural networks  150 . This uses a meta-gradient approach, as changes to the parameters of these neural networks indirectly affect the performance of the manager neural network  120  and of the option policy neural networks  130 . The meta-gradient approach evaluates the performance of the manager and option policy neural networks across multiple tasks and uses this evaluation to train the option reward and option termination neural networks. In this way the option reward and option termination neural networks discover option rewards and termination criteria which are useful across multiple tasks. 
     The manager neural network  120  is configured to receive and process the observations  106 , and the data  110  identifying the task currently being performed, in accordance with parameter values of the manager neural network, to generate a manager neural network output (π M ). The manager neural network output is configured for selecting a manager action from a set of manager actions comprising possible discrete or continuous actions that can be performed by the agent and a set of option selection actions, each option selection action selecting one of the option policy neural networks. In some implementations the manager neural network output defines one or more parameters of a probability distribution over possible manager actions i.e. it defines a stochastic action selection policy. Then the manager action may be selected e.g. by sampling from the probability distribution or by selecting a highest-probability action. The training engine  160  is configured to train the manager neural network to maximize the task reward. 
     Each option policy neural network  130  is configured to receive and process the observations  106 , in accordance with parameter values of the option policy neural network, to generate an option policy neural network output (π o     i   ) configured for selecting possible actions that can be performed by the agent. In some implementations the option policy network output defines one or more parameters of a probability distribution over possible discrete or continuous agent actions i.e. it defines a stochastic action selection policy. When selected by the manager neural network  120  an option policy neural network  130  selects actions to be performed by the agent for successive time step until an option termination criterion is met. The actions may be selected e.g. by sampling from the probability distribution or by selecting a highest-probability action. The training engine  160  is configured to train each option policy neural network to maximize an option reward generated by a respective option reward neural network  140 . 
     Each option reward neural network  140  is configured to receive and process the observations  106 , in accordance with parameter values of the option reward neural network, to generate the option reward (r o     i   ) for its respective option policy neural network  130 . In implementations the option reward is a scalar numeric value. 
     Each option termination neural network  150  is configured to receive and process the observations  106 , in accordance with parameter values of the option termination neural network, to generate an option termination value (β o     i   ) for its respective option policy neural network  130 . The option termination value determines whether the option termination criterion is met for its respective option policy neural network  130 . In implementations the option termination value is a scalar value e.g. a value stochastically sampled from a categorical distribution such as {0,1} where one value indicates termination; or e.g. a scalar in a range such as [0,1], which indicates a probability of termination. 
     An option corresponds to a learned sub-goal for a task. The training process described below enables sub-goals, or “options”, useful for multiple different tasks to be learned. Each of the options corresponds to one of option policy neural networks. Merely as an example, an implementation may have of order 1-20 options. 
     As shown in  FIG.  1   , each of the option policy neural networks  130 , the option reward neural networks  140 , and the option termination neural networks  150  may comprise different neural network heads on a shared neural network body. In some implementations each neural network body may have essentially the same architecture. However in implementations only the manager neural network  120  receives the data  110  identifying the task—the task goal; the other neural networks do not receive the task goal. This helps to discover task-independent options useful across multiple tasks. 
     Not shown in  FIG.  1   , prior to processing by one or more of the manager neural network  120 , option policy neural networks  130 , option reward neural networks  140  or option termination neural networks  150 , the observations  106  may be encoded and/or different types observation features, such as image features and proprioceptive features, may be combined. Merely by way of example, for the manager neural network  120  the data  110  identifying the task currently being performed may be combined with an observation comprising an image, as an extra channel of an encoded version of the image. In general the manager neural network  120 , option policy neural networks  130 , option reward neural networks  140  and option termination neural networks  150  may have any architecture e.g. they may include one or more feedforward, convolutional, recurrent, batch-norm or layer-norm neural network layers. 
       FIG.  2    shows an example process for using the reinforcement learning neural network system  100  to perform a task. The process of  FIG.  2    may be performed during and/or after training by a system of one or more computers in one or more locations. 
     At step  200  the system receives and processes an observation  106  of a state of the environment s t  at a current time step time t and data  110  identifying a task (goal), g, and, at step  202  processes this using the manager neural network  120  to generate a manager neural network output e.g. defining a probability distribution π M . 
     The process then uses the manager neural network output to select a manager action which is either an action, i.e. a primitive action, for the agent or an option selection action for selecting an option policy neural network (step  204 ). Selecting the manager action may comprise sampling from the probability distribution π M . If the manager action is an option selection action then the selected option policy neural network is used to select the action for the agent (step  206 ). 
     The process then generates an output to cause the selected action to be performed by the agent e.g. a control signal output (step  208 ). As a result a next observation of the environment is received, and optionally a task reward. 
     The output for selecting the action to be performed may be generated by the manager neural network  120  or by the selected option policy neural network. Where the manager neural network outputs an option selection action the process continues to use the selected option policy neural network to receive and process observations and generate outputs for selecting agent actions until an option termination criterion is met (step  210 ). The process may loop back to process the most recent observation with the manager neural network again. 
     In implementations the option termination criterion is met when the option termination neural network corresponding to the selected option policy neural network outputs an option termination value indicating that the option should be terminated e.g. a categorical value such as β o     i   , or a scalar value that indicates a probability of termination of greater than a threshold value. When the option termination criterion is met a new manager neural network output is generated to select a new option or primitive action. 
     An example training process for the reinforcement learning neural network system  100  to perform a task has an inner loop and an outer loop. The inner loop updates the parameters of the manager neural network  120  and of the option policy neural networks  130 . The outer loop updates parameters of the option reward neural networks  140  and option termination neural networks  150 . At the start of the training process parameters of the neural networks of system  100  are initialized, e.g. randomly. 
       FIG.  3    shows an example of the inner loop process; the process may be performed by one or more computers in one or more locations. The process begins by choosing a task e.g. by randomly sampling from possible tasks (step  300 ). 
     Then an observation  106  of the state of the environment is obtained and processed together with data  110  identifying the task by the manager neural network  120  to generate the manager neural network output. In this example this is sampled to select an agent action or an “option” i.e. one of the option policy neural networks  130 , as previously described (step  302 ). If the manager neural network selects an agent action then this is performed; if an option is selected an agent action is selected by the selected option policy neural network, again as previously described. The manager neural network may select multiple agent actions before selecting an option. 
     If an option is selected the observation  106  is processed by each of the selected option policy neural network, the option reward neural network corresponding to the selected option policy neural network, and the option termination neural network corresponding to the selected option policy neural network. In an implementation as shown in  FIG.  1   , with neural networks  130 - 150  each comprising multiple neural network heads on a shared body, all of the neural networks may process the observation. 
     The selected option policy neural network is used to select the agent action (step  304 ). The system then generates an output to control the agent to perform the selected action (step  306 ), the environment transitions to a new state, an observation of the new state is obtained, and a task reward may be received from the environment. 
     The option is followed until termination, e.g. as indicated by the option termination value from the corresponding option termination neural network, e.g. β o =1. Thus steps  304  and  306  are repeated. In this way a n-step trajectory of transitions is obtained by the inner loop (step  308 ). 
     The trajectory of transitions comprises a transition for each of a series of n time steps (where n may be 1). Each transition comprises data representing an observation, the selected agent action, the task reward (if any), and the option reward from the option reward neural network corresponding to the selected option policy neural network. The transition may also include the option termination value from the corresponding option termination neural network. Optionally a trajectory may include data identifying the task and data indicating the selected option. 
     The process then uses any reinforcement learning technique, to train the manager neural network  120  and the selected option policy neural network using the n-step trajectory (step  310 ). Specifically the manager neural network is trained using the task rewards(s), and the selected option policy neural network is trained using the option rewards from the option reward neural network corresponding to the selected option policy neural network. In implementations the manager neural network  120  is only trained using transitions where the manager neural network output was used to select an option (or an agent action). 
     Training each neural network may comprise backpropagating gradients of a reinforcement learning objective function dependent on the reward(s) for that neural network, through the neural network to update parameters of the neural network. Specifically, the manager neural network may be trained to maximize a time-discounted sum of the task rewards, i.e. a return from the environment, and the selected option policy neural network may be trained to maximize a time-discounted sum of the option rewards. In some implementations the option termination value from the corresponding option termination neural network may be used as a time discount factor (e.g. where the option termination value is not a categorical variable). 
     In one example implementation an actor-critic reinforcement learning method is used. In such an implementation the manager neural network output and each of the option policy neural network outputs includes an output, e.g. from a separate head, defining a respective state value. The state value is an estimate of a value of the environment being in a current state to successfully performing the task, e.g. an estimated return for the task from the current state, as characterized by a current observation, when using the option policy neural network to select actions. Then an update to the parameter values of the option policy neural network, 0°, can be determined for each time t as: 
       θ o ←θ o +α( G   t   o   −v   o ( s   t ))·∇ θ     o   [log π o ( a   t   \s   t )− K   o   v   o ( s   t )]
 
     where π o (a t \s t ) is the option policy neural network output for selecting an action a t  at time t given the state of the environment s t  at time t, e.g. a probability value or score for action a t ; v o (s t ) is the option policy neural network state-value output for state s t ; K o  is a hyperparameter that weights the state-value updates relative to the policy updates (typically of order unity e.g. 0.5); ∇ θ     o    is a gradient taken with respect to the parameter values of the option policy neural network; G t   o  is a target value or goal, at time t, for the option policy neural network output for selecting an action i.e. an option policy objective function; and a is a learning rate. 
     Similarly an update to the parameter values of the manager neural network, θ M , can be determined for times t o  when an option is sampled as: 
       θ M ←θ M +α( G   t     o     M   −v   M ( s   t     o   ))·∇ θ     M   [log π M ( o\s   t     o     ,g )− K   M   v   M ( s   t     o     ,g )]
 
     where π M  (o\s t     o   , g) is the manager neural network output for selecting option o at time t o  given the task identity g and the state of the environment s t     o    at time t o , e.g. a probability value or score for option o; v M  (s t     o   ) is the manager neural network state-value output for state s t     o   ; K M  is a hyperparameter that weights the state-value updates relative to the policy updates (typically of order unity e.g. 0.5); ∇ θ     M    is a gradient taken with respect to the parameter values of the manager neural network; G t     o     M  is a target value or goal, at time t o , for the manager neural network output for selecting an option i.e. a manager objective function; and a is the or another learning rate. 
     The target value or goal for the option policy neural network output, g t   o , and for the manager neural network output, G t     o     M , may each be a respective n-step return. The n-step return may be evaluated over the n-step trajectory acquired by the inner loop i.e. a trajectory starting at time t o  and ending n time steps later when the option termination neural network indicates that the option should finish. The n-step return for the option policy neural network output is evaluated using the option rewards from the option reward neural network for the option policy neural network. For example, if the option termination value β t   o  for the option policy neural network at time t is used as the time discount factor: 
     
       
         
           
             
               G 
               t 
               o 
             
             = 
             
               
                 
                   ∑ 
                   
                     j 
                     = 
                     1 
                   
                   n 
                 
                 
                   
                     
                       ( 
                       
                         1 
                         - 
                         
                           β 
                           
                             t 
                             + 
                             j 
                           
                           o 
                         
                       
                       ) 
                     
                     j 
                   
                   ⁢ 
                   
                     r 
                     
                       t 
                       + 
                       j 
                     
                     o 
                   
                 
               
               + 
               
                 
                   
                     ( 
                     
                       1 
                       - 
                       
                         β 
                         
                           t 
                           + 
                           n 
                         
                         o 
                       
                     
                     ) 
                   
                   
                     n 
                     + 
                     1 
                   
                 
                 ⁢ 
                 
                   
                     v 
                     o 
                   
                   ( 
                   
                     s 
                     
                       t 
                       + 
                       n 
                     
                   
                   ) 
                 
               
             
           
         
       
     
     The n-step return for the option policy neural network output is evaluated using the task rewards from the environment. For example: 
     
       
         
           
             
               G 
               t 
               M 
             
             = 
             
               
                 
                   ∑ 
                   
                     j 
                     = 
                     1 
                   
                   n 
                 
                 
                   
                     γ 
                     j 
                   
                   ⁢ 
                   
                     r 
                     
                       t 
                       + 
                       j 
                     
                   
                 
               
               + 
               
                 
                   γ 
                   
                     n 
                     + 
                     1 
                   
                 
                 ⁢ 
                 
                   
                     v 
                     M 
                   
                   ( 
                   
                     s 
                     
                       t 
                       + 
                       n 
                     
                   
                   ) 
                 
               
               - 
               
                 
                   γ 
                   n 
                 
                 ⁢ 
                 c 
               
             
           
         
       
     
     where γ is a time discount factor; and -c represents a switching cost which is added, on option terminations, to the per-step rewards for the manager neural network updates. The switching cost is a hyperparameter that encourages the manager neural network to select options which are temporally extended, thus aiding their discovery. Merely by way of example, c may have a value comparable to but smaller than the reward scale. 
       FIG.  4    shows an example of the outer loop process; again the process may be performed by one or more computers in one or more locations. This begins by performing the inner loop process, either once or multiple times (step  400 ). For example the inner loop may be performed up to 10 times before the subsequent outer loop steps. 
     Once the inner loop has been performed, optionally a new task may be selected; this may but need not be different to the task(s) used for the inner loop (step  402 ). The task is performed as previously described, that is using the manager neural network to select an option (or an agent action), then using the selected option policy neural network to select the agent actions until termination of the option. In this was the new task is performed for e.g. m steps, to obtain a new m-step “validation” trajectory (step  404 ). 
     The process then trains the option reward neural network and the option termination neural network for the selected option(s) using the validation trajectory, in particular using the task rewards in the validation trajectory (step  406 ). This may comprise backpropagating gradients of an option reward objective function dependent on the task rewards, through the selected option policy neural network and into the corresponding option reward neural network, to update parameters of the option reward neural network. This may further comprise backpropagating gradients of an option termination objective function dependent on the task rewards, through the selected option policy neural network and into the corresponding option termination neural network, to update parameters of the option termination neural network. 
     The option reward objective function and the option termination objective function may be any type of reinforcement learning objective function dependent on the task rewards or returns. The same objective function may be used for each of the option reward neural networks and for each of the option termination neural networks. For example if an actor-critic reinforcement learning method is used, updates to the parameter values of the option reward neural network, η r     o   , and to the parameter values of the option termination neural network, η β     o    can be determined as: 
     
       
         
           
             
               η 
               
                 r 
                 o 
               
             
             ← 
             
               
                 η 
                 
                   r 
                   o 
                 
               
               + 
               
                 
                   
                     
                       α 
                       η 
                     
                     ( 
                     
                       
                         G 
                         t 
                         M 
                       
                       - 
                       
                         
                           v 
                           M 
                         
                         ( 
                         
                           
                             s 
                             t 
                           
                           , 
                           g 
                         
                         ) 
                       
                     
                     ) 
                   
                   · 
                   
                     
                       ∇ 
                       
                         η 
                         
                           r 
                           o 
                         
                       
                     
                     log 
                   
                 
                 ⁢ 
                 
                   
                     π 
                     o 
                   
                   ( 
                   
                     
                       a 
                       t 
                     
                     ⁢ 
                     
                       
                         ❘ 
                         &#34;\[LeftBracketingBar]&#34; 
                       
                       
                         s 
                         t 
                       
                     
                   
                   ) 
                 
               
             
           
         
       
       
         
           and 
         
       
       
         
           
             
               η 
               
                 β 
                 o 
               
             
             ← 
             
               
                 η 
                 
                   β 
                   o 
                 
               
               + 
               
                 
                   
                     
                       α 
                       η 
                     
                     ( 
                     
                       
                         G 
                         t 
                         M 
                       
                       - 
                       
                         
                           v 
                           M 
                         
                         ( 
                         
                           
                             s 
                             t 
                           
                           , 
                           g 
                         
                         ) 
                       
                     
                     ) 
                   
                   · 
                   
                     
                       ∇ 
                       
                         η 
                         
                           β 
                           o 
                         
                       
                     
                     log 
                   
                 
                 ⁢ 
                 
                   
                     π 
                     o 
                   
                   ( 
                   
                     
                       a 
                       t 
                     
                     ⁢ 
                     
                       
                         ❘ 
                         &#34;\[LeftBracketingBar]&#34; 
                       
                       
                         s 
                         t 
                       
                     
                   
                   ) 
                 
               
             
           
         
       
     
     where 
     
       
         
           
             
               
                 ∇ 
                 
                   η 
                   
                     r 
                     o 
                   
                 
               
               and 
             
             ⁢ 
             
                 
                  
             
             
               ∇ 
               
                 η 
                 
                   β 
                   o 
                 
               
             
           
         
       
     
     are gradients taken with respect to the parameter values of the respective option reward and option termination neural networks, and α η  is a learning rate which may, but need not be the same for the two updates. 
     In some implementations the equations determining updates to the parameter values of the manager, option policy, option reward, and option termination neural networks may include an entropy regularization term to inhibit premature convergence during training, e.g. a gradient with respect to the parameter values of an entropy bonus, such as a small term depending on a gradient of −log π(α|s t ). 
     The gradients 
     
       
         
           
             
               
                 ∇ 
                 
                   η 
                   
                     r 
                     o 
                   
                 
               
               and 
             
             ⁢ 
             
                 
                  
             
             ⁢ 
             
               
                 ∇ 
                 
                   η 
                   
                     β 
                     o 
                   
                 
               
               , 
             
           
         
       
     
     above, may be referred to as meta-gradients because they update meta-parameters i.e. parameters of the corresponding option reward neural network and option termination neural network which generate the option rewards and option termination values that control the behavior of the selected option policy neural network. 
     In implementations the option reward neural network and the option termination neural network may be trained to maximize a time-discounted sum of the task rewards, i.e. a return from the environment, e.g. the same return as used in the inner loop to train the manager neural network. 
     Conceptually the validation trajectory is used to evaluate the options policies learned in the inner loop, and to update the option reward and termination values guiding the learning of these policies. Thus in the inner loop the parameters of the option reward neural networks and option termination neural networks are fixed and updates are made to the parameters of the manager and options policy neural networks. Then in the outer loop a meta-gradient is determined which depends on a change in the outer loop objective with respect to the parameters of the option reward and option termination neural networks, and thus which depends on the effect the updates to the manager and options policy neural networks have on the outer loop objective. The update to the parameters of the option reward and option termination neural networks may be computed by back propagating through the inner loop updates, e.g. storing copies of each of the inner loop updates to the parameters of the selected option policy neural network. In practice this may be achieved by auto-differentiation back through the parameters of the option reward neural network. 
     The outer loop is performed multiple times, until training is complete e.g. until a maximum number of training time steps is reached. Whilst the outer loop may only update the parameters of the option reward and option termination neural networks corresponding to the selected option, over time the parameters of all the option reward and option termination neural networks are updated. 
     Implementations of the above described system and method can learn to optimize a different objective for each option policy neural network, as parameterized by the option reward and option termination neural networks. The options are disentangled in the sense that objectives are discovered that are useful across multiple tasks. This can speed up learning of new tasks, and can help to achieve higher rewards during training. 
     For example, in some implementations the parameters of the option policy, option reward and option termination neural networks may be fixed after some training. The manager neural network may then be trained to perform a new (previously unseen) task, facilitated by the learned options. At this stage the switching cost may be omitted when training the manager neural network. 
     In general, once the system is trained it may be used to control the agent to perform one or more of the learned tasks in the environment. Also or instead the parameters of the trained option policy, option reward and option termination neural networks may be provided to a second, similar system so that a manager neural network of the second system may be trained to perform one or more tasks using the previously learned options, i.e. using option policy, option reward, and option termination neural networks having the provided parameters. 
     In situations in which the systems discussed here make use of data potentially including personal information, that data may be treated in one or more ways, such as aggregation and anonymization, before it is stored or used so that such personal information cannot be determined from the data that is stored or used. Furthermore, the use of such information may be such that no personally identifiable information may be determined from the output of the systems that use such information. 
     This specification uses the term “configured” in connection with systems and computer program components. For a system of one or more computers to be configured to perform particular operations or actions means that the system has installed on it software, firmware, hardware, or a combination of them that in operation cause the system to perform the operations or actions. For one or more computer programs to be configured to perform particular operations or actions means that the one or more programs include instructions that, when executed by data processing apparatus, cause the apparatus to perform the operations or actions. 
     Embodiments of the subject matter and the functional operations described in this specification can be implemented in digital electronic circuitry, in tangibly-embodied 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 storage medium for execution by, or to control the operation of, data processing apparatus. The computer storage medium can be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them. 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 term “data processing apparatus” refers to data processing hardware and encompasses all kinds of apparatus, devices, and machines for processing data, including by way of example a programmable processor, a computer, or multiple processors or computers. The apparatus can also be, or further include, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). The apparatus can optionally include, in addition to hardware, code that creates an execution environment for computer programs, e.g., code that constitutes processor firmware, a protocol stack, a database management system, an operating system, or a combination of one or more of them. 
     A computer program, which may also be referred to or described as a program, software, a software application, an app, 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. A program may, but need not, correspond to a file in a file system. A program can be stored in a portion of a file that holds other programs or data, e.g., one or more scripts stored in a markup language document, in a single file dedicated to the program in question, or in multiple coordinated files, e.g., files that store one or more modules, sub-programs, or portions of code. A computer program can be deployed to be executed on one computer or on multiple computers that are located at one site or distributed across multiple sites and interconnected by a data communication network. 
     In this specification the term “engine” is used broadly to refer to a software-based system, subsystem, or process that is programmed to perform one or more specific functions. Generally, an engine will be implemented as one or more software modules or components, installed on one or more computers in one or more locations. In some cases, one or more computers will be dedicated to a particular engine; in other cases, multiple engines can be installed and running on the same computer or computers. 
     The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform functions by operating on input data and generating output. The processes and logic flows can also be performed by special purpose logic circuitry, e.g., an FPGA or an ASIC, or by a combination of special purpose logic circuitry and one or more programmed computers. 
     Computers suitable for the execution of a computer program can be based on general or special purpose microprocessors or both, or any other kind of central processing unit. Generally, a central processing unit will receive instructions and data from a read-only memory or a random access memory or both. The elements of a computer are a central processing unit for performing or executing instructions and one or more memory devices for storing instructions and data. The central processing unit and the memory can be supplemented by, or incorporated in, special purpose logic circuitry. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. However, a computer need not have such devices. Moreover, a computer can be embedded in another device, e.g., a mobile telephone, a personal digital assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device, e.g., a universal serial bus (USB) flash drive, to name just a few. 
     Computer-readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices, including by way of example semiconductor memory devices, e.g., EPROM, EEPROM, and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto-optical disks; and CD-ROM and DVD-ROM disks. 
     To provide for interaction with a user, embodiments of the subject matter described in this specification can be implemented on a computer having a display device, e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, for displaying information to the user and a keyboard and a pointing device, e.g., a mouse or a trackball, by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input. In addition, a computer can interact with a user by sending documents to and receiving documents from a device that is used by the user; for example, by sending web pages to a web browser on a user&#39;s device in response to requests received from the web browser. Also, a computer can interact with a user by sending text messages or other forms of message to a personal device, e.g., a smartphone that is running a messaging application, and receiving responsive messages from the user in return. 
     Data processing apparatus for implementing machine learning models can also include, for example, special-purpose hardware accelerator units for processing common and compute-intensive parts of machine learning training or production, i.e., inference, workloads. 
     Machine learning models can be implemented and deployed using a machine learning framework, e.g., a TensorFlow framework. 
     Embodiments of the subject matter described in this specification can be implemented in a computing system that includes a back-end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front-end component, e.g., a client computer having a graphical user interface, a web browser, or an app through which a user can interact with an implementation of the subject matter described in this specification, or any combination of one or more such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN) and a wide area network (WAN), e.g., the Internet. 
     The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. In some embodiments, a server transmits data, e.g., an HTML page, to a user device, e.g., for purposes of displaying data to and receiving user input from a user interacting with the device, which acts as a client. Data generated at the user device, e.g., a result of the user interaction, can be received at the server from the device. 
     While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or on the scope of what may be claimed, but rather as descriptions of features that may be specific to particular embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination. Moreover, although features may be described above as acting in certain combinations and even initially be claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination. 
     Similarly, while operations are depicted in the drawings and recited in the claims in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products. 
     Particular embodiments of the subject matter have been described. Other embodiments are within the scope of the following claims. For example, the actions recited in the claims can be performed in a different order and still achieve desirable results. As one example, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous.