langmultiscalelossformulation2025.md 23 KB


category: literaturenote citekey: langmultiscalelossformulation2025 title: A multi-scale loss formulation for learning a probabilistic model with proper score optimisation authors: "Lang, Simon; Leutbecher, Martin; Maciel, Pedro" year: 2025 date: 2025-00-00 2025 url: "https://arxiv.org/abs/2506.10868v1" zotero_key: CZE825DK zotero_storage: QB5PASHX collections: transpordi_planeerimine folder: 001_artiklid firstAuthor: "Lang, Simon"

status: converted

A multi-scale loss formulation for learning a probabilistic model with proper score optimisation

Simon Lang, Martin Leutbecher, and Pedro Maciel

ECMWF, Reading, UK

12 June 2025

Abstract

We assess the impact of a multi-scale loss formulation for training probabilistic machine-learned weather forecasting models. The multi-scale loss is tested in AIFS-CRPS, a machine-learned weather forecasting model developed at the European Centre for Medium-Range Weather Forecasts (ECMWF). AIFS-CRPS is trained by directly optimising the almost fair continuous ranked probability score (afCRPS). The multi-scale loss better constrains small scale variability without negatively impacting forecast skill. This opens up promising directions for future work in scale-aware model training.

1 Introduction

Over the last few years, probabilistic machine-learned weather prediction models have begun to rival physics-based numerical weather prediction (NWP) systems in skill (Kochkov et al., 2024; Price et al., 2023; Lang et al., 2024c,b). AIFS-CRPS (Lang et al., 2024b) is based on the machined-learned weather forecasting model AIFS (Lang et al., 2024a), developed at the European Centre for Medium-Range Weather Forecasts (ECMWF). AIFS-CRPS produces skilful predictions by directly optimising a score based on a proper scoring rule, the almost fair continuous ranked probability score (afCRPS). The model learns to shape Gaussian noise to represent uncertainty in the atmospheric state and achieves ensemble forecast skill that is competitive with, or superior to, the physics-based IFS ensemble (Molteni et al., 1996; Leutbecher and Palmer, 2008; Lang et al., 2021, 2023) at ECMWF.

The afCRPS loss function used in AIFS-CRPS is computed point-wise on the full output field. However, atmospheric processes are inherently multi-scale, and different scales contribute to a different degree to the loss function. The scaledependent verification of ensemble forecasts has been explored with wavelets and spectral band pass filters by Casati and Wilson (2007); Jung and Leutbecher (2008), respectively. These studies have shed additional light on the skill of ensemble forecasts as function of spatial scale. In contrast, the standard application of scoring rules to gridded forecasts does not take the spatial scale of the forecast errors and ensemble perturbations into account. An exception is the work of Kochkov et al. (2024) who incorporate a spectral CRPS terms in their loss function to train a hybrid model that combines a differentiable solver for atmospheric dynamics with a machine-learned physics module.

The question that arises is whether the machine-learned forecast model AIFS-CRPS can be improved by adding additional constraints via a loss function that evaluates different spatial scales separately. Here, we test the effect of adding a multi-scale component to the afCRPS training objective. We evaluate whether this modification leads to improved spatial structures compared to the scale-unaware loss function.

2 Methodology

2.1 The multi-scale loss

We consider predictions and targets which are scalar functions on an ℓ-dim manifold M

$$\phi : \mathcal{M} \to \mathbb{R}$$ .

Later in this section, an idealized 1-dim example will be shown. The remainder of the paper focusses on an application to the 2-sphere for global weather prediction. However, the concepts are generic and can be applied to higher dimensions ℓ > 2 as well. In most applications, we expect that discretization of these functions on suitable grids will be used. For what follows, we will not distinguish explicitly between the continuous case and the discretized case and will adopt a lightweight notation. Spatial integration over the manifold will be denoted by integrals with the understanding that these are replaced by suitable finite sums over grids for the discrete case.

Consider an optimisation of probabilistic predictions for a target using a scoring rule S for scalars. Let xj : M → R and y : M → R denote the j-th prediction and the target, respectively. Then a loss can be defined as

$$\mathcal{L} = c \int_{\mathcal{M}} \mathcal{S}([x_j \mid j = 1, \dots M], y) \,d\mu \tag{1}$$

The score S is computed for each location q ∈ M and then spatially averaged. Here µ denotes a measure on M and c is a normalisation constant. The loss is not scale-aware as the scoring rule depends only on the marginal distributions sampled by the ensemble of predictions at each location q ∈ M. In order to distinguish this loss from the multi-scale loss introduced next, we will refer to it by Lscale-unaware.

