CircuitBuilder: From Polynomials to Circuits via Reinforcement Learning
Organizations: University of Washington
Abstract
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.
Figures & tables
| Depth | C4-main | C4-pretrain |
|---|---|---|
| 0 | 3 | 1 |
| 1 | 12 | 2 |
| 2 | 174 | 9 |
| 3 | 10,862 | 96 |
| 4 | 8,949 | 6,548 |
| Metric | C4-main (multivar) | C4-pretrain (single-var) |
|---|---|---|
| Nodes | 20,000 | 6,656 |
| Edges | 31,746 | 20,966 |
| Roots | 3 | 1 |
| Nodes with multiple optimal circuits | 18,966 (94.83%) | 6,592 (99.04%) |
| Max optimal circuits for one node | 164 | 92 |
| Max total circuits for one node | 1,596 | 15,296 |
| Variables | Task | Iter 50 | Iter 100 | Iter 150 | Iter 200 | Entropy |
|---|---|---|---|---|---|---|
| success (%) | 29.40 | 26.50 | 27.40 | 34.90 | 3.28 | |
| success (%) | 26.00 | 27.30 | 27.60 | 35.80 | 3.21 | |
| avg reward | 2.47 | 2.22 | 2.34 | 3.08 | — | |
| avg reward | 2.19 | 2.30 | 2.31 | 3.20 | — | |
| success (%) | 17.70 | 20.90 | 26.50 | 27.30 | 3.65 | |
| success (%) | 16.40 | 23.50 | 20.90 | 19.90 | 3.72 |
| Variables | Task | Iter 50 | Iter 100 | Iter 150 | Iter 200 | Entropy |
|---|---|---|---|---|---|---|
| success (%) | 48.30 | 55.60 | 53.20 | 57.80 | 1.85 | |
| success (%) | 45.10 | 49.70 | 48.30 | 46.30 | 1.88 | |
| avg reward | 3.41 | 4.14 | 3.90 | 4.37 | — | |
| avg reward | 3.09 | 3.52 | 3.39 | 3.19 | — | |
| success (%) | 5.40 | 5.00 | 6.20 | 10.70 | 2.23 | |
| success (%) | 4.30 | 4.30 | 5.60 | 9.40 | 2.22 |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
Program Synthesis
Program synthesis automatically constructs executable programs from examples, specifications, demonstrations, or natural-language descriptions.
See all 177 papers