LLMs

DeepCrossAttention: Up to 3× Faster Transformer Training

Google DeepMind's DeepCrossAttention restructures Transformer residual paths with cross-attention, reporting comparable quality and up to 3× faster training. The gains depend on model scale, configuration, evaluation setup, and hardware.

Font size

Google DeepMind has released research on the DeepCrossAttention architecture, with a focused goal: optimizing Transformer residual connections. The team reports comparable model quality and training speedups of up to 3×, though that ceiling cannot be assumed for every LLM training workload.

DeepCrossAttention Explained: Up to 3× Faster Training

Google DeepMind published research on the DeepCrossAttention architecture with a specific goal: optimizing Transformer residual connections.

It does not add another standard set of self-attention layers or make the model larger. The change targets the internal information paths of the network. According to Google, DeepCrossAttention delivers quality comparable to existing models while accelerating training by as much as 3×.

That sounds like a case of getting a major speedup simply by changing how components connect. The reality is more complicated.

The initial reaction to the research provides some context. It reached the Hacker News front page with 81 points and 18 comments. Engineers hearing about a result like this tend to ask three questions before sharing it:

  • Which model and configuration produced the 3× speedup?
  • Which benchmarks were used to establish “comparable quality”?
  • Can existing training frameworks integrate it directly?

Original research: Google Research's official blog post, “Supercharging Transformer Residual Connections”.

The 3× Speedup Does Not Come from Extra Attention

First, it is worth dispelling a common misconception.

DeepCrossAttention does not add an extra cross-attention layer to every Transformer block. Despite the words “Attention” and “Cross” in its name, the central problem is how effectively the residual branch can pass information forward.

A conventional Transformer block can be approximated as follows:

x = x + attention(norm1(x))
x = x + feed_forward(norm2(x))

The first line preserves the original input and adds back the attention output. The second preserves the current representation and adds the feed-forward network's output.

The benefits of this structure are clear: gradients have a direct path, which supports stable training. The problem is that the two branches are not fully symmetric. The attention branch reorganizes information among tokens, while the residual branch carries information into subsequent layers. A conventional residual connection acts more like an unmodified, direct channel.

DeepCrossAttention enhances the flow of residual information through attention. Instead of information traveling through a fixed path from a block's input, the architecture can more actively select and combine representations that are useful downstream.

In other words, Google did not change how much attention computation occurs; it changed how residual connections work.

This distinction matters. If the gains mainly came from additional computation, DeepCrossAttention would simply be another way to build a larger model. If they come from reorganizing information flow, the method could improve both training efficiency and representation quality.

The official blog post says the method uses cross-attention to strengthen Transformer residual connections and reports training acceleration of up to 3×. That figure is an official result, not a fixed multiplier for every model and hardware configuration.

Why Residual Connections Become a Training Bottleneck

Residual connections are not usually the first place people look when optimizing LLM training.

Most teams focus on questions such as:

  • Can FlashAttention reduce memory accesses?
  • Can Mixed Precision eliminate more than half the cost of matrix operations?
  • Can a larger batch size improve GPU utilization?
  • Can ZeRO, FSDP, or activation checkpointing reduce memory consumption?

A residual addition is simple, typically an element-wise operation. Why would it become a bottleneck?

In a deep network, every layer does two things at once: compute a new representation and continue passing the old one forward. The latter is inexpensive, but its cost accumulates across large numbers of tokens, hidden dimensions, and layers.

The more difficult issue is information efficiency.

Suppose a representation in layer 10 is no longer useful to layer 11. A conventional residual connection still carries it forward in full. Later layers must learn to filter it out, and when every block repeats this pattern, the cost and redundancy grow with depth.

DeepCrossAttention attempts to make the residual branch participate in information selection. Through cross-attention, the residual path can consult the current layer's context and then decide which information should be emphasized in the representations passed forward.

This differs from the role of standard self-attention. Standard attention generally finds relationships among tokens. DeepCrossAttention focuses on how residual information flows into the next stage of computation.

From an engineering perspective, the gains may come from three areas:

  1. Higher effective utilization of representations, reducing the burden of irrelevant information on later layers.
  2. Better information transfer across layers, shortening the path required for some representations to reach the output.
  3. Reaching a target with fewer training steps or a shorter training period while maintaining quality.

The third point requires careful evaluation. “Up to 3× faster training” may refer to a reduction in total training time required to reach the same evaluation quality, or it may represent a throughput increase during a particular stage. These are not the same claim.

Up to 3× Does Not Mean Every Task Gets Faster

This is the part most likely to be obscured by the headline.

“Up to 3× faster” is a ceiling, not an average or an automatic result after integration.

At least four sets of conditions determine the speedup.

Model Scale

Small models may be constrained by kernel launch overhead, Python scheduling, and communication latency. Adding cross-attention increases theoretical computation, but it does not necessarily keep the GPU busier.

Larger models operate differently. As model size increases, redundancy in residual information flow may accumulate, potentially making the optimization more valuable.

