---
title: "Actor–learner architecture"
url: https://www.daytona.com/compute-glossary/reinforcement-learning/actor-learner-architecture
---

# Actor–learner architecture

Part of the [Compute Glossary](https://www.daytona.com/compute-glossary.md), section [Reinforcement learning](https://www.daytona.com/compute-glossary/reinforcement-learning.md).

Also called Rollout workers and trainer.

An actor–learner architecture is a design for [reinforcement learning](https://www.daytona.com/compute-glossary/reinforcement-learning/reinforcement-learning.md) that separates the workers who run rollouts from the process that updates the model. The actors run [rollouts](https://www.daytona.com/compute-glossary/reinforcement-learning/rollout.md) and send back what happened. The learner takes those records, computes an update, and sends new weights back to the actors. Each side can then grow to the size it needs.

The two sides do very different work. The learner trains the model, which needs many [GPUs](https://www.daytona.com/compute-glossary/hardware/gpu.md) working together on large batches of data. The actors need the model only to choose actions, and need [environments](https://www.daytona.com/compute-glossary/reinforcement-learning/environment.md) to carry those actions out. Putting both on the same machines would waste whichever resource the current step does not use.

For agents trained on real tasks, the actors usually split further. An inference server on GPUs generates the model's actions for many rollouts at once. The environments run in sandboxes on ordinary processors, often thousands of them on many hosts. The actor logic in between passes actions to the environments and results back to the model.

## Keeping the sides in balance

Keeping the sides in balance means sizing each part so that none waits for another. If the learner is faster than the actors, it waits for data and its GPUs sit idle. If the actors are faster, data piles up before the learner can use it. The balance shifts with every change to the model, the tasks or the length of rollouts.

Environment capacity is often the part that is easiest to grow. Sandboxes run on ordinary processors, which are cheaper and easier to obtain than GPUs. Adding more of them raises the number of rollouts in flight, as long as the inference server can serve them. Systems grow this side with the same tools they use to [scale](https://www.daytona.com/compute-glossary/infrastructure/scale.md) any other workload.

Inference is often the hardest part to keep busy. Rollouts generate actions at uneven times, so requests arrive in bursts and gaps. Servers batch requests from many rollouts together to keep their GPUs full. Long tasks with many short actions are especially costly, because each action is a separate round trip to the model.

## Synchronous and asynchronous training

Synchronous and asynchronous training differ in whether the actors wait for each update. In synchronous training, every rollout in a batch uses the same version of the model, and the learner waits for all of them to finish. That keeps the data consistent with the model being updated. It also means the whole system waits for the slowest rollout in each batch.

In asynchronous training, actors keep running while the learner updates, and receive new weights as they become available. Throughput is higher, because nothing waits for the slowest rollout. The price is that some data was produced by an older version of the model than the one being trained. Learning from data produced by a different version is called off-policy learning.

Data that is too stale can make training unstable. Methods correct for the gap between versions, or drop rollouts that are too old. Many systems allow only a small lag, often a few updates, to keep the benefits of both. The right amount depends on how fast the model changes from one update to the next.

## Related terms

- [Rollout](https://www.daytona.com/compute-glossary/reinforcement-learning/rollout.md)
- [Environment](https://www.daytona.com/compute-glossary/reinforcement-learning/environment.md)
- [GPU](https://www.daytona.com/compute-glossary/hardware/gpu.md)
- [Scale](https://www.daytona.com/compute-glossary/infrastructure/scale.md)
- [Scheduler](https://www.daytona.com/compute-glossary/infrastructure/scheduler.md)
