arXiv ScienceSearch

arXiv · 2609.23367

LLM-Based FORM Code Generation with Verification-Driven Fine-Tuning

Abstract

FORM is a domain-specific symbolic manipulation language widely used in particle physics for processing the very large algebraic expressions arising from multi-loop Feynman diagram calculations. Despite its central role in precision theoretical physics, no artificial-intelligence tooling exists, to our knowledge, for assisting physicists in writing FORM code. We show that contemporary large language models (LLMs), including frontier models with hundreds of billions of parameters, achieve a zero-percent execution pass rate on our instruction-following and tutorial-style FORM tasks without documentation in a single attempt, establishing FORM as a genuine zero-shot language for LLMs at the time of writing. We then present a verification-driven data generation pipeline that uses the FORM binary itself as an execution oracle to produce and validate a corpus of 4,633 training examples spanning deterministic computations, open-ended programs, tutorial code, and knowledge question-answer pairs. Fine-tuning a compact open-weights model (Qwen3-8B) with quantized low-rank adaptation (QLoRA) yields a specialist that, evaluated on four complementary benchmarks (840 tasks, single attempt each), decisively outperforms frontier models with up to 756B parameters in execution rate and in strict, FORM-verified output matching on the larger benchmarks, and remains statistically indistinguishable from them on the smaller, harder ones. General reasoning and coding capabilities are preserved within 2.6 percentage points.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Bakar Chargeishvili. 2026-09-20. LLM-Based FORM Code Generation with Verification-Driven Fine-Tuning. https://arxiv.org/abs/2609.23367

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Exploring the Singlino-dominated Thermal Neutralino Dark Matter in the $Z_3$ invariant NMSSM

We examine the parameter space of the Next to Minimal Supersymmetric Standard Model (NMSSM) with Singlino-dominated neutralino $\widetildeχ_1^0$ as the lightest supersymmetric particle (LSP). Our study focuses on identifying the regions within this parameter space that produce a thermal relic abundance of $\widetildeχ_1^0$ smaller than the observed cold dark matter relic density while remaining consistent with constraints from LEP measurements, low-energy experiments, Higgs measurements, LHC data, and dark matter direct detection experiments. We identify the dominant annihilation modes of the LSP neutralino across varying LSP mass ranges $\sim \mathcal{O}(1)-\mathcal{O}(10^{3})~$GeV. Furthermore, we conduct a benchmark study to assess the production rates of triple-boson final states emerging from direct electroweakino pair production at the LHC. Drawing insights from these findings, we perform a detailed collider analysis to explore the future potential of probing the triple-boson final states involving a light Higgs boson at the high-luminosity LHC (HL-LHC).

hep-ph

A Finite-History Interpretation of the AMS-02 Positron Spectrum

I examine whether the separation between the characteristic energy scales of cosmic-ray electrons and positrons can be understood as a finite-history effect, without introducing a separate dominant source specifically to generate the high-energy positron feature. In this description the positron retains the opposite Dirac phase orientation relative to ordinary matter clocks, while local interactions and positive physical energies remain unchanged. Reduced accumulated overlap with the matter-defined Galactic environment is represented by a single, approximately shape-preserving energy rescaling. An illustrative overlap benchmark moves the broad structure of an empirical electron reference near 10 GeV into the few-hundred-GeV region. A number-conserving spatial-dilution example provides an order-of-magnitude interpretation of the relative amplitude. The comparison uses the published AMS-02 electron spectrum directly, with fixed, rounded horizontal and vertical scales rather than optimized spectral parameters. Known populations, including pulsars, may contribute subleading components in this interpretation. The resulting characteristic-scale displacement and geometrical amplitude interpretation provide a possible physical account of the positron spectral hierarchy.

hep-ph

A Common Antimatter Response in AMS-02 Positrons and Antiprotons

I present a common finite-history picture for the contrasting spectra of cosmic-ray positrons and antiprotons. Particles and antiparticles retain opposite Dirac phase orientations relative to ordinary matter clocks, while local interactions and positive physical energies remain unchanged. The finite-history description assigns their accumulated response a different overlap with the matter-defined Galactic environment. Its leading effect is represented by a single, approximately shape-preserving rescaling. For positrons, an illustrative overlap benchmark moves the broad structure of an empirical electron reference near 10 GeV into the few-hundred-GeV region, without introducing a separate dominant source specifically to generate that feature. A number-conserving spatial-dilution example provides an order-of-magnitude interpretation of the relative amplitude. For antiprotons, ordinary secondary production supplies an approximately power-law reference; a scale-neutral response preserves its index and gives a nearly constant antiproton-to-proton ratio. Direct comparisons with the published AMS-02 spectra illustrate these two outcomes using fixed, rounded scales. The resulting characteristic-scale displacement and spectral-index preservation provide a unified physical organization of two otherwise different antimatter observations.

hep-ph