Skip to main content
QUICK REVIEW

[Paper Review] Branches of a Tree: Taking Derivatives of Programs with Discrete and Branching Randomness in High Energy Physics

M. Kagan, L. Heinrich|arXiv (Cornell University)|Aug 31, 2023
Distributed and Parallel Computing SystemsComputer Science5 citations
TL;DR

This paper introduces gradient estimation techniques—specifically score function estimators with baselines and stochastic AD—for differentiating programs with discrete and branching randomness in High Energy Physics (HEP). It presents the first fully differentiable branching program and demonstrates that stochastic AD and score function estimators with baselines enable effective gradient-based detector design optimization, even with small batch sizes.

ABSTRACT

We propose to apply several gradient estimation techniques to enable the differentiation of programs with discrete randomness in High Energy Physics. Such programs are common in High Energy Physics due to the presence of branching processes and clustering-based analysis. Thus differentiating such programs can open the way for gradient based optimization in the context of detector design optimization, simulator tuning, or data analysis and reconstruction optimization. We discuss several possible gradient estimation strategies, including the recent Stochastic AD method, and compare them in simplified detector design experiments. In doing so we develop, to the best of our knowledge, the first fully differentiable branching program.

Motivation & Objective

  • Enable gradient-based optimization in High Energy Physics (HEP) for programs with discrete and branching randomness, such as particle showers and detector simulations.
  • Address the limitation of standard automatic differentiation (AD) in handling parameter-dependent discrete stochasticity in HEP software.
  • Develop and validate a fully differentiable branching program for particle shower simulations, a novel contribution to HEP differentiable programming.
  • Compare gradient estimation techniques—score function, numeric gradients, and stochastic AD—on a simplified detector design optimization task.
  • Demonstrate the feasibility of end-to-end differentiable HEP simulators for applications like detector design, simulator tuning, and reconstruction optimization.

Proposed method

  • Apply score function gradient estimators with control variates (baselines) to estimate gradients in stochastic programs with discrete randomness.
  • Implement and apply Stochastic AD (Arya et al., 2022), a recently developed method for differentiating programs with discrete random variables, to HEP workloads.
  • Design a toy detector simulator with a branching shower model where the detector radius is a tunable parameter, and the loss is defined by the radial shower depth.
  • Use the Adam optimizer with mini-batch gradient estimation (batch size = 2) to perform 500 optimization steps on the detector radius parameter.
  • Compare gradient estimators via repeated optimizations (10 runs per method) and evaluate performance using mean loss and standard deviation over optimization steps.
  • Employ re-use of random variables in the primal and alternative programs to reduce variance in the Stochastic AD estimator, observing a 1.5× or greater reduction in standard deviation when re-use is applied.
(a) Single particle energy loss
(a) Single particle energy loss

Experimental results

Research questions

  • RQ1Can score function gradient estimators with baselines be effectively applied to HEP detector design optimization with discrete randomness?
  • RQ2Can Stochastic AD be successfully applied to branching processes in HEP, such as parton showers, to enable differentiable programming?
  • RQ3How do different gradient estimators (score function, numeric, Stochastic AD) compare in terms of variance and convergence speed in a low-sample-size HEP optimization setting?
  • RQ4What impact does random variable re-use in Stochastic AD have on gradient estimator variance in HEP applications?
  • RQ5Is it feasible to perform gradient-based optimization in HEP using only two simulation runs per gradient step, given high variance in gradient estimators?

Key findings

  • Stochastic AD and score function estimators with baselines exhibit the lowest standard deviation among all gradient estimators tested, enabling stable optimization with only two simulation runs per step.
  • The score function estimator without a baseline and numeric gradients show such high variance that optimization is infeasible in the given low-sample regime.
  • Stochastic AD and score function with baseline estimators achieve similar convergence progress toward the loss minimum, suggesting both are viable for future HEP differentiable programming applications.
  • Reusing random variables in the alternative program of Stochastic AD reduces gradient estimator variance by a factor of 1.5 or more, highlighting the importance of coupling strategy.
  • The study presents the first known differentiable branching program capable of estimating gradients through discrete branching processes in HEP, enabling end-to-end differentiable simulation of particle showers.
  • Both Stochastic AD and score function with baselines are shown to be effective for gradient-based detector design optimization, even with minimal data, suggesting strong potential for broader HEP applications.
(b) Particle shower with splitting
(b) Particle shower with splitting

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.