That does not mean a larger model will necessarily train 3× faster. The memory, computation, and communication requirements of attention matrices all grow with sequence length and hidden size.

Training Configuration

Training speed depends on more than the GPU model.

Batch size, sequence length, gradient accumulation, checkpointing, attention kernels, and parallelism strategies can all change the result. The full experiment is needed to determine whether the 3× speedup comes from the algorithm or from better-suited hyperparameters.

The number of training steps is equally important. If DeepCrossAttention reaches the same quality in half as many steps, that is a sample-efficiency gain. If throughput improves 3× at every step, that is a compute-efficiency gain. Both are valuable, but they imply very different budget models.

Evaluation Setup

“Comparable quality” also needs to be unpacked.

Language-model perplexity, instruction following, code generation, and long-context retrieval measure different capabilities. A model that matches the baseline on perplexity may still regress in tool use, multi-turn Agent workflows, or long-chain reasoning.

LLM teams should record at least the following:

  • Loss curves under the same number of training tokens;
  • Evaluation scores under the same wall-clock time;
  • Throughput, memory consumption, and communication volume at the same number of steps;
  • Downstream task results and length-extrapolation performance.

Hardware and Training Stack

A method that performs well in a paper's environment will not necessarily perform well on an existing cluster.

If the new attention operation cannot use efficient kernels or is incompatible with the partitioning strategy used by ZeRO-3, FSDP, or tensor parallelism, the theoretical gains may be offset by communication and recomputation.

For that reason, “up to 3×” should not be used directly to revise a training budget.

Adopting DeepCrossAttention in LLM Training

The practical question is not whether the method can accelerate training, but how much adaptation is required to obtain that speedup.

DeepCrossAttention changes the information paths inside a Transformer. In theory, it does not require a new tokenizer or a rewrite of the entire training paradigm. The main work involves implementing the block and adapting the training system.

If an existing codebase uses the standard structure:

class TransformerBlock(nn.Module):
    def __init__(self, config):
        super().__init__()
        self.norm1 = nn.LayerNorm(config.hidden_size)
        self.attn = nn.MultiheadAttention(config.hidden_size, config.num_heads)
        self.norm2 = nn.LayerNorm(config.hidden_size)
        self.ffn = nn.Sequential(
            nn.Linear(config.hidden_size, config.intermediate_size),
            nn.GELU(),
            nn.Linear(config.intermediate_size, config.hidden_size),
        )

    def forward(self, x):
        x = x + self.attn(self.norm1(x), self.norm1(x), self.norm1(x))[0]
        x = x + self.ffn(self.norm2(x))
        return x

The team should validate at least four points:

  1. Whether Google's official DeepCrossAttention implementation is publicly available and whether its license permits commercial use.
  2. Whether it integrates directly with Hugging Face Transformers, native PyTorch modules, or Megatron-LM.
  3. Whether the cross-attention implementation can reuse an existing KV cache path; training-only and inference scenarios should be tested separately.
  4. Whether memory consumption and communication degrade under FSDP, tensor parallelism, and activation checkpointing.

The paper demonstrates that the direction is promising. The availability of usable code determines how quickly it can enter a production training pipeline.

For a budget-constrained team, a small A/B test is a better starting point than immediately migrating the main model:

  • Select a model between 100M and 500M parameters;
  • Fix the dataset, token count, and seed;
  • Run one group with conventional residual connections and another with DeepCrossAttention;
  • Record step time, tokens/s, peak memory consumption, and loss;
  • Run a quality comparison using the same training budget.

Migration is worthwhile only if the time required to reach equivalent quality decreases while memory use, communication, and convergence stability remain acceptable.

Inference cost also requires attention. Faster training does not imply faster generation. If cross-attention increases parameter count, sequence state, or computational-graph complexity, lower training costs may be offset by higher deployment costs.

This is especially relevant to teams building AI Agents. Agents often use a foundation model alongside tool calling, RAG, and state machines. Even with a 3× improvement in training efficiency, end-to-end Agent latency may still be dominated by retrieval, tool services, and model inference.

DeepCrossAttention is therefore better viewed as a foundation-model training optimization worth testing than as a switch for directly improving Agent response times.

Engineering Perspective

The most interesting aspect of this research is not the 3× figure, but the idea of turning residual connections from a fixed topology into a learnable information-routing layer. Transformer optimization has historically focused on attention layers, MLPs, and data pipelines. Residual connections are usually treated as a free and immutable backbone. DeepCrossAttention offers a different perspective: the backbone itself may introduce redundancy or limit information efficiency.

More architectural optimizations of this kind are likely to appear as an alternative to simply adding parameters. When training costs are substantial, correcting the information flow once may be more economical than scaling up a model. The official results, however, cannot yet be assumed to carry over to long-context training, MoE architectures, or multi-node training. Nor is it clear whether gains on the training side will persist during inference. Code availability, kernel compatibility, and reproducibility are the three gates between the paper and a production training cluster.

Source

https://research.google/blog/supercharging-transformer-residual-connections/

Source: https://research.google/blog/supercharging-transformer-residual-connections/