Now, a multi-scale loss will be introduced based on a sequence of ordered smoothing operators Di , i = 1, . . . , n − 1 which remove the smaller scales of

Figure 1: Smoothing kernels for the 1-dim simulation study

functions ϕ : M → R. It is assumed that Di smooths more than Di+1. These operators induce a partition of a function ϕ on the manifold into n scales

$$\begin{split} \phi_{\text{scale }1} &= D1(\phi) \ \phi{\text{scale }2} &= D_2(\phi) - D1(\phi) \ &\vdots \ \phi{\text{scale }n} &= \phi - D_{n-1}(\phi) \end{split}$$

Then, the n-scale loss is defined as a weighted sum of the loss for each scale i

$$\mathcal{L}{n\text{-scale}} = \sum{i=1}^{n} \zetai c \int{\mathcal{M}} \mathcal{S}([x{j,\text{scale } i} \mid j = 1, \dots M], y{\text{scale } i}) d\mu$$ (2)

with weight ζi > 0 for scale i. It is straightforward to introduce as many loss scales as required. The Di could be implemented as linear kernel smoothers with width decreasing with i. Alternatively, a spectral filter could be used if spectral transforms are available for the manifold M.

2.1.1 Simulation study with monochromatic waves

In order to motivate why a multi-scale loss may be useful, this section illustrates the concept with a one-dimensional simulation study on a periodic domain. The predictions and the target are sine waves with a random phase and unit amplitude. We consider a 3-scale loss defined with the kernels shown in Figure 1 The implied partition of the waves into different spatial scales is shown for a couple of different waves in Figure 2

For the simulation study, we use the fair CRPS as scoring rule. It accounts for the finite number of predictions and estimates the CRPS one would obtain with probabilities estimated from an infinite sample. We consider as target waves with wavenumber kt. Then, for a set of wavenumbers k we consider predictions with an ensemble size of M = 8. The scale-unaware loss and the 3-scale loss are computed for each wavenumber. This is repeated for 4000 realisations of the truth and the predictions.

Figure 2: Predictions and targets are sine waves with random phases. The three scales focus on different wavelengths: Scale 1 is dominated by the largest wavelengths, scale 2 emphasises intermediate wavelengths and scale 3 the shortest wavelengths.

Figure 3: Fair CRPS as function of the predicted wavenumber for the scaleunaware loss and the three-scale loss. The dashed vertical line indicates the wavenumber of the target. The three panels consider target wavenumbers of 1 4 1 and 1.

Figure 3 shows that the scale-unaware loss is indeed invariant of the wavenumber of the prediction. In contrast, the 3-scale loss correctly identifies the target wavenumber.

2.2 AIFS-CRPS experiments

We compare two versions of AIFS-CRPS, one reference experiment, trained with the scale-unaware loss formulation and one with the multi-scale loss formulation. The models have a spatial resolution of approximately 0.25◦ (N320 reduced Gaussian grid, Wedi, 2014).

2.2.1 Loss objective

We use the almost fair Continuous Ranked Probability Score (afCRPS, Lang et al. (2024b)) with α = 0.95 as the loss objective. The afCRPS is a linear combination of the CRPS (Hersbach, 2000) and the fair version of the CRPS (fCRPS, Ferro (2013); Leutbecher (2019)). The fair score enables training with small ensembles sizes as low as two members. However, it exhibits a degeneracy which leaves one member unconstrained if all other members are identical to the observed value. The degeneracy can be addressed by using the almost fair CRPS introduced by Lang et al. (2024b):

$$\begin{split} \text{afCRPS}{\alpha} &:= \alpha \, \text{fCRPS} + (1 - \alpha) \text{CRPS} \ &= \frac{1}{M} \sum{j=1}^{M} |xj - y| - \frac{M - 1 + \alpha}{2M^2(M - 1)} \sum{j=1}^{M} \sum_{k=1}^{M} |x_j - xk| \ &= \frac{1}{M} \sum{j=1}^{M} |xj - y| - \frac{1 - \epsilon}{2M(M - 1)} \sum{j=1}^{M} \sum_{k=1}^{M} |x_j - x_k| \end{split}$$

with ϵ := (1−α) M . Here, the xj and y denote ensemble forecasts and the analysis, respectively.

The scale-unaware loss is defined consistently with Lang et al. (2024b) using the almost fair CRPS as scoring rule S in (1). Likewise, a multi-scale loss is defined by using the almost fair CRPS as scoring rule in (2). We focus on a two-scale version and use equal weighting for both scales, ζi = 1.

