Reinforcement Learning through Asynchronous Advantage Actor-Critic on a GPU
Paper · 2016 · Mohammad Babaeizadeh, Iuri Frosio, Stephen Tyree et al.
Summary
A reinforcement learning agent generates its own training data by acting. In an Atari game, it observes the screen, asks its policy what to do, takes an action, and receives a reward. The next decision depends on what happens after that action. A graphics processing unit can do many calculations together, but an agent playing a game supplies a succession of small requests. This paper asks how to make those requests worth processing on a GPU without losing the benefits of the asynchronous learning algorithm known as A3C, or Asynchronous Advantage Actor-Critic.
The authors build GA3C, a TensorFlow implementation that divides work between a CPU and a GPU. Many agents run separate copies of a game on the CPU, while a single neural network on the GPU handles both action predictions and learning updates. Agents submit requests through queues. Predictor threads group requests from different agents into a GPU call, and trainer threads can combine recently collected experiences for an update. The best allocation of agents, predictors and trainers depends on the game, the network and the hardware. A search that adjusts these counts during training comes close to the performance of a configuration chosen through profiling on the same machine. GPU & parallel computing
Against the authors’ CPU implementation of A3C, GA3C reaches up to 6× the prediction rate for the small network and 45× for the largest tested network, on different systems. These are throughput measurements. The Atari score comparison uses a separate, previously published CPU baseline. After one day of training, GA3C reaches scores broadly comparable to those reported for A3C after four days, with substantial differences by game. Learning curves also vary by game. The paper observes faster progress in Pong and slower progress in Breakout under the reported comparisons.
Sharing the network creates a learning problem as well as a computing opportunity. An agent can take an action using one version of the policy, then have its experience used for training after other agents’ experiences have changed the policy. The authors call this mismatch policy lag. They add a small constant before taking the logarithm of an action probability, and they test larger training batches to make updates less frequent. Minimum batches between 20 and 40 experiences give the best overall learning behavior in their experiments, while further increases slow some games. The authors release GA3C so that others can examine these tradeoffs and use the implementation for further experiments.
Deep dive: Reinforcement Learning through Asynchronous Advantage Actor-Critic on a GPU
How GA3C speeds up reinforcement learning by batching Atari agents’ requests on a GPU, and how delayed updates affect training stability. · about 35 minutes to read
The problem and its context
The next training example depends on the last decision
An agent learning from a game supplies its own sequence of observations. Its current policy, the rule it uses to choose actions, partly determines which positions it visits, which rewards it receives, and what it can learn from those rewards. When the policy changes through training, the experience the agent is likely to collect changes as well.
This dependence creates a computing constraint. Within any game instance, the agent has to choose an action before the simulator can reveal the next state. The next prediction depends on that state. A sequence from a single game therefore offers little opportunity to evaluate a large batch of upcoming decisions together. The inputs for those decisions become available as play proceeds.
Training has its own demands on the same network. It uses recently collected states, actions and rewards to improve the policy and the estimate of future return. The quantities involved in an update can be available for several steps at once, but A3C ordinarily updates after a short stretch of play. Even when the accelerator executes an individual operation quickly, a stream of small calls can leave it waiting for data or for the software to prepare the next operation. Transfers between the CPU and GPU matter too, particularly when the work associated with each transfer is small.
Independent games supply another source of parallel work. A decision in one game can proceed while another game is advancing, a different agent is preparing a training submission, or a previous request is returning. The challenge is to turn that independence into enough work for the GPU while keeping the agents moving. A predictor needs several requests to make a substantial batch, but the agents that supplied those requests are waiting for their answers. A trainer needs experiences from play, and its access to the GPU affects how quickly agents can obtain the predictions that generate more experiences.
Deep reinforcement learning before GA3C
The paper situates this computing problem in a field that had already made progress on learning from raw input. Earlier reinforcement learning applications often depended on features designed for a particular task. Deep Q-Learning Networks, or DQN, showed how a neural network could serve as a general-purpose function approximator in reinforcement learning. The paper points to game-playing systems that learn from pixels as evidence of what this change made possible.
DQN uses experience replay. The agent’s past interactions go into a memory from which the learning procedure can repeatedly draw examples. The paper credits replay with helping stabilize training and identifies its costs in computation and memory. For a GPU implementation, the stored examples have a practical advantage. An updater can assemble a batch from experiences already in memory, even though the individual interactions that generated them had to happen in order.
The paper describes several changes to the DQN approach. Prioritized DQN makes some experiences more likely to be selected from replay, giving greater attention to those considered significant. Double DQN separates choosing an action from estimating its value to reduce the tendency toward overly optimistic estimates. Dueling Double DQN gives the network separate computations for the value of a state and the advantage associated with actions. These changes concern which experiences are used or how the network assigns values. GA3C starts from a different learning algorithm and focuses on the mechanics of getting work to an accelerator. Deep Reinforcement Learning with Double Q-learning
The authors also describe systems that pursued speed or capability through extensive parallel resources. The distributed Gorilla DQN system used 100 concurrent actors on 31 machines, with 100 learners and a central parameter server. In the account given by the paper, it improved on DQN and demonstrated that deep reinforcement learning could scale across a substantial installation. The improvement came with greater memory requirements, computation and cost. AlphaGo is another example in the paper of an approach that combined changes in the learning system with extensive hardware specialization. GA3C concentrates on how to make the CPU and GPU in a single system work together. Massively Parallel Methods for Deep Reinforcement Learning
The starting point is a parallel CPU algorithm
A3C was already designed for concurrency. Several agents play separate games and contribute updates to shared parameters. Each agent has a local copy of the network, evaluates its own policy, and calculates gradients from the experiences it gathers. The shared parameters can receive an update as an agent finishes a stretch of play. The agents operate asynchronously, meaning they can complete their work and contribute at different times.
The paper describes the original implementation as using 16 agents on a 16-core CPU. This arrangement gives many game instances a chance to make progress concurrently and keeps the individual prediction and training computations near the processes that need them. A3C does without replay. An agent collects a short run of new experience and uses it to train, with no replay memory from which large batches are always ready to be drawn. A GPU arrangement that submits each small inference call and each short training batch separately has limited opportunity to use the accelerator’s parallel capacity.
GA3C changes where prediction and gradient calculation happen. The CPU continues to advance the simulations. Requests from different simulations become work for a shared neural network on the GPU, and the architecture retains the short experience sequences that make A3C practical. The question is whether a queue can bring together enough independent work for efficient processing while still returning predictions and applying updates promptly. The answer depends on how the system schedules both kinds of work and on what happens to an experience while it waits.
The method, step by step
From a screen observation to a learning signal
Consider an agent partway through an Atari episode. It observes the current state and samples an action using its policy. Sampling means the policy supplies a probability for each available action and the agent draws an action from that distribution. After the action, the simulator advances, supplies the next state and passes back a reward. The cycle continues until a terminal state or a time limit ends the episode, when the environment resets.
The aim is to increase expected reward over a sequence of decisions. An action’s immediate reward can give only a partial account of its value. The agent also cares about what follows, with later rewards discounted by a factor that governs how strongly they enter the return. In the reinforcement learning background, the paper writes the return from a timestep as a sum extending over future rewards.
Rₜ = ∑ᵢ₌₀^∞ γⁱ rₜ₊ᵢ
Here Rₜ is the discounted return from timestep t. The summation index i counts steps forward from t, starting at 0, and ∞ denotes the open-ended horizon in this definition. The reward at time t + i is rₜ₊ᵢ. The discount factor γ belongs to (0, 1], and γⁱ is the weight on the reward i steps ahead. A discount below 1 gives rewards less weight the farther ahead they occur. The addition in the time subscript indicates which reward in the sequence is being counted.
The policy takes a state and returns probabilities. During learning, the algorithm changes the parameters of the network that produces those probabilities. In the REINFORCE formulation discussed by the authors, a sampled action contributes a direction for changing the parameters, and its return determines how that direction is weighted.
∇θ log π(aₜ | sₜ; θ) · Rₜ
The symbol ∇θ denotes the gradient with respect to the parameter set θ, and log is the logarithm. The policy π assigns a probability to the action aₜ taken at time t, given the state sₜ and parameters θ. The vertical bar marks the state as the condition for the action probability, and the semicolon separates the parameters from the state in the notation. The multiplication dot indicates that the log-probability gradient is scaled by the observed discounted return Rₜ. The paper describes this expression as an unbiased estimate of the gradient of expected return.
Returns can vary considerably from one trajectory to another. The paper introduces a baseline that depends on the state. With a baseline, the learning signal for the action depends on whether the return surpassed or fell below an expectation for that state. The baseline version of the gradient is as follows.
∇θ log π(aₜ | sₜ; θ) · [Rₜ − bₜ(sₜ)]
The gradient ∇θ still measures change with respect to θ, the network parameters. The logarithm takes the probability assigned by policy π to the action aₜ given state sₜ at time t. The bracketed term subtracts the baseline bₜ(sₜ), a function of that state at t, from the return Rₜ. The multiplication dot scales the gradient by that difference. The paper describes baseline subtraction as a way to reduce the variability of the estimate.
A natural baseline in this setting is the expected return from the current state if the agent continues to follow its policy. This gives the critic a concrete job. It estimates how much return the agent can expect from where it is. The actor uses the comparison between the estimated return and the return used for training to adjust its action probabilities.
Vπ(sₜ) = E[Rₜ | sₜ]
The notation Vπ denotes the state-value function for policy π. Its input sₜ is the state at time t. E denotes expectation, Rₜ is the future discounted return from t, and the vertical bar indicates that the expectation is conditional on starting at sₜ. In this definition, the future actions follow π. In the implementation, the critic supplies an estimate of this quantity using the neural network.
The network and the short return used for training
A3C uses one network with a shared set of hidden layers and separate outputs for the actor and critic. The small architecture described in the paper begins with convolutional layers specified by 16×8×8 filters at stride 4 and 32×4×4 filters at stride 2. The leading quantity in each specification is the number of filters. The remaining quantities give their spatial dimensions. Stride controls how far the filter moves between applications. These layers feed a fully connected layer with 256 units. A rectifier follows each hidden layer.
The policy output uses a softmax, which converts the network’s action scores into a distribution over actions. The value output is linear and supplies a single estimate of return from the state. Sharing the hidden layers lets both outputs use the same processing of the screen input. The training objectives distinguish the probability the actor assigns to the sampled action from the return the critic predicts.
A3C need not wait for an episode to finish before making an update. An agent collects at most tₘₐₓ = 5 actions for a submission, with an earlier stopping point if the episode terminates. If the rollout stops before the episode ends, the method can use the critic’s estimate at the ending state to account for what might follow. Using that estimate beyond the rewards actually observed is called bootstrapping. The paper uses Rₜ for this short-horizon training target as well as for the general return in its background discussion.
Rₜ = ∑ᵢ₌₀^(k−1) γⁱ rₜ₊ᵢ + γᵏ V(sₜ₊ₖ; θₜ)
In this expression, t is the step whose return is being estimated and k is the length of the remaining stretch of observed experience used for that estimate, bounded by tₘₐₓ. The index i starts at 0 and runs up to k − 1. The observed reward rₜ₊ᵢ is discounted by γⁱ, where γ is the discount factor. The plus sign adds a continuation estimate from the state sₜ₊ₖ reached after that stretch. V is the learned value function evaluated with parameters θₜ, the parameter values at time t in the paper’s notation. The multiplier γᵏ discounts that continuation over k steps. If the episode has ended, there is no further return from continuing that episode.
This construction uses information available in time for a short update. A reward within the agent’s collected stretch enters the target directly. The critic carries the estimate beyond the stretch when play continues. Short submissions give the system work throughout an episode, while the predictor still has to advise the agent on each successive decision.
The actor uses the difference between the return target and the critic’s estimate at the starting state as its advantage signal. The sign of that difference matters. A sampled action associated with a better return than the critic anticipated supplies a signal to raise the action’s probability. A worse return supplies a signal in the other direction. The policy objective adds an entropy term that favors keeping some variety in the decisions sampled during training.
fπ(θ) = log π(aₜ | sₜ; θ) · [Rₜ − V(sₜ; θₜ)] + β H(π(sₜ; θ))
Here fπ is the policy objective as written by the authors, and θ denotes the parameters with respect to which it varies. The logarithm log is applied to the probability that policy π assigns to aₜ in state sₜ. Both aₜ and sₜ refer to step t. The multiplication dot applies the advantage estimate in brackets to that log probability. Rₜ is the return target, V(sₜ; θₜ) is the critic’s estimate using the parameter values θₜ at t, and the minus sign takes their difference. The notation π(sₜ; θ) denotes the entire action distribution at the state. H is its entropy, a measure of how spread out the probabilities are, and β controls the strength of the entropy term added to the objective.
The critic learns from the error in its value estimate. A large gap between the target and the estimate contributes a larger squared error.
fᵥ(θ) = [Rₜ − V(sₜ; θ)]²
Here fᵥ is the value loss as a function of θ. Rₜ denotes the return target for step t, and V(sₜ; θ) is the value output for state sₜ using the parameters being trained. The subtraction gives the signed error and the superscript ² squares it. The objective for the critic is to reduce this error. Its estimate also supplies the baseline that helps the actor interpret the same experience.
Gradients and parameter updates
The paper describes using non-centered RMSProp to apply the gradients from the objectives. It keeps a running estimate of recent squared gradient magnitudes and uses that estimate to scale updates. The accumulation is carried out for the individual parameters.
g ← αg + (1 − α)(Δθ)²
Here g stores the running estimate for the squared gradient, and the left arrow assigns the newly calculated value to it. The old estimate receives weight α, the decay parameter. The current squared gradient, written (Δθ)², receives weight 1 − α. The plus sign combines the two contributions. Δθ denotes the gradient used by the optimizer, written in the descent convention for the parameter update.
θ ← θ − ηΔθ / √(g + ε)
Here θ is the parameter set and the arrow indicates its replacement by the updated values. The minus sign moves in the descent direction using gradient Δθ, and η is the learning rate. Division by the square root of g plus ε scales the update using the running squared-gradient estimate g. The small constant ε keeps the denominator away from zero. The original A3C account describes storing the RMSProp statistics separately per agent thread or sharing them, and identifies the shared version as the more robust option.
In the original CPU architecture, an agent calculates the gradients from its own short trajectory using its local network. A central parameter store receives the resulting update, and the agent obtains updated weights. The other agents can be elsewhere in their cycles. A local network thus supports consistency between the probabilities used to act and the calculation that turns the agent’s experience into a gradient. Meanwhile, the global parameters can move as other agents contribute.
What moves through the queues
GA3C moves all network prediction and training to a single instance of the network on the GPU. A rollout still belongs to one agent and follows the sequence of that agent’s game. Batching happens among independent requests that need the same kind of computation. An agent can submit a state for action prediction even though a different agent is already ready to submit a trajectory for training.
How GA3C turns play into shared GPU updates
The steps in order.
Each agent is a CPU process operating its own environment. Before taking an action, it puts a prediction request into the prediction queue and waits for the response. The queue can hold requests from agents at unrelated points in their games. Each request asks for an evaluation of the network on a current state. After receiving its policy, the agent chooses an action and collects the next observation and reward.
A predictor is a CPU thread that takes the requests currently available, puts them into a batch, and invokes the network on the GPU. It then routes the outputs back to the agents that requested them. The batching rule reacts to the requests already waiting. It can generate larger calls when many agents have reached a prediction point. Multiple predictor threads can operate concurrently to hide latency, though taking requests from the queue more often may leave fewer to combine in any given call.
The agent periodically sends a short sequence of experiences to a separate training queue. A submission usually contains tₘₐₓ experiences and can be shorter at the end of an episode. The agent sends experience data, including the states, actions and return targets needed for the update. The trainer retrieves this work and calls the GPU to calculate the gradients and update the shared parameters. The basic configuration processes one agent’s submission in an update. The paper also tests collecting submissions from several agents into one training batch.
Several trainer threads can help keep new work ready while other calls are in progress. The same accelerator, however, handles both prediction and training. An agent obtains its next experience only after its prediction comes back, and the supply of training data depends on agents obtaining predictions at a sufficient rate. Adding trainer threads can therefore have opposing effects. They can keep the GPU supplied with updates, and they can occupy it for periods when the predictors have requests ready. Adding agents can populate the prediction queue and hide waiting across independent games, while adding too many processes can increase the cost of sharing the CPU.
Measuring and tuning the division of work
The authors use trainings per second, abbreviated TPS, to measure the rate at which batches leave the training queue for updates. It counts updates as the batching procedure defines them. With a fixed learning rate and a fixed batch size, it can serve as an approximate indicator of the rate of learning work. Predictions per second, abbreviated PPS, measures the prediction rate across the agents and tracks their combined rate of playing. A GPU call can supply predictions for several agents, so a rate of predictions has a different interpretation from a count of batched calls.
The paper relates the rates for a balanced setting in which an agent usually supplies one update’s worth of experience after a full stretch of play.
PPS ≈ TPS × tₘₐₓ
Here PPS is predictions per second, TPS is trainings per second, and tₘₐₓ is the maximum number of actions in a rollout submission. The multiplication sign converts the update rate to the approximate prediction rate associated with those rollouts. The approximation sign allows for the fact that the relationship is a description of the balanced arrangement. Early episode endings can shorten a submission, and combining submissions changes how many experiences an update represents.
Each selected action is repeated four times in the simulator, following the earlier A3C setup. The paper therefore also expresses the rate of frames advanced.
FPS = 4 × PPS
FPS is frames per second across the agents, and PPS is predictions per second for their decisions. The factor 4 is the number of frames for which the selected action is repeated. The multiplication converts the decision rate to the frame rate under that setup.
GA3C can adjust the numbers of agents, predictors and trainers as it runs. The paper denotes these counts by Nₐ, Nₚ and Nₜ, respectively. As an initial rule of thumb, the authors suggest at least as many agents as CPU cores and a predictor count and trainer count of 2 each. Simulation cost, the network architecture, and the characteristics of the host and accelerator can all change the setting that actually gives the best throughput.
The dynamic procedure periodically perturbs the configuration. Every minute, it randomly chooses a component count to change by ±1, observes the effect on TPS, and uses that measurement to decide whether to accept or reject the change. The objective for this search is the update rate. The paper separately examines score curves to see whether configurations with better throughput also make better use of wall-clock time.
What happens when the policy changes before training
A single network removes the need to distribute weights to agent copies. It also means that the agent has no local copy available for computing its gradient against the same network that originally selected its action. After the agent collects a stretch of experience, the submission can wait in the training queue. Other updates can change the network in the meantime.
The paper writes the resulting gradient using t for the time of consumption and t − k for the earlier time associated with the example. In this discussion k measures lag. In the return formula above, the same letter measured the length of the reward stretch. The action attached to an experience remains the action the agent actually sampled. The policy and the value estimate used at training can have moved.
∇θ {log π(aₜ₋ₖ | sₜ₋ₖ; θ) · [Rₜ₋ₖ − V(sₜ₋ₖ; θₜ)] + β H(π(sₜ₋ₖ; θ))}
Here ∇θ denotes the gradient with respect to network parameters θ. The index t identifies the training time and k the lag, so sₜ₋ₖ and aₜ₋ₖ denote the older state and sampled action. The policy π assigns that action a probability when evaluated at the older state using θ, and log takes its logarithm. The multiplication dot scales this term by the difference between the stored return target Rₜ₋ₖ and the value estimate V at that state using the parameters θₜ at training time. The entropy H is computed from the policy’s action distribution at the older state, and β weights its contribution. The braces enclose the expression being differentiated.
An action with substantial probability when sampled might have a very small probability after intervening updates. In the extreme case described by the authors, the updated probability can reach zero in the calculation, which makes its logarithm unusable. GA3C adds a small positive constant to the probability inside the logarithm. A corresponding offset appears in the entropy term.
∇θ {log[π(aₜ₋ₖ | sₜ₋ₖ; θ) + ε] · [Rₜ₋ₖ − V(sₜ₋ₖ; θₜ)] + β H(π(sₜ₋ₖ; θ) + ε)}
The operator ∇θ again differentiates with respect to θ. The time t is when training consumes the experience, k is the lag, and aₜ₋ₖ and sₜ₋ₖ are the action and state from its collection. The function π supplies either the probability of that action or the full distribution, according to its arguments. In the logarithm log, ε is the positive offset added to the chosen action’s probability. In the entropy calculation H, the offset is applied to the probabilities in the distribution. Rₜ₋ₖ is the return target, V(sₜ₋ₖ; θₜ) is the value estimate using the training-time parameters, and their difference weights the log term. The factor β weights entropy.
The paper explains the effect of the offset by differentiating the logarithm. In the following expression, π stands for the probability of the sampled action.
∂ log(π + ε) / ∂θ = (∂π / ∂θ) / (π + ε)
The partial derivative symbol ∂ denotes differentiation with respect to θ, the network parameters. The symbol π is the action probability as a function of θ, log is the logarithm, and ε is the positive constant. The numerator on the right is the derivative of the probability itself. Because the denominator includes ε, the reciprocal factor multiplying that derivative has a finite upper bound even when the probability approaches zero. The authors say this change addresses the numerical instability that otherwise motivates gradient clipping, the practice of limiting large gradients.
The offset deals with the calculation at small probabilities. An older action can still be evaluated using a different set of parameters, and the critic’s estimate can have shifted too. The authors address this broader source of noise by experimenting with how often the shared network changes. If the trainer combines several submissions, it applies fewer updates for the same set of experiences. That can leave fewer parameter changes between the prediction and gradient computation. The combined batch also changes the amount of work in each update and the time for which training occupies the GPU. The learning experiments examine the balance among these effects.
Experiments and results
What the benchmarks measure
The experiments use Atari games as environments that generate experience during training. Separate agents advance their games and accumulate observations, actions and rewards. Some tests concentrate on the computing system, with Pong used to profile configurations and network sizes. Others track game scores to see how training progresses with elapsed time. This gives the paper several ways to assess the implementation, including prediction rate, update rate, GPU utilization, and evaluation score. A configuration can do well on one of those measures for reasons that have different implications for another. Evaluation & benchmarks
The authors profile GA3C using CUDA tools and timing code in Python. The hardware includes System I with a GeForce Titan X, System II with a GeForce 980, and System III with a Tesla K80. A Quadro M6000 is used in System IV for the training curves reported at the chosen learning rates. The authors compare their TensorFlow GPU implementation with their own CPU implementation for the throughput tests. Their wider Atari score comparison instead uses published scores for original A3C, along with published random-player and human-player scores.
This distinction matters when interpreting any claim about speed. Predictions per second directly compares the rate at which the authors’ implementations can guide play under a specified workload. A score at the end of a run measures what the trained agent can achieve after a specified period. The run may differ in learning rate, selection procedure, architecture or hardware. A comparison of scores can establish how competitive the reported outcomes are without supporting the same kind of speed ratio as the throughput measurements.
Throughput for the small controller
On System I, the authors profile configurations during the first 16 minutes of Pong training. They vary the number of agents over 16, 32, 64 and 128. For the numbers of predictors and trainers, the values considered are 1, 2, 4, 8 and 16. For each agent count, the figure emphasizes the top 3 predictor–trainer configurations, using TPS normalized to the best performance at the end of the profiling interval.
The highest consistently observed update rate on System I occurs with 128 agents, 2 predictors and 2 trainers. At the higher agent count, the authors observe diminishing returns and suggest that extra process overhead contributes to them. More agents give a waiting predictor a greater chance of finding several states ready for a call. An excess of CPU processes can also make the work of running the simulators and coordinating requests more expensive.
Table 2 reports prediction rates for the authors’ A3C and GA3C implementations. For the small controller on System I, it lists 352 PPS for CPU A3C and 1361 PPS for GA3C, with a reported speed-up of 4×. The corresponding speed-ups for the small network are 6× on System II and 4× on System III. The table’s largest small-network speed-up occurs on System II, where both implementations have lower absolute prediction rates than they do on System I. A speed-up compares to the CPU baseline on the same system. An absolute prediction rate describes the resulting pace of play.
CPU A3C and GA3C prediction throughput with the small Atari controller on System I
GA3C supplies predictions to the agents at a higher rate on the profiled system.
The numbers
| System or setting | predictions per second |
|---|---|
| CPU A3C | 352 |
| GA3C (this paper) | 1361 |
In the fastest small-network configuration on System I, the paper reports GPU utilization of 56%. The GPU’s average occupancy when active is 76%, and peak occupancy is 98%. Utilization measures how much of the time the GPU is in use. Occupancy describes how much of its thread capacity is active while it is working. The distinction helps explain how a computation can use many threads while it is running and still leave the device idle for substantial periods. The profiling gives the authors a reason to test networks that require more computation.
How the implementations handle larger networks
The paper creates larger variants by increasing the first layer’s filter count from 16 to 32 and adding a convolutional layer with 64 filters of size 4 × 4 and stride 2. To create workloads of different sizes, it lowers the stride of the first layer from 4 to 1 in steps of 1 pixel. A smaller first stride applies the filters at more locations. The stride 1 variant also has a fully connected layer that the paper describes as 4× larger. The table thus compares the same CPU and GPU approaches over a set of networks that place successively different demands on their hardware.
System I illustrates what happens to absolute rates. The large network at stride 4 reaches 113 PPS on CPU A3C and 1271 PPS on GA3C. At stride 3, the rates are 97 and 1206 PPS. At stride 2, they are 43 and 874 PPS. The stride 1 network reaches 11 PPS on CPU A3C and 490 PPS on GA3C. As the workload grows, both implementations process fewer predictions per second, with a larger fall for the CPU implementation. The paper lists speed-ups of 11×, 12×, 20× and 45× for those large variants on System I.
CPU A3C and GA3C prediction throughput with the large stride 1 Atari controller on System I
GA3C sustains a higher prediction rate than CPU A3C on the largest tested controller.
The numbers
| System or setting | predictions per second |
|---|---|
| CPU A3C | 11 |
| GA3C (this paper) | 490 |
For the largest network, Table 2 reports a 28× speed-up on System II and 6× on System III. GPU utilization for the same large variant is 90% on System I, 78% on System II and 82% on System III. These measurements characterize the tested CPU and GPU combinations. They show that the amount of useful work the implementation can give the accelerator changes with the architecture of the controller.
A profiling comparison in the Pong experiment also isolates the effect of moving to a controller with an extra layer. The paper reports a 7% drop in TPS, accompanied by increases of approximately 12% in average GPU utilization and 0.5% in occupancy. The authors attribute the update-rate decrease to additional sequential work required by the layer. They interpret the small occupancy change as consistent with efficient scheduling of available work by the GPU library and some remaining capacity for more parallel computation. The result is about the cost of executing a larger controller. The score experiments do not assign a corresponding playing benefit to the extra layer.
Where the time goes
Timing the calls reveals a substantial cost around the GPU computation. On System I, the authors measure an average of 108ms from an agent’s request to its completed prediction. GPU inference accounts for 10% of that duration. They say the remaining 90% comes from building up the batch and invoking the prediction function from Python. In the same profiling discussion, a network update averages 11.1ms, and overhead accounts for 59% of that time.
These measurements capture different spans of work. Prediction time is measured from the perspective of an agent waiting for an answer. It includes the work required to turn a pending request into part of a GPU call. Update time covers the network update and its associated overhead. Independent agents can still make progress elsewhere in the system while a particular agent is waiting. As a result, a system can have both appreciable request latency and a high combined prediction rate.
The timing also helps account for how GA3C can leave the GPU underused with small networks. Faster computation of the network would affect only part of the time spent waiting. The authors suggest that a lower-level implementation might reduce some of the overhead they measure. They leave that possibility for further work.
Atari scores after training
The score table compares average Atari scores for a random player, a human player, original A3C and GA3C. The A3C results are from CPU training for four days. GA3C scores come from GPU training for one day, using the best agent trained by the authors’ implementation. The reported GA3C averages are over 30 game plays initialized with random seeds. The random and human rows for each game provide context for the scale of the game’s score. Each game has its own scoring rules.
In Boxing, GA3C records an average score of 92, while the published A3C score is 60. Human and random scores are 10 and −2, respectively. In Centipede, GA3C reaches 7386 and A3C reaches 3756, with 10,322 for the human player and 1926 for the random player. Other comparisons favor A3C. In Amidar, GA3C scores 218 and A3C scores 264. In Name This Game, GA3C scores 5643 and A3C scores 10,476. The pattern supports the authors’ description of broadly similar scores after the stated training periods, with the ordering varying by game.
Average Centipede game score for players and agents in the Atari comparison
GA3C scores above published A3C and below the reported human performance.
The numbers
| System or setting | average game score |
|---|---|
| Random player | 1926 |
| Published CPU A3C | 3756 |
| GA3C (this paper) | 7386 |
| Human player | 10,322 |
Learning curves provide a closer look at time and score together. On System IV, the paper plots GA3C training for five Atari games, with three runs at each of two learning rates, 0.0003 and 0.0001. The same rates are used across games. Comparing these curves with those reported for original A3C, the authors describe GA3C as approaching the maximum score sooner in Pong. In Qbert, GA3C approaches a higher score over a longer period. In Breakout, its reported rate of improvement is slower.
The original A3C curves summarize the top five learners selected from fifty learners that used different learning rates. GA3C’s curves show individual runs at its fixed choices of learning rate. The authors regard the performance across the tested choices as some evidence that GA3C can learn without a separate search for the best rate in each game. The difference in how the curves are constructed also helps explain why they use them to discuss particular examples of learning behavior, alongside the separate measurements of prediction throughput.
What the ablations show
Agents, predictors and trainers need to keep pace with each other
The paper varies the thread and process counts in Pong to look for the configurations that make efficient use of System I. Even the subset consisting of the top 3 predictor–trainer configurations at each agent count shows a 14% drop in TPS between the best and worst depicted configurations. The comparison holds the game and machine fixed. The measured rate changes as the components share the work differently.
Configurations with 4 or fewer predictor threads produce the strongest results in this comparison. A predictor that removes requests before many others arrive can create small batches. With additional predictor threads taking work from the same queue, there can be more calls for the same set of predictions. The authors link the observed preference for fewer predictors to that batching effect. Among the configurations shown, the fastest ranks near the top in average prediction batch size.
The authors also report that the most successful predictor-to-trainer ratios tend to be 1 : 2, 1 : 1 or 2 : 1. Ratios of 1 : 8 and 1 : 4 seldom appear among the successful configurations. When trainers demand a greater share of the GPU, they can delay the predictions that agents need to generate new training experience. Conversely, having trainers ready is useful when experience is arriving quickly and the GPU has time to process it. The paper finds that the curves for PPS and TPS track each other closely in its configuration tests, consistent with the dependence of training on the pace of play.
The queue measurements add context to those rates. For the top configurations, the training queue settles well below its maximum capacity. The authors also find that the fastest configuration combines a high training rate with a relatively large prediction batch. A full training queue would indicate a backlog of experience waiting for updates. The observed balance gives the GPU work while the trainers remove experience at a pace that avoids a persistent large backlog in the configurations profiled.
Reallocating work during training
The dynamic search starts from a deliberately sparse allocation in the tuning demonstrations. Agent, predictor and trainer counts are each initialized at 1. The system then tries local changes, uses measured TPS to decide among settings, and reaches different preferred configurations for Boxing and Pong on the same hardware. The game can change the system’s operating point even when the CPU and GPU remain the same.
The paper also compares scoring curves for four GA3C settings with the same initial network in each game. The settings include configurations with insufficient concurrency, a strong fixed configuration, and one using dynamic adjustment. The plots track score over wall-clock time and record the cumulative number of frames played during 3 hours. Configurations that play more frames generally make faster scoring progress in these runs. On a fixed wall-clock budget, they can generate and use more experience.
The dynamically adjusted configuration tracks the scoring curve of the strong fixed setting closely, despite its slow starting allocation. It generally accumulates slightly fewer frames in the same period. The authors attribute some of that difference to the search itself, which changes a count once a minute and tends to fluctuate around the preferred allocation. The experiment shows that a configuration chosen while the game is running can approach the measured performance of one selected in advance. The scoring curves are important here because the tuner’s feedback is TPS, while its practical value depends on the trained agent making progress.
The paper also notes that the more successful GPU configurations use more agents than the original CPU implementation. It suggests that both the rate at which the system processes experience and the use of a larger collection of agent trajectories may contribute to the learning behavior. The comparison changes the rate of play along with the number of agents, so the plots support the combined result of efficient configuration. They leave the independent contribution of the number of agents unresolved.
Changing the minimum training batch
The minimum-batch experiment examines an aspect of learning that a throughput-only analysis would miss. By default, a trainer can issue an update from one agent’s submission. Under an enforced minimum, it gathers additional submissions before doing the update. The paper describes the progression from a minimum size of 1 to 40 as reducing the effect of policy lag and improving convergence. A minimum of 1 permits small batches. An ordinary agent submission may already contain several experiences.
The authors’ explanation centers on the number of parameter changes while experience is waiting. An update changes the shared policy for every submission still in the queue. When each update consumes more submissions, the same flow of experience can be processed through fewer separate parameter changes. Predictions and gradient calculations then have a greater chance of using similar parameters. This can make the learning curve more stable even when the number of updates per second falls.
The batch size affects more than update frequency. GA3C sums the gradients within a batch, so combining experiences changes the typical magnitude of an update. It can also give the GPU more parallel work per call and reduce the share of its time spent handling many small updates. A long training call eventually has its own cost. Predictors can have states ready and still wait for the accelerator to become available. The observed learning effect reflects the way these aspects change together.
The paper identifies minimums between 20 and 40 experiences as giving its best overall results. Larger minimums can slow convergence substantially, especially for games whose curves show unstable learning. Pong shows a less pronounced response because its learning curves exhibit less of the instability that the intervention addresses. The result supports moderate batching in the tested arrangement and gives a specific example of why increasing batches to improve device use can eventually work against learning. The authors suggest that selecting the learning rate jointly with the minimum batch might improve the curves further. They frame that as a possibility.
Limitations
Limits the authors identify
The authors distinguish comparisons they can perform directly from those they can make using published scores. Their direct throughput baseline is the CPU implementation they build in TensorFlow. For the original CPU A3C results, they say they lack the original code or comparable measurements of average frame and update rates. The score table compares one day for their GA3C run with four days for published A3C, but this timing comparison has no measured per-frame or per-update counterpart for the original implementation.
The published curves also use a broader learning-rate search and a different way of selecting runs. Original A3C averages the top five of fifty learners. GA3C reports three runs for each of the two shared rates. The GA3C curves illustrate behavior at those settings, and the paper leaves open the possibility that tuning the rates would improve learning. Consequently, even in games where one set of curves rises visibly sooner, the published comparison combines differences in implementation and evaluation procedure.
The authors report sizeable overhead from forming batches and making calls in Python. They suggest a lower-level implementation as a possible way to reduce it and leave the investigation open. They also observe that, with larger controllers, the CPU can have spare capacity after running the simulators while the GPU performs prediction and training. They identify further use of that CPU capacity as outside the study. Neither observation is accompanied by a measurement of the improvement available from the proposed change.
The conclusion presents larger GPU-hosted controllers as opening up experiments in applications such as robotics or autonomous driving. The tests here concern Atari learning and the computational cost of larger Atari controllers. The control applications are a motivation for making larger networks practical. The paper also sees possible uses for its queues and scheduling in similar asynchronous algorithms, while its implementation and measurements concern A3C. Continuous control with deep reinforcement learning
Limits of what the comparisons establish
A large prediction speed-up for a larger network establishes a computational advantage for that workload. To infer that the architecture improves learning, a reader would also need to see how the larger controller changes game performance and the experience required to reach it. The architecture comparison reports throughput and utilization, while the game experiments study score and training settings. Consequently, the evidence for scaling to larger networks is stronger on the cost of running them than on the outcome they would produce.
The same distinction applies to wall-clock learning progress and the amount of experience an agent needs. A faster configuration can improve its score sooner by playing more frames in an hour. The configuration curves support that explanation because they show cumulative frames alongside time and score. They leave open whether a different configuration would learn more from the same amount of experience. Changing the number of agents alters both the rate of collection and the trajectories that supply an update. A wall-clock comparison combines those effects.
TPS is most interpretable among settings with comparable batches. The minimum-batch experiments explicitly change how much experience an update contains, and the gradients are summed. A lower TPS can therefore coexist with more processed experiences per update and a steeper learning curve. The dynamic search demonstrates a way to choose component counts using its throughput objective under the tested settings. Its measured success does not establish that this objective identifies the best learning configuration across different choices of batch size or learning rate.
Policy lag is also difficult to isolate experimentally in this setup. Grouping training submissions reduces the frequency of parameter updates, changes the combined gradient, and changes how prediction and training contend for the GPU. The resulting score curves are consistent with the authors’ account of lag, and they show that there are practical benefits to moderate batching. They leave the size of the improvement attributable specifically to less lag undetermined. The positive offset in the logarithm has a direct mathematical effect on the dangerous small-probability term, while the state, action and current parameters can still be out of step.
The experiments make the hardware dependence visible. The same network sees distinct absolute prediction rates and relative speed-ups across the tested systems. The choice of an agent count or thread ratio can also depend on the environment, as in the Boxing and Pong tuning demonstration. The paper’s measured settings are therefore tied to the workloads, hardware and software it profiles. The evidence for dynamic tuning is strongest where the paper compares the resulting curves to a strong fixed configuration. A local search judged by TPS supplies no guarantee that every workload will have an equally good configuration nearby.
Finally, the table’s average over 30 randomly initialized GA3C evaluations concerns the behavior of the reported trained agent. Repeated evaluation of that agent across initializations gives information about its play. It does not measure variation across independently trained agents. The learning curves do show repeated training at the stated rates, and the authors note game-specific differences. Together, these comparisons support the narrower claim that the implementation can deliver competitive Atari scores in the reported time while increasing prediction and training throughput under its measured configurations.
What came after
The later work identified here is Beyond Traditional Teaching, a 2023 paper whose title concerns the potential of chatbots in graduate engineering education. It cites GA3C, but that citation alone does not establish whether the later paper discusses the shared GPU architecture, repeats a result, or uses any part of the training procedure. Its stated subject is graduate engineering education, and the citation provides no basis for attributing a technical extension or replication to it. Beyond Traditional Teaching
GA3C’s authors released their TensorFlow implementation to support follow-up investigations of the computing costs of reinforcement learning. They specifically envisaged testing new ways to distribute work between the CPU and GPU and using the implementation to study how asynchronous training behaves. Those are directions proposed by the original paper. The later citation documents that the work was referenced in a paper on a different subject. Whether that paper used GA3C’s scheduling, batching or treatment of policy lag remains unspecified.
Cite
Cite as Mohammad Babaeizadeh, Iuri Frosio, Stephen Tyree, Jason Clemons and Jan Kautz. 2016. Reinforcement Learning through Asynchronous Advantage Actor-Critic on a GPU. arXiv:1611.06256.
@misc{babaeizadeh2016reinforcement,
title = {{Reinforcement Learning through Asynchronous Advantage Actor-Critic on a GPU}},
author = {Mohammad Babaeizadeh, Iuri Frosio, Stephen Tyree, Jason Clemons and Jan Kautz},
year = {2016},
doi = {10.48550/arxiv.1611.06256},
eprint = {1611.06256},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.1611.06256}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/babaeizadeh-2016-reinforcement-learning-through-asynchronous-advantage/