cs.LGNov 25, 2026

Feature Engineered Reinforcement Learning for S-pair Selection in Buchberger's Algorithm

Authors: Uzma Shafiq, Matthew England, Nayyar Zaidi

Organizations: Coventry University, UK · Deakin University, Australia

Abstract

Selecting the order in which to process S-pairs is a crucial decision in Buchberger's algorithm for computing Groebner bases: this choice can change the cost by orders of magnitude. Recent work has shown that reinforcement learning agents viewing exponent vectors of the polynomials outperform classical heuristics on binomial ideals. We extend this line of work to general polynomial ideals by using statistical features. We introduce a 17-dimensional feature vector to describe a polynomial and use PPO to train policies on five distributions of random ideals. We find that using S-polynomial features significantly outperforms S-pair features on all five distributions. The new policies also outperform the retrained RL baseline on all five distributions, reducing algorithmic work by 41--53% relative to the degree heuristic on four distributions where learning helps. The additional cost of the feature engineering means that wall-clock cost remains similar to the baseline, but our new approach benefits from easier transfer to unseen distributions.

Figures & tables

Explore similar work

Jun 22, 2026

Hierarchical Reinforcement Learning for Sparse-Reward Search in Commutative Algebra

Applying machine learning techniques to solving long-standing mathematical conjectures can be particularly challenging due to their extreme reward sparsity. As an illustrative example, we consider Kalai's algebraic Hirsch conjecture and recast the construction of its counterexamples as a sparse-reward reinforcement learning problem on graphs. We propose a constrained options-based HRL framework with an equivariant graph neural network policy, which allows us to learn useful temporal abstractions for this task. We evaluate our approach over a wide range of degrees and demonstrate that it consistently outperforms classical RL algorithms as well as greedy search. By exploiting the hierarchical structure of the problem, we effectively provide a first-of-its-kind application of HRL to a problem in commutative algebra.
Jun 24, 2026

FactorLibrary: From Polynomials to Circuits via Recursive Subgoals

Finding minimal arithmetic circuits for polynomials over finite fields is a combinatorially hard problem central to algebraic complexity theory. We formulate it as a reinforcement learning problem in two directions, bottom-up and top-down. To address the challenge of a fast-growing combinatorial search space, we introduce FactorLibrary, which stores factorizable subexpressions that serve as reusable subgoals across training episodes. We trained a bottom-up agent with Gumbel-PPO-MCTS and two top-down agents with PPO+MCTS and SAC. The PPO+MCTS top-down agent exhibited the most stable performance, finding certified optimal circuits up to complexity 88 with a success rate of 91.8%91.8\%.
Mar 17, 2026

CircuitBuilder: From Polynomials to Circuits via Reinforcement Learning

Motivated by auto-proof generation and Valiant's VP vs. VNP conjecture, we study the problem of discovering efficient arithmetic circuits to compute polynomials, using addition and multiplication gates. We formulate this problem as a single-player game, where an RL agent attempts to build the circuit within a fixed number of operations. We implement an AlphaZero-style training loop and compare two approaches: Proximal Policy Optimization with Monte Carlo Tree Search (PPO+MCTS) and Soft Actor-Critic (SAC). SAC achieves the highest success rates on two-variable targets, while PPO+MCTS scales to three variables and demonstrates steady improvement on harder instances. These results suggest that polynomial circuit synthesis is a compact, verifiable setting for studying self-improving search policies.