๐ค AI Summary
The discovery of first integrals in dynamical systems has long been hindered by the scarcity of high-quality data and reliance on mathematical intuition. This work proposes FISolver, which introduces a novel inverse generation algorithm to construct a large-scale dataset of differential equationโfirst integral pairs. By integrating supervised fine-tuning with reinforcement learning guided by Levenshtein distance, FISolver optimizes a small mathematical language model. Through reward shaping and synthetic data strategies, it achieves efficient generalization from sparse examples to complex families of problems. Experiments demonstrate that FISolver significantly outperforms both large mathematical language models and commercial solvers such as Mathematica on challenging benchmarks, while substantially reducing computational costs.
๐ Abstract
The discovery of first integrals is of fundamental scientific importance for understanding conservation laws in dynamical systems. However, existing symbolic computation tools and Large Language Models (LLMs) remain limited on this task because high-quality training data are scarce and successful solutions often depend on mathematical intuition. This paper presents FISolver, an LLM-based solver developed to address this challenge. First, we introduce a "Backward Generation" algorithm that systematically builds large-scale datasets of (differential equation, first integral) pairs by deriving differential equations from sampled integrals, thereby alleviating the data scarcity bottleneck. Second, we apply supervised fine-tuning to a compact mathematical model and further improve its performance through reinforcement learning with a Levenshtein Distance-based shaped reward. In addition, we design data synthesis and blending strategies that support effective adaptation to difficult problem families from sparse examples. Experiments show that FISolver, while requiring substantially lower computational cost, significantly outperforms larger mathematical LLMs and commercial solvers such as Mathematica on challenging benchmarks, indicating a new data-driven route for automated discovery of first integrals.