TL;DR
Finding the exact mathematical equation hidden inside raw data—known as symbolic regression—usually requires either slow evolutionary trial-and-error or left-to-right neural generation that can’t fix early mistakes. EditFlowSR reframes equation discovery as an iterative editing process, sculpting random strings of math symbols into clean, accurate formulas via insertions, deletions, and substitutions. By simultaneously training the model to fit data and simplify bloated algebra, it reaches the top Pareto front across accuracy, equation simplicity, and speed.
What Problem Does This Paper Address?
Imagine watching a pendulum swing, logging its position over time, and asking a computer to hand you back the governing physics equation—not a black-box neural network, and not just fitted curve parameters, but the actual formula. That is symbolic regression (SR).
Historically, SR methods fall into two camps, each with a frustrating catch:
- Search-based methods (like genetic programming) mutate and breed populations of equation trees. They find great formulas eventually, but navigating the massive combinatorial space of math expressions is computationally slow, and structural cleanup happens only indirectly via fitness survival.
- Autoregressive neural models treat math like text, predicting equations one token at a time from left to right. They are fast at inference, but they write in permanent ink. Because every math operator interacts globally with its ancestors and children, a single mischosen symbol early on locks the rest of the expression into a flawed trajectory. Fixing an error requires throwing the draft away and regenerating, or relying on external pruning.
The authors ask: what if a neural network could write math the way humans do—by drafting, revising in place, and simplifying as the expression takes shape?
Methods
EditFlowSR builds on Edit Flows, a recent generative framework based on continuous-time Markov chains (CTMCs) and discrete flow matching. Instead of predicting the next token, the model looks at an entire sequence of math tokens (a pre-order traversal of an expression tree) and predicts transition rates for three sequence-level operations at every position: Insert, Delete, and Substitute.
The architecture pairs a standard Set-Transformer-style Data Encoder (which digests $(x, y)$ data points without caring about their row order) with a non-causal Editing Decoder that attends globally to the current formula and cross-attends to the data.
The secret sauce is dual-trajectory supervision, which trains a single shared editor on two distinct paths simultaneously:
- The Discovery Trajectory: Starts from random math tokens and learns to edit them into the true underlying equation, conditioned on the observed $(x, y)$ data.
- The Repair Trajectory: Starts from an algebraically bloated, redundant version of an equation and edits it down to its concise equivalent—conditioned on nothing (a null condition). This bakes algebraic simplification directly into the generator's weights.
At inference time, EditFlowSR starts with random tokens, simulates the learned editing process over discrete time steps conditioned on your dataset, and finishes by polishing numerical constants with BFGS (a standard numerical optimizer).
Datasets
- Training: Pretrained entirely online using synthetic data following standard protocols—randomly generated expression trees (up to 10 input variables) paired with up to 200 points sampled from Gaussian and uniform mixtures.
- Evaluation: Tested on the standard SRBench suite (no new benchmark datasets are introduced, though custom algebraic probes are constructed for ablations):
- Feynman: 119 physics equations from the Feynman Lectures on Physics.
- Strogatz: 14 nonlinear dynamical systems tasks with known ground-truth formulas.
- Black-box: 89 real-world/tabular regression tasks from PMLB where the true underlying formula is unknown.
Key Insights and Ideas
- Algebraic equivalence matters more than just "being short": In an ablation where the repair trajectory simply mapped long equations to unrelated shorter ones ("Non-equivalent Shortening"), test accuracy actually dropped below having no repair trajectory at all! Teaching equivalence-preserving edits is what stops the model from overfitting noise while keeping formulas compact.
- True structural awareness, not blind pruning: When researchers injected tiny perturbation terms like $+\eta x$ into clean formulas, EditFlowSR assigned high deletion scores when $\eta \approx 0$ (recognizing numerical redundancy), but reliably lowered deletion scores as $\eta$ grew large enough to represent real signal.
- Noise resilience via revision: Autoregressive decoders tend to accumulate errors, while search methods often invent convoluted terms just to fit noisy data points. Iterative global editing keeps expression complexity flat even as target noise ramps up by orders of magnitude.
Key Results
Evaluated against 22 baselines (spanning genetic programming, autoregressive transformers, and LLM-guided search), EditFlowSR sits on the first Pareto front balancing $R^2$ accuracy, equation complexity, and runtime.
- Outperforming generators on Black-box data: Pretrained neural generators notoriously struggle on Black-box datasets (where clean, textbook equations may not exist), often ranking near the bottom in accuracy (e.g., E2E and NeSymReS rank 16th and 18th in $R^2$). EditFlowSR leaps to 3rd place overall in $R^2$ rank, rivaling heavyweight evolutionary search (like Operon) while running significantly faster and outputting much simpler equations.
- Dual-trajectory payoff: On clean Black-box tasks, adding the repair trajectory boosts mean test $R^2$ from
0.683to0.707while simultaneously trimming average expression length from44.9tokens down to38.4. Under heavy noise ($\sigma = 0.1$), it maintains a0.673$R^2$ (+0.029over no-repair) and cuts10.3tokens of bloat. - Pinpointing bloat: On token-level redundancy localization probes, EditFlowSR achieves a Top-1 accuracy of 1.000 and a 0.915 Macro-AUPRC, cleanly distinguishing redundant algebra from structurally identical valid math.
Limitations and Future Work
Because EditFlowSR is pretrained strictly for end-to-end generation from synthetic distributions, using its editing dynamics to guide external test-time optimization or extrapolating far outside its pretraining operator distribution may require task-specific adaptation. For future work, the authors plan to explore broader pretraining distributions alongside explicit search or verification objectives to boost out-of-distribution reliability.
Summary updated