Paper · 2026-10-24 · cs.LG
Climate downscaling with likelihood functional flow matching
CD-FFM downscales ERA5 reanalysis to 1 km daily temperature over Fennoscandia with a pointwise functional flow-matching model. One network is queried at any grid or point set, texture comes from a spectrum-fitted noise prior, and every observation gets an exact likelihood. A distilled flow map samples in one or two steps. Author-reported: CRPS 27-31% below regression, 12-18% below a 124M FNO flow.
Flow matchingNormalizing flowsNeural operatorImplicit neural representation (INR)climate-downscalingflow-matchinggenerative-modelslikelihoodweather
arXivPDFCodeMarkdown16 min read
AI-compiled by claude-haiku-5-5 on 2026-11-21, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
Climate datasets come on coarse grids, with cells of tens of kilometres, but a road crew or a city planner needs to know about one particular valley or coastline. This paper builds a model that adds the missing detail to daily temperature maps for the Nordic countries, down to 1 km, together with the uncertainty around that detail.
The model does not produce one fixed grid. It treats the fine map as a random surface that can be read at any location and at any resolution. It starts from random noise that has the texture of real temperature fields and moves each point's noise value, one point at a time, into a plausible temperature. Because every point is handled separately, the model can also compute exactly how likely an observed temperature is. Sampling is quick, so producing many possible maps is affordable. The authors report better probabilistic scores than a regression model, a much larger neural operator and a diffusion model, and they show that the same design also works for precipitation, with weaker results on the heaviest rain.
TL;DR
CD-FFM is a small (3.2M parameters) functional flow-matching model for climate downscaling. It encodes each coarse ERA5 day once, then transports a Gaussian random field into 1 km daily mean, maximum and minimum temperature at any set of points. Its textures come from a power-law noise prior, its likelihood is exact, and a distilled flow map gives samples in one or two network evaluations. Results are author-reported and come from one region and one target product.
Problem
Reanalyses such as ERA5 resolve the atmosphere at roughly 25-100 km § Main. Deterministic statistical downscaling returns conditional means and loses the variability and tails that matter for impacts § Main. Earlier generative downscalers have four limits named by the authors § Main: they are tied to one target grid; they need tens of network evaluations per member over the whole domain; their ensembles are often under-dispersed; and their likelihood is intractable at full-field scale, so they are judged by sample scores only. The paper also asks what determines the spatial texture of generated fields § Main.
Setting: ERA5 0.25 degree inputs, NGCD 1 km targets over Norway, Sweden and Finland, 1,325,781 land pixels with complete climatologies § Methods (Data). Test years 2016, 2018 and 2019 were not used for training or checkpoint selection § Skill.
Method
CD-FFM has four parts § Model:
- Encoder and query. A Flower encoder maps the four standardised ERA5 fields of a day to a 128-channel feature map, once per day. For any query point, a local implicit function reads the four surrounding cells with 3x3 feature unfolding, blends them by opposite-corner area, appends 17 static descriptors and returns a 64-dimensional condition c(s) § Methods (Model).
- Pointwise velocity. A small MLP v(x, c(s), t) acts on each point separately, with x in R^3 for TG, TX and TN § Methods (Model). The day-of-year encoding is appended to the condition § Methods (Model).
- Noise prior. The start point z(s) at t = 0 is a Gaussian random field with unit variance, built from 1,024 random Fourier features whose radial frequencies follow a power law S(k) proportional to k^-beta, beta = 2.4, between wavelengths of 8 and 500 km § Methods (Model). The slope is measured on the NGCD residual field at 5-100 km § Methods (Model). The authors chose this prior over i.i.d. and RBF noise because it matched the observed roughness and spectrum in flat terrain, although per-pixel scores barely separated the priors § Noise tab. ED2.
- Flow matching, flow map, likelihood. Training uses the linear interpolant x_t = (1 - t) z + t x_1 and regresses the velocity § Methods (Model). A second network, the flow map, is distilled from the trained velocity so that one call jumps between any two times § Methods (Model). Because the velocity is pointwise, the density of an observation follows from one backward ODE solve with the exact trace of a 3x3 Jacobian § Methods (Model) § Likelihood.
The paper uses the convention below for citations. Unnumbered sections are cited as § Name with the first word of the heading, and the Methods subsections as § Methods (Subsection). Extended Data figures and tables are cited as fig. ED1 and tab. ED1. Supplementary Information subsections are cited as § SI (S1-S4). Display equations are unnumbered in the source, so they are cited by section.
Training
# Flow-matching training step [§ Methods] (Model)
# [code: scripts/fast_train.py#L154-L163]
# Input: days (16 per batch), NGCD targets x1 (B, N, 3), ERA5 inputs
# Output: scalar loss
def training_loss(days, targets, cond):
# Sample 2048 uniform points and 16 clusters of 32 points
# (2560 points per day in total) [§ Methods] (Model)
points = sample_points(days, uniform=2048, clusters=16, cluster_size=32)
# Draw the noise start from the random-field prior [§ Methods] (Model)
z0 = noise_field(points) # (B, N, 3)
# Draw one time per point, uniformly on [0, 1]
# [code: scripts/fast_train.py#L159]
t = uniform(0, 1, shape=(B, N))
# Linear interpolant between noise (t = 0) and data (t = 1)
# [§ Methods] (Model)
x_t = (1 - t) * z0 + t * targets # (B, N, 3)
# Regress the velocity onto the straight-line target; mask missing pixels
# [§ Methods] (Model)
error = velocity(x_t, cond, t) - (targets - z0)
return masked_mean(error ** 2, valid_mask)Optimiser and schedule: AdamW with learning rate 3e-4, 1,000 linear warm-up steps, cosine decay, gradient clipping at 1 and an exponential moving average of the weights with decay 0.999 § Methods (Model). Training runs for 60,000 steps, the evaluated checkpoint is reached after about 40,000 § Methods (Model).
Flow-map distillation
# Flow-map distillation of the frozen teacher [§ Methods] (Model)
# [code: scripts/fast_train.py#L115-L143]
# Input: teacher velocity (frozen), student flow map u(x, t, s)
# Output: masked mean squared error
def flowmap_loss(teacher, student, x0, x1, cond):
# Draw the time t and a target time s [§ Methods] (Model)
# On 25% of points s = t; otherwise s is drawn uniformly from [t, 1]
# (the second rule is code-only, see Paper vs code)
t = uniform(0, 1, shape=(B, N))
diagonal = uniform(0, 1, shape=(B, N)) < 0.25
s = where(diagonal, t, uniform(t, 1))
# Interpolant point at time t [§ Methods] (Model)
x_t = (1 - t) * x0 + t * x1
# Teacher ODE from x_t to time s with 8 fourth-order Runge-Kutta
# substeps [§ Methods] (Model)
x_s = rk4_integrate(teacher, x_t, t, s, substeps=8)
# Target: average velocity over [t, s]; teacher velocity where s = t
# [§ Methods] (Model)
average = (x_s - x_t) / (s - t)
target = where(diagonal, teacher(x_t, cond, t), average)
return masked_mean((student(x_t, cond, t, s) - target) ** 2)The student is initialised from the velocity network with its new time inputs set to zero, so it starts as a single Euler step § Methods (Model). Only the velocity part is trained; the encoder and query are frozen fast_train.py. Distillation runs for 20,000 steps at learning rate 1e-4, about 27 minutes § Methods (Model).
Sampling
# Draw one ensemble member over a set of points [§ Methods] (Model)
# [code: scripts/fast_eval.py#L154-L176]
# Input: condition cond (N, 66), points, steps (1 or 2 for the flow map)
# Output: physical TG, TX, TN per point
def sample_member(cond, points, steps):
# Start from one noise field, fixed seed per member [§ Methods] (Model)
x = noise_field(points) # (N, 3)
# Euler steps of size 1 / steps, or flow-map jumps of the same size
# [§ Methods] (Model)
for k in range(steps):
t = k / steps
if flow_map:
x = x + student(x, cond, t, t + 1 / steps) / steps
else:
x = x + velocity(x, cond, t) / steps
# Undo the standardisation with the local climatology [§ Methods] (Data)
return x * sigma(points, day) + mu(points, day)Results use the flow map with two steps and 16 members unless stated otherwise § Methods (Model).
Exact likelihood
# Exact log-likelihood of one observation [§ Methods] (Model)
# [code: scripts/fast_logscore.py#L41-L69]
# Input: observation y (N, 3) in standardised units, condition cond
# Output: log density in physical units, per point
def log_likelihood(y, cond, steps=20):
# Integrate the ODE backwards from the observation to t = 0 [§ Methods]
# (Model), with 20 fourth-order Runge-Kutta steps
x = y
divergence_integral = 0
for k in range(steps):
# The divergence is the trace of the 3x3 Jacobian, computed exactly
# with one backward pass per output channel [§ Methods] (Model)
x, divergence = rk4_step_backwards(velocity, x, cond, k)
divergence_integral += divergence
# Change-of-variables formula with the standard normal base density
# [§ Methods] (Model)
log_p = log_normal(x, 0, I_3) - divergence_integral
# Convert to degrees Celsius by subtracting the sum of log sigma
# [§ Methods] (Model)
return log_p - sum(log(sigma))Noise prior
# Gaussian random field from random Fourier features [§ Methods] (Model)
# [code: scripts/fast_data.py#L82-L101, #L209-L233]
# Input: points (N, 2) as (lat, lon * cos 64.5 deg), output channels C = 3
# Output: field z (N, C) with unit marginal variance
def noise_field(points, n_out=3, features=1024, beta=2.4):
# Band limits: k_min = 1/500 and k_max = 1/8 cycles per km
# [§ Methods] (Model)
k_min, k_max = 1 / 500, 1 / 8
# Radial frequency with density proportional to k^(1 - beta) on [k_min,
# k_max]; inverse CDF with e = 2 - beta: k = (k0^e + u (k1^e - k0^e))^(1/e)
u = uniform(0, 1, features)
e = 2 - beta
radii = (k_min**e + u * (k_max**e - k_min**e)) ** (1 / e)
# Uniform direction on the circle [code: scripts/fast_data.py#L100-L101]
angles = uniform(0, 2 * pi, features)
freqs = radii[:, None] * stack([cos(angles), sin(angles)], axis=1)
# Amplitudes and phases are drawn independently per output channel
# [§ Methods] (Model)
amps = normal(0, 1, shape=(features, n_out))
phases = uniform(0, 2 * pi, shape=(features, n_out))
# Sum of cosines with normalisation sqrt(2 / F) [§ Methods] (Model)
phase = 2 * pi * points @ freqs.T # (N, F)
cos_part = cos(phase) @ (amps * cos(phases))
sin_part = sin(phase) @ (amps * sin(phases))
return sqrt(2 / features) * (cos_part - sin_part) # (N, n_out)The squared-exponential comparison prior (RBF) uses a 0.5 degree length scale and 64 features instead § Methods (Model).
Hyperparameters
| Name | Value | Where | Notes |
|---|---|---|---|
| ERA5 inputs | daily mean, max and min 2 m T; total precipitation; 0.25 deg grid, 71 x 113 cells | § Methods (Data) | temperatures standardised by a two-harmonic seasonal fit per cell |
| NGCD target | 1 km grid, 2,020 x 1,550 cells; 1,325,781 land pixels | § Methods (Data) | interpolated from station observations |
| Train / validation / test | 2001-2015 (5,478 days) / 2017 / 2016, 2018, 2019 | § Methods (Data) | checkpoints selected on 2017; normalisation fitted on 1981-2015 |
| Sigma floor | 0.5 degC | § Methods (Data) | climstats.py |
| Static descriptors | 17 per pixel, derived from the NGCD climatology | § Methods (Data) | fast_data.py |
| Encoder | Flower U-net, 4 levels, lifting dim 64, 8 heads, 8 groups, 128 output channels | § Methods (Model) | the FNO alternative (124M, lifting 64; 7.7M, lifting 16) is in § Methods (Baselines) |
| Query MLP | 3 layers; output condition 64-dim | § Methods (Model) | hidden width 128 is code-only: model.py |
| Velocity network | 4 hidden layers, width 256, GELU; 3.2M parameters in total | § Methods (Model) | time embedding width 64 is code-only: model.py |
| Noise prior | power law, beta 2.4, 8-500 km, F = 1,024 features | § Methods (Model) | the spectrum slope comes from 5-100 km of the NGCD residual |
| RBF prior | squared exponential, 0.5 deg, 64 features | § Methods (Model) | comparison only |
| Batch | 16 days x 2,560 points (2,048 uniform + 16 clusters of 32) | § Methods (Model) | 1,000 warm-up steps in training |
| Optimiser | AdamW, lr 3e-4, cosine decay, clip 1, EMA 0.999, 60,000 steps | § Methods (Model) | weight decay not stated; code uses 0 fast_train.py |
| Checkpoints | every 5,000 steps; best near 40,000 | § Methods (Model) | released temperature model: step 40,000 README.md |
| Flow map | 8 RK4 teacher substeps; 25% of points with s = t; 20,000 steps; lr 1e-4 | § Methods (Model) | warm-up 500 steps is code-only w5_flowmap.json |
| Likelihood integration | 20 RK4 steps | § Methods (Model) | 10, 20 and 40 steps agree to 0.001 nats |
| Default sampler | flow map, 2 steps, 16 members | § Methods (Model) | Euler steps and member counts vary by table |
| CorrDiff-style baseline | UNet 24.8M; EDM residual diffusion; Heun sampler, 18 steps (35 evaluations) | § Methods (Baselines) | 60,000 + 150,000 training steps, § SI (S3) |
| Precipitation | dry day at or below 0.1 mm; global quantile table with generalised Pareto tail above 15.6 mm | § Methods (Data) | the code's wet threshold also uses 0.1 mm compute_norm_stats.py |
| Compute | about 1 h training on one MI250X die; 27 min distillation; about 110 GPU-hours for all experiments | § Practice § Methods (Evaluation) |
Results
Author-reported. Setup: NGCD 1 km targets, test year 2019 with all 1.33 million pixels and 16 members for the generative models, and every seventh day (55 days) with 8 members for the diffusion comparison tab. 1.
| Model | Params | CRPS TG | CRPS TX | CRPS TN | Spread/skill TG | TX | TN | Source |
|---|---|---|---|---|---|---|---|---|
| FNO flow | 124M | 1.195 | 0.639 | 0.837 | 0.17 | 0.28 | 0.27 | tab. 1 |
| CD-FFM, 10 Euler steps | 3.2M | 1.034 | 0.530 | 0.699 | 0.51 | 0.61 | 0.59 | tab. 1 |
| CD-FFM, flow map | 3.2M | 1.008 | 0.522 | 0.689 | 0.61 | 0.75 | 0.72 | tab. 1 |
| BCSD-style | n/a | 1.984 | 1.005 | 1.302 | n/a | n/a | n/a | tab. 1 |
| Regression | 3.2M | 1.422 | 0.752 | 0.986 | n/a | n/a | n/a | tab. 1 |
| CD-FFM, zero noise | 3.2M | 1.386 | 0.727 | 0.959 | n/a | n/a | n/a | tab. 1 |
| CorrDiff-style, every 7th day, 8 members | 24.8M | 1.288 | 0.549 | 0.730 | 0.40 | 0.64 | 0.62 | tab. 1 |
| CD-FFM flow map, every 7th day, 8 members | 3.2M | 1.064 | 0.523 | 0.694 | 0.55 | 0.70 | 0.69 | tab. 1 |
Headline claims § Skill:
- CRPS against regression (same network and inputs) falls by 28-31% pooled over 2016, 2018 and 2019 (1,096 days), and by 27-31% in single years § Skill tab. ED1.
- CRPS against the 124M FNO flow falls by 14-17% pooled, and by 12.5-18% in single years § Skill tab. ED1.
- Against the CorrDiff-style model on 55 days of 2019, CRPS falls by 17%, 5% and 5% for TG, TX and TN, with paired intervals that exclude zero § Skill tab. ED1.
- One flow-map step matches twenty Euler steps on CRPS: 1.067, 0.524 and 0.696 degC against 1.077, 0.524 and 0.697 for TG, TX and TN § Practice tab. ED4. Two flow-map steps are 1.3-2.5% better than ten Euler steps on every variable § Practice tab. ED1.
Other results:
- Brier score for hot and cold extremes falls by 24-27% against regression § Extremes tab. ED3.
- Exact log score on the seventh-day subset is 4.71 nats per pixel for CD-FFM, against 5.10 for the regression Gaussian with an oracle covariance and 7.78-9.12 for the FNO flows § Likelihood. The regression comparator is optimistic § Likelihood.
- Precipitation: CRPS 1.174 mm/day, against 1.651 for regression and 2.207 for bilinearly interpolated ERA5 tab. ED7.
- Speed: the first 1 km member over the whole domain costs 0.94 s with encoding included, and each later member about 0.35 s § Overview. The diffusion baseline takes about 19 s per member and day in the same evaluation pipeline § Skill.
- Ablation: removing the static descriptors raises TX and TN CRPS by 2.6% and 4.7% and lowers TG CRPS by 3.4% (the table values; the text rounds the TX and TN figures to 3% and 5%) § SI (S4) tab. ED6. The row without descriptors uses 8 members, not 16 tab. ED6.
Paper vs code
Official code: the paper's code availability statement, which follows § Methods (Evaluation), names https://github.com/Holmes-Alan/CD-FFM under the MIT license. The repository's LICENSE names three of the four authors (Liu, Toropainen and Boy) as copyright holders LICENSE. The GitHub owner name does not match an author, but the paper links the repository and the license names the authors, so it is used. The Zenodo code archive (doi 10.5281/zenodo.23499076) is listed in the README and was not checked here README.md. The commit cloned for this card is 7c8608e1c7811020a8ca7f5921858e721e2e0def.
Differences between the paper and the code:
- Flow-map checkpoint. The paper distils for 20,000 steps § Methods (Model). The released flow map is the best validation checkpoint, step 12,000 README.md, and the paper does not say which checkpoint produced Table 1 tab. 1.
- Learning-rate schedule. The paper says cosine decay § Methods (Model). The code decays to 10% of the base rate, not to zero fast_train.py.
- Flow-map time sampling. The paper does not say how s is drawn. The code draws s uniformly in [t, 1] for 75% of points fast_train.py.
- Regression oracle. The paper says residual covariance § Methods (Model). The code uses an uncentred second moment of the residuals fast_logscore.py and fast_logscore.py.
- Soft mass-conservation loss. The code has a soft cell-mean loss on TG, with weight 0.1 by default fast_train.py. The released configurations set the weight to 0.0 w2e_static_pl24_l8.json. The paper does not mention this loss and reports that hard cell-mean constraints hurt § Practice.
- Shared frequencies. The paper gives per-channel draws of amplitude and phase § Methods (Model). The code also shares the frequencies across the three channels of one field fast_data.py.
- Sampler. The code uses explicit Euler steps that evaluate the velocity at the left endpoint of each step fast_eval.py. The paper does not name the scheme.
- Unstated widths and depth. The query MLP width (128) and the time embedding width (64) are not in the paper model.py model.py. The paper calls the velocity network a four-layer perceptron; the code has four hidden layers of width 256 plus an output layer model.py.
- Constraint default. The evaluation default is no constraint fast_eval.py. The paper's reference results are unconstrained tab. ED4.
No other discrepancies were found in the checked hyperparameters: learning rate, warm-up, clipping, EMA, batch composition, the 17 static descriptors, the RK4 and Euler step counts, and the 8 to 500 km band all match the configurations w2e_static_pl24_l8.json fast_train.py.
Pitfalls
- Two different 10-step CRPS numbers. Table 1 gives 1.034 for 16 members on all days tab. 1. The inference table gives 1.092 for 8 members on every seventh day tab. ED4. Do not compare them as one series tab. 1 tab. ED4.
- Log score uses the continuous ODE. The log score integrates the trained velocity with 20 RK4 steps, not the two-step flow map used for CRPS § Likelihood fast_logscore.py.
- Noise band is a modelling decision. The 8-500 km prior was chosen on spectra and roughness, not on the best log score; the 20-500 km prior has the best log score (4.57 nats) and the best TG CRPS (0.992) tab. ED2. The 8-500 km prior is only close to the observed flat-terrain roughness on average (1.16 times, range 0.97-1.51 over three days) § Noise.
- Stationary prior limits. A single stationary prior does not fit both flat and steep terrain. Its samples are too rough in flat terrain with 2-500 km and too smooth with 20-500 km § Noise § Discussion.
- Under-dispersion and extremes. Spread/skill is 0.61-0.75 for the flow map § Discussion tab. 1. During extremes the observation falls within the central 90% of samples on only 74-91% of days § Extremes.
- Unbounded cold samples. The coldest sampled TN is -59.5 degC, against -39.7 degC in NGCD at the same pixels, and 413 of 7.3 million pixel-days fall below -40 degC § SI (S4). The authors think the coldest samples should not be used until the output is bounded or physically constrained § Discussion.
- Hard constraints. Forcing the ERA5 cell means exactly raises TG CRPS by 60%, and the unconstrained model is closer to NGCD than ERA5 is § Practice tab. ED4.
- Sub-cell variability. The interquartile range of departures from the cell mean is 2.4 times the observed value § SI (S4).
- Mostly one region and one product. Results are for one region and one target product, which is itself interpolated from stations § Discussion. The method also relies on the NGCD climatology for normalisation and static descriptors § Discussion, so it cannot run where no such record exists.
- Diffusion comparison. The CorrDiff-style model is a re-implementation, run tile-wise with overlapping tiles, and evaluated on a subset of days § Discussion § SI (S3). The paper says it had about ten times the training compute § Skill.
- Data and cost. Inputs and targets come from the Copernicus Climate Data Store, and the NGCD download needs a CDS account and a one-time licence acceptance; the raw archive is about 1 TB README.md. Reproducing every experiment needs about 110 GPU-hours § Methods (Evaluation).
- Unstated details to fill in when implementing. The distillation loss (mean squared error is what the code uses) fast_train.py, distillation batch size and warm-up (code: 500 steps), the Flower encoder's internal widths, and the velocity network's time embedding are not stated in the paper. Use the code for these.
- Influence maps are sensitivities. Input gradients show where the model draws information from; the authors say these are not causal effects fig. ED6.
- Precipitation. Precipitation reuses the temperature noise prior. It produces too few events above 20 mm and too much fragmentation, and a coarser noise band can be chosen at sampling time, but tile-wise probability matching leaves seams § Practice fig. ED9.
Lineage
- Builds on: flow matching and stochastic interpolants (Lipman et al.; Liu et al.; Albergo et al.), functional flow matching (Kerrigan et al.), flow maps (Boffi et al.), the Flower encoder, the local implicit image function (Chen et al.), and the Fourier neural operator (Li et al.) § Model.
- Compared against: a regression network with the same inputs, a 124M FNO flow, a BCSD-style statistical baseline and a CorrDiff-style model (Mardani et al., re-implemented) § Methods (Baselines).
- Related: GenFocal (Wan et al.) for climate-projection debiasing and super-resolution § Main. The paper suggests its pointwise design could replace the super-resolution stage of such pipelines § SI (S1).
- Superseded by: not known.
Source and license
Adapted from “Climate downscaling with likelihood functional flow matching” by Zhi-Song Liu, Helmi Toropainen, Ammar Kheder, Michael Boy (arXiv:2610.33482), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. Code citations refer to https://github.com/Holmes-Alan/CD-FFM at commit 7c8608e1c781 (MIT). Any quoted code is shown under that license.