The smoothing operator is a linear filter implemented via sparse matrix multiplication. We use a Gaussian kernel, which is easily parametrised, though other filters could be employed. Its standard deviation is set to eight times the grid spacing. The kernel weights are linearly normalised to sum to one. We use matrices generated with ECMWF's Meteorological Interpolation and Regridding (MIR) software package (Maciel et al., 2017). An example of a target field and its two scales is shown in Figure 4.

Figure 4: ERA5 v-component of wind (in m s−1 ) at 850 hPa, full field (a), field after filtering (b) and difference between filtered and full field (c).

2.2.2 Training

The training and model set-up follows Lang et al. (2024b). However, here we do not fine tune on operational analyses data of the physics-based Integrated Forecasting System (IFS). Instead we only train on the Copernicus ERA5 reanalysis dataset produced by ECMWF (Hersbach et al., 2020). The training consists of three sequential stages. In the first stage, the model learns to forecast a single 6-hour time step ahead. In the second stage, we extend training to an auto-regressive setup with two 6-hour forecast steps. The third stage involves training with progressively longer forecast windows. The forecast length is increased after each epoch by 6 hours, up to a maximum of 72 hours. For the multi-scale loss version of the AIFS-CRPS, we start from the scale-unaware loss pre-trained model after the first training stage and then train the model with the multi-scale loss during stage 2 and 3.

The first stage comprises 300,000 parameter updates, starting with an initial learning rate of 10−3 . We apply a cosine learning rate schedule with 1,000 warm-up steps, during which the learning rate increases linearly from zero to its maximum value, then gradually decreases back to zero. The second stage involves 60,000 iterations, using a cosine schedule with 100 warm-up steps and an initial learning rate of 10−5 . The third stage includes approximately 45,000 iterations, with a fixed learning rate (10−6 ). We use a batch size of 16 throughout training. The AdamW optimizer (Loshchilov and Hutter (2019)) is used with β-coefficients of 0.9 and 0.95, and a weight decay of 0.1. The training data consists of the years 1979 to 2017 and the year 2018 is reserved for validation.

3 Results

To assess the impact of the multi-scale loss we compare 8 member ensemble forecasts of the scale-unaware loss and multi-scale loss trained AIFS-CRPS version. Forecasts have been run for each day of 2019, initialised at 00 UTC. Forecasts are started from ERA5 analyses and with initial perturbations derived from the ERA5 ensemble of data assimilations.

Both experiments exhibit equal skill, as demonstrated by the nearly identical skill scores. Figure 5 shows examples for the Northern Hemisphere extra-tropics, where the curves are on top of each other. The same is true across other variables and regions (not shown).

However, examining individual forecast fields reveals that the scale-unaware loss experiment contains more small-scale variability than the multi-scale loss experiment and the ERA5 analysis. This is evident in regions with weaker gradients, where contour lines appear more variable. For example, the 12-hour forecast 588 dam isohypse in figure 6 shows noticeable differences between the scale-unaware loss experiment (figure 6a), and the multi-scale loss experiment (figure 6b) and the ERA5 analysis (figure 6c). On the other hand, The multiscale experiment and the ERA5 analysis are in better agreement.

Spectra of forecast fields show that the multi-scale loss experiment better

Figure 5: Fair CRPS for (a) northern hemisphere geopotential at 500 hPa, (b) temperature at 850 hPa and (c) windspeed at 850 hPa. Scores are shown for the year 2019, forecasts are initialised on 00 UTC each day. Fields are interpolated to a 1.5 ◦ grid for verification, following standard practice.

40°S Figure 6: Geopotential at 500 hPa (dam, contours) and v-component of wind at 850 hPa (shaded) of (a) the scale-unaware loss experiment, (b) the multi-scale loss experiment and (c) the ERA5 analysis. Shown are 24 h forecasts of member 1, initialised on 2019-01-01 00 UTC (a, b) and verifying analysis on 2019-01-02 00 UTC (c).

constrains small-scale variability compared to the scale-unaware loss experiment, when compared to the ERA5 analysis (figure 7). The impact is most pronounced for fields that appear relatively smooth, for example geopotential at 500 hPa (figure 7a), while for other fields differences in the spectra are smaller (figure 7b).

Figure 7: Spectra of (a) geopotential at 500 hPa and (b) temperature at 850 hPa for the experiment trained with the multi-scale loss and the experiment trained with the scale-unaware loss for 12 h forecasts. ERA5 refers to the initial conditions. The spectra are averaged over 11 initial dates for a single ensemble member.

4 Discussion

