CaloDREAM -- Detector Response Emulation via Attentive flow Matching

Luigi Favaro, Ayodele Ore, Sofia Palacios Schweitzer, Tilman Plehn

Abstract

Detector simulations are an exciting application of modern generative networks. Their sparse high-dimensional data combined with the required precision poses a serious challenge. We show how combining Conditional Flow Matching with transformer elements allows us to simulate the detector phase space reliably. Namely, we use an autoregressive transformer to simulate the energy of each layer, and a vision transformer for the high-dimensional voxel distributions. We show how dimension reduction via latent diffusion allows us to train more efficiently and how diffusion networks can be evaluated faster with bespoke solvers. We showcase our framework, CaloDREAM, on datasets 2 and 3 of the CaloChallenge.

Introduction

In high-energy physics, simulating particle interactions with detectors like those at the Large Hadron Collider is a critical but computationally expensive task. The gold standard, GEANT4, relies on first-principles physics but is notoriously slow. Generative machine learning models offer a potential speedup, yet calorimeter data presents a "perfect storm" of difficulty: extreme dimensionality (tens of thousands of voxels), high sparsity, and the need for percent-level precision.

CaloDREAM (Detector Response Emulation via Attentive flow Matching) addresses these challenges by combining Conditional Flow Matching (CFM) with Transformer-based architectures to produce high-fidelity simulations with significant speed improvements.

Methodology

CaloDREAM factorizes the simulation problem into two distinct components: energy deposition across layers and the spatial distribution of that energy within voxels.

Conditional Flow Matching (CFM)

Instead of standard diffusion, CaloDREAM uses CFM. It learns a vector field that maps a simple Gaussian distribution to the complex data distribution along straight-line trajectories. This approach leads to more stable training and efficient sampling.

Factorized Architecture

The model employs two specialized networks:

  1. Energy Network ("Transfusion"): An autoregressive transformer that predicts the total energy deposited in each detector layer. This provides a strong conditioning signal for the subsequent spatial distribution.
  2. Shape Network (ViT): A 3D Vision Transformer that determines the spatial distribution (voxels) within the layers, conditioned on the predicted energies. By operating on "patches" of voxels, the ViT can efficiently handle the extreme sparsity of detector data.
The Transfusion architecture for the Energy Network, utilizing a Transformer-Encoder/Decoder and CFM.

Latent Diffusion (laViT)

To handle high-resolution datasets (up to 40,000 dimensions), CaloDREAM utilizes a Variational Autoencoder (VAE) to compress the voxel space into a lower-dimensional latent space. The CFM model then operates within this latent space, improving computational efficiency.

The training and sampling workflow for the Latent Diffusion (laViT) model.

Bespoke Non-Stationary (BNS) Solvers

To accelerate sampling, the authors developed specialized ODE solvers. Instead of generic solvers like Runge-Kutta, BNS solvers are trained to learn the specific trajectories of the model, enabling high-quality generation in just 4 to 8 function evaluations, compared to the 50-100 steps typically required.

Datasets and Results

The framework was evaluated on the CaloChallenge 2022 datasets: Dataset 2 (DS2, ~6,500 voxels) and Dataset 3 (DS3, ~40,500 voxels). Both datasets consist of 200,000 electron showers simulated with GEANT4.

  • High Fidelity: On DS2, the model achieved a classifier AUC score of ~0.53, indicating that generated showers are nearly indistinguishable from GEANT4 ground truth.
  • Scalability: The laViT approach successfully modeled the 40k-dimensional DS3, maintaining precision across physical observables like shower depth and width.
  • Speed: The BNS solver achieved massive speedups, and hardware performance on an NVIDIA H100 GPU ranged from 17ms (DS2) to 84ms (DS3) per forward pass.

Conclusion

CaloDREAM demonstrates that combining Transformers with Conditional Flow Matching and latent space representations can effectively simulate complex, high-dimensional detector data. While challenges remain regarding low-energy noise in latent spaces, the use of factorized architectures and bespoke solvers sets a new benchmark for speed and precision in calorimeter simulation.

Summary updated

Abstract

Detector simulations are an exciting application of modern generative networks. Their sparse high-dimensional data combined with the required precision poses a serious challenge. We show how combining Conditional Flow Matching with transformer elements allows us to simulate the detector phase space reliably. Namely, we use an autoregressive transformer to simulate the energy of each layer, and a vision transformer for the high-dimensional voxel distributions. We show how dimension reduction via latent diffusion allows us to train more efficiently and how diffusion networks can be evaluated faster with bespoke solvers. We showcase our framework, CaloDREAM, on datasets 2 and 3 of the CaloChallenge.
BibTeX
@inproceedings{favaro2025calodream,
  author = {Luigi Favaro and Ayodele Ore and Sofia Palacios Schweitzer and Tilman Plehn},
  title = {{CaloDREAM -- Detector Response Emulation via Attentive flow Matching}},
  booktitle = {SciPost},
  year = {2025},
  doi = {10.21468/scipostphys.18.3.088},
}
Figure