Evolved Code Value Functions for Small-Model Dialogue Search

Dialogue agents that plan ahead, simulating a few turns of the conversation before choosing what to say, beat agents that only pick the best next reply. The catch is that every simulated future has to be scored, and today that scoring is done by asking a language model "how well is this conversation going?" at every node of the search tree. A small open model is bad at that holistic judgment. A frontier model is good at it but makes search expensive. We propose to split the judgment in two. Small models answer narrow, checkable questions about each simulated state: which procedure step are we on, which required fields are filled, has the user's stance shifted. A strong model then writes, once per domain and offline, a short executable program that turns those answers into a score. That program is refined through a simulate-and-reflect loop of the kind Eureka used for robot rewards.

The opportunity is that the expensive reasoning in this setup happens once, when the scoring code is written. It does not happen thousands of times inside the search. If it works, a 7B–8B planner could run lookahead search in procedure-bound and supportive dialogue at a fraction of frontier cost. The study also offers a clean test of where the "base model bottleneck" in agent systems actually sits. Small models may fail at holistic judgment while staying adequate at narrow state reading.

Core Claim

In multi-turn dialogue tree search, most of the gap between small and large backbones comes from node evaluation, not from proposing candidate moves. Most of that evaluation gap can be closed by two steps. The first is to break evaluation into narrow state-extraction questions, each answered by a small model with its own prompt and context. The second is to score the extracted state with a value program that a strong coding model has evolved against simulated dialogue outcomes. Written out, the value of a search node $s$ is

$$V(s) = f\big(\phi_1(s), \dots, \phi_k(s)\big),$$

where each $\phi_i(s)$ is a typed field (a step index, a boolean, a small categorical label) produced by a small extractor model, and $f$ is plain Python generated and mutated by the coding model. At search time $f$ costs nothing, and the extractors are short, single-purpose calls.

This claim does not contradict the evidence that scaffolding cannot create reasoning the backbone lacks. Two results establish that evidence. ReDel builds recursive delegation, where agents hand sub-tasks to new agents, and finds its gain over single agents grows with backbone strength. CaPo coordinates embodied agents through a shared plan and degrades sharply when GPT-4 is swapped for smaller models. Our proposal does not ask the small model to reason better. It moves the hard reasoning offline into code a strong model writes once. The small model is left with only reading tasks, which we expect it can do.

Positioning Against Prior Work

Three lookahead dialogue planners supply the search setting and motivate the gap, because all three score nodes with hand-designed signals. ChatSOP runs Monte Carlo tree search (MCTS) constrained to a standard-operating-procedure graph, the fixed flowchart of steps a service agent must follow. It uses fixed terminal success definitions and costs roughly 8x per turn. MultiESC scores emotional-support strategy sequences with a hand-built A*-style function: past strategy likelihood plus a lookahead estimate of how much the user's distress will fall. SAPIENT applies MCTS to conversational recommendation, choosing between asking about preferences and recommending. We keep their search procedures and replace only the evaluator.

Two works supply the method. Eureka has GPT-4 write reward code from simulator source and mutate it using training statistics. It beat human rewards on 83% of robot tasks, but only for physical control with a numeric fitness check. We port this loop to dialogue. The "simulator source" becomes the extractor schema and the procedure graph, and fitness becomes success in simulated conversations. CollabLLM shows that rolling a user simulator several turns forward gives a usable trajectory-level reward for training. It uses that reward offline to train one model. We use rollouts instead as the fitness signal for evolving an inference-time value program.

Two works constrain the design and form our strongest competition. Self-Taught Lookahead (STL) fine-tunes Llama-3 8B on its own lookahead rationales so it can estimate state values. It reports matching GPT-4o on WebShop, but it was never tested in dialogue with a simulated partner. DebateCV shows that untrained small moderators fall into a "neutrality trap" of defaulting to "Not Enough Evidence." That false-neutral rate fell from 25% to 0.4% after supervised fine-tuning. This is direct evidence that small models are poor holistic judges without targeted training, which is the failure we route around.

Our decomposition is a fixed set of extractors rather than dynamic delegation. This is deliberate. ReDel documents agents that either hoard work until their context overflows or delegate trivial steps endlessly. Inside a search loop that already multiplies calls, we do not want to risk either pathology.

Research Program

The system has four parts. The first is a move proposer, a small model that proposes abstract dialogue acts, following the prompt-based MCTS formulation of Prompt-Based Monte-Carlo Tree Search for Goal-oriented Dialogue Policy Planning. The second is a user simulator that rolls each branch forward a few turns. The third is a bank of $k$ extractors, each a small model prompted to fill one typed field from the simulated transcript. Examples include "current procedure node," "mandatory verification done?", "user goal stated?", "user resistance level," and for emotional support "distress level, 1–5." The fourth is the value program $f$.

The evolution loop works as follows. A frontier coding model receives four inputs: the extractor schema, the domain's procedure graph or strategy taxonomy, a handful of example transcripts, and the current best $f$ with its fitness report. Fitness is task success when the full search runs against a user simulator on development dialogues, together with step compliance where a procedure exists. The reflection text reports where $f$ ranked a failing branch above a succeeding one. Each generation evaluates a batch of candidate programs in parallel, the same budget shape Eureka used.

