A Self-Improving Agent that Grows its Own DSL: Oracle-Free Operator Induction for Exact Question Answering
Organizations: PayPal AI
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 twentyfold. 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.
Figures & tables
| Configuration | Threat model | Buggy | Adv. | False rej. |
|---|---|---|---|---|
| Compile-only (sandbox) | n/a | 129/138 | 6/6 | 0/14 |
| +differential | uncorrelated | 0/138 | 4/6 | 0/14 |
| +differential | correlated | 129/138 | 6/6 | 0/14 |
| +metamorphic | n/a | 10/138 | 5/6 | 1/14 |
| Full gate | uncorrelated | 0/138 | 4/6 | 1/14 |
| Full gate | correlated | 10/138 | 5/6 | 1/14 |
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
| Round | Known before | Proposed | Executable | Verified | New | Total answerable |
| 1 | 0 | 82 | 40 | 35 | 26 | 36 |
| 2 | 26 | 75 | 48 | 40 | 18 | 54 |
| 3 | 44 | 68 | 43 | 39 | 9 | 63 |
| Starting set | Init. ops | Gap | Admitted | Proposed | Executable | Verified | New | Using induced |
|---|---|---|---|---|---|---|---|---|
| Amounts/timing | 9 | mode | 6 | 387 | 108 | 79 | 65 | 25 |
| Top-buyer | 8 | where | 5 | 590 | 140 | 81 | 62 | 6 |
| Timing | 15 | mode | 2 | 332 | 133 | 95 | 66 | 2 |
| Amounts/timing (round 2) | 15 | mode | 2 | 339 | 119 | 88 | 67 | 3 |
| Control (amounts/timing, no induction) | 9 | n/a | 0 | 277 | 103 | 92 | 69 | 0 |
| Compressed operator | Sites | Questions | Chars saved | Equiv. checks |
|---|---|---|---|---|
| max(per_group_sum(a0, a1)) | 14 | 10 | 84 | 882 |
| ratio(sum(a0), nunique(a1)) | 6 | 6 | 42 | 378 |
| max(gaps_days(a0)) | 4 | 4 | 8 | 252 |
| min(gaps_days(a0)) | 4 | 4 | 8 | 252 |
| mean(gaps_days(a0)) | 4 | 4 | 12 | 252 |
| Operator | Buggy mutants | Diff. kills | Metamorphic kills | Structural kills | False admits |
|---|---|---|---|---|---|
| per_group_reducer | 7 | 7 | 6 | 1 | 0 |
| group_reduce_by_key | 11 | 11 | 10 | 1 | 0 |
| per_group_count | 5 | 5 | 5 | 0 | 0 |
| per_group_size | 9 | 9 | 7 | 0 | 2 |
| per_group_sum | 13 | 13 | 11 | 2 | 0 |
| group_reduce | 13 | 13 | 11 | 1 | 1 |
| Operator | Construction | Uncorrelated | Correlated |
|---|---|---|---|
| per_group_sum | cyclic (relabel) | admitted | admitted |
| per_group_sum | swap (relabel) | admitted | admitted |
| per_group_sum | merge (control) | rejected | admitted |
| group_size | cyclic (relabel) | admitted | admitted |
| group_size | swap (relabel) | admitted | admitted |
| group_size | merge (control) | rejected | rejected |
| Admission rule | Buggy | Adv. | False rej. |
|---|---|---|---|
| Oracle-free gate (uncorrelated) | 0/138 | 4/6 | 1/14 |
| Oracle-free gate (correlated) | 10/138 | 5/6 | 1/14 |
| LLM judge (same model, maj. of 5) | 0/138 | 0/6 | 2/14 |
| category | questions | SQL (0-shot) | SQL (3-shot) | DSL acc. | mean SQL len. | mean DSL len. |
|---|---|---|---|---|---|---|
| flat | 129 | 0.87 | 0.88 | 1.00 | 59 | 37 |
| per-group | 25 | 0.75 | 0.71 | 1.00 | 118 | 45 |
| order-dependent | 29 | 0.61 | 0.79 | 1.00 | 258 | 38 |
| overall | 183 | 0.81 | 0.84 | 1.00 | n/a | n/a |
| Outcome | Drafts | Share |
|---|---|---|
| Admitted | 41 | 11% |
| Rejected by substrate (method-free) | 270 | 70% |
| Method call or attribute access | 196 | |
| Other banned syntax | 74 | |
| Rejected by verification | 64 | 17% |
| A metamorphic relation fails | 44 |
| Base model | Starting set | Inner cov. | Gap | Drafts | Admitted | Final |
|---|---|---|---|---|---|---|
| Qwen3-4B (dense) | Amounts/timing | 39 | group_by, mode | 320 | 4 | 39 |
| Top-buyer | 17 | mode | 192 | 0 | 17 | |
| Timing | 36 | latest | 128 | 0 | 36 | |
| Qwen3-8B (dense) | Amounts/timing | 57 | mode | 128 | 0 | 57 |
| Top-buyer | 36 | mode | 64 | 0 | 36 | |
| Timing | 42 | mode | 192 | 0 | 42 |
| Merchant seeds (final) | Transfer (final) | False | Compile | ||||
|---|---|---|---|---|---|---|---|
| Proposer (family) | Amt | Buyer | Timing | BookSQL | EHRSQL | Admits | (median) |
| Qwen3.6-35B-A3B (main) | 336 | 445 | 278 | 162 | 248 | 0 | n/a |
| Mistral-Small-24B | 302 | 258 | 243 | 158 | 147 | 0 | 31% |
| Gemma-3-27B | 70 | 25 | 121 | 37 | 75 | 0 | 13% |
| Llama-3.3-70B | 155 | 143 | 181 | 109 | 106 | 0 | 34% |
| zero-shot | few-shot | |||||
|---|---|---|---|---|---|---|
| model | agg | ratio | order | overall | order | overall |
| Qwen3-4B | 1.000 | 0.667 | 0.500 | 0.800 | 0.750 | 0.800 |
| Qwen3-8B | 0.750 | 0.443 | 0.498 | 0.622 | 0.319 | 0.624 |
| Qwen3-14B | 0.993 | 0.667 | 0.250 | 0.729 | 0.507 | 0.868 |
| Qwen3-32B | 1.000 | 0.996 | 0.448 | 0.852 | 1.000 | 0.933 |
| Qwen3.6-35B-A3B | 1.000 | 0.859 | 0.514 | 0.842 | 0.990 | 0.944 |
| model | Compositional (main) | Compositional (few-shot) | Retrieval (supp.) |
|---|---|---|---|
| Qwen3-4B | 0.635 | 0.852 | 0.809 |
| Qwen3-8B | 0.763 | 0.740 | 0.775 |
| Qwen3-14B | 0.774 | 0.850 | 0.848 |
| Qwen3-32B | 0.821 | 0.887 | 0.808 |
| Qwen3.6-35B-A3B | 0.911 | 0.917 | 0.958 |
| Gemma-3-27B | 0.885 | † 0.768 | 0.859 |
| Quantity (same value on all 63 merchants) | Amounts/timing | Top-buyer | Timing |
|---|---|---|---|
| Median transactions per buyer | count_per_group | per_bsigner_count | mode_counts |
| Busiest hour’s transaction count | count_per_group | group_count | mode_counts |
| Buyers with more than one transaction | count_per_group | group_count | mode_counts |
| Busiest weekday’s transaction count | count_per_group | group_count | mode_count_by |
LLM Agent Self-Improvement
Large language model agent self-improvement studies how agents use experience and feedback to improve their behavior, tools, and workflows.
See all 277 papers