Counterexample-Trained Best-Response Code for Games with Exponentially Many Strategies

In many security, routing and team games, each player has astronomically many possible strategies. A patrol schedule, a path through a network, or a coordinated plan for a team of card players is a single "pure strategy," and there can be $10^{23}$ or more of them. The standard way to compute an equilibrium in such games is column generation, also called the double oracle method. You solve the game restricted to a small set of strategies. Then you ask a "best-response oracle" (a subroutine that, given the current prices on targets or resources, finds the single strategy that most improves on the current restricted solution) for a new strategy to add. You repeat until the oracle finds nothing better. The oracle is almost always the bottleneck, and it is hand-built for each game variant. Change the rules, for example by adding fuel limits to patrols or non-linear congestion costs, and someone must write a new combinatorial solver.

We propose to let a language model write and repeatedly rewrite this oracle as ordinary code. The refinement is driven by a signal that is unusually crisp for code refinement: an exact but slow reference oracle that can certify when the fast code missed an improving strategy. Each such miss is a concrete counterexample, consisting of the prices and the missed strategy, and it becomes a permanent regression test for the next round of code edits. The exact oracle is always the final arbiter, so the equilibrium computed is exactly as correct as the classical method. The research question is purely one of speed and adaptability. Can a code-refining agent learn a fast oracle that is tuned to the prices that actually arise inside the solver loop, so that the slow exact call is needed only rarely? And can it do this for new game variants without a human writing a new solver?

Core Claim

