Attention Cubes for Weather Forecasting ✎

Original: "Earthformer: Exploring Space-Time Transformers for Earth System Forecasting"
arXiv:2207.05833 · 2022-07-12 · arXiv non-exclusive · independent analysis · 3 min
The new Earthformer architecture slices space and time into cubes, helping neural networks predict precipitation and El Niño more accurately and faster.

A meteorologist looks at a map where clouds gather in flocks, like birds before a storm. Each spot on the radar could be a future downpour or just noise. Earth system forecasting is like trying to assemble a puzzle with thousands of pieces that keep changing shape.

For years, forecasters relied on numerical models that grind through the physics equations of the atmosphere and ocean. These machines are accurate but slow and expensive. Satellites and radars have accumulated mountains of data over decades, and neural networks have already learned to predict rain from sky images. But older architectures, such as convolutional and recurrent networks, are too rigidly tied to the data's shape. The Earth system is chaotic: a butterfly flapping its wings in Brazil could trigger a tornado in Texas.

Transformers excel at capturing relationships between distant points, but applying them directly to three-dimensional data hits the quadratic complexity of attention. Every element wants to "look" at all others, and computations explode.

The authors of Earthformer found a way to tame this greed. They slice the input into cubes, blocks of size time × height × width. Inside each cube, the neural network performs self-attention, weighing the importance of points relative to each other. Cubes do not see each other directly, but a small set of global vectors links them. These vectors gather a summary from all cubes and send it back, like a courier delivering news across neighborhoods.

The architecture is hierarchical: first, convolutional layers compress the data, then it is expanded again. The decoder produces the forecast not step by step but all at once, using positional embeddings. On the synthetic MovingMNIST dataset, where digits move across the screen, Earthformer achieves an MSE of 41.79, and on N-body MNIST, where digits obey the gravity of three bodies, it reaches 14.82. This beats six baseline models.

On the real precipitation dataset SEVIR, the model achieves CSI-219 = 0.1791, compared to 0.0831 for Rainformer and 0.0577 for UNet. For El Niño forecasting, the correlation C-Nino3.4-M reaches 0.7329, surpassing competitors.

Global vectors provide a stable improvement without increasing computation: parameters grow from 6.6 million to 7.6 million, while GFLOPS barely change. The hierarchy reduces the error on MovingMNIST from 48.04 to 46.91. Qualitatively, the model tracks digit trajectories in N-body MNIST more accurately, whereas baseline methods blur the image or confuse direction.

Previously, it was unclear how to apply transformers to three-dimensional Earth system forecasting data without drowning in computation. Now it is clear: cutting into cubes and using global vectors allow the transformer to outperform convolutional and recurrent networks on precipitation and El Niño tasks. The model can be used for operational forecasting of precipitation and ocean temperature, and as a basis for hybrid physics-neural network systems.

The meteorologist looks at the map again, but now attention cubes assemble the world picture piece by piece, like a mosaic where each fragment knows about the whole.

The N-body MNIST dataset makes digits move according to the laws of three-body gravity, a chaotic system where the slightest change in initial velocity leads to a completely different trajectory. The model must guess where the digit '0' will fly, even though the exact solution is unstable.

The idea of predicting a chaotic system from limited observations echoes Liu Cixin's 'The Three-Body Problem', where a civilization tries to compute the motion of a planet in a system of three suns. Earthformer, like the novel's protagonists, confronts fundamental unpredictability but learns to give the best possible forecast.

Concepts
transformers forecast IRI probabilistic forecast climate model spring predictability barrier climate network ERA5 forecasting attention mechanism seismometer reanalysis Hovmöller diagram lead time Machine Learning Multivariate ENSO Index