Emulating Stochastic Multi-Zone Blazar Variability with Patch Discriminators

Blazars are galaxies whose black holes fire a jet of plasma almost straight at us. They flare across radio, X-ray and gamma-ray bands in ways the simplest physical model cannot explain. That model is a single uniform blob of electrons, and it predicts that X-rays and gamma rays rise and fall together. Real jets instead show gamma-ray outbursts with no X-ray counterpart, X-ray polarization angles that swing by about 100° within days, and gamma-ray fluctuations several times larger than X-ray ones. The natural explanation is a jet made of many small turbulent cells that brighten and fade somewhat independently, sitting inside a slowly varying larger structure. Physicists can simulate such "multi-zone" jets. What they cannot do is fit them to data, because each run is stochastic and costly, and fitting needs very many runs.

We propose a fast learned emulator of these simulations, trained so that its random draws look like simulator draws rather than like their average. The emulator is a neural network that mimics the simulator's output. Its output is a "dynamic spectrum", an image whose axes are time and photon energy, plus a polarization channel. Training uses two terms, each matched to what the physics says about that part of the output. A plain reconstruction penalty covers only the part the physical parameters fully determine: the average spectrum and the mean flux in each band. A patch-based adversarial critic covers the rest, the flare-scale fluctuations. That critic is a second network that judges small time–energy tiles as real or fake, with tile size set to the light-crossing time of one turbulent cell. The two-sentence version is this. Standard image-translation losses applied to stochastic physics outputs either blur the flares away or hallucinate them. Splitting the loss along the deterministic/stochastic boundary, and sizing the critic's tiles to the physical cell scale, should give an emulator whose samples reproduce orphan flares and polarization swings statistically, at a speed that makes fitting such models to real campaigns feasible.

Core Claim

The standard recipe joins a patch discriminator with an L1 reconstruction loss against a single target sample. That recipe is Image-to-Image Translation with Conditional Adversarial Networks (pix2pix), which pairs a "PatchGAN" critic with L1. It fits badly when the target is one random realization of a stochastic process. The L1 term pulls the output toward the conditional mean, which erases flares. Isola et al. themselves report that under a strong reconstruction term the generator learns to ignore its input noise, so outputs are deterministic. A small reconstruction weight lets the adversarial term invent structure not tied to the physics; Ruffino et al. describe this weighting as a trade-off between realism and fidelity to conditioning values.

Our claim is that most of this tension goes away when the reconstruction loss targets a quantity that really is deterministic given the physical parameters $\theta$. That quantity is the ensemble-mean dynamic spectrum $\bar{S}(\theta)$, estimated by averaging several simulator runs, together with the band-integrated energy budget. The adversarial term then handles only the fluctuations. Concretely, the generator $G(\theta, z)$ maps parameters and noise $z$ to a dynamic spectrum and is trained with

$$\mathcal{L}(G) = \lambda\,\big\| \mathbb{E}_z[G(\theta,z)] - \bar{S}(\theta) \big\|_1 + \mathcal{L}_{\text{adv}}^{\text{patch}}\big(G(\theta,z) - \mathbb{E}_z[G(\theta,z)]\big).$$

The expectation over $z$ is estimated from a small batch of noise draws per $\theta$, and $\mathcal{L}_{\text{adv}}^{\text{patch}}$ is the patch critic's loss applied to the residual tiles. Because the reconstruction term only constrains the mean across draws, it cannot punish variety between draws. Deterministic collapse is then no longer the optimum.

Why this is where the open problem sits

The astrophysics supplies the motivation. Single-zone models fail on the Mrk 421 2017 campaign. There, Unveiling the complex correlation patterns in Mrk 421 reports a threefold rise in Compton dominance with no change in synchrotron flux, a VHE flare near 7 Crab units, and an optical/UV–X-ray anti-correlation above 3σ. They also fail on the December 2023 flare. There, Insights from the first flaring activity of a high synchrotron peaked blazar with X-ray polarization and VHE gamma rays finds X-ray polarization peaking at 26 ± 2%, well above optical (~4.5%) and radio (~2%), with angle swings of about 100°. Extreme HBL behavior of Markarian 501 during 2012 finds VHE fractional variability roughly three times the X-ray value.