Optimising a proper score objective is a powerful method to generate probabilistic forecasts of complex dynamical systems like the atmosphere (Lang et al., 2024b; Pacchiardi et al., 2024; Shokar et al., 2024; Kochkov et al., 2024). It enables optimising forecast skill over long forecasts, and one forecast step only requires a single model evaluation. This is in contrast to, for example, the diffusion paradigm (Sohl-Dickstein et al., 2015; Ho et al., 2020; Song et al., 2021), which also has been shown to be an effective method to generate probabilist forecasts (Price et al., 2023; Lang et al., 2024c; Larsson et al., 2025). Here, the model needs to be called many times during inference for each forecast step. However, in diffusion modelling the model learns to forecast different scales due to varying level of noise added to the target state (e.g., Dieleman (2024)). How much emphasis is put on each scale can then be adjusted by the noise schedule during training and sampling (Karras et al., 2022). In proper score optimisation, the representation of different scales is implicit. By introducing a multi-scale loss component, it becomes possible to target specific scales and, e.g. reduce spurious variability in predictions. Consistently, Kochkov et al. (2024) find that combining CRPS terms computed in spectral space (one for each spectral coefficient up to wavenumber 80) with their grid-point CRPS loss improves the representation of long-range correlations in forecast with their hybrid model.

Computing the multi-scale loss at two scales incurs only marginal additional cost beyond the model's forward and backward pass. The overhead might become more significant with a large number of scales.

More work will be required to assess what the best set of hyper-parameters is for weather forecasting. For example, while variability of geopotential fields is significantly improved, there is still an offset between analysis and forecasted fields at the smallest scales. This could be an indication that more scales will improve results further. Also, different problems - for example long-range forecasting, or downscaling - might require different scale-weighting. This will be explored in future work.

5 Conclusion

Introducing a multi-scale loss function in proper-score-based training, such as with the almost fair continuous ranked probability score (afCRPS), improves the representation of variability in machine-learned weather forecasting models. In our experiments, forecast skill remains unchanged while the physical realism of forecast fields is enhanced. We believe that the multi-scale loss formulation will make proper-score optimization even more attractive for a wide range of prediction tasks.

Acknowledgments: We acknowledge the EuroHPC Joint Undertaking for awarding this work access to the EuroHPC supercomputer MN5, hosted by BSC in Barcelona through a EuroHPC JU Special Access call.

References

