arXiv:2610.20809cs.AIOct 2026

Manuscript Offprint

arXiv:2610.20809

A Self-Improving Agent that Grows its Own DSL: Oracle-Free Operator Induction for Exact Question Answering

Yun-Shiuan Chuang, Yirou Ge, Yixi Li, Yiming Bian, Zijie Pan, Jenna L. Ballard, Uma Kona, Linsey Pang, Prakhar Mehrotra

ABSTRACT

A self-improving agent has to decide which new skills to keep, and in practice it keeps whatever earns a high reward, convinces a judge model, or compresses its library, even when the skill is wrong. That is fine until the answers have to be exactly right: over a table of transactions, a total is either right or wrong. We ask a harder question: can an agent grow what it can compute with no reward, no judge, and no answer key, and still be exactly right? A single frozen model runs two nested loops over a small, exact domain-specific language (DSL). The inner loop answers new questions only when two independently written expressions agree on every record. The outer loop discovers its own missing capability and authors an operator for it, admitted only when an independent second implementation agrees and the result obeys a conservation law, all without ground truth. The inner loop roughly triples the answerable-question set, and the outer loop self-extends on disjoint starting sets, inventing operators outside the starting closure; a no-induction control answers none of the new questions. The admission rule is empirically sound: it rejects 138 of 138 buggy operator variants under an independent reference, even one written by a different model family, where the admit-if-it-runs, self-consistency, and compression signals the field relies on admit most of them. Unmodified, the same mechanism self-extends on two further domains with unrelated schemas, business-ledger and clinical-encounter question answering, growing their answerable sets more than tenfold and nearly twenty-fold. The loop transfers across model families too: run with further proposers, the gate stays sound and independent families self-extend comparably, with only the induction yield tracking each proposer's DSL fluency.

1 INTRODUCTION

Getting a language-model agent to improve itself is easy to want and hard to trust. An agent can fine-tune its weights, rewrite its prompts, or grow a library of skills (Wang et al., 2024a; Cai et al., 2024), and in each case it keeps a new capability because that capability earned a high reward (Romera-Paredes et al., 2024; Novikov et al., 2025), convinced a judge model, or compressed the library (Ellis et al., 2021; Grand et al., 2024; Wang et al., 2024b). With no ground truth, those are about the best signals available. When the answers have to be exactly right, they are not enough. A wrong skill can score well, satisfy a judge, and compress the library as neatly as a correct one. Ask “how much did my top buyer spend?” of a merchant’s transaction history and the total is either right or wrong. We study self-improvement with no teacher: can an agent expand what it can compute using no reward, no judge, and no answer key, while every answer stays exactly checkable by a trusted program?

One dependable route to exact answers is to have the model write a program instead of doing the arithmetic in its head. Program-of-thoughts methods (Chen et al., 2023) take this route. In our setting the program is an expression in a small sandboxed domain-specific language (DSL): a set of operators that compose like code and run under a trusted interpreter. But coverage is the limit.

∗^{*}Equal contribution.

A fixed operator set O\mathcal{O} answers exactly the questions you can build by composing its operators, its closure cl(O)\text{cl}(\mathcal{O}). A per-group total, when the DSL has only whole-table reductions, is simply out of reach, and writing a fresh operator by hand for every question a domain raises does not scale. So the agent has to grow its own DSL, adding the operators its questions demand, without ever admitting one it cannot verify. Think of a language with a fixed vocabulary: you can only say what its words combine to express, so the agent has to coin new words. A coined word is dangerous if no one can check what it means.

Whether this works then depends on the rule for admitting a new operator. A rule built on reward, compression, or a model's judgment does not preserve exactness: a wrong operator can score well, compress beautifully, or convince a judge, and even a judge that happens to be right supplies no checkable guarantee (Appendix M). We hold a harder line: an operator is admitted only on evidence that needs no answer key and no judge. The model writes it twice, independently, and the two implementations must agree on every record. It must also obey conservation laws stated over the operators already trusted, the simplest being that per-group totals add back up to the global total. This rule is oracle-free but empirical, not a formal proof: independent agreement is checked on a finite validation set within a small numerical tolerance, and the conservation laws are the ones the model states, so admission certifies an operator against targeted tests rather than over all possible inputs.

The method is two nested loops (Figure 1, Appendix B), both run by a single frozen model. The inner loop adds no operators. It proposes questions it has not seen, answers each with one expression, and keeps the answer only when a second expression, written from the question alone, agrees on every record and computes something new. The outer loop adds capability. When the model keeps asking for something outside cl(O)\text{cl}(\mathcal{O}), it works out what is missing, writes an operator for it, and puts it through the gate above. If the operator passes, it joins the library and the inner loop runs again on the larger set.

We make six contributions. First, a teacher-free basis for self-improvement: an agent grows what it can compute using only evidence that needs no answer key, two independently written programs that agree on every record and conservation laws over operators it already trusts, replacing the reward, judge, and compression signals that self-evolving agents and library-learning systems (Grand et al., 2024; Wang et al., 2024b) rely on. Second, a two-loop, single-model self-extending DSL agent that instantiates it, with direct evidence the admission rule is sound: it admits none of 138 buggy operator variants under an independent reference, including ones built to slip past the agreement check, and stays sound with the reference in a separate call and from a different model family, Gemma-3-27B (Gemma Team et al., 2025), whereas admit-if-it-runs, self-consistency, and compression each admit most. Third, a gap-seeking use of the frozen model that surfaces and ranks the capabilities its own questions demand but its operators cannot express, so the agent picks what to add. Fourth, a controlled end-to-end study on financial-transaction QA over a fully synthetic corpus (no real customer data; Appendix A): the inner loop roughly triples coverage across 13 starting sets, the outer loop extends three disjoint sets into operators outside the original closure with a no-operator control isolating them, and the grown DSL agrees exactly with an independent human-authored gold extractor on every compute type. Fifth, evidence it is not specific to merchant transactions: with no code changes beyond a schema-adapting parser, the same loop self-extends on two further domains, business-ledger and clinical-encounter QA (Appendices Q, R). Sixth, evidence it is not tied to one model family: run with three further proposers the gate stays sound for all, and two independent families, Mistral-Small-24B (Mistral AI, 2025) and Llama-3.3-70B (Grattafori et al., 2024; Meta AI, 2024), self-extend comparably, with yield tracking each proposer's DSL fluency (§4.4).

References (63)