All of these are statistical signatures of many independent cells. They are the kind of local, tile-scale structure an L1-trained model averages out. The multi-zone models in these papers are hand-tuned two-zone or spine–sheath fits. Both the spine–sheath picture of Anderhub et al. (2009) and the close/far regions of Multiwavelength study of the gravitationally lensed blazar QSO B0218+357 between 2016 and 2020 produce one deterministic curve per parameter set. None of them does likelihood-level inference over a stochastic many-cell model.

Discrete treatment of inverse Compton scattering adds a constraint. It shows that the stochastic, discrete nature of Compton scattering by very energetic electrons shifts parameter estimates. Stochasticity is therefore part of the physics, not a nuisance to be averaged away.

The machine-learning side supplies the method but has never met this domain. Hybrid adversarial-reconstruction objectives have been used for sharp textures on regular grids. Examples are pix2pix, SEGAN for speech ( SEGAN: Speech Enhancement Generative Adversarial Network), and the double-GAN flame super-resolution of Learning-Based Super-Resolution Imaging of Turbulent Flames in Both Time and 3D Space Using Double GAN Architectures. In every case the reconstruction target was a single ground-truth field. None of them separated deterministic from stochastic content, and none tied receptive-field size to a physical scale. The research file notes that patch size is usually tuned by hand, and that a patch critic cannot enforce long-range structure on its own. Our design answers both points directly. Tile size comes from physics, and long-range structure (energy conservation, the slow extended zone) is carried entirely by the mean-matching reconstruction term.

We deliberately do not propose the most obvious combination at this intersection: a pix2pix-style network that maps an observed spectrum straight to jet parameters, "choosing a mode" among degenerate solutions. The degeneracy between leptonic spine–layer and hadronic models documented in Extreme blazars under the eyes of MAGIC calls for a posterior, not a sharpened point estimate. Standard probabilistic inference supplies that posterior once a fast simulator exists. The emulator is what makes that inference affordable.

Research Program

The first piece is the simulator. We will write a time-dependent stochastic multi-zone synchrotron self-Compton code. Synchrotron self-Compton means electrons radiate in the magnetic field and then scatter their own photons up to gamma-ray energies. The code will contain three components: a slowly evolving extended zone; a shock region populated by $N_c$ turbulent cells, each with a random magnetic field orientation and a random injection history; and optional discrete Compton sampling at the highest electron energies. Macroscopic parameters $\theta$ include the magnetic field, the Doppler factor, the cell size, the cell-renewal rate, electron spectral indices and the minimum electron Lorentz factor. The minimum Lorentz factor matters because the 2023 Mrk 421 modelling required $\gamma'_{\min} \gtrsim 10^4$. Each run outputs a time × energy grid from optical to TeV, with polarization degree and angle in the optical and X-ray bands. We will build a training library of a few thousand $\theta$ values with several stochastic realizations each, and we will measure and report the simulator's wall-clock cost per run.

The second piece is the emulator. The generator is a conditional convolutional network on the time–energy grid, with parameters injected at every layer and noise injected at multiple scales. The patch critic is fully convolutional. Its temporal receptive field is set to $k$ times the observer-frame cell crossing time $R_c/(c\delta)$, with $k \in \{0.5, 1, 2, 4\}$ swept in ablation. The critic sees the residual after the batch mean is subtracted, plus $\theta$.

The third piece is inference. Plugging the emulator into neural posterior estimation, which learns the posterior over $\theta$ directly from simulated pairs, lets us fit real campaigns. We will score each fitted model by posterior predictive checks: does the model make the observed orphan flares and polarization swings typical, or rare?

Baselines

The naive reference point is a deterministic emulator of the same architecture trained only with L1 against individual realizations. It will learn the conditional mean, and it shows what is lost when fluctuations are ignored. A second naive point is "mean plus matched noise": the deterministic emulator's output plus Gaussian noise whose variance per energy bin is fitted to the simulator. This checks whether the adversarial term captures structure beyond variance, such as flare shapes, the lag between energy bands, and the coherence of polarization angle swings.

The strongest existing recipe on this question is pix2pix as specified in Image-to-Image Translation with Conditional Adversarial Networks: a patch critic plus L1 to the raw sample, with its default patch size. It competes most directly because it already contains both of our ingredients. It differs only in the reconstruction target and in how tile size is chosen. A variant with a global scalar critic plus our mean-matched loss isolates the value of patch locality.