Barbara Casati and Lori J Wilson. A new spatial-scale decomposition of the Brier score: Application to the verification of lightning probability forecasts. Monthly Weather Review, 135(9):3052–3069, 2007.

  • Sander Dieleman. Diffusion is spectral autoregression. https://sander. ai/2024/09/02/spectral-autoregression.html, September 2024. URL https://sander.ai/2024/09/02/spectral-autoregression.html. Blog post.
  • C. A. T. Ferro. Fair scores for ensemble forecasts. Quarterly Journal of the Royal Meteorological Society, 140(683):1917–1923, December 2013. ISSN 0035-9009. doi: 10.1002/qj.2270. URL http://dx.doi.org/10.1002/qj.2270.
  • H. Hersbach, B. Bell, P. Berrisford, et al. The ERA5 global reanalysis. QJ R Meteorol Soc, 146:1999–2049, 2020. doi: 10.1002/qj.3803.
  • Hans Hersbach. Decomposition of the continuous ranked probability score for ensemble prediction systems. Weather and Forecasting, 15(5): 559 – 570, 2000. doi: 10.1175/1520-0434(2000)015⟨0559:DOTCRP⟩2.0. CO;2. URL https://journals.ametsoc.org/view/journals/wefo/15/5/ 1520-0434_2000_015_0559_dotcrp_2_0_co_2.xml.
  • Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. arXiv preprint arXiv:2006.11239, 2020.
  • Thomas Jung and Martin Leutbecher. Scale-dependent verification of ensemble forecasts. Quarterly Journal of the Royal Meteorological Society, 134(633): 973–984, 2008.
  • Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine. Elucidating the design space of diffusion-based generative models. arXiv preprint arXiv:2206.00364, 2022.
  • Dmitrii Kochkov, Janni Yuval, Ian Langmore, Peter Norgaard, Jamie Smith, Griffin Mooers, Milan Kl¨ower, James Lottes, Stephan Rasp, Peter D¨uben, Sam Hatfield, Peter Battaglia, Alvaro Sanchez-Gonzalez, Matthew Willson, Michael P. Brenner, and Stephan Hoyer. Neural general circulation models for weather and climate. arXiv preprint arXiv:2311.07222, 2024.
  • Simon Lang, Mark Rodwell, and Dinand Schepers. IFS upgrade brings many improvements and unifies medium-range resolutions. ECMWF Newsletter 176, pages 21–28, 2023. doi: 10.21957/slk503fs2i.
  • Simon Lang, Mihai Alexe, Matthew Chantry, Jesper Dramsch, Florian Pinault, Baudouin Raoult, Mariana C. A. Clare, Christian Lessig, Michael Maier-Gerber, Linus Magnusson, Zied Ben Bouall`egue, Ana Prieto Nemesio, Peter D. Dueben, Andrew Brown, Florian Pappenberger, and Florence Rabier. AIFS – ECMWF's data-driven forecasting system. arXiv preprint arXiv:2406.01465, 2024a. URL https://arxiv.org/abs/2406.01465.
  • Simon Lang, Mihai Alexe, Mariana C. A. Clare, Christopher Roberts, Rilwan Adewoyin, Zied Ben Bouall`egue, Matthew Chantry, Jesper Dramsch, Peter D. Dueben, Sara Hahner, Pedro Maciel, Ana Prieto-Nemesio, Cathal O'Brien,

  • Florian Pinault, Jan Polster, Baudouin Raoult, Steffen Tietsche, and Martin Leutbecher. AIFS-CRPS: Ensemble forecasting using a model trained with a loss function based on the continuous ranked probability score. arXiv preprint arXiv:2412.15832, 2024b. URL https://arxiv.org/abs/2412.15832.

  • Simon Lang, Matthew Chantry, and Mihai Alexe. Enter the ensembles. http: //doi.org/10.21957/a791daf964, 2024c.

  • Simon T.K. Lang, Andrew Dawson, Michail Diamantakis, Peter Dueben, Sam Hatfield, Martin Leutbecher, Tim Palmer, Fernando Prates, Christopher D. Roberts, Irina Sandu, and Nils Wedi. More accuracy with less precision. Q.J.R. Meteorol. Soc., 147(741):4358–4370, 2021. doi: 10.1002/qj.4181.

  • Erik Larsson, Joel Oskarsson, Tomas Landelius, and Fredrik Lindsten. Diffusionlam: Probabilistic limited area weather forecasting with diffusion, 2025. URL https://arxiv.org/abs/2502.07532.

  • Martin Leutbecher. Ensemble size: How suboptimal is less than infinity? Quarterly Journal of the Royal Meteorological Society, 145(S1):107–128, 2019. doi: https://doi.org/10.1002/qj.3387. URL https://rmets.onlinelibrary. wiley.com/doi/abs/10.1002/qj.3387.

  • Martin Leutbecher and Tim N Palmer. Ensemble forecasting. Journal of Computational Physics, 227(7):3515–3539, 2008.

  • Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019. URL https: //openreview.net/forum?id=Bkg6RiCqY7.

  • P. Maciel, T. Quintino, U. Modigliani, P. Dando, B. Raoult, W. Deconinck, F. Rathgeber, and C. Simarro. The new ECMWF interpolation package MIR, 2017. URL https://doi.org/10.21957/H20RZ8.

  • Franco Molteni, Roberto Buizza, Tim N Palmer, and Thomas Petroliagis. The ECMWF ensemble prediction system: Methodology and validation. Quarterly Journal of the Royal Meteorological Society, 122(529):73–119, 1996.

  • Lorenzo Pacchiardi, Rilwan A Adewoyin, Peter Dueben, and Ritabrata Dutta. Probabilistic forecasting with generative networks via scoring rule minimization. Journal of Machine Learning Research, 25(45):1–64, 2024.

  • Ilan Price, Alvaro Sanchez-Gonzalez, Ferran Alet, Timo Ewalds, Andrew El-Kadi, Jacklynn Stott, Shakir Mohamed, Peter Battaglia, Remi Lam, and Matthew Willson. GenCast: Diffusion-based ensemble forecasting for medium-range weather. arXiv preprint arXiv:2312.15796, 2023.

  • Ira J. S. Shokar, Rich R. Kerswell, and Peter H. Haynes. Stochastic latent transformer: Efficient modeling of stochastically forced zonal jets. Journal of Advances in Modeling Earth Systems, 16(6), June 2024. ISSN 1942-2466. doi: 10.1029/2023ms004177. URL http://dx.doi.org/10.1029/2023MS004177.

  • Jascha Sohl-Dickstein, Eric A. Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics, 2015. URL https://arxiv.org/abs/1503.03585.

  • Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations, 2021. URL https://arxiv.org/abs/2011. 13456.

  • N. P. Wedi. Increasing the horizontal resolution in numerical weather prediction and climate simulations: illusion or panacea? Philosophical Transactions of the Royal Society A, 372, 2014. doi: 10.1098/rsta.2013.0289.