arXiv(opens in a new tab)cs.AIOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.19148

Compiling Expert Procedures into Verified Programs: When a Small Model Is Enough

Vishvesh Bhat, Asad Aali, Muhammad Ahmed Mohsin

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

In procedural tool-use domains, how much of the gap between base models is procedure rather than capability? We build an explicit program from a teacher's traces and run it in front of unchanged small models, including an 8B model. The construction, PLVR (Program Learning with Verifiable Rewards), takes the reasoning traces of a teacher, Kimi-K3, clusters their segments to locate recurring operations, has a frontier model author one typed primitive per operation, each run by a small frozen model and checked by a deterministic verifier, and assembles the program by A* search over a rule library mined from the same traces, under a reference-action objective: the distance between the actions the program takes and the actions the teacher took on the training tasks. At inference the program takes one of two forms: for troubleshooting and tool search it produces the chain of thought the student would otherwise generate for itself, and the student acts on it; for multi-turn tool matching the student proposes each action and the program checks, repairs, or retries it before it goes out. On the official τ2\tau^{2}-Bench Retail and Telecom test sets and on LiveMCPBench, with three Nemotron base models and the same program for each, the answer depends on the domain. On Telecom, Granite-4.2-8B as the student goes from 43.0% to 91.2% under the program, and every Nemotron student reaches 93.3–94.4%, against at most 58.2% for fine-tuning on the same traces, prompt optimisation of the student, or two token-matched baselines. With Granite-4.2-8B as the student, the program is within 2 to 3 points of the Nemotron students on Telecom and within 3 on Retail, and 3 to 13 points below them on LiveMCPBench: where the domain is procedural an 8B student is enough, and on tool search the student still matters. On Retail and LiveMCPBench the program is competitive with the best baseline. The spread between base models shrinks from about 7 points to about 2, averaged over the suites, with no weights changed.

1 Introduction

A small model that fails a multi-step tool-use task may lack the capability for the task, or may only lack the procedure: which record to read first, which check to run before which fix, when to stop. The two look alike in an end-to-end score. They differ in what fixes them. Capability is addressed by a bigger or better-trained model; procedure can be written down.

This paper asks how much of the gap between base models in procedural tool-use domains is procedure. We build an explicit program from a teacher's traces and run it in front of unchanged models of different sizes, down to an 8B model. If the gap is mostly procedure, the choice of model under the program should matter little; if it is mostly capability, the program should help the stronger model more and the model should still matter. The answer we find depends on the domain: on troubleshooting and multi-turn tool matching an 8B student under the program is level with larger ones, and on tool search the student still matters.

Trace-guided program construction. PLVR takes the teacher traces that supervised fine-tuning would consume and decompose them instead. Clustering the traces’ segments proposes where recurring operations occur; a frontier model decides what each operation is and writes it as a primitive, a call to a small frozen model scoped to one operation, with a typed input, an output schema, and a deterministic verifier that rejects ill-formed or ungrounded outputs; and the primitives are composed into a program by search. The student’s weights are never updated; the program is the object that is built.

Two forms of the program. A base model asked to reason before acting generates a plan for itself at inference time and then follows it. For troubleshooting and tool search, the program is that plan, constructed once, from the teacher's

A PREPRINT

Figure

Figure 1: Trace-guided program construction. (A) Each kept teacher trace is cut into segments typed as reason, call, message, or question. (B) Segments are clustered within kind; each cluster's behaviours become primitives, each a single call to frozen Granite-4.2-8B with a typed input, an output schema, a deterministic verifier, and a fallback (§3.2). (C) From the same traces, code alone reads off the expert actions, and a program is scored by the distance between the actions it takes and the expert's (§3.3). (D) A* adds rules from a library mined from the traces, minimising f=∣P∣+100f = |P| + 100 d on the training tasks, and keeps the best program (§3.4).

traces, as a typed composition of primitives, and at inference runs it to produce the chain of thought the student then acts on: the program replaces the student's reasoning. For multi-turn tool matching the program is a guard around the student: the student proposes each action, and the program checks it against the records, the rules, and the user's consent, repairs it, or sends it back to be proposed again. In both forms the student is the same model with the same weights; what changes is whether its reasoning is written for it or its actions are checked for it.

Finding the program. Assembling the program is a discrete search with no gradients. A frontier model first mines a library of rules from the traces, one line each. Starting from a hand-written seed, A* adds rules from that library, scoring each partial program by the distance between the actions a program takes and the actions the teacher took on the same task, read off the trace by code: a reference-action objective. We report the seed's and the final program's accuracy on the test suites so the search's contribution is visible.

Results. Four results, all in Table 2. First, on τ2\tau^{2} Telecom, Granite-4.2-8B as the student goes from 43.0% to 91.2% under the program, and Nemotron 3.5 Lightning, Nemotron 3 Nano, and Nemotron 3 Super reach 94.4%, 93.3%, and 93.3%; no other arm on any student exceeds 58.2%. Second, with Granite-4.2-8B as the student the program is 2.1 to 3.2 points below the Nemotron students on Telecom, within 2.7 points of them on Retail, and 3.2 to 12.6 points below on LiveMCPBench: where the domain is procedural an 8B student is enough, and on tool search the student still matters. On Retail and LiveMCPBench the program is competitive with the best baseline, above it on some students and below it on others. Third, the spread between the three students shrinks from 6.6 points to 1.9 averaged over the suites, with no weights changed; per suite, from 15.8 to 3.5 on Retail, 15.0 to 1.1 on Telecom, and 10.9 to 9.4 on LiveMCPBench. Fourth, the search contributes: on Lightning it takes the hand-written seed from 73.1%, 68.4%, and 37.9% on the three suites to 82.7%, 94.4%, and 50.5% (59.8% to 75.9% averaged).

Scope. The method needs intermediate outputs that admit checking. Tasks whose quality is a matter of judgement rather than satisfaction, such as summarisation and open generation, are outside its scope, and we make no claim about them. Extraction was run on one teacher and three kinds of tool-use task, and we do not claim the primitives transfer to other domains.

A PREPRINT

References (26)