The strongest competitor from outside this family is a conditional diffusion model, a generator that learns to turn random noise into samples by gradual denoising. We train it on the same library. Where single-pass speed matters, we distill it following SF-V: Single Forward Video Generation Model, which uses a Pseudo-Huber reconstruction loss plus an adversarial hinge loss to compress a multi-step generator into one forward pass.

All models get the same training library, the same parameter count within 10%, the same GPU-hour budget, and the same hyperparameter-search budget over their own key weights. For our method and pix2pix that is λ; for diffusion it is the noise schedule. Our ablations cover four things: mean-matched versus raw-sample reconstruction; physically sized versus default patch sizes; removing the energy-budget term; and removing noise at intermediate scales.

No reported result was found on Lacuna for any emulator of blazar dynamic spectra, so there is no published number to beat on this task. The closest reported figures come from other domains. Pix2pix fooled human raters 18.9% of the time on maps, and the flame double-GAN reached PSNR 38.1 dB and SSIM 0.994 on jet-flame super-resolution. Neither is comparable here. We will count our method as beating pix2pix if it does two things at once. It must reduce the distance between emulated and simulated distributions of variability statistics on held-out $\theta$. It must also leave the ensemble-mean spectral error no worse than the deterministic emulator's.

Why not just…?

Why not just use a deterministic neural emulator and run inference on summary statistics? For the mean spectrum this is correct, and our reconstruction term effectively is that emulator. Summary statistics such as fractional variability or cross-band correlation, however, are computed from realizations. A mean-only emulator produces a smoothed light curve whose variability is zero by construction, and a per-bin noise model gets the variance right while missing correlations between bands. The mean-plus-matched-noise baseline tests this directly. If it matches our emulator on the statistics we care about, including the VHE-to-X-ray variability ratio, the orphan-flare rate and the angle-swing distribution, we will adopt it and report the adversarial term as unnecessary.

Why not just run the physical simulator inside the inference loop? If the stochastic many-cell code is cheap enough for the tens to hundreds of thousands of calls that neural posterior estimation needs, the emulator adds nothing. We have no measured cost yet. Our first milestone is to time the simulator, and we will abandon the emulator route if direct simulation fits within the inference budget.

Why not just use a conditional diffusion model? This is the real threat. Diffusion models avoid adversarial instability and may match the fluctuation statistics better. We treat diffusion as a first-class baseline, distilled to a single pass for fairness at inference time. If it wins on fidelity at equal speed, the remaining contribution is the mean-matched, physically scaled loss, which can serve as the adversarial and reconstruction terms of a distillation objective like SF-V's. We would then report the result in that form rather than claim an advantage for the GAN.

Why not just use pix2pix off the shelf? Pix2pix is the predicted failure case, not a straw man. Its L1-to-sample term is exactly what drives the mean blur and the noise-ignoring behavior that Isola et al. report. The mean-matched-versus-raw ablation is the test of this prediction.

Proposed Experiments

On held-out simulator parameters, the decisive check is statistical. Each model generates many realizations per $\theta$. Against the simulator, we compare the distributions of the ratio of VHE to X-ray fractional variability, the cross-correlation between X-ray and VHE flux, the fraction of VHE flares with no X-ray counterpart, the Compton-dominance excursion, the power spectrum of each band, and the size of polarization-angle swings. The comparison uses energy-distance scores and calibration of the resulting posteriors on simulated data with known truth. Ensemble-mean spectral error is reported separately, so that improved fluctuations cannot come at the cost of the energy budget.

The patch-size sweep tests whether performance peaks near one cell crossing time. If the peak lands at an arbitrary scale, that undercuts the physical-scale claim and we will say so.

On real data, we fit the Mrk 421 2017 and December 2023 campaigns and the Mrk 501 2012 campaign. We then ask whether the posterior predictive distribution makes the observed features typical. The targets are the threefold Compton-dominance change and 7 Crab unit orphan flare, the 26 ± 2% X-ray polarization peak with ~100° swings, and the VHE variability roughly three times the X-ray value. We run the same fits with a deterministic two-zone model as reference and report whether the stochastic model is preferred.

A negative outcome is informative too. If no region of the many-cell model reproduces these statistics, even with a well-calibrated emulator, the turbulent-cell explanation itself is in trouble.