Reward hacking is the main risk, because a program can learn to exploit a particular simulator. We counter it in two ways. Evolution and final evaluation use simulators from different model families. A held-out human-rated slice checks that gains are real.

The analysis side measures where the small-model gap actually lives. For each backbone size, we separately measure extraction accuracy against gold annotations, holistic-judgment accuracy, and end-task success. This tests directly whether small models read state well but judge it poorly.

Baselines

The naive reference point is the same small backbone generating replies greedily, with chain-of-thought and no search. This shows how much any lookahead buys at that scale.

The main existing system is ChatSOP's procedure-guided MCTS on SOPDAIL, run with its original hand-specified rewards. ChatSOP reports a 27.95% relative improvement in action accuracy over standard GPT-3.5 baselines. For predicting the procedure graph itself, it reports an F1 of 77.00 for fine-tuned Qwen1.5-72B against 71.85 for GPT-4o. The file gives no absolute action-accuracy value, so we will rerun it. On ESConv, the hand-built lookahead reference is MultiESC, which reports 42.01% strategy-prediction accuracy and CIDEr 29.98, a text-overlap score against reference replies.

The strongest competitor on our actual question is an STL-style value model. This is the same 8B backbone, fine-tuned on its own lookahead rationales drawn from dialogue rollouts, and plugged into the identical search. It is the strongest because it attacks the same bottleneck with the same small model and has a strong reported result elsewhere: a 39% success-rate gain for Llama-3 8B on WebShop, matching GPT-4o. We found no reported result on Lacuna for STL on SOPDAIL, ESConv, or any dialogue benchmark.

We also include a frontier-model judge, GPT-4o scoring nodes inside the same search, as an upper reference for quality and cost.

Fairness rules are fixed in advance. Every method uses the same proposer, user simulator, search algorithm, node budget, and development data. STL's fine-tuning data comes from the same number of simulated rollouts that our evolution loop consumes. Each method gets the same budget of tuning runs. We report success at matched token cost, counting the one-off cost of evolution and STL training.

Two ablations isolate the key ingredients. In the first, a single small model fills all fields in one holistic call, testing whether decomposition matters. In the second, we test whether evolution matters by replacing the evolved program with two alternatives: one-shot code with no reflection, and the human reward from ChatSOP or MultiESC.

Beating the field means two things. The method must exceed both the STL value model and hand-crafted rewards on task success at no greater per-turn cost. It must also recover most of the gap between the small-model judge and the GPT-4o judge.

Why not just…?

Why not just fine-tune the small model as a value estimator, as STL does? This is the real threat, and we treat it as the primary comparison rather than a straw man. STL's evidence comes from single-agent settings: web shopping, multi-hop question answering, and arithmetic puzzles. Dialogue values depend on a simulated partner's hidden state, and DebateCV suggests small judges carry systematic biases that fine-tuning must specifically correct. If STL matches our method at equal rollout budget, we will report that code value functions add nothing beyond interpretability. We also test a hybrid that feeds the extracted fields to the STL model, which would show whether the two approaches are complementary.

Why not just use a frontier model as the judge? It works but is expensive. ChatSOP already pays about 8x per turn, and STL reports being 5x cheaper than GPT-4o search. Our cost–success curves will show whether the evolved program reaches frontier-judge quality while calling the frontier model only during evolution.

Why not just hand-write the reward, as ChatSOP and MultiESC do? For a single domain with a clean procedure graph, a hand reward may be nearly as good, and the human-reward ablation tests exactly this. The argument against it is scale. SOPDAIL alone spans 53 tasks across 32 domains, and Eureka's results show hand rewards are usually beaten once trade-offs appear, such as brevity versus completeness or verification versus speed. If hand rewards match evolved ones on SOPDAIL, the contribution shrinks to labor savings, and we will say so.

Why not just train the policy with multi-turn rewards and skip search? CollabLLM-style RL is a strong option and avoids search cost entirely. We include it as a no-search reference trained on the same simulated rollouts. Search keeps one advantage: it can enforce hard procedural steps at inference time. Our step-compliance metric will show whether that advantage survives.

Proposed Experiments

The primary benchmark is SOPDAIL, measured by action accuracy, mandatory-step compliance, simulated goal success, and tokens per turn. It suits the extractor design because its procedures supply natural typed state. The secondary benchmark is ESConv, measured by strategy accuracy, CIDEr against MultiESC's reported values, and simulated distress reduction. Here the state is softer and extraction is harder, so it tests the claim's limits. The multi-domain recommendation sets used by SAPIENT serve as a third, measuring success rate and turns to success. Backbones range from Qwen 7B through 72B, with GPT-4o as reference.

The first decisive check is the backbone-gap curve. Plot task success against backbone size for the frontier judge, the STL value model, the holistic small judge, and our method. The claim holds if our curve is flattest, meaning the 7B system loses the least relative to 72B.

The second decisive check is diagnostic. If small models extract fields with accuracy close to large models while their holistic judgments diverge, the bottleneck sits in judgment and the design is justified. If extraction itself collapses at small scale, the claim is wrong, and the base-model ceiling applies even to narrow reading.

The third decisive check targets reward hacking. If evolved programs gain substantially on the evolution simulator but not on the held-out simulator and the human-rated slice, they are exploiting the simulator, and the method fails on its own terms.