Column generation turns an open-ended code-synthesis problem into a well-posed one, for two reasons. First, any candidate strategy can be checked cheaply. Feasibility is a constraint check, and the improvement it offers (its "reduced cost" against the restricted game's dual prices) is a single evaluation. Second, the exact oracle supplies counterexamples on demand. We claim that an iterative code-refinement loop, trained on exactly the distribution of dual prices generated during solving, will produce heuristic oracles that resolve most pricing calls without the exact solver. This should cut wall-clock time to equilibrium substantially relative to exact-oracle column generation and relative to hand-written generic heuristic pricing. We also claim that oracles refined on one instance of a game family will transfer to larger instances of the same family.

This claim is narrower than the corresponding candidate gap in the research file, and deliberately so. The new ingredient is not "an LLM inside a game solver." It is using the exact oracle's counterexamples as the test suite that drives refinement. That suite is non-stationary, because it grows as the restricted game evolves. It also has a sharp correctness criterion that most code-refinement work lacks.

Relation to Prior Work

The closest work on the code side evolves optimization programs with language models. A2DEPT evolves whole algorithm workflows through a program tree with simulated annealing and dependency self-healing. RefineEvo guides heuristic evolution with a planner and a memory of good and bad edits. AFL uses a four-agent team to write self-contained routing solvers. These papers supply our method: program-level edits, experience memory, and judgment/revision roles. They also motivate the proposal, because they show that LLM-refined code can handle constraint-heavy variants that would take months to hand-engineer. All three optimize a fixed objective over static benchmark instances. Our oracle instead faces an objective that changes with every master-problem solve. Its fitness is not the average gap on a benchmark but whether it misses improving columns that the exact oracle would find.

On the game side, ASPEN solves security games by generating patrol schedules with a network-flow subproblem. DAG-Based Column Generation solves adversarial team games with a tree-based oracle whose output is mapped into a compact belief graph. The decision-diagram Frank-Wolfe method compresses path strategies into decision diagrams (compact graphs that encode huge sets of paths) and runs dynamic programming over them. These supply the exact oracles and the benchmarks. In every case the oracle is fixed, hand-written mathematics, and none of them adapts it to the instance distribution.

Counterexample-guided strategy refinement is the conceptual ancestor of our loop. A solver verifies a candidate strategy rule, returns a counterexample when the rule fails, and the counterexample refines the rule. That work synthesizes logical invariants rather than executable code, and it timed out on $N \times N$ Chomp. We keep its counterexample structure but move it to general code, and we never require the synthesized artifact to be provably complete, because the exact oracle covers the gaps.

One negative result constrains the claim. Exponential lower bounds on double oracle shows that some games force exponentially many iterations. A faster oracle reduces the cost per iteration, not the number of iterations, so we make no claim about escaping that bound. XDO and regret-minimizing double oracle attack iteration count instead and are complementary to this work.

Research Program

The system has three components. The first is a master solver, the standard linear program over the current strategy set, which outputs dual prices. The second is a fast oracle, a Python program written by the language model that maps prices to a candidate strategy. The third is an exact oracle: a mixed-integer program, network-flow model or dynamic program, depending on the game.

At each pricing step the fast oracle runs first. If it returns a feasible strategy with positive reduced cost, that strategy is added. If it does not, the exact oracle runs. Either it certifies that no improving strategy exists, in which case we have converged, or it returns one, which is a counterexample. We also call the exact oracle on a small random fraction of steps where the fast oracle succeeded, to detect cases where the fast oracle returned a much weaker column than the best one. Counterexamples are stored as (prices, best strategy, best reduced cost) triples.

Refinement runs asynchronously in the style of AFL. A generator proposes edits given recent counterexamples, profiler output and a memory of past edits in the manner of RefineEvo. An edit is accepted only if, on the stored suite, it does not increase the miss rate and does not slow the oracle beyond a set budget. Otherwise it is rolled back, in the style of checkpoint rollback in Fang et al.. The acceptance test directly targets the partial-migration and over-editing failures documented for A2DEPT and Adversarial Review.

We will study three game families. The first is security scheduling games in the ASPEN style, plus a new fuel-limited variant with no existing hand-written oracle. The second is combinatorial congestion games on the TW Telecom network and synthetic grids, plus a variant with non-linear costs. The third is Kuhn and Leduc adversarial team poker with the DCG belief-graph master problem. In the team-poker setting the fast oracle may also take over the tree-to-graph transformation that DCG reports as its bottleneck in wide games.

Baselines

The naive reference point is column generation with only the exact oracle, as published. For security games this is ASPEN, which reports being up to 6 times faster than ERASER-C and generating fewer than 350 columns at 200 targets ASPEN. For congestion games the reference is the decision-diagram method, which reports about 12 seconds (BSR) and 3.7 seconds (MC) on TW Telecom Frank-Wolfe with decision diagrams. For team poker it is DCG, which reports converging in about 119 seconds on a large Leduc instance where baselines failed to finish in 10 hours DCG. This is the strongest existing method on these exact problems. We will rerun each on our hardware rather than compare against quoted times. Beating it means reaching the same equilibrium tolerance in lower total time across held-out instances. We will report total time both excluding and including language-model time, amortized over the instance family.

The second baseline is hand-written heuristic pricing with exact fallback, the standard trick in branch-and-price. The heuristic is a greedy constructor plus local search, written once per family by us with a fixed engineering budget and run in the same fallback loop. This baseline isolates whether language-model refinement adds anything beyond "use any cheap heuristic first."

The third baseline is offline evolution. We run A2DEPT-style or RefineEvo-style evolution (using the RefineEvo code) on the oracle, with fitness measured on randomly sampled price vectors instead of in-loop counterexamples. It gets the same token budget as our method.

The key ablation removes counterexample feedback. The refinement agent then sees only success and failure counts plus profiler output, and never the missed strategies. If this ablation matches the full system, the core claim fails.

For Colonel Blotto and the dynamic games in the file, there is no reported result found on Lacuna for column-generation runtime, so we do not use them as headline benchmarks.

Why not just…?

Why not just use Gurobi as the oracle and skip the language model? That is our naive baseline. On standard variants with good formulations it may well win, and we will report this honestly. The classical solvers' dominance at scale documented in FrontierCO is a real threat. Our bet rests on two things. First, pricing calls are repeated thousands of times on structurally similar prices, which a tuned heuristic can exploit and a generic solver cannot. Second, for new variants someone still has to write the mixed-integer model. The fuel-limited and non-linear-cost experiments test the second point directly.

Why not just hand-write a greedy pricing heuristic with exact fallback? This is the most serious competitor, because it captures most of the speedup if pricing is easy. If our system does not beat it on miss rate and time to equilibrium in at least the new variants, we will conclude that refinement is unnecessary for pricing. The comparison is built into the baselines with matched engineering effort.

Why not just have the language model write a wrapper around an existing solver? AFL reports runtime error rates of 94.1% for SGE and 82.4% for DRoC, two methods built on external-solver integration, against 0% for self-contained refined code. This suggests wrapper approaches break on integration. We will nonetheless include an LLM-written model-plus-solver oracle on the new variants and measure its crash rate and speed.

Why not just evolve the oracle offline on random prices? Prices that arise in the solver loop are concentrated and correlated with the current restricted game, so random prices may train for the wrong cases. The offline-evolution baseline at equal token budget tests this directly.

Proposed Experiments

The primary metric is wall-clock time to an equilibrium gap below a fixed tolerance, measured by exploitability for poker and by the gap between the master objective and the dual bound for the linear-program games. Secondary metrics are the fraction of pricing calls that fall through to the exact oracle, the number of columns generated, and tokens spent. Correctness is not a metric, because the exact certificate guarantees it. We will nevertheless verify final equilibria against the exact-only runs.

The first decisive check is a scaling curve. We refine the oracle on small instances, freeze it, and run it on larger instances, for example 200-target security games and the largest Leduc instances. The claim survives only if the fall-through fraction stays low as size grows. A rising fall-through rate would mean the code memorized small cases.

The second decisive check is the counterexample ablation. The full system should reach a lower miss rate per token than both the no-counterexample variant and offline evolution.

The third check covers the new variants without hand-written oracles. For fuel-limited patrols and non-linear-cost congestion, we compare against the exact mixed-integer oracle and the LLM-written solver wrapper on both crash rate and time to equilibrium.

A negative outcome is also informative. If the hand-written greedy heuristic matches the refined oracle everywhere, the result would show that pricing in these games is too easy to need program search. Effort would then be better spent on iteration-count methods such as XDO.