Search arXivSearch

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

Stochastic Ultralight Dark Matter Fluctuations in Pulsar Timing Arrays

Metric perturbations induced by ultralight dark matter (ULDM) fields have long been identified as a potential target for pulsar timing array (PTA) observations. Previous works have focused on the coherent oscillation of metric perturbations at the characteristic frequency set by the ULDM mass. In this work, we show that ULDM fields source low-frequency stochastic metric fluctuations and that these low-frequency fluctuations can produce distinctive detectable signals in PTA data. Using the NANOGrav 12.5-year data set and synthetic data sets mimicking present and future PTA capabilities, we show that the current and future PTA observations provide the strongest probe of ULDM density within the solar system for masses in the range of $10^{-18}\;{\rm eV}-10^{-16}\;{\rm eV}$.

hep-ph

On the Origin of QCD Collectivity in High-Multiplicity Jets: A Transport Model Study

The CMS Collaboration has observed an enhancement of elliptic azimuthal anisotropy ($v^{\ast}_2$) in high-multiplicity jets. To investigate its microscopic origin, we employ a hybrid transport model that couples jets generated with \textsc{PYTHIA~8} to partonic and hadronic rescattering. The analysis is performed in the jet frame, where the jet momentum defines the longitudinal axis. We characterize the initial-state geometry using the eccentricity vectors of shower partons and quantify the geometric response by correlating them with the final-state flow vectors of hadrons. By systematically varying the partonic and hadronic interactions, we find that the anisotropy enhancement is dominated by hadronic rescattering in the present model and increases with the initial eccentricity. We further classify jets using the Soft Drop variable $z_gθ_g^β$ and show that this momentum-space substructure variable is sensitive to the initial coordinate-space geometry, although the predicted substructure dependence differs from the current CMS measurement. These results support a geometry--response mechanism for collective behavior inside jets and establish jet substructure as a promising experimental handle on the initial geometry. They also motivate models that treat parton branching and transport interactions concurrently.

hep-ph

Comprehensive effective field theory framework for coherent elastic neutrino-nucleus scattering

Coherent elastic neutrino-nucleus scattering (CE$ν$NS) stands out as a pivotal process for precision tests of the Standard Model electroweak sector, investigations of neutrino properties, and searches for new physics. Recent experimental measurements by COHERENT, CONUS+, and ton-scale xenon detectors--including PandaX-4T and XENONnT--underscore the need for a systematic theoretical framework to bridge high-energy physics scenarios with low-energy observational data. In this work, we develop a comprehensive end-to-end effective field theory (EFT) framework for CE$ν$NS, encompassing the complete energy scale hierarchy spanning the ultraviolet regime down to the nuclear sector. We consider the low-energy EFT (LEFT) operators up to dimension 8, incorporating their QCD renormalization group running effects, and employ the systematic spurion method to achieve matching between these operators and the chiral Lagrangian. A full power counting analysis is performed, extending to nuclear response functions, which evaluates contributions from LEFT operators up to dimension 8 while accounting for the nucleon number enhancement effect intrinsic to CE$ν$NS. Moreover, we match the relevant LEFT operators for CE$ν$NS onto operators up to dimension 8 within the Standard Model EFT. By also providing their complete tree-level ultraviolet completions, this procedure establishes a consistent top-down theoretical workflow. Leveraging a broad suite of CE$ν$NS experimental data, this framework enables a combined analysis to extract constraints on the scales of EFT operators and neutrino non-standard interaction parameters.

hep-ph