DeepSpeed: Extreme-scale model training for everyone

In this article

1. [3D parallelism: Scaling to trillion-parameter models](#3d-parallelism-scaling-to-trillion-parameter-models)
2. [ZeRO-Offload: 10x bigger model training using a single GPU](#zero-offload-10x-bigger-model-training-using-a-single-gpu)
3. [DeepSpeed Sparse Attention: Powering 10x longer sequences with 6x faster execution](#deepspeed-sparse-attention-powering-10x-longer-sequences-with-6x-faster-execution)
4. [1-bit Adam: 5x less communication and 3.4x faster training](#1-bit-adam-5x-less-communication-and-3-4x-faster-training)

In February, [we announced DeepSpeed](https://www.microsoft.com/en-us/research/blog/zero-deepspeed-new-system-optimizations-enable-training-models-with-over-100-billion-parameters/), an open-source deep learning training optimization library, and ZeRO (Zero Redundancy Optimizer), a novel memory optimization technology in the library, which vastly advances large model training by improving scale, speed, cost, and usability. DeepSpeed has enabled researchers to create Turing Natural Language Generation ([Turing-NLG](https://www.microsoft.com/en-us/research/blog/turing-nlg-a-17-billion-parameter-language-model-by-microsoft)), the largest language model with 17 billion parameters and state-of-the-art accuracy at the time of its release. In May, [we released ZeRO-2](https://www.microsoft.com/en-us/research/blog/zero-2-deepspeed-shattering-barriers-of-deep-learning-speed-scale/)—supporting model training of 200 billion parameters up to 10x faster compared to state of the art—along with a list of compute, I/O, and convergence optimizations powering the fastest BERT training. From there, we have been continuing to innovate at a fast rate, pushing the boundaries of speed and scale for deep learning training.

Today, we are happy to share our new advancements that not only push deep learning training to the extreme, but also democratize it for more people—from data scientists training on massive supercomputers to those training on low-end clusters or even on a single GPU. More specifically, DeepSpeed adds four new system technologies that further the [AI at Scale](https://www.microsoft.com/en-us/research/project/ai-at-scale/) initiative to innovate across Microsoft’s AI products and platforms. These offer extreme compute, memory, and communication efficiency, and they power model training with billions to trillions of parameters. The technologies also allow for extremely long input sequences and power on hardware systems with a single GPU, high-end clusters with thousands of GPUs, or low-end clusters with very slow ethernet networks.

\* \*\*Trillion parameter model training with 3D parallelism:\*\* DeepSpeed enables a flexible combination of three parallelism approaches—ZeRO-powered data parallelism, pipeline parallelism, and tensor-slicing model parallelism. 3D parallelism adapts to the varying needs of workload requirements to power \*\*extremely large models\*\* with over a \*\*trillion\*\* parameters while achieving near-perfect memory-scaling and throughput-scaling efficiency. In addition, its improved communication efficiency allows users to train multi-billion-parameter models 2–7x faster on regular clusters with limited network bandwidth.
\* \*\*10x bigger model training on a single GPU with ZeRO-Offload:\*\* We extend ZeRO-2 to leverage both CPU and GPU memory for training large models. Using a machine with \*\*a single NVIDIA V100 GPU\*\*, our users can run \*\*models of up to 13 billion parameters\*\* without running out of memory, 10x bigger than the existing approaches, while obtaining competitive throughput. This feature democratizes multi-billion-parameter model training and opens the window for many deep learning practitioners to explore bigger and better models. Read the paper:
\* \*\*Powering 10x longer sequences and 6x faster execution through DeepSpeed Sparse Attention:\*\* DeepSpeed offers sparse attention kernels—an instrumental technology to support long sequences of model inputs, whether for text, image, or sound. Compared with the classic dense Transformers, it powers \*\*an order-of-magnitude longer input sequence\*\* and obtains up to 6x faster execution with comparable accuracy. It also outperforms state-of-the-art sparse implementations with 1.5–3x faster execution. Furthermore, our sparse kernels support efficient execution of flexible sparse format and empower users to innovate on their custom sparse structures.
\* \*\*1-bit Adam with up to 5x communication volume reduction:\*\* Adam is an effective and (probably the most well-utilized) optimizer for training many large-scale deep learning models. However, Adam is generally not compatible with communication-efficient optimization algorithms. Therefore, the communication cost could become a bottleneck while scaling across distributed devices. We introduce a new algorithm, 1-bit Adam with efficient implementation, which \*\*reduces communication volume by up to 5x\*\* while achieving similar convergence efficiency to Adam. We observe up to 3.5x faster distributed training in communication-constrained scenarios, allowing for scaling to different types of GPU clusters and networks. Read the paper: [https://www.microsoft.com/en-us/research/publication/1-bit-adam-communication-efficient-large-scale-training-with-adams-convergence-speed/](https://www.microsoft.com/en-us/research/publication/1-bit-adam-communication-efficient-large-scale-training-with-adams-convergence-speed/ )

[![3d Parallelism, ZeRO-Offload, Sparse Attention, 1-bit Adam](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/Blog\_DeepSpeed3\_MainHero\_HighRes.jpg)](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/Blog\_DeepSpeed3\_MainHero\_HighRes-1024x636.jpg)
This blog post explores these four lines of technology in greater depth. We have been making all of these exciting new optimizations available in [open-source library, DeepSpeed](https://github.com/microsoft/DeepSpeed).

Spotlight: On-demand video

[![a screenshot of a computer screen shot of a man](https://www.microsoft.com/en-us/research/uploads/prod/2023/03/AIEx01\_blog\_hero\_1400x788.png)](https://www.microsoft.com/en-us/research/blog/ai-explainer-foundation-models-and-the-next-era-of-ai/)

AI Explainer: Foundation models and the next era of AI
-------------------------------------------------------

Explore how the transformer architecture, larger models and more data, and in-context learning have helped advance AI from perception to creation.

[Watch video](https://www.microsoft.com/en-us/research/blog/ai-explainer-foundation-models-and-the-next-era-of-ai/)

3D parallelism: Scaling to trillion-parameter models
----------------------------------------------------

With the rapid growth of compute available on modern GPU clusters, training a powerful trillion-parameter model with incredible capabilities is no longer a far-fetched dream but rather a near-future reality. DeepSpeed has combined three powerful technologies to enable training trillion-scale models and to scale to thousands of GPUs: data parallel training, model parallel training, and pipeline parallel training. This symbiosis scales deep learning training far beyond what each of the strategies can offer in isolation. 3D parallelism simultaneously addresses the two fundamental challenges toward training trillion-parameter models: \*memory efficiency\* and \*compute efficiency\*. As a result, DeepSpeed can scale to fit the most massive models in memory without sacrificing speed.

\* Learn the challenges of obtaining memory and compute efficiency for gigantic models

\*\*Memory Efficiency:\*\* The memory requirements to train a trillion-parameter model are far beyond what is available in a single GPU device. Training using the Adam optimizer in mixed precision requires approximately 16 terabytes (TB) of memory just to store the model states (parameters, gradients, and optimizer states). For comparison, the state-of-the-art NVIDIA A100 GPUs have just 40 gigabytes (GB) of memory. It would require the collective memory of 400 such GPUs just to store the model states.

Activations consume additional memory that increases with the batch size. A trillion-parameter model trained with only unit batch size produces over 1 TB of activation memory. Activation \*checkpointing\* reduces this memory to approximately 20 GB by trading for additional compute, but the memory requirements remain prohibitively large for training.

The model states and activations must be efficiently partitioned across the available multiple GPU devices to enable such a model to even begin training without running out of memory.

\*\*Compute Efficiency:\*\* Training a trillion-parameter model end-to-end requires approximately 5,000 zettaflops (that’s 5 with \*24 zeros\* after it; based on the [laws of scaling](https://arxiv.org/abs/2001.08361) work from OpenAI). It would take 4,000 NVIDIA A100 GPUS running at 50% compute efficiency about 100 days to train such a model.

While large super-computing GPU clusters can have well over 4,000 GPUs, achieving high compute efficiency at this scale is challenging due to the batch size constraints. Compute efficiency increases as the computation time increases over the communication time. This ratio is proportional to the batch size. However, the batch size that a model can be trained with has an upper bound—beyond that the convergence efficiency deteriorates rapidly.

One of the largest models in the world, [GPT-3](https://arxiv.org/abs/2005.14165), was trained using a batch size of about 1,500. With 4,000 GPUs, even a liberal batch size of 4,000 would only allow for a batch size of 1 per GPU and limit scalability.
\* Understand the tradeoffs of data, model, and pipeline parallelism

\*\*Data parallelism\*\* is a ubiquitous technique in deep learning in which each input batch of training data is split among the data parallel workers. Gradients must be communicated and aggregated after backward propagation to ensure that consistent steps are taken by the optimizer. Data parallelism has several distinct advantages, including compute efficiency and minimal implementation effort. However, data parallelism relies on scaling the batch size with the number of data parallel workers, which cannot be done indefinitely without affecting convergence.

 + \*\*Memory efficiency:\*\* Data parallelism replicates the model and optimizer across all workers, and therefore is not memory efficient. DeepSpeed developed [ZeRO](https://www.microsoft.com/en-us/research/blog/zero-deepspeed-new-system-optimizations-enable-training-models-with-over-100-billion-parameters/), a collection of optimizations that improve the memory efficiency of data parallelism. This work relies on ZeRO stage 1, which partitions the optimizer states among data parallel workers to reduce redundancy.
 + \*\*Compute efficiency:\*\* The amount of computation performed by each worker is constant as we increase the degree of parallelism. Data parallelism can achieve near-perfect scaling at small scales. However, the communication cost of aggregating gradients among data parallel workers scales with the model size and limits compute efficiency on large models or systems with low communication bandwidth. \*Gradient accumulation\* is a common strategy for amortizing this communication cost by further increasing the batch size and performing multiple forward and backward propagations on \*micro-batches\* while locally accumulating gradients before aggregating and taking an optimizer step.
\*\*Model Parallelism\*\* is a broad class of techniques that partitions the individual layers of the model across workers. By its nature, the computations and communications of model parallelism are specific to a model architecture and therefore can have large initial implementation effort. DeepSpeed leverages NVIDIA’s [Megatron-LM](https://github.com/NVIDIA/Megatron-LM) in this work for massive model-parallel Transformer-based language models. Model parallelism reduces the memory proportional to the number of workers. Model parallelism is the most memory efficient among the three types of parallelism at the cost of the lowest compute efficiency.

 + \*\*Memory efficiency:\*\* Model parallelism reduces the memory footprint proportional to the number of workers. Crucially, it is the only approach that reduces the activation memory for individual network layers. DeepSpeed further improves memory efficiency by partitioning the activation memory among model-parallel workers.
 + \*\*Compute efficiency:\*\* Model parallelism has poor computational efficiency due to additional communication of activations in each forward and backward propagation. Model parallelism requires high communication bandwidth to be efficient and does not scale well beyond a single node where the communication bandwidth is limited. Furthermore, each model-parallel worker decreases the amount of computation performed between each communication stage, impacting compute efficiency. Model parallelism is often used in conjunction with data parallelism to trade between memory and compute efficiency.
\*\*Pipeline parallelism\*\* training engine is included in this release of DeepSpeed! Pipeline parallelism divides the layers of the model into \*stages\* that can be processed in parallel. As one stage completes the forward pass for a micro-batch, the activation memory is communicated to the next stage in the pipeline. Similarly, as the next stage completes its backward propagation, gradients are communicated backwards through the pipeline. Multiple micro-batches must be kept in flight to ensure pipeline stages compute in parallel. Several approaches, such as [PipeDream](https://www.microsoft.com/en-us/research/blog/pipedream-a-more-effective-way-to-train-deep-neural-networks-using-pipeline-parallelism/), have been developed to trade off memory and compute efficiency as well as convergence behavior. The DeepSpeed approach extracts parallelism through gradient accumulation to maintain the same convergence behavior as traditional data- and model-parallel training with the same total batch size.

 + \*\*Memory efficiency:\*\* Pipeline parallelism reduces memory proportional to the number of pipeline stages, allowing model size to scale linearly with the number of workers. However, pipeline parallelism does not reduce the memory footprint for the activations of each layer. Additionally, each worker must store the activations for all micro-batches in flight. In effect, the activation memory on the first stage of the pipeline is approximately the same as the total activation memory for a single micro-batch. A trillion-parameter model would need approximately 19 GB of memory for the activations of a micro-batch, consuming almost half the available memory of the new NVIDIA A100 GPU.
 + \*\*Compute efficiency:\*\* Pipeline parallelism has the lowest communication volume since it only communicates data proportional to the activation size of the layers between stage boundaries. However, it cannot scale indefinitely. Like model parallelism, increasing the pipeline size decreases the computation per pipeline stage, which also decreases the compute-to-communication ratio. Pipeline parallelism also requires each of its stages to be perfectly load balanced to achieve good efficiency.

 Furthermore, pipeline parallelism incurs a bubble overhead from filling and emptying the pipeline at the beginning and end of each training batch. Training with gradient accumulation steps (and thus batch size) that is 4x or 8x the number of pipeline stages achieves 81% and 90% scaling efficiency from one pipeline stage, respectively.

### Achieving both memory and compute efficiency with 3D parallelism

Data, model, and pipeline parallelism each perform a specific role in improving memory and compute efficiency. Figure 1 illustrates our 3D strategy.

\*Memory Efficiency:\* The layers of the model are divided into pipeline stages, and the layers of each stage are further divided via model parallelism. This 2D combination simultaneously reduces the memory consumed by the model, optimizer, and activations. However, we cannot partition the model indefinitely without succumbing to communication overheads which limits compute efficiency.

\*Compute Efficiency:\* To allow the number of workers to scale beyond model and pipeline parallelism without sacrificing compute efficiency, we use ZeRO-powered data parallelism (ZeRO-DP). ZeRO-DP not only improves memory efficiency further via optimizer state partition, but also allows scaling to arbitrarily large number of GPUs with minimal communication overhead by exploiting topology aware mapping.

\*Topology aware 3D mapping\* (Figure 2)\*:\* Each dimension in 3D parallelism is carefully mapped onto the workers to achieve maximum compute efficiency by exploiting two key architectural properties.

1. \*\*Optimizing for intra- and inter-node communication bandwidth\*\*: Model parallelism has the largest communication overhead of the three strategies, and so we prioritize placing model parallel groups within a node to utilize the larger intra-node bandwidth. Here we apply NVIDIA Megatron-LM for tensor-slicing style of model parallelism. Data parallel groups are placed within a node when model parallelism does not span all the workers in a node.  Otherwise, they are placed across nodes.  Pipeline parallelism has the lowest communication volume, and so we can schedule pipeline stages across nodes without being limited by the communication bandwidth.
2. \*\*Bandwidth amplification via parallelism in communication:\*\* The size of the gradients communicated by each data parallel group decreases linearly via both pipeline and model parallelism, and thus the total communication volume is decreased from pure data parallelism.  Furthermore, each data parallel group performs its communication independently and in parallel among a subset of localized workers. As a result, the effective bandwidth for data parallel communication is amplified by a combination of reduced communication volume and increased locality and parallelism.

![Diagram showing Example 3D parallelism with 32 workers. Layers of the neural network are divided among four pipeline stages. Layers within each pipeline stage are further partitioned among four model parallel workers. Lastly, each pipeline is replicated across two data parallel instances, and ZeRO partitions the optimizer states across the data parallel replicas.](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/Blog\_DeepSpeed3\_Figure-1\_highres-1024x615.png)Figure 1: Example 3D parallelism with 32 workers. Layers of the neural network are divided among four pipeline stages. Layers within each pipeline stage are further partitioned among four model parallel workers. Lastly, each pipeline is replicated across two data parallel instances, and ZeRO partitions the optimizer states across the data parallel replicas.
![Colorful blocks showing Mapping of workers in Figure 1 to GPUs on a system with eight nodes, each with four GPUs. Coloring denotes GPUs on the same node.](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/Blog\_DeepSpeed3\_Figure2\_highres.png)Figure 2: Mapping of workers in Figure 1 to GPUs on a system with eight nodes, each with four GPUs. Coloring denotes GPUs on the same node.
\* Learn more about how 3D parallelism enlists each type of parallelism to train trillion-parameter models

A trillion-parameter model could be scaled across 4,096 NVIDIA A100 GPUs using 8-way model parallelism, 64-way pipeline parallelism, and 8-way data parallelism.

By combining model parallelism and pipeline parallelism, 3D parallelism achieves excellent memory efficiency and compute efficiency across multiple nodes. Model parallelism brings memory efficiency for the activations and model states within a node, while pipeline parallelism allows for memory efficiency of model states across nodes without sacrificing compute efficiency compared to using model parallelism alone. In our trillion-parameter example with a micro-batch size of 1, our model would consume 30 GB of memory for model states and 2.5 GB for partitioned activations after activation checkpointing with the aforementioned 3D parallelism. This results in a total memory footprint of 32.5 GB. With such a configuration, NVIDIA A100 GPUs with 40 GB of memory have more than enough space to fit and train such a model.

Combining model parallelism with pipeline parallelism also allows pipeline parallelism to achieve high compute efficiency with minimal bubble overhead even at very small batch sizes. With 8-way model parallelism, using a micro-batch of 1 per model would result in an effective micro-batch of 1/8 per GPU. Therefore, pipeline parallelism can achieve a 90% compute efficiency using a gradient accumulation step of 8x the pipeline parallelism degree and with an aggregate per-GPU batch size of only 1. When combined with data parallelism, this results in an effective batch size of 4,096 on 4,096 GPUs, which can still achieve 90% pipeline efficiency.

\*\*But what compute efficiency results from data parallelism? Doesn’t data parallelism require large batch per GPU to remain efficient?\*\*

Model parallelism can reduce the effective batch size to be less than 1 per GPU. This allows pipeline parallelism to hide the pipeline bubble overhead even with small batch sizes. Note that by using pipeline parallelism across nodes, we are effectively allowing communication between data parallel nodes at each stage of the pipeline to happen independently and in parallel with the other pipeline stages. In fact, in a fully connected network topology common in high-end GPU clusters, this has a significant implication on the effective communication bandwidth available for data parallel training. Since each node at a pipeline stage can communicate in parallel with its corresponding data parallel nodes, the effective communication bandwidth is directly proportional to the number of pipeline stages. With 64 pipeline-parallel stages, the effective bandwidth is 64x the bandwidth to and from a single node. With such large effective bandwidth pipeline parallelism enables data parallelism to scale effectively, even at small batch sizes where the compute-to-communication ratio is very low.

### Powering trillion-parameter model training with linear efficiency scaling

DeepSpeed can train a language model with one \*\*\*trillion\*\*\* parameters using as few as 800 NVIDIA V100 GPUs (Figure 3). We demonstrate simultaneous memory and compute efficiency by scaling the size of the model and observing linear growth, both in terms of the size of the model and the throughput of the training. In every configuration, we can train approximately 1.4 billion parameters per GPU, which is the largest model size that a single GPU can support without running out of memory, indicating perfect memory scaling. We also obtain close to perfect-linear compute efficiency scaling and a throughput of 47 teraflops per V100 GPU. This is impressive scaling and throughput for the given hardware.

![Figure 3: Model size (in billions of parameters) and training throughput (in petaflops) as a function of GPUs. DeepSpeed can train a model with 1 trillion parameters using 800 NVIDIA V100 Tensor Core GPUs with 32 GB of memory. Each configuration uses 16-way model parallelism provided by NVIDIA Megatron-LM, and the remaining GPUs are arranged using pipeline parallelism. The trillion-parameter model has 298 layers of Transformers with a hidden dimension of 17,408 and is trained with sequence length 2,048 and batch size 2,048. For smaller models, we decrease the number of Transformer layers and the batch size proportionally to the number of GPUs.](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed-Figure-3\_Section-1.jpg)Figure 3: Model size (in billions of parameters) and training throughput (in petaflops) as a function of GPUs. DeepSpeed can train a model with 1 trillion parameters using 800 NVIDIA V100 Tensor Core GPUs with 32 GB of memory. Each configuration uses 16-way model parallelism provided by [NVIDIA Megatron-LM](https://github.com/NVIDIA/Megatron-LM), and the remaining GPUs are arranged using pipeline parallelism. The trillion-parameter model has 298 layers of Transformers with a hidden dimension of 17,408 and is trained with sequence length 2,048 and batch size 2,048. For smaller models, we decrease the number of Transformer layers and the batch size proportionally to the number of GPUs.
\* Dive deeper into how 3D parallelism accelerates training at the scale of GPT-3

[![Figure 4: System performance using 800 GPUs to train a GPT-3 scale model with 180 billion parameters using 2D and 3D parallelism. The model has 100 Transformer layers with hidden dimension 12,288 and 96 attention heads. The model is trained with batch size 2,048 and sequence length 2,048. ZeRO-1 is enabled alongside data parallelism. P, M, and D denote the pipeline, model, and data parallel dimensions, respectively.](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed-3\_Figure-2-\_section-2.jpg)](https://www.microsoft.com/en-us/research/blog/zero-deepspeed-new-system-optimizations-enable-training-models-with-over-100-billion-parameters/)Figure 4: System performance using 800 GPUs to train a GPT-3 scale model with 180 billion parameters using 2D and 3D parallelism. The model has 100 Transformer layers with hidden dimension 12,288 and 96 attention heads. The model is trained with batch size 2,048 and sequence length 2,048. ZeRO-1 is enabled alongside data parallelism. P, M, and D denote the pipeline, model, and data parallel dimensions, respectively.
In Figure 4, we use the recent [GPT-3](https://arxiv.org/abs/2005.14165) model architecture, with over 175 billion parameters, as a benchmark for 3D parallelism:

 + We first evaluate the \*\*2D configurations\*\* (C1-C3). Configurations C1 and C2 use only pipeline and model parallelism—they can train the model but achieve low throughput due to over-decomposing the problem and having low GPU utilization. C3 attempts to use only pipeline and data parallelism but is unable to fit the problem in memory without reducing the size of activations via Megatron’s model parallelism.
 + The \*\*3D configurations\*\* (C4-C10) are arranged by increasing degree of pipeline parallelism; the best performance is achieved by the middle configurations that balance the parallelism in order to be memory-, computation-, and communication-efficient.
 + The best 3D approaches achieve 49 teraflops per GPU, over 40% of the theoretical hardware peak.
\* See how hybrid parallelism accelerates training GPT-2 on low-bandwidth clusters up to 7x

We demonstrate the communication benefits of hybrid parallelism in Figure 5 while training a 1.5-billion-parameter GPT-2 model. We train on four nodes of a cluster with low inter-node bandwidth in order to emphasize the communication stages of training:

 + \*\*Model parallelism\*\* is not advantageous in this case due to the low intra-node bandwidth and smaller model size.
 + \*\*Pipeline parallelism\*\* communicates over an order of magnitude less volume than the data and model parallel configurations and is 7x faster at small batch sizes.
 + \*\*Data parallelism\*\* uses gradient accumulation to amortize communication overhead as the batch size increases, but pipeline parallel configurations still achieve over twice the performance of data parallelism at larger batch sizes.
 + The \*\*hybrid pipeline and data parallel configuration\*\* avoids the gradient communication bottleneck by restricting data parallel groups to GPUs within a node, so gradient communications benefit from the faster intra-node bandwidth.
![Figure 5: Throughput as a function of batch size while training GPT-2 (1.5B parameters) with sequence length 1,024. Training uses four nodes, each with four NVIDIA V100 GPUs with 16 GB of memory. The GPUs are connected with 50 Gigabits-per-second (Gbps) intra-node bandwidth and 4 Gbps inter-node bandwidth. DP denotes data parallelism with ZeRO-1 enabled. All methods scale batch size via increasing steps of gradient accumulation.](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed-3\_Figure-4\_Section-1.jpg)Figure 5: Throughput as a function of batch size while training GPT-2 (1.5B parameters) with sequence length 1,024. Training uses four nodes, each with four NVIDIA V100 GPUs with 16 GB of memory. The GPUs are connected with 50 Gigabits-per-second (Gbps) intra-node bandwidth and 4 Gbps inter-node bandwidth. DP denotes data parallelism with ZeRO-1 enabled. All methods scale batch size via increasing steps of gradient accumulation.

ZeRO-Offload: 10x bigger model training using a single GPU
----------------------------------------------------------

ZeRO-Offload pushes the boundary of the maximum model size that can be trained efficiently using minimal GPU resources, by exploiting computational and memory resources on both GPUs and their host CPUs. It allows training up to 13-billion-parameter models on a single NVIDIA V100 GPU, 10x larger than the state-of-the-art while retaining high training throughput of over 30 teraflops per GPU.

\* Publication
[ZeRO-Offload: Democratizing Billion-Scale Model Training](https://www.microsoft.com/en-us/research/publication/zero-offload-democratizing-billion-scale-model-training/)

By enabling multi-billion-parameter model training on a single GPU, ZeRO-Offload democratizes large model training, making it accessible to deep learning practitioners with limited resources.

![Bar graph showing largest models can be trained using default PyTorch and ZeRO-Offload on a single GPU.](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/Blog\_deepspeed3\_figure6\_highres-1024x552.jpg)Figure 6: The largest models can be trained using default PyTorch and ZeRO-Offload on a single GPU.
The key technology behind ZeRO-Offload is our new capability to offload optimizer states and gradients onto CPU memory, building on top of [ZeRO-2](https://www.microsoft.com/en-us/research/blog/zero-2-deepspeed-shattering-barriers-of-deep-learning-speed-scale/). This approach allows ZeRO-Offload to minimize the compute efficiency loss from CPU offloading while also achieving the same, and sometimes even better, efficiency of the original ZeRO-2. The figure below shows the architecture of ZeRO-Offload.

![Figure 7: ZeRO-Offload overview. ](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed-3\_Figure-2\_section-1-1024x546.png)Figure 7: ZeRO-Offload overview.
\* Learn how ZeRO-Offload enables multi-billion parameter training on a single GPU

Training multi-billion-parameter models like GPT and T5 require many GPUs to fit the model and its states in GPU memory. Large model training has been mostly carried out with model parallelism across multiple GPU devices to solve the memory limitation problem. Recently, we released ZeRO, a memory efficient optimizer that partitions model states (optimizer states, gradients, and model weights) across data parallel GPUs, allowing multi-billion-parameter models to be trained without requiring model parallelism. However, ZeRO still requires a large number of data parallel GPUs to hold the partitioned model states, limiting the access of large model training to a few with access to such resources.

ZeRO-Offload democratizes large model training by making it possible even on a single GPU. To allow training multi-billion-parameter models without using multiple GPUs, ZeRO-Offload inherits the optimizer state and gradient partitioning from ZeRO-2. Unlike ZeRO-2, instead of having each GPU keep a partition of the optimizer state and gradients, ZeRO-Offload offloads both to host CPU memory. Optimizer states are kept in CPU memory for the entire training. Gradients, on the other hand, are computed and averaged using reduce-scatter on the GPUs during the backward pass, and each data-parallel process then offloads the averaged gradients belonging to its partition to the CPU memory (\*g offload\* in Figure 7) while discarding the rest.

Once the gradients are available on the CPU, optimizer state partitions are updated in parallel by each data parallel process directly on the CPU (\*p update\* in Figure 7). After the update, parameter partitions are moved back to GPU followed by an all-gather operation on the GPU to gather all the updated parameters (\*g swap\* in Figure 7). ZeRO-Offload also exploits overlapping between communication (such as \*g offload\* and \*g swap\*) and computation (such as the backward pass and \*p update\*) using separate CUDA streams to maximize training efficiency.
\* See the benefits of ZeRO-Offload on model scale, training speed, and scalability

\*\*10x model scale:\*\* On a single 32 GB V100 GPU, Figure 6 shows that the biggest model that can be trained by PyTorch has 1.3 billion parameters, while ZeRO-Offload allows for training models of 13 billion parameters, which is 10 times bigger. This is because ZeRO-Offload keeps the optimizer states (which consume a large portion of GPU memory) in host memory during the entire training process while also offloading gradients to CPU as they are computed in the backward pass. As a result, the saved GPU memory can be used in hosting bigger models for training.

\*\*Efficient training throughput\*\*: Figure 8 shows that when training a 10-billion-parameter model, ZeRO-Offload provides over 30 teraflops throughput per GPU even when training with only a single GPU, and its throughput increases close to perfect linearly with the increasing number of GPUs.

ZeRO-Offload complements ZeRO-2 well, supporting efficient training of large models on a small number of GPUs. From 1 to 16 GPUs, ZeRO-Offload turns the model training from infeasible to feasible by leveraging CPU memory, reducing GPU memory required for the model. On 32 GPUs, ZeRO-Offload slightly outperforms ZeRO-2; the improvement comes from additional memory savings on GPU from ZeRO-Offload, which allows training with larger batch sizes and increases the GPU computation efficiency despite the overhead of CPU offloading. With more GPUs (such as 64 and 128), ZeRO-2 outperforms ZeRO-Offload since both can now run similar batch sizes. On one hand, though, ZeRO-2 does not have the overhead of moving data to CPU, while on the other hand, the optimizer step calculation on GPU is much faster than on CPU. In summary, ZeRO-Offload complements ZeRO-2 and extends ZeRO family of optimizations to cover the full spectrum of large model training from a single device to thousands of devices.

![Bar graph showing The training throughput is compared for ZeRO-Offload and ZeRO-2 using 128 GPUs to train a 10-billion parameter GPT-2 model. ](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/Blog\_DeepSpeed3\_Figure8\_HighRes-1024x403.jpg)Figure 8: The training throughput is compared for ZeRO-Offload and ZeRO-2 using 128 GPUs to train a 10-billion parameter GPT-2 model.

DeepSpeed Sparse Attention: Powering 10x longer sequences with 6x faster execution
----------------------------------------------------------------------------------

Attention-based deep learning models, such as Transformers, are highly effective in capturing relationships between tokens in an input sequence, even across long distances. As a result, they are used with text, image, and sound-based inputs, where the sequence length can be in thousands of tokens. However, despite the effectiveness of attention modules to capture long term dependencies, in practice their application to long sequence input is limited by compute and memory requirements of the attention computation that grow quadratically, \(O(n^2 )\), with the sequence length \(n\).

To address this limitation, \*\*DeepSpeed offers a suite of sparse attention kernels\*\*—an instrumental technology that can reduce the compute and memory requirement of attention computation by orders of magnitude via block-sparse computation. The suite not only alleviates the memory bottleneck of attention calculation, but also performs sparse computation efficiently. Its APIs allow convenient integration with any transformer-based models. Along with providing a wide spectrum of sparsity structures, it has the flexibility of handling any user-defined block-sparse structures.

More specifically, sparse attention (SA) can be designed to compute local attention between nearby tokens, or global attention via summary tokens computed with local attention. Moreover, SA can also allow random attention or any combination of local, global, and random attention as shown in Figure 10 with blue, orange, and green blocks, respectively. As a result, SA decreases the memory footprint to \(O (wn)\), in which 1\(<w ≤ n\) is a parameter, whose value depends on the attention structure.

![Box of colorful small blocks that shows the Variable Sparsity structure](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/Blog\_DeepSpeed3\_Figure10\_Sparse-Attention\_highres.jpg)Figure 10: Variable Sparsity structure
\*\*Efficient implementation on GPUs:\*\* While a basic implementation of sparse attention may show a benefit of memory savings, computationally it can be even worse than full computation. This is mainly due to the divergence and un-coalesced memory access that sparse data adds to the full picture. In general, developing efficient sparse kernels, particularly on GPUs, is challenging. DeepSpeed offers efficient sparse attention kernels developed in [Triton](https://github.com/ptillet/triton). These kernels are structured in block-sparse paradigm that enables aligned memory access, alleviates thread divergence, and balances workloads on processors.

\*\*System performance:\*\* SA powers over \*\*10x longer sequences\*\* and \*\*up to 6.3x faster computation\*\* as shown in Figure 11. The left figure shows the longest sequence length runnable in BERT-Base and BERT-Large models under three settings: dense, dense with activation checkpoint, and sparse (SA) with activation checkpoint. SA empowers 10x and 16x longer sequences when compared with dense for BERT-Base and BERT-Large, respectively. Furthermore, SA reduces total computation compared with dense and improves training speed: the boost is higher with increased sequence length, and it is up to 6.3x faster for BERT-Base and 5.3x for BERT-Large.

[![Figure 11: Maximum possible sequence length for BERT models (left); Training time of BERT-Base (center) and BERT-Large (right) on a single NVIDIA V100 GPU with varying sequence length.](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed-Figure-11\_final.jpg)](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/Blog\_DeepSpeed3\_Figure11\_updated-v3-1024x465.jpg)Figure 11: Maximum possible sequence length for BERT models (left); Training time of BERT-Base (center) and BERT-Large (right) on a single NVIDIA V100 GPU with varying sequence length.
\* Learn how SA obtains comparable or higher accuracy than full attention

Related works along the line of sparse attention ([Sparse Transformer](https://arxiv.org/pdf/1904.10509.pdf), [Longformer](https://arxiv.org/pdf/2004.05150.pdf), [BigBird](https://arxiv.org/pdf/2007.14062.pdf)) have shown comparable or higher accuracy than full attention. Our experience is well aligned. In addition to lower memory overhead and faster computation, we also observe cases in production models where SA reaches higher accuracy and faster convergence. The following chart illustrates the accuracy of training a production model based on BERT for \*long document comprehension\* (2,048 sequence length). The experiment is performed in three settings: dense starting from scratch, SA starting from scratch, and SA continued training from a checkpoint of using dense with a sequence length of 512. We have observed that, for pretraining from scratch, SA converges faster with higher accuracy compared with dense. Furthermore, continuing training from a pretrained checkpoint with SA performs even better, with respect to both time and accuracy.

![Figure 12: Accuracy of long document comprehension application](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed-Figure-12\_update.jpg)Figure 12: Accuracy of long document comprehension application
\* Learn how SA compares with state-of-the-art LongFormer

We compared SA with Longformer, a state-of-the-art sparse structure and implementation. In our experiment, SA uses “[Fixed](https://arxiv.org/pdf/1904.10509.pdf)” sparsity, and two implementations have comparable accuracy. On system performance, SA outperforms Longformer both in training and inference:

 + 1.5x faster execution pretraining MLM on Wikitext103
 + 3x faster execution inference on BERT-Base (batch size 1, sequence length 2,048)

\*\*Flexibility to handle any block-sparse structure:\*\* DeepSpeed sparse attention suite does not target any specific sparse structure but enables model scientists to explore any block sparse structure with efficient system support. Currently, we have added popular sparse structures, like [Fixed](https://arxiv.org/pdf/1904.10509.pdf) (from OpenAI Sparse Transformer), [BigBird](https://arxiv.org/pdf/2007.14062.pdf) (from Google), and BSLongformer (Block-Sparse implementation of AI2 [Longformer](https://arxiv.org/pdf/2004.05150.pdf)). We also define a template to have “variable” structure, shown in Figure 10, which can be used to simply customize any block-sparse random, local, or global attention pattern.

1-bit Adam: 5x less communication and 3.4x faster training
----------------------------------------------------------

Scalable training of large models (like BERT and GPT-3) requires careful optimization rooted in model design, architecture, and system capabilities. From a system standpoint, communication has become a major bottleneck, especially on commodity systems with standard TCP interconnects that offer limited network bandwidth.

\* Publication
[1-bit Adam: Communication Efficient Large-Scale Training with Adam’s Convergence Speed](https://www.microsoft.com/en-us/research/publication/1-bit-adam-communication-efficient-large-scale-training-with-adams-convergence-speed/)

Communication compression is an important technique to reduce training time on such systems. One of the most effective ways to compress communication is via error compensation compression, which offers robust convergence speed, even under 1-bit compression. However, state-of-the-art error compensation techniques only work with basic optimizers like Stochastic Gradient Descent (SGD) and momentum SGD, which are linearly dependent on the gradients. They do not work with non-linear gradient-based optimizers like Adam, which offers state-of-the-art convergence efficiency and accuracy for many tasks, including training of BERT-like models.

For a powerful optimizer like Adam, the non-linear dependency on gradient (in the variance term) makes it challenging to develop error compensation-based compression techniques, limiting the practical value of the state-of-the-art communication compression techniques.

\* Understand the background on classic compression techniques

One way of communication compression is 1-bit compression, which can be expressed as:

![latex equation](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/LaTex-Equation-1\_DeepSpeed-1.jpg)
With this compression, we could achieve a 32x reduction of memory size by representing each number using one bit. The problem is that using this straightforward method would significantly degrade the convergence speed, which makes this method inapplicable. To solve this problem, recent studies show that by using error compensation compression, we could expect almost the same convergence rate with communication compression.

The idea of error compensation can be summarized as: 1) doing compression, 2) memorizing the compression error, and then 3) adding the compression error back in during the next iteration. For SGD, doing error compression leads to:

![latex equation](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/LaTex-Equation\_2\_DeepSpeed.jpg)
Where \(C(⋅)\) is the 1-bit compression operator. The good thing about doing this error compensation is that the history compression error \(e\\_t\) and \(e\\_t-1\) would be canceled by itself eventually, which can be seen by:

![latex equation](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/LaTex-Equation-3\_DeepSpeed.jpg)
This strategy has been proven to work for all optimization algorithms that are linearly dependent on the gradient, such as SGD and Momentum SGD.
\* Learn about the challenges in applying error-compensation to Adam

We provide an overview of the Adam algorithm below. The update rules are as follows.

![latex equation](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/LaTex-Equations-3\_DeepSpeed.jpg)
As shown in the equations above, the variance term \(v\\_t\) is nonlinearly dependent on the gradient \(g\\_t\). If we apply basic error compensation compression to Adam, we observe that Adam will not converge as shown in Figure 13.

![Figure 13: Inapplicability of Error-compensation Compression for Adam due to non-linear dependence on the gradient](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed-3\_Figure-1-\_Section-5.png)Figure 13: Inapplicability of Error-compensation Compression for Adam due to non-linear dependence on the gradient

#### Compressing communication with 1-bit Adam

To compress communication while using the Adam optimizer, we develop \*\*1-bit Adam\*\*, which addresses the non-linearity in gradients via preconditioning. We observe that the magnitude of changes on the non-linear term, variance (\(v\\_t\)), decrease significantly after a few epochs of training and setting \(v\\_t\) constant afterwards will not change the convergence speed. The proposed 1-bit Adam optimizer, as shown in Figure 14, consists of two parts: the \*\*warmup\*\* stage, which is essentially the vanilla Adam algorithm; and the \*\*compression\*\* stage, which keeps the variance term constant and compresses the remaining linear term, that is the momentum, into 1-bit representation.

The compression stage of the algorithm is controlled by a threshold parameter (as shown in Figure 14). When we detect that the change in “variance” falls below a certain threshold, we switch to the compression stage. Our study shows that only 15-20% of the overall training steps are needed for the warmup stage.

\* Learn more about how 1-bit Adam works under the hood

The weight update rule for 1-bit Adam is governed by the following equations. For the \*i\*![]()th worker, in the compression stage:

![equations](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed-Equations-5\_Latex-1024x392.jpg)

![Figure 14: Comparison of distributed training steps in classic Adam and the proposed 1-bit compressed Adam algorithm](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed-3\_Figure-2\_Section-4.png)Figure 14: Comparison of distributed training steps in classic Adam and the proposed 1-bit compressed Adam algorithm
#### Addressing system challenges for 1-bit Adam

Besides the algorithmic challenge, there are two system challenges in applying 1-bit Adam in training systems. First, we need efficient kernels that convert the momentum to 1-bit representations. Second, we need efficient communication schemes to exchange this compressed momentum across different GPUs. The goal of compression is to reduce the overall training time so that commodity systems with bandwidth-limited interconnects can be used to train large models. We address these challenges in DeepSpeed and introduce a fully optimized 1-bit Adam implementation for training on communication-constrained systems.

#### Benefits of 1-bit Adam on communication-constrained systems

1-bit Adam offers the same convergence as Adam, incurs up to \*\*5x less communication\*\* that enables up to \*\*3.5x higher throughput\*\* for BERT-Large pretraining and up to \*\*2.7x higher throughput\*\* for SQuAD fine-tuning. This end-to-end throughput improvement is enabled by the 6.6x (Figure 15 left) and 6.2x (Figure 15 right) speedup observed during the compression stage. It is worth mentioning that our 1-bit Adam optimizer scales so well on a 40 Gigabit Ethernet system that its performance is comparable to Adam’s scalability on a 40 Gigabit InfiniBand QDR system. We note that the effective bandwidth on 40 Gigabit Ethernet is 4.1 Gbps based on iPerf benchmarks, whereas InfiniBand provides near-peak bandwidth of 32 Gbps based on InfiniBand perftest microbenchmarks.

![Figure 15: Scalability of 1-bit Adam for BERT-Large Pretraining (left) and SQuAD Fine-tuning (right) on NVIDIA V100 GPUs. The batch sizes are 16/GPU and 3/GPU for BERT pretraining and SQuAD fine-tuning, respectively.](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed-3-Figure-3-Section-4-1024x349.jpg)Figure 15: Scalability of 1-bit Adam for BERT-Large Pretraining (left) and SQuAD Fine-tuning (right) on NVIDIA V100 GPUs. The batch sizes are 16/GPU and 3/GPU for BERT pretraining and SQuAD fine-tuning, respectively.
\* Dive deeper into 1-bit Adam evaluation results

\*\*Same convergence as Adam\*\*: One major question for using 1-bit Adam is the convergence speed, and we find that 1-bit Adam can achieve the same convergence speed and comparable testing performance using the same number of training samples as shown in Figure 16.

![Figure 16: 1-bit Adam converges like Adam using the same number of training samples.](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed-3\_Figure-4\_Section-5.png)Figure 16: 1-bit Adam converges like Adam using the same number of training samples.
Detailed BERT-Base and BERT-Large results are shown in Table 1. We see that the scores are on par with or better than the original model for both the uncompressed and compressed cases.

![table 1](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed\_Table-1.png)Table 1: Verifying correctness of 1-bit Adam on various testing tasks
\*\*Up to 5x less communication:\*\* 1-bit Adam provides the same convergence as Adam and reduces the communication volume by 16x during the compression stage for 16-bit (FP16) training. For BERT pretraining, this leads to an overall communication reduction of 5x as we observed the warmup stage to be just 15% of the end-to-end training time.

The formula to calculate the communication volume ratio of the original versus 1-bit Adam is as follows:

1 / (warmup + (1 – warmup)/16)

\*\*1-bit Adam is 3.5x faster for training BERT-Large:\*\* We present two main results for training BERT-Large on systems with two different bandwidth-limited interconnects: 1) 40 Gbps Ethernet (Figure 17 left) and 2) 40 Gbps InfiniBand QDR (Figure 17 right). During the compression phase, we observe up to 6.6x higher throughput on the system with Ethernet and up to 2x higher throughput on the system with InfiniBand, resulting in end-to-end speed up (including both warmup and compression stages) of 3.5x and 2.7x, respectively. The major benefit of 1-bit Adam comes from the communication volume reduction—enabled by our compressed momentum exchange—and from our custom \*allreduce\* operation that implements efficient 1-bit communication using non-blocking gather operations followed by an \*allgather\* operation.

It is important to note that one can also increase total batch size to reduce communication using optimizers like LAMB instead of Adam for BERT pretraining. However, 1-bit Adam avoids the need for rigorous hyperparameter tuning, which is often more difficult for large batches from our experience. Furthermore, 1-bit Adam also works very well for workloads that have small critical batch size (cannot converge well with large batch size) like many fine-tuning tasks.

![Figure 17: Performance of 1-bit Adam for BERT-Large training on 40 Gbps Ethernet (left) and InfiniBand (right) interconnect during the compression stage.](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed-3\_Figure-5\_Section-5-1024x343.jpg)Figure 17: Performance of 1-bit Adam for BERT-Large training on 40 Gbps Ethernet (left) and InfiniBand (right) interconnect during the compression stage.
\*\*1-bit Adam is 2.7x faster for SQuAD fine-tuning:\*\* 1-bit Adam offers scalability not only on large-scale training tasks but also on tasks like SQuAD fine-tuning. As shown in Figure 18, 1-bit Adam scales well on both Ethernet- and InfiniBand-based systems and offers up to 6.2x higher throughput (during the compression stage) on the Ethernet-based system, resulting in 2.7x end-to-end speedup (25% warmup plus 75% compression stage). For SQuAD fine-tuning, we observed that a total batch size of 96 offers the best F1 score. Batch sizes larger than this value lower the convergence rate and require additional hyperparameter tuning. Therefore, in order to scale to 32 GPUs, we can only apply a small batch size of 3-4 per GPU. This makes fine-tuning tasks communication intensive and hard to scale. 1-bit Adam addresses the scaling challenge well, obtaining 3.4x communication reduction without enlarging batch size, and it results in a 2.7x end-to-end speedup.

![Figure 18: Performance of 1-bit Adam for SQuAD fine-tuning on 40 Gbps Ethernet (left) and InfiniBand (right) interconnect during the compression stage.](https://www.microsoft.com/en-us/research/uploads/prod/2020/09/DeepSpeed-3\_Figure-6\_Section-5-1024x316.jpg)Figure 18: Performance of 1-bit Adam for SQuAD fine-tuning on 40 Gbps Ethernet (left) and InfiniBand (right) interconnect during the compression stage.

Please visit [DeepSpeed website](https://www.microsoft.com/en-us/research/project/deepspeed/) and [Github repository](https://github.com/microsoft/DeepSpeed) for the codes, tutorials and documentations about these new technologies! We are also integrating some of these techniques into [ONNX Runtime](http://aka.ms/onnxruntime).

### About our great collaborators:

\* We would like to acknowledge our academic collaborator, Philippe Tillet from Harvard University, for helping us co-develop sparse attention kernels through [Triton](http://www.eecs.harvard.edu/~htk/publication/2019-mapl-tillet-kung-cox.pdf) compiler.
\* ZeRO-Offload was co-developed with our intern Jie Ren from UC Merced. We would also like to thank Dong Li from UC Merced, as well as Bharadwaj Pudipeddi and Maral Mesmakhouroshahi from Microsoft [L2L work](https://arxiv.org/abs/2002.05645), for their discussions on the topic.
\* 1-bit Adam was co-developed with our intern Hanlin Tang from University of Rochester.
\* We would like to thank the great collaboration from NVIDIA, especially the Megatron-LM team.

### About the DeepSpeed Team:

We are a group of system researchers and engineers—Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, Reza Yazdani Aminabadi, Elton Zheng, Arash Ashari, Jing Zhao, Minjia Zhang, Niranjan Uma Naresh, Shaden Smith, Ammar Ahmad Awan, Conglong Li, Yuxiong He (team lead) — who are enthusiastic about performance optimization of large-scale systems. We have recently focused on deep learning systems, optimizing deep learning’s speed to train, speed to convergence, and speed to develop!

In this post, Microsoft announces updates to DeepSpeed, its open-source deep learning training optimization library. The new updates include:

 - '3D parallelism', a scheme for carefully optimizing how training runs are split across machines. Training runs that use 3D parallelism demonstrate linear scaling of GPU memory and compute efficiency, enabling the theoretical training of extremely large models of over a trillion parameters on as few as 800 NVIDIA V100 GPUs.
 - 'ZeRO-Offload', which allows CPU memory to be used during training runs, enabling running models of up to 13 billion parameters on a single NVIDIA V100 GPU.
 - 'DeepSpeed Sparse Attention', an instrumental technology that reduces the compute and memory requirements of attention computations used in models like Transformers. Compared to models that use densely computed attention, this enables models that pay attention to sequences that are 10x longer and can be trained up to 6.3x faster.
 - '1-bit Adam', a scheme for compressing the communication requirements between machines doing training runs that use the Adam gradient descent optimizer. 1-bit Adam enables up to 5x less communication and up to 3.5x faster training runs.


\* [Twitter](https://twitter.com/intent/tweet?text=Cooperative+AI%3A+machines+must+learn+to+find+common+ground&url=https%3A%2F%2Fwww.nature.com%2Farticles%2Fd41586-021-01170-0)
\* [Facebook](http://www.facebook.com/sharer.php?u=https%3A%2F%2Fwww.nature.com%2Farticles%2Fd41586-021-01170-0)
\* [Email](mailto:?subject=Cooperative AI: machines must learn to find common ground&body=https%3A%2F%2Fwww.nature.com%2Farticles%2Fd41586-021-01170-0)

[Access through your institution](https://wayf.springernature.com?redirect\_uri=https%3A%2F%2Fwww.nature.com%2Farticles%2Fd41586-021-01170-0)

[Buy or subscribe](#access-options)

Artificial-intelligence assistants and recommendation algorithms interact with billions of people every day, influencing lives in myriad ways, yet they still have little understanding of humans. Self-driving vehicles controlled by artificial intelligence (AI) are gaining mastery of their interactions with the natural world, but they are still novices when it comes to coordinating with other cars and pedestrians or collaborating with their human operators.

Access options
--------------

[Access through your institution](https://wayf.springernature.com?redirect\_uri=https%3A%2F%2Fwww.nature.com%2Farticles%2Fd41586-021-01170-0)

[Access through your institution](https://wayf.springernature.com?redirect\_uri=https%3A%2F%2Fwww.nature.com%2Farticles%2Fd41586-021-01170-0)

[Change institution](https://wayf.springernature.com?redirect\_uri=https%3A%2F%2Fwww.nature.com%2Farticles%2Fd41586-021-01170-0)

[Buy or subscribe](#access-options)

/\\* style specs start \\*/
style{display:none!important}.LiveAreaSection-193358632 \\*{align-content:stretch;align-items:stretch;align-self:auto;animation-delay:0s;animation-direction:normal;animation-duration:0s;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;azimuth:center;backface-visibility:visible;background-attachment:scroll;background-blend-mode:normal;background-clip:borderBox;background-color:transparent;background-image:none;background-origin:paddingBox;background-position:0 0;background-repeat:repeat;background-size:auto auto;block-size:auto;border-block-end-color:currentcolor;border-block-end-style:none;border-block-end-width:medium;border-block-start-color:currentcolor;border-block-start-style:none;border-block-start-width:medium;border-bottom-color:currentcolor;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image-outset:0s;border-image-repeat:stretch;border-image-slice:100%;border-image-source:none;border-image-width:1;border-inline-end-color:currentcolor;border-inline-end-style:none;border-inline-end-width:medium;border-inline-start-color:currentcolor;border-inline-start-style:none;border-inline-start-width:medium;border-left-color:currentcolor;border-left-style:none;border-left-width:medium;border-right-color:currentcolor;border-right-style:none;border-right-width:medium;border-spacing:0;border-top-color:currentcolor;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;bottom:auto;box-decoration-break:slice;box-shadow:none;box-sizing:border-box;break-after:auto;break-before:auto;break-inside:auto;caption-side:top;caret-color:auto;clear:none;clip:auto;clip-path:none;color:initial;column-count:auto;column-fill:balance;column-gap:normal;column-rule-color:currentcolor;column-rule-style:none;column-rule-width:medium;column-span:none;column-width:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;display:inline;empty-cells:show;filter:none;flex-basis:auto;flex-direction:row;flex-grow:0;flex-shrink:1;flex-wrap:nowrap;float:none;font-family:initial;font-feature-settings:normal;font-kerning:auto;font-language-override:normal;font-size:medium;font-size-adjust:none;font-stretch:normal;font-style:normal;font-synthesis:weight style;font-variant:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;font-weight:400;grid-auto-columns:auto;grid-auto-flow:row;grid-auto-rows:auto;grid-column-end:auto;grid-column-gap:0;grid-column-start:auto;grid-row-end:auto;grid-row-gap:0;grid-row-start:auto;grid-template-areas:none;grid-template-columns:none;grid-template-rows:none;height:auto;hyphens:manual;image-orientation:0deg;image-rendering:auto;image-resolution:1dppx;ime-mode:auto;inline-size:auto;isolation:auto;justify-content:flexStart;left:auto;letter-spacing:normal;line-break:auto;line-height:normal;list-style-image:none;list-style-position:outside;list-style-type:disc;margin-block-end:0;margin-block-start:0;margin-bottom:0;margin-inline-end:0;margin-inline-start:0;margin-left:0;margin-right:0;margin-top:0;mask-clip:borderBox;mask-composite:add;mask-image:none;mask-mode:matchSource;mask-origin:borderBox;mask-position:0 0;mask-repeat:repeat;mask-size:auto;mask-type:luminance;max-height:none;max-width:none;min-block-size:0;min-height:0;min-inline-size:0;min-width:0;mix-blend-mode:normal;object-fit:fill;object-position:50% 50%;offset-block-end:auto;offset-block-start:auto;offset-inline-end:auto;offset-inline-start:auto;opacity:1;order:0;orphans:2;outline-color:initial;outline-offset:0;outline-style:none;outline-width:medium;overflow:visible;overflow-wrap:normal;overflow-x:visible;overflow-y:visible;padding-block-end:0;padding-block-start:0;padding-bottom:0;padding-inline-end:0;padding-inline-start:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:initial;resize:none;right:auto;ruby-align:spaceAround;ruby-merge:separate;ruby-position:over;scroll-behavior:auto;scroll-snap-coordinate:none;scroll-snap-destination:0 0;scroll-snap-points-x:none;scroll-snap-points-y:none;scroll-snap-type:none;shape-image-threshold:0;shape-margin:0;shape-outside:none;tab-size:8;table-layout:auto;text-align:initial;text-align-last:auto;text-combine-upright:none;text-decoration-color:currentcolor;text-decoration-line:none;text-decoration-style:solid;text-emphasis-color:currentcolor;text-emphasis-position:over right;text-emphasis-style:none;text-indent:0;text-justify:auto;text-orientation:mixed;text-overflow:clip;text-rendering:auto;text-shadow:none;text-transform:none;text-underline-position:auto;top:auto;touch-action:auto;transform:none;transform-box:borderBox;transform-origin:50% 50%0;transform-style:flat;transition-delay:0s;transition-duration:0s;transition-property:all;transition-timing-function:ease;vertical-align:baseline;visibility:visible;white-space:normal;widows:2;width:auto;will-change:auto;word-break:normal;word-spacing:normal;word-wrap:normal;writing-mode:horizontalTb;z-index:auto;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;margin:0}.LiveAreaSection-193358632{width:100%}.LiveAreaSection-193358632 .login-option-buybox{display:block;width:100%;font-size:17px;line-height:30px;color:#222;padding-top:30px;font-family:Harding,Palatino,serif}.LiveAreaSection-193358632 .additional-access-options{display:block;font-weight:700;font-size:17px;line-height:30px;color:#222;font-family:Harding,Palatino,serif}.LiveAreaSection-193358632 .additional-login>li:not(:first-child)::before{transform:translateY(-50%);content:"";height:1rem;position:absolute;top:50%;left:0;border-left:2px solid #999}.LiveAreaSection-193358632 .additional-login>li:not(:first-child){padding-left:10px}.LiveAreaSection-193358632 .additional-login>li{display:inline-block;position:relative;vertical-align:middle;padding-right:10px}.BuyBoxSection-683559780{display:flex;flex-wrap:wrap;flex:1;flex-direction:row-reverse;margin:-30px -15px 0}.BuyBoxSection-683559780 .box-inner{width:100%;height:100%}.BuyBoxSection-683559780 .readcube-buybox{background-color:#f3f3f3;flex-shrink:1;flex-grow:1;flex-basis:255px;background-clip:content-box;padding:0 15px;margin-top:30px}.BuyBoxSection-683559780 .subscribe-buybox{background-color:#f3f3f3;flex-shrink:1;flex-grow:4;flex-basis:300px;background-clip:content-box;padding:0 15px;margin-top:30px}.BuyBoxSection-683559780 .subscribe-buybox-nature-plus{background-color:#f3f3f3;flex-shrink:1;flex-grow:4;flex-basis:100%;background-clip:content-box;padding:0 15px;margin-top:30px}.BuyBoxSection-683559780 .title-readcube,.BuyBoxSection-683559780 .title-buybox{display:block;margin:0;margin-right:10%;margin-left:10%;font-size:24px;line-height:32px;color:#222;padding-top:30px;text-align:center;font-family:Harding,Palatino,serif}.BuyBoxSection-683559780 .title-asia-buybox{display:block;margin:0;margin-right:5%;margin-left:5%;font-size:24px;line-height:32px;color:#222;padding-top:30px;text-align:center;font-family:Harding,Palatino,serif}.BuyBoxSection-683559780 .asia-link{color:#069;cursor:pointer;text-decoration:none;font-size:1.05em;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;line-height:1.05em6}.BuyBoxSection-683559780 .access-readcube{display:block;margin:0;margin-right:10%;margin-left:10%;font-size:14px;color:#222;padding-top:10px;text-align:center;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;line-height:20px}.BuyBoxSection-683559780 .access-asia-buybox{display:block;margin:0;margin-right:5%;margin-left:5%;font-size:14px;color:#222;padding-top:10px;text-align:center;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;line-height:20px}.BuyBoxSection-683559780 .access-buybox{display:block;margin:0;margin-right:10%;margin-left:10%;font-size:14px;color:#222;opacity:.8px;padding-top:10px;text-align:center;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;line-height:20px}.BuyBoxSection-683559780 .price-buybox{display:block;font-size:30px;color:#222;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;padding-top:30px;text-align:center}.BuyBoxSection-683559780 .price-buybox-to{display:block;font-size:30px;color:#222;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;text-align:center}.BuyBoxSection-683559780 .price-info-text{font-size:16px;padding-right:10px;color:#222;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.BuyBoxSection-683559780 .price-value{font-size:30px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.BuyBoxSection-683559780 .price-per-period{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.BuyBoxSection-683559780 .price-from{font-size:14px;padding-right:10px;color:#222;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;line-height:20px}.BuyBoxSection-683559780 .issue-buybox{display:block;font-size:13px;text-align:center;color:#222;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;line-height:19px}.BuyBoxSection-683559780 .no-price-buybox{display:block;font-size:13px;line-height:18px;text-align:center;padding-right:10%;padding-left:10%;padding-bottom:20px;padding-top:30px;color:#222;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.BuyBoxSection-683559780 .vat-buybox{display:block;margin-top:5px;margin-right:20%;margin-left:20%;font-size:11px;color:#222;padding-top:10px;padding-bottom:15px;text-align:center;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;line-height:17px}.BuyBoxSection-683559780 .tax-buybox{display:block;width:100%;color:#222;padding:20px 16px;text-align:center;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;line-height:NaNpx}.BuyBoxSection-683559780 .button-container{display:flex;padding-right:20px;padding-left:20px;justify-content:center}.BuyBoxSection-683559780 .button-container>\\*{flex:1px}.BuyBoxSection-683559780 .button-container>a:hover,.Button-505204839:hover,.Button-1078489254:hover,.Button-2496381730:hover{text-decoration:none}.BuyBoxSection-683559780 .readcube-button{background:#fff;margin-top:30px}.BuyBoxSection-683559780 .button-asia{background:#069;border:1px solid #069;border-radius:0;cursor:pointer;display:block;padding:9px;outline:0;text-align:center;text-decoration:none;min-width:80px;margin-top:75px}.BuyBoxSection-683559780 .button-label-asia,.ButtonLabel-3869432492,.ButtonLabel-3296148077,.ButtonLabel-1651148777{display:block;color:#fff;font-size:17px;line-height:20px;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;text-align:center;text-decoration:none;cursor:pointer}.Button-505204839,.Button-1078489254,.Button-2496381730{background:#069;border:1px solid #069;border-radius:0;cursor:pointer;display:block;padding:9px;outline:0;text-align:center;text-decoration:none;min-width:80px;max-width:320px;margin-top:10px}.Button-505204839 .readcube-label,.Button-1078489254 .readcube-label,.Button-2496381730 .readcube-label{color:#069}
/\\* style specs end \\*/Access Nature and 54 other Nature Portfolio journals

Get Nature+, our best-value online-access subscription

24,99 € / 30 days

cancel any time

[Learn more](https://shop.nature.com/products/plus)Subscribe to this journal

Receive 51 print issues and online access

199,00 € per year

only 3,90 € per issue

[Learn more](/nature/subscribe)Rent or buy this article

Prices vary by article type

from$1.95

to$39.95

[Learn more](//www.nature.com/articles/d41586-021-01170-0.epdf?no\_publisher\_access=1&r3\_referer=nature)Prices may be subject to local taxes which are calculated during checkout

### Additional access options:

\* [Log in](https://idp.nature.com/authorize/natureuser?client\_id=grover&redirect\_uri=https%3A%2F%2Fwww.nature.com%2Farticles%2Fd41586-021-01170-0)
\* [Learn about institutional subscriptions](https://www.springernature.com/gp/librarians/licensing/license-options)
\* [Read our FAQs](https://support.nature.com/en/support/home)
\* [Contact customer support](https://www.springernature.com/gp/contact)

\*Nature\* \*\*593\*\*, 33-36 (2021)

\*doi: https://doi.org/10.1038/d41586-021-01170-0\*

References
----------

1. Campbell, M., Hoane Jr, A. J. & Hsu, F.-H. \*Artif. Intell.\* \*\*134\*\*, 57–83 (2002).

[Article](https://doi.org/10.1016%2FS0004-3702%2801%2900129-1)
 [Google Scholar](http://scholar.google.com/scholar\_lookup?&title=&journal=Artif.%20Intell.&doi=10.1016%2FS0004-3702%2801%2900129-1&volume=134&pages=57-83&publication\_year=2002&author=Campbell%2CM.&author=Hoane%20Jr%2CA.%20J.&author=Hsu%2CF.-H.)
2. Silver, D. \*et al.\* \*Nature\* \*\*529\*\*, 484–489 (2016).

[Article](https://doi.org/10.1038%2Fnature16961)
 [PubMed](http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Abstract&list\_uids=26819042)
 [Google Scholar](http://scholar.google.com/scholar\_lookup?&title=&journal=Nature&doi=10.1038%2Fnature16961&volume=529&pages=484-489&publication\_year=2016&author=Silver%2CD.)
3. Moravčík, M. \*et al.\* \*Science\* \*\*356\*\*, 508–513 (2017).

[Article](https://doi.org/10.1126%2Fscience.aam6960)
 [PubMed](http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Abstract&list\_uids=28254783)
 [Google Scholar](http://scholar.google.com/scholar\_lookup?&title=&journal=Science&doi=10.1126%2Fscience.aam6960&volume=356&pages=508-513&publication\_year=2017&author=Morav%C4%8D%C3%ADk%2CM.)
4. Bard, N. \*et al.\* \*Artif. Intell.\* \*\*280\*\*, 103216 (2020).

[Article](https://doi.org/10.1016%2Fj.artint.2019.103216)
 [Google Scholar](http://scholar.google.com/scholar\_lookup?&title=&journal=Artif.%20Intell.&doi=10.1016%2Fj.artint.2019.103216&volume=280&publication\_year=2020&author=Bard%2CN.)
5. Kitano, H. \*et al.\* \*AI Magazine\* \*\*18\*\*, 73 (1997).

[Article](https://doi.org/10.1609%2Faimag.v18i1.1276)
 [Google Scholar](http://scholar.google.com/scholar\_lookup?&title=&journal=AI%20Magazine&doi=10.1609%2Faimag.v18i1.1276&volume=18&publication\_year=1997&author=Kitano%2CH.)
6. Villani, V., Pini, F., Leali, F. & Secchi, C. \*Mechatronics\* \*\*55\*\*, 248–266 (2018).

[Article](https://doi.org/10.1016%2Fj.mechatronics.2018.02.009)
 [Google Scholar](http://scholar.google.com/scholar\_lookup?&title=&journal=Mechatronics&doi=10.1016%2Fj.mechatronics.2018.02.009&volume=55&pages=248-266&publication\_year=2018&author=Villani%2CV.&author=Pini%2CF.&author=Leali%2CF.&author=Secchi%2CC.)
7. Russell, S. \*Human Compatible: Artificial Intelligence and the Problem of Control\* (Penguin, 2019).

[Google Scholar](http://scholar.google.com/scholar\_lookup?&title=Human%20Compatible%3A%20Artificial%20Intelligence%20and%20the%20Problem%20of%20Control&publication\_year=2019&author=Russell%2CS.)
8. Adadi, A. & Berrada, M. \*IEEE Access\* \*\*6\*\*, 52138–52160 (2018).

[Article](https://doi.org/10.1109%2FACCESS.2018.2870052)
 [Google Scholar](http://scholar.google.com/scholar\_lookup?&title=&journal=IEEE%20Access&doi=10.1109%2FACCESS.2018.2870052&volume=6&pages=52138-52160&publication\_year=2018&author=Adadi%2CA.&author=Berrada%2CM.)
9. Allcott, H., Braghieri, L., Eichmeyer, S. & Gentzkow, M. \*Am. Econ. Rev.\* \*\*110\*\*, 629–676 (2020).

[Article](https://doi.org/10.1257%2Faer.20190658)
 [Google Scholar](http://scholar.google.com/scholar\_lookup?&title=&journal=Am.%20Econ.%20Rev.&doi=10.1257%2Faer.20190658&volume=110&pages=629-676&publication\_year=2020&author=Allcott%2CH.&author=Braghieri%2CL.&author=Eichmeyer%2CS.&author=Gentzkow%2CM.)
10. Barocas, S., Hardt, M. & Narayanan, A. \*Fairness and Machine Learning\* (Fairmlbook.org, 2019).

[Google Scholar](http://scholar.google.com/scholar\_lookup?&title=Fairness%20and%20Machine%20Learning&publication\_year=2019&author=Barocas%2CS.&author=Hardt%2CM.&author=Narayanan%2CA.)
11. Buolamwini, J. & Gebru, T. \*Proc. Mach. Learn. Res.\* \*\*81\*\*, 77–91 (2018).

[Google Scholar](http://scholar.google.com/scholar\_lookup?&title=&journal=Proc.%20Mach.%20Learn.%20Res.&volume=81&pages=77-91&publication\_year=2018&author=Buolamwini%2CJ.&author=Gebru%2CT.)
12. Axelrod, R. \*The Evolution of Cooperation\* (Basic, 1984).

[Google Scholar](http://scholar.google.com/scholar\_lookup?&title=The%20Evolution%20of%20Cooperation&publication\_year=1984&author=Axelrod%2CR.)
13. Deng, J. \*et al.\* \*IEEE Conf. Comput. Vis. Pattern Recognit\*. \*\*2009\*\*, 248–255 (2009).

[Article](https://doi.org/10.1109%2FCVPR.2009.5206848)
 [Google Scholar](http://scholar.google.com/scholar\_lookup?&title=&journal=IEEE%20Conf.%20Comput.%20Vis.%20Pattern%20Recognit&doi=10.1109%2FCVPR.2009.5206848&volume=2009&pages=248-255&publication\_year=2009&author=Deng%2CJ.)
14. Dafoe, A. \*et al.\* Preprint at  (2020).

[Download references](https://citation-needed.springer.com/v2/references/10.1038/d41586-021-01170-0?format=refman&flavour=references)

Related Articles
----------------

\* [![](//media.nature.com/lw100/magazine-assets/d41586-021-01170-0/d41586-021-01170-0\_18662916.jpg)

 Sliced, diced and digested: AI-generated science ready in minutes](https://www.nature.com/articles/d41586-020-03415-w)
\* [![](//media.nature.com/lw100/magazine-assets/d41586-021-01170-0/d41586-021-01170-0\_19028706.jpg)

 Robo-writers: the rise and risks of language-generating AI](https://www.nature.com/articles/d41586-021-00530-0)
\* [![](//media.nature.com/lw100/magazine-assets/d41586-021-01170-0/d41586-021-01170-0\_18365752.jpg)

 Don’t ask if artificial intelligence is good or fair, ask how it shifts power](https://www.nature.com/articles/d41586-020-02003-2)
\* [![](//media.nature.com/lw100/magazine-assets/d41586-021-01170-0/d41586-021-01170-0\_19042736.jpg)

 Am I arguing with a machine? AI debaters highlight need for transparency](https://www.nature.com/articles/d41586-021-00867-6)
\* [![](//media.nature.com/lw100/magazine-assets/d41586-021-01170-0/d41586-021-01170-0\_19120814.jpg)

 Cooperating with machines](https://www.nature.com/articles/s41467-017-02597-8)
\* [![](//media.nature.com/lw100/magazine-assets/d41586-021-01170-0/d41586-021-01170-0\_19039036.jpg)

 Time to regulate AI that interprets human emotions](https://www.nature.com/articles/d41586-021-00868-5)

Subjects
--------

\* [Machine learning](/subjects/machine-learning)
\* [Computer science](/subjects/computer-science)
\* [Society](/subjects/society)
\* [Technology](/subjects/technology)
\* [Sociology](/subjects/sociology)
\* [Human behaviour](/subjects/human-behaviour)

Latest on:
----------

Machine learning

[![ChatGPT gives an extra productivity boost to weaker writers](https://images.nature.com/w140h79/magazine-assets/d41586-023-02270-9/d41586-023-02270-9\_25602406.jpg)
ChatGPT gives an extra productivity boost to weaker writers

News 13 JUL 23](https://www.nature.com/articles/d41586-023-02270-9)

[Large language model is a flagship for Japan

Correspondence 11 JUL 23](https://www.nature.com/articles/d41586-023-02230-3)

[![AI tools are designing entirely new proteins that could transform medicine](https://images.nature.com/w140h79/magazine-assets/d41586-023-02227-y/d41586-023-02227-y\_25580718.jpg)
AI tools are designing entirely new proteins that could transform medicine

News Feature 11 JUL 23](https://www.nature.com/articles/d41586-023-02227-y)

Computer science

[![How to introduce quantum computers without slowing economic growth](https://images.nature.com/w140h79/magazine-assets/d41586-023-02317-x/d41586-023-02317-x\_25606130.jpg)
How to introduce quantum computers without slowing economic growth

Comment 17 JUL 23](https://www.nature.com/articles/d41586-023-02317-x)

[![ChatGPT gives an extra productivity boost to weaker writers](https://images.nature.com/w140h79/magazine-assets/d41586-023-02270-9/d41586-023-02270-9\_25602406.jpg)
ChatGPT gives an extra productivity boost to weaker writers

News 13 JUL 23](https://www.nature.com/articles/d41586-023-02270-9)

[![Quantum-enhanced Markov chain Monte Carlo](https://media.nature.com/w140h79/springer-static/image/art%3A10.1038%2Fs41586-023-06095-4/MediaObjects/41586\_2023\_6095\_Fig1\_HTML.png)
Quantum-enhanced Markov chain Monte Carlo

Article 12 JUL 23](https://www.nature.com/articles/s41586-023-06095-4)

Society

[Brazil: threat to Indigenous peoples persists

Correspondence 18 JUL 23](https://www.nature.com/articles/d41586-023-02302-4)

[Large language model is a flagship for Japan

Correspondence 11 JUL 23](https://www.nature.com/articles/d41586-023-02230-3)

[![Don’t get mad, get equal: putting an end to misogyny in science](https://images.nature.com/w140h79/magazine-assets/d41586-023-02101-x/d41586-023-02101-x\_25403536.jpg)
Don’t get mad, get equal: putting an end to misogyny in science

Career Column 26 JUN 23](https://www.nature.com/articles/d41586-023-02101-x)

Nature Careers
---------------

###
[Jobs](https://www.nature.com/naturecareers/)

\* #### [CLINICAL TENURE TRACK TRANSLATIONAL INVESTIGATOR POSITION](https://www.nature.com/naturecareers/job/12803015/clinical-tenure-track-translational-investigator-position-/?TrackID=62&utm\_source=widget&utm\_medium=referral&utm\_campaign=62)

The Intramural Research Program (IRP) of the Eunice Kennedy Shriver National Institute of Child Health

Bethesda, Maryland (US)

NIH Eunice Kennedy Shriver National Institute of Child Health and Human Development (NICHD)

![](https://www.nature.com/naturecareers/getasset/7bbb397f-8471-4c85-94af-90224e72209c/)
\* #### [Post-Doctoral Position](https://www.nature.com/naturecareers/job/12803014/post-doctoral-position/?TrackID=62&utm\_source=widget&utm\_medium=referral&utm\_campaign=62)

A postdoctoral position supported by a NIH R01 grant

New Brunswick, New Jersey

Rutgers, The State Univ RBHS

![](https://www.nature.com/naturecareers/getasset/b0727c66-da27-4837-bcf0-2dfe24ea204b/)
\* #### [Postdoc in Computational Cancer Genomics (Harvard Medical School)](https://www.nature.com/naturecareers/job/12802998/postdoc-in-computational-cancer-genomics-harvard-medical-school-/?TrackID=62&utm\_source=widget&utm\_medium=referral&utm\_campaign=62)

Postdoc in computational cancer genomics at Harvard (Dietlein lab). Develop new bioinformatics tools to discover oncogenic mutations in cancer genomes

Boston, Massachusetts (US)

Harvard Medical School / Boston Children's Hospital

![](https://www.nature.com/naturecareers/getasset/e732ff84-56bc-440f-b736-b4b957592e5a/)
\* #### [Postdoctoral fellow / Bioinformatician](https://www.nature.com/naturecareers/job/12802975/postdoctoral-fellow-bioinformatician/?TrackID=62&utm\_source=widget&utm\_medium=referral&utm\_campaign=62)

Post-doctoral position for a computational and/or wet-lab researcher is immediately available in the field of functional cancer epigenomics.

Helsinki, Uusimaa (FI)

ATG-RPU, University of Helsinki

![](https://www.nature.com/naturecareers/getasset/ee6cf4bc-df59-4a28-b0be-254745d007e3/)
\* #### [Tenure-Track Investigator 1](https://www.nature.com/naturecareers/job/12802936/tenure-track-investigator-1/?TrackID=62&utm\_source=widget&utm\_medium=referral&utm\_campaign=62)

Department of Health and Human Services National Institutes of Health National Institute on Aging

Bethesda, Maryland (US)

National Institutes of Health

![](https://www.nature.com/naturecareers/getasset/b423992a-21d5-4e79-8511-35df20d615dd/)

Allan Dafoe
Yoram Bachrach
Gillian Hadfield
Eric Horvitz
Kate Larson
Thore Graepel

This short piece argues that rather than building autonomous AI systems (which typically involves a non-social environment), we should instead work on building AI systems that are able to promote mutually beneficial joint action, that is, we should work on <@Cooperative AI@>(@Open Problems in Cooperative AI@). This can be separated into three main categories:

1. AI-AI cooperation: Here, two AI systems must cooperate with each other. Think for example of games like Hanabi or Diplomacy.
2. AI-human cooperation: This setting involves an AI system that must understand and work with a human. <@Assistance games@>(@Human Compatible: Artificial Intelligence and the Problem of Control@) are a central example. When there are multiple humans, it becomes important for our AI system to understand norms and institutions as well.
3. Human-human cooperation: Here, AI systems are used to enhance cooperation between humans. For example, machine translation helps people who speak different languages cooperate with each other.

There is now a new nonprofit, the [Cooperative AI Foundation](https://www.cooperativeai.com/foundation), that supports research on these topics.

I think there are three main sources of impact of this agenda from an x-risk perspective:
1. If an AI system has better agent-agnostic cooperative intelligence, it should be less likely to fall into “traps” of multiagent situations, such as <@conflict, bargaining failures@>(@Cooperation, Conflict, and Transformative Artificial Intelligence: A Research Agenda@), or <@commitment races@>(@The "Commitment Races" problem@).
2. If an AI system has better human-specific cooperative intelligence, it should be easier to (a) align that system with a human principal and (b) have that system cooperate with other humans (besides its principal).
3. If an AI system promotes cooperation between other agents (including humans), that seems to help with a variety of other major global problems, such as biorisk, nuclear war, and climate change.

I agree that all three of these things, if achieved, would make the world better in expectation (though see <@here@>(@Thoughts on Human Models@) for some arguments against). I feel best about (3), because it seems to have the largest surface area for improvement. In fact, (1) and (2) are almost special cases of (3), in which the AI system improves cooperation by being one of the agents that is cooperating with others (presumably on behalf of some human principal who wouldn't have done as good a job).

I am more uncertain about how best to achieve the goals laid out in (1) - (3). The article promotes multiagent reinforcement learning (MARL) for goal (1), which I think is plausible but not obvious: I could imagine that it would be better to (say) pretrain a large language model and then finetune it to be cooperative using human judgments. Within the Cooperative AI paradigm, I’m most excited about figuring out the best research bets to make in order to achieve the three goals above. The authors are very interested in finding others to help with this.