TL;DR
Pangu-Weather is a deep learning system that forecasts the global atmosphere. It treats the weather as a three-dimensional block, with latitude, longitude and pressure level as its axes, and runs a Transformer-style network over that block. Trained on reanalysis data from 1979 to 2017, it reported better accuracy than the operational numerical forecast of the European Centre for Medium-Range Weather Forecasts (ECMWF) on the variables and lead times the authors tested, and it produces a forecast in about 1.4 seconds on one GPU. Its second idea is to train a few models with different time steps and chain them, which keeps the error from piling up over a week of forecasting.
Builds on: Shifted Window Attention, Relative Position Bias, Encoder-Decoder Architecture · Leads to: autoregressive forecasting
Why it mattered
Weather forecasting is one of the largest jobs in scientific computing. Forecast centres run physics simulations on supercomputers, and those simulations take hours for a ten-day forecast even at high resolution. Before this paper, data-driven models were fast but less accurate than the physics models. The paper cites a review that conjectured "a number of fundamental breakthroughs are needed" before AI-based methods could beat conventional forecasting. The paper claims that the gap closed: it says Pangu-Weather is the first AI-based system to beat the physics-based operational forecast across all the weather factors and all lead times it tested, from one hour to one week. The abstract says the result "ends the debate" on whether AI-based methods can surpass conventional numerical forecasting. Whether that holds beyond their test set is a question for later work, and the paper leaves room for it.
The paper also matters for how the model is built. It shows that a three-dimensional, transformer-style design can use the vertical structure of the atmosphere in a way that a two-dimensional model cannot. That design choice is the reason the rest of the lesson looks at the architecture so closely.
The problem
A weather forecast starts from a snapshot of the atmosphere and predicts a later snapshot. The snapshot is large. The ERA5 reanalysis, the dataset the paper uses, has 37 pressure levels with 21 variables each, plus 262 surface variables, on a grid of 1440 by 721 points at a quarter-degree spacing. The time axis runs hourly for decades. A physics model solves partial differential equations on this grid, and the cost grows quickly with resolution.
There are two problems with fast data-driven models, the paper says.
The first is dimension. Many earlier AI forecasters treat the atmosphere as a flat image, a two-dimensional map of latitude and longitude, with each pressure level as a separate channel. The paper argues that this throws away the structure between levels. Pressure levels are not like colour channels: the air changes quickly from one level to the next, and some processes such as convection can only be described in three dimensions.
The second is error accumulation. A model that predicts six hours ahead must be run many times to reach a week, and each run adds a little error to the last. The paper uses FourCastNet as its example. It trained a six-hour model and ran it 28 times to reach seven days, and the error grew faster than linearly with time.
The paper's answer is to use the three-dimensional data directly and to reduce the number of model calls. Both ideas come with a cost in memory and compute, and the design below is a trade-off between them.
How it works
The system has two parts. The first is a network, the 3D Earth-specific transformer (3DEST), that maps one atmospheric state to the state a fixed time later. The second is a schedule that chains several such networks to reach any forecast time. Here is the path of one forecast, from input to output, with a toy grid in place of the real one:
flowchart LR A["input state: pressure levels, latitudes, longitudes, variables"] --> B["patch embedding: cut into small 3D blocks"] B --> C["encoder: windowed attention with Earth-specific bias"] C --> D["downsample: merge neighbouring blocks"] D --> E["decoder: upsample, joined to the encoder by a skip connection"] E --> F["patch recovery: back to the grid"] F --> G["forecast state, 6 or 24 hours ahead"]
Here is that path for a toy atmosphere. Suppose the grid has 4 pressure levels, 8 latitudes, 16 longitudes and 5 variables at each point. The patch size is 2 levels by 4 latitudes by 4 longitudes, a smaller version of the real patch.
- Start with the grid. The input is , which is numbers. Check: , , and .
- Cut the grid into patches. Each patch covers 2 levels, 4 latitudes and 4 longitudes. The levels give patches, the latitudes give and the longitudes give . That is patches. Check: each patch holds points, and points, which is the number of grid points in the toy grid, .
- Embed each patch as a vector. A linear layer maps each patch's numbers to a vector of length . The paper uses a GELU activation alongside the linear map. After this step the grid is a set of 16 tokens, each a length- vector. Check: the model now works on 16 tokens instead of 2560 numbers.
- Run the encoder. Attention runs inside small windows of tokens, and the window is shifted by half a window in alternate layers, so information can cross window edges over depth. The bias is chosen by where the window sits on the Earth (its height and latitude), not only by the offsets between its tokens. Check: the same operation is applied to every window, so the cost grows with the number of tokens in a window, not with the square of the whole grid.
- Downsample. Four neighbouring tokens are merged into one, which quadruples the feature length, and a linear layer shrinks it to twice . In the toy case, 16 tokens become 4. Check: the number of tokens drops by a factor of four, and the length of each token goes from to .
- Decode and skip. The decoder mirrors the encoder and upsamples back to the full resolution. The output of an early encoder layer is concatenated with a late decoder layer, so fine detail from the input reaches the output. Check: the token count returns to 16, and the feature length carries both paths.
- Recover the grid. A patch recovery layer maps each token back to values per variable. This layer has its own weights, not the inverse of the embedding. The result is the forecast, one snapshot later by the model's fixed lead time, which the paper gives as 6 hours in its example. Check: the output has the same shape as the input, so it can be fed back in.
The atmosphere also has a surface, which is not a pressure level. The paper embeds it separately, with a patch, and concatenates the result along the level axis. Upper air and surface are therefore processed by the same stack.
The second part of the system chains models. A single model has a fixed lead time, and the paper trains four of them, for 1, 3, 6 and 24 hours. Any forecast time can then be covered with fewer calls, as the worked example in "The math" shows.
The math
The attention in each block is the standard scaled dot-product, with one change in the bias term. The paper writes it as
Here , and are the query, key and value vectors of the tokens in one window, is the length of a query or key, and is a bias added to the scores before the Softmax. Each entry of says how much two tokens in a window should attend to each other, independent of their content.
Step 4 in symbols: the Earth-specific bias
A standard Swin bias depends only on the relative offset between two tokens. The paper argues this is wrong for the globe, for two reasons. On a latitude-longitude grid, the physical distance between neighbouring points shrinks towards the poles. And some quantities, such as geopotential and wind, depend on absolute position and height, as the paper's Figure 3 shows. So the paper gives each token an absolute-position bias, written .
The bias table is indexed by the window's height and latitude but not by its longitude, since the longitude axis is a circle with evenly spaced points. The paper counts the new parameters for the first block as about 527 times the number of the standard relative bias. Those extra parameters, the authors say, let each block learn different spatial relations for each latitude and height. They also say the bias does not increase the number of floating-point operations.
Step 5 in symbols: the grid sizes
For the real model the upper-air cube is , and the surface cube is . With the patch sizes and , the embedded shapes are and . These are concatenated along the level axis to give , which is the working shape of the first encoder layers. The levels become 7 because the 13 pressure levels are padded to 14 before patching. The 181 comes from padding 721 latitudes to 724. The encoder then uses after its downsampling step.
Step 6 in symbols: the forecast error
The network takes the state at time and predicts the state at , and the difference from the true state is what training back-propagates. The paper scores forecasts with a latitude-weighted root mean squared error. The weight at latitude is proportional to , so that grid rows near the poles, which cover less area on the sphere, count for less. The paper defines the metric as
where is the forecast, is the truth, is a variable, and and are the grid sizes. The metric is the square root of a mean squared error, the same idea as Mean Squared Error with the latitude weighting added.
The chaining schedule in symbols
Let be the forecast time in hours and let be the lead time of one model. A forecast needs at least calls when the division is exact. The paper's greedy rule uses the largest model that fits and then smaller ones for the remainder. The worked example below shows how this works on a forecast that does not divide evenly.
- calls needed for 7 days
- Start with the 24-hour, 6-hour, 3-hour and 1-hour models available. The target is 23 hours ahead.
- The largest model that fits is the 6-hour model. Since with remainder , use it three times. That covers hours, and hours are left. Check: .
- For the remaining 5 hours, the 3-hour model fits once, which covers 3 hours, and hours are left.
- The 1-hour model is then used twice, which covers 2 hours. Check: .
- The total is calls, against 23 calls for a model that moved only one hour at a time.
Try it: how many calls does a 7-day (168-hour) forecast need if only the 6-hour and 1-hour models are available? Work it out before reading on.
Answer: 168 is a multiple of 6, so 28 calls of the 6-hour model suffice. No 1-hour call is needed.
Results
The paper compares deterministic forecasts on the 2018 test year of ERA5, starting from unperturbed states at 00:00 and 12:00 UTC each day. The main comparison is against operational IFS, the physics model of ECMWF. Its upper-air numbers come from the TIGGE archive, while the surface numbers and the FourCastNet numbers are read from published plots. Root mean squared errors are in the units of each variable. Lower is better.
| Variable and lead time | Operational IFS | FourCastNet | Pangu-Weather |
|---|---|---|---|
| Z500, 3 days (m²/s²) | 152.8 | — | 134.5 |
| Z500, 5 days (m²/s²) | 333.7 | 462.5 | 296.7 |
| T850, 3 days (K) | 1.37 | — | 1.14 |
| T850, 5 days (K) | 2.06 | — | 1.79 |
| T2M, 3 days (K) | 1.34 | 1.39 | 1.05 |
| T2M, 5 days (K) | 1.75 | 2.00 | 1.53 |
| U10, 3 days (m/s) | 1.94 | 2.24 | 1.61 |
| U10, 5 days (m/s) | 2.90 | 3.41 | 2.53 |
The paper reports that the advantage over operational IFS holds at every lead time for every variable it tested, and that the gain grows with lead time. It also gives a "forecast time gain" of 12 hours or more for the upper-air variables: a Pangu-Weather forecast at a given lead time is as accurate as an IFS forecast made 12 or more hours later. The inference time is about 1,400 milliseconds on one GPU, which the authors say is more than 10,000 times faster than the operational system.
Its limits are stated in the paper and should be read with the table. The numbers for IFS and FourCastNet are partly read off published plots, and the paper says that adds some error that it considers small next to the gaps. The mean sea-level pressure forecast could not be compared to IFS because that data was unavailable. The models were trained for 100 epochs and the authors say they had not converged, so the reported accuracy is a lower bound for that architecture. The system is trained on reanalysis, which is itself a blend of observations and model output, so it is not a test on raw observations. And the claim that AI has overtaken physics for all forecasting is a claim about the tests the paper ran, not a general proof.
Reading guide
The paper is long. Here is how its sections map onto this lesson.
- Section I, Introduction. The motivation and the headline numbers in Figure 1. Needs the idea of partial differential equations as the basis of physics forecasts.
- Section II, Preliminaries and insights. The notation in Table I and the two insights about dimension and iteration. This is the source of "The problem" above.
- Section III-B, Data preparation. The training years (1979 to 2017), validation (2019) and test (2018, 2020, 2021), and the 13 pressure levels. Read it to see which numbers are real and which are the paper's choices.
- Section III-C, the 3D Earth-specific transformer. Patch embedding, the encoder and decoder layout, and the bias. Needs Vision Transformer (ViT), Shifted Window Attention, Relative Position Bias and Encoder-Decoder Architecture. The attention equation is the one in "The math".
- Section III-D, Hierarchical temporal aggregation. The four lead times and the greedy schedule. This is the second idea of the paper.
- Section IV-A, Deterministic forecast. The RMSE and ACC definitions, and the comparison tables. The RMSE idea is the one in Mean Squared Error with latitude weights added.
- Sections IV-B and IV-C, extreme weather and ensemble forecasts. Outside the scope of this lesson. Read them after the deterministic results, since they use the same model on other tasks.
Check yourself
QuestionThe paper's upper-air patch size is and the upper-air cube has 13 pressure levels. How many levels remain after patch embedding, and why is the count not simply 13 divided by 2?Show answer
Padding is applied. 13 divided by 2 is 6.5, which is not a whole number, so the level axis is padded to 14 with zeros before the patches are cut. That gives levels, which matches the shape in the paper.
QuestionIn the toy example, the grid has 4 pressure levels, 8 latitudes and 16 longitudes, and the patch size is 2 by 4 by 4. How many tokens does the encoder see, and how many after the first downsampling step?Show answer
The grid gives patches over levels, over latitudes and over longitudes, so tokens. The downsampling step merges four neighbouring tokens into one, so the count falls to tokens.
QuestionWhy does the paper argue that a standard relative positional bias is the wrong choice for a global weather model?Show answer
A relative bias depends only on the offset between two tokens, so it treats every part of the map the same. On a latitude-longitude grid, distance between neighbouring points changes with latitude, and some variables such as geopotential depend on absolute position and height. An absolute, Earth-specific bias lets the model learn those dependencies, and the paper reports that the model converges faster with it.
QuestionA 5-day forecast with the 1-hour model needs 120 calls, and with the 24-hour model it needs 5. Why does the paper stop the chain at 24 hours instead of training a 48-hour model?Show answer
The paper's stated reason is that a longer lead time makes the base model harder to train. A 48-hour model would cut the calls further, but with the current network the authors found long-range forecasts difficult, and they conjecture that more powerful methods might overcome this.
Sources
- Kaifeng Bi, Lingxi Xie, Hengheng Zhang, Xin Chen, Xiaotao Gu, Qi Tian, Pangu-Weather: A 3D High-Resolution Model for Fast and Accurate Global Weather Forecast, arXiv:2211.02556: https://arxiv.org/abs/2211.02556
- Ze Liu et al., Swin Transformer: Hierarchical Vision Transformer using Shifted Windows, arXiv:2103.14030: https://arxiv.org/abs/2103.14030