Cross-Attention vs Self-Attention in Robot Policies

A mechanistic breakdown of how self-attention and cross-attention work differently in robot learning: where each appears in ACT, π0, OpenVLA, and GR00T N2, with working PyTorch implementations.

In this article

  • Self-Attention: a sequence understanding itself
  • Cross-Attention: one sequence querying another
  • Code: Both Mechanisms Side by Side
  • Why Cross-Attention is the Critical Fusion Layer
  • π0: Cross-Attention at Every Denoising Step
  • The Full Attention Map in a VLA
  • Flash Attention: Making Cross-Attention Fast Enough for Real Robots
  • Practical Takeaway