MoreFit
2025
Read MoreFit (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2505-12414.txt.
Introduction
Christoph Langenbruch introduced a software tool in 2025 for fitting models to data in particle physics. Fitting by maximum likelihood, without binning the data, is a central task in the field, but it can be slow on large data sets.
The tool, called MoreFit, builds a graph of the needed computations and compiles it just in time for the machine at hand. New automatic tricks squeeze more speed from the graph. It can run on graphics cards from all major makers and on normal processors, using several threads and wide vector steps at once. In benchmarks against other fitting tools, it performed very well, which the author takes as proof of the approach.
Catalog record
| YEAR | 2025 |
|---|---|
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 58 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2505-12414
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
MoreFit Abstract Parameter estimation via unbinned maximum likelihood fits is a central technique in particle physics. This article introduces MoreFit , which aims to provide a more optimised, rapid and efficient fitting solution for unbinned maximum likelihood fits. MoreFit is developed with a focus on parallelism and relies on computation graphs that are compiled just-in-time. Several novel automatic optimisation techniques are employed on the computation graphs that significantly increase performance compared to conventional approaches. MoreFit can make efficient use of a wide range of heterogeneous platforms through its compute backends that rely on open standards. It provides an OpenCL backend for execution on GPUs of all major vendors, and a backend based on LLVM and Clang for single- or multithreaded execution on CPUs, which in addition allows for SIMD vectorisation. MoreFit is benchmarked against several other fitting frameworks and shows very promising performance, illustrating the power of the approach. A More Optimised, Rapid and Efficient Fit Christoph Langenbruch a , a Physikalisches Institut, Heidelberg University, Im Neuenheimer Feld 226, 69120 Heidelberg, Germany E-Mail: [email protected] . Keywords: Parallel computation, Maximum likelihood, Heterogeneous architectures, GPGPU, OpenCL, LLVM, Clang, Just-in-time compilation, Computation graphs, Automatic optimisation, Symbolic differentiation Published in Eur. Phys. J. C 86 (2026) 105 © C. Langenbruch, licence CC-BY-4.0 . 1 Introduction The estimation of parameters and their confidence intervals from data is a central task in the physical sciences. In particle physics, unbinned maximum likelihood fits are an essential tool for parameter inference, as, in the asymptotic limit, the maximum likelihood estimator is normally distributed around the true parameter value and its variance is equal to the minimum variance bound [ 1 ] . Furthermore, unbinned fits do not lose information due to binning. However, the unprecedented amount of data taken in modern particle physics experiments pose computational challenges. It is not unusual for data samples to contain {\cal O}(10^{6}) events from which more than 100 parameters need to be determined. Even the analysis of smaller data samples can be time- and energy-consuming if techniques for coverage correction need to be employed [ 2 , 3 ] . These methods typically rely on large numbers of pseudo-experiments being performed. For each parameter which requires coverage correction, often more than {\cal O}(10^{5}) pseudo-experiments are needed. To address these computational challenges, an obvious strategy is to exploit the “embarrassingly parallel” nature of the likelihood computation: Since the determination of the logarithmic probability density function for each event is independent, the problem can be easily parallelised over each event. Several existing fitting frameworks implement parallel computation for unbinned likelihoods, among them RooFit [ 4 ] , zfit [ 5 ] , GooFit [ 6 , 7 ] , and the TensorFlowAnalysis package [ 8 ] . These software packages typically rely on CUDA [ 9 ] , either directly or indirectly via the TensorFlow library [ 10 ] , to allow execution on NVIDIA GPUs. This article introduces MoreFit , a new fitting framework for unbinned maximum likelihood fits developed with a focus on parallelism and automatic optimisation. MoreFit is based on automatically optimised computation graphs that are compiled just-in-time. The determination of the likelihood can be performed on heterogeneous platforms: The default compute backend uses the open and vendor-independent OpenCL standard which is supported by GPUs of all major vendors [ 11 ] . For computation on CPUs, an additional backend based on LLVM [ 12 ] and Clang [ 13 ] is available, which allows for vectorised single- and multithreaded execution. MoreFit is a C++ only library which aims to be lightweight with minimal dependencies. As such it does not rely on TensorFlow or ROOT [ 14 ] , though compilation with the ROOT libraries is possible to enable ROOT -related functionality. This article is structured as follows: Section 2.1 briefly introduces the problem of parameter estimation using unbinned maximum likelihood fits and Sec. 2.2 details how MoreFit approaches this problem using computation graphs that allow for automatic optimisation. Technical details on the compute backends are given in Sec. 2.3 . Sections 2.4 and 2.5 discuss parameter fits and event generation, as well as the automatic optimisations that are performed by MoreFit to be as efficient as possible in these areas. MoreFit provides all of the discussed optimisations automatically, for both built-in as well as user-supplied PDFs. The resulting performance of MoreFit is studied in Sec. 3.1 , where it is benchmarked against RooFit [ 4 ] and zfit [ 5 ] using two simple examples. Section 4 gives an outlook on future developments of MoreFit and provides a summary. 2 Maximum likelihood fits and the MoreFit strategy 2.1 Maximisation of unbinned likelihood Unbinned maximum likelihood fits are based on the minimisation of the negative logarithmic likelihood, \displaystyle-\ln{\cal L}(\bm{x}_{1},\ldots,\bm{x}_{N}|\bm{\lambda}) \displaystyle=-\sum_{i=1}^{N}\ln{\cal P}(\bm{x}_{i}|\bm{\lambda}), (1) where {\cal P} denotes the probability density function (PDF), evaluated for the N data points \bm{x}_{i=1,\ldots,N} , and the parameter set \bm{\lambda} . Since \ln{\cal P}(\bm{x}_{i}|\bm{\lambda}) is independent for all i , the calculation of the (often computationally expensive) logarithmic PDF can be parallelised over the N events. Minimisation of the negative logarithmic likelihood requires its repeated evaluation at many parameter points. In addition, gradient-based minimisers can often be more efficient than gradient-free methods. Therefore, a fast and accurate determination of both the logarithmic likelihood as well as its partial derivatives is necessary. For the determination of parameter uncertainties, the second derivatives of the logarithmic likelihood are needed in addition. Being able to use analytic derivatives can be very beneficial in this context, as they tend to be more stable than numerical approximations and can be faster. MoreFit provides the analytic derivatives via symbolic differentiation of a computation graph, as detailed below in Sec. 2.2 . In high energy physics, the most popular software used for minimisation of the negative logarithmic likelihood is the Minuit software package [ 15 , 16 ] . Its minimiser Migrad uses by default the Davidon-Fletcher-Powell variable-metric algorithm [ 17 ] or alternatively the Broyden–Fletcher–Goldfarb–Shanno algorithm [ 18 , 19 , 20 , 21 ] . MoreFit uses the Minuit2 standalone minimiser which can be used without compilation with the ROOT libraries [ 14 ] . When the ROOT libraries are available, the legacy TMinuit minimiser can be used alternatively. While in MoreFit the minimisation algorithm is always executed on the host machine, the computationally expensive determination of the logarithmic likelihood can be performed on an accelerator, such as a GPU. This involves data transfer from the host to the accelerator which can incur some overhead. Care should therefore be taken to minimise these transfers as much as possible. The minimisation process repeatedly evaluates the logarithmic likelihood and, if requested, the analytic gradient for the same data sample at different parameter values. This opens up several opportunities for optimisations, as will be discussed in Sec. 2.4 . 2.2 Computation graphs PDFs in MoreFit are implemented using computation graphs, from which compute kernels are written automatically that are compiled just-in-time. Computation graphs store a calculation in a simple tree structure, with nodes consisting of basic operations, functions, variables and constants. Each PDF, either built-in or user-supplied, needs to implement at least the unnormalised probability density and the corresponding analytic normalisation, from which the computation graph