Why Transformers Fail and Ensemble Models Succeed in Approximating AMS-02 Proton Spectra
Abstract
The use of Machine learning models in cosmic ray physics is currently a very popular topic across cosmic ray physicists, even widely discussed at international conferences. There is a need to replace or at least supplement traditional physics-based methods with machine learning models, and the topic of approximating cosmic ray spectra is no exception. Traditional physics-based models, like the Force-field approximation, provide a baseline and fast approximation, but suffer from failures at higher rigidities. This paper compares performance between two machine learning architectures: Gradient Boosted Decision Trees (XGBoost) and the Transformer. We demonstrate that XGBoost achieves a state-of-the-art approximation, successfully modeling the spectra with R2 scores consistently exceeding 0.96 for rigidities under 11 GV. In contrast, a custom Transformer-based model fails after 6.5 GV on the same data.
© 2026 Martin Nguyen, Pavol Bobík, Ján Genči, published by Technical University of Košice
This work is licensed under the Creative Commons Attribution 4.0 License.
