Rules in Text, Reliability in the Weights: How a Small AI Agent Taught Itself to Rival Frontier Models
A new preprint shows a 12B open model improving itself from its own customer-service logs, with no stronger teacher, and finds that written rules and training do very different jobs.
Most companies that want an AI agent to handle customer service face an awkward choice. The best results come from frontier models served by someone else's API, but that means sending customer conversations outside the business. Small open models can run on private infrastructure and keep that data in-house, yet on realistic benchmarks they trail the frontier by a wide margin. The obvious fix is to let the small model learn from its own deployment, but most published methods for doing that quietly lean on a bigger, smarter model to write the improvements.
A new preprint posted to arXiv this month, Knowledge in the Harness, Reliability in the Weights: Teacher-Free Co-Evolution of an LLM Agent, by Yujia Zhang, Xinqi Ren, Shixiong Zhou and Jia Meng of Brightendata, asks whether a 12-billion-parameter model can improve itself without any stronger teacher at all. Its answer is a qualified yes, and the more interesting part is not the headline score but what the authors found about where different kinds of improvement actually live.
Two ways an agent can get better
The paper starts from a simple observation about why agents fail. When the authors had their base model diagnose its own failed conversations, it concluded that in 56% of cases the guidance it needed was missing, unclear, or sitting in a document the agent never loaded. In the other 44%, the agent had read clear guidance and simply did not follow it.
Those are two different problems, and the paper argues they need two different fixes:
- The harness. This is the text around a fixed model: its instructions, skill documents and rules. Editing the harness can supply knowledge the model lacks.
- The weights. Training the model itself, here with reinforcement learning from outcome rewards. The authors cite earlier work suggesting this kind of training mostly reinforces behaviour the model already produces, which makes it a good tool for consistency rather than new knowledge.
Plenty of recent systems combine both. The paper's comparison table lists several, and most use a frontier model such as Claude Opus, GPT-5.5 or o3 to write the harness edits. The authors also point to evaluations finding that gains from evolved harnesses often fail to carry over to tasks that were not part of the loop. Their goal was to do both layers with one small model, and to check the results on tasks that never entered the loop.
The setup
The testbed is the retail and airline domains of τ²-bench, a benchmark in which a simulated customer, played by another language model, follows a private scenario while the agent reads and writes a database through tools under a written company policy. A conversation scores 1 only if the final database matches the reference state and the agent passed on the required information. Retail has 114 official tasks and airline has 50.
The authors report two numbers throughout. pass^1 is the expected success rate on a single try. pass^4 estimates the chance that four independent attempts at the same task all succeed, which makes it a measure of reliability. For a business, that second number arguably matters more: a support agent that gets a refund right three times out of four is not one you can leave alone.
The agent, the editor that writes rules and the model being trained are all the same model: Gemma 4 12B, run with reasoning enabled. The user simulator is DeepSeek-V4.1-Flash, and, as in the benchmark, GPT-4.1 judges some natural-language checks on retail's official tasks. The authors are explicit that the simulator and judge belong to the environment, while the editor, agent and training signal involve no external model.
Policy as skills, not one giant prompt
One design choice shapes everything else. The benchmark's reference agent places the whole company policy in its system prompt. This paper's agent instead reads the policy as on-demand skills: a script splits the policy word for word into an entry document with general clauses and a routing table, plus one skill per kind of database change (for retail, cancel, modify, return, exchange and user address; for airline, book, modify, cancel and compensation). The agent loads a document by calling a tool.
The authors give three reasons. Context cost scales with use, since a rule only takes up space in conversations that load its skill; by the end, a typical conversation read about 60% of its own domain's text. Edits stay local, so each rule has an owner and can be audited or reverted. And the logs show exactly which documents the agent had read before each action, so the editor can tell a missing rule from one that was never loaded.
The evolving system may only add, rewrite or delete rules in a rules section at the end of each document. The policy text itself, the routing table and the tools are read-only, and the rules section opens by stating that the policy wins any conflict.
Keeping the benchmark out of the loop
To stop the method from simply memorising the test, no official task, customer or reference answer is used for editing rules, training or choosing versions. Instead, a generator builds tasks straight from the policy without any language model, computing reference answers from the database. Per domain it produces a 200-task validation set and three training batches of 300. The paper reports that generated tasks share no customers with the official ones, and that their wording is measurably dissimilar. Official tasks are run only for reporting.
How one round works
Each round has four stages. The current system serves a fresh batch of generated tasks, four times each. The base model then acts as an editor on the failed conversations and proposes new rules. If the new harness passes a validation check, the batch is rerun under it, and reinforcement learning trains a small LoRA adapter on the model's own complete conversations. The trained checkpoints must pass their own validation check before they are adopted.
Making an unreliable editor safe
The authors are candid that a 12B editor is not trustworthy on its own, so the loop hands every judgment it can to programmatic checks and statistics. A script builds an "evidence pack" for each failure, including the difference between the reference and actual database writes and the timing of each skill load, because small models are poor at pulling facts out of long conversations. The editor never sees the simulated customer's scenario.
The editor must classify the root cause before editing. Missing guidance gets a new rule. Guidance in an unloaded document gets a loading rule. Only an unclear or wrong rule may be rewritten or deleted, and a correct rule that was ignored stays in place and gets a more specific companion rule.
Every proposed rule then faces three checks:
- Code checks. Replies must follow a strict schema, quoted evidence must appear word for word in the pack, and rules may not name database keys or amounts that are not in the policy. That last point is aimed at stopping rules that overfit to individual customers.
- Counterexample self-review. The editor reviews each new rule twice, independently, each time trying to imagine a different customer for whom following the rule would break the policy. A rule is blocked only if both reviews find such a case. Over two rounds this blocked 30 edits, and in 21 of them at least one review found the rule forbade something the policy allows.
- Paired retest. The current and candidate harnesses are each rerun six times on the relevant tasks, and the candidate is kept only if it wins by at least four successes. A single rule is also reverted if one task drops sharply and the failed conversations cite that rule. Five rules were reverted this way.
Across two rounds, 180 of 220 merged edits passed the checks, 27 of 60 editing steps were kept, and the final harnesses hold 51 rules: 24 for retail and 27 for airline.
Training on its own conversations
The weight updates use GRPO, a reinforcement learning method that compares a group of attempts at the same task against each other. A group where every attempt gets the same reward teaches nothing, so the authors give more attempts to harder tasks: 16 for tasks that always failed, 8 for mixed ones and 5 for tasks that always succeeded. The whole thing ran on four NVIDIA A100 or A800 GPUs. A round over both domains took about 50,000 conversations and 84 hours, and cost $260 to $360 in GPU time and simulator calls, according to the paper.
The results
After two rounds, the final system's scores on the official tasks were:
- Retail: 85.1 pass^1 and 66.7 pass^4, against 73.2 and 43.9 for the benchmark's reference agent running the same model.
- Airline: 75.5 pass^1 and 60.0 pass^4, against 67.5 and 44.0 for the reference agent.
Measured from the starting point, that is a gain of 12.5 pass^1 points in retail and 19.5 in airline. The authors report that official pass^1 rose at each of the eight accepted updates, even though every update was chosen using the generated validation set alone.
For comparison, they ran three frontier models with the original skills harness: GPT-5.6-sol, Claude Sonnet 5 and GLM-5.2. Before evolution, all three beat the 12B agent in all twelve comparisons with 95% confidence. After two rounds, none of the twelve differences was statistically significant. The frontier models still score a little higher on most measures (GPT-5.6-sol, for example, reached 86.0 and 71.1 in retail and 77.0 and 70.0 in airline), but the small model closed most of the gap. The paper puts frontier API inference at $0.04 to $0.07 per conversation, against under $0.01 for its own loop including simulator and training costs.
There is an important caveat here. The protocol modifies the agent prompt, uses a different user simulator from the public leaderboard and trains on the benchmark's domains, so the authors call it a custom setting and compare only systems run under their own protocol. These numbers should not be read against the public τ²-bench leaderboard.
The real finding: rules rescue, weights stabilise
The most useful part of the paper is a 2×2 ablation that mixes and matches the final rules and the final trained weights. It shows the two layers do genuinely different jobs.
The authors grouped official tasks by how often the starting system solved them. On tasks it never solved, the evolved rules on their own reached 44% success in retail and 27% in airline, while the trained weights on their own reached only 25% and 5%. On tasks it always solved, the picture flipped: the trained weights held 95% in retail and 99% in airline, while the rules alone held 87% and 93%.
In other words, text rules made impossible tasks possible, and training made already-possible tasks dependable. Together, the final system reached 69% and 43% on the never-solved tasks. In airline the effects roughly added up. In retail, each layer alone barely moved pass^4, yet together they added 18.4 points, although the authors' confidence interval for that interaction effect is wide.
Knowledge does not move into the weights
A second result is a useful warning for anyone hoping training will "bake in" business rules. The airline policy's baggage allowance table lives only in the booking skill. The model was trained with the evolved rules in its context, including a copy of the allowance formula. Yet when the trained weights were run with the original skills, they still failed all 28 baggage conversations that skipped the booking skill, exactly like the untrained model.
The authors' explanation is straightforward: with the formula always in context, the reward never required the model to remember it, so it never did. Across airline computations, the trained weights alone barely moved scores on baggage allowance (15.0 to 17.5), adding bags (0 to 0), price calculation (18.8 to 18.8) and fare difference (22.9 to 25.0), while the rules alone lifted those to 42.5, 25.0, 53.1 and 43.8.
Rules also feed training
The layers help each other in a less obvious way too. Because GRPO learns only from tasks with mixed outcomes, a rule that makes a never-solved task occasionally solvable gives training something to work with. In the first airline round, the harness update cut the number of batch tasks that never succeeded from 71 to 42. The paper compares this to giving partial hints on hard problems during training, except here the hints are the model's own rules and remain in place at inference.
The cost of splitting things up, and the repair
Breaking a policy into skills is not free. The airline policy defines the free baggage allowance, the $50 fee per extra bag and the insurance rules in its booking section, but modifications and cancellations need them too. With the verbatim split, the starting system trailed the reference agent by 11.5 pass^1 points in airline, while in retail, whose sections are self-contained, it roughly matched it.
The authors note that this was a harness defect rather than a small-model weakness: on the ten baggage tasks, the 12B agent loaded the booking skill in 30% of conversations and the frontier models in 32% to 58%, and all of them mostly failed when they skipped it.
The loop found the problem itself on its first step. Because the evidence pack recorded which skills were loaded, the editor classified the failure as "not loaded" and wrote a routing rule telling the agent to load both the modify and book skills when baggage changes. It later copied the allowance formula into the modification skill and added the insurance condition to the cancellation skill. Within one round the airline score returned to the reference level. Notably, most of the final airline gain was not this repair: on the 19 airline tasks the split did not affect, the final system ended 14.5 points above the reference agent.
A quiet lesson about measuring agents
One section is worth reading for anyone who evaluates agents, even if they never train one. The authors expected that running two versions with the same random seeds would make comparisons cleaner. It did not. Even with the simulated customer at temperature 0 and a fixed greeting, the simulator's first message differed in 59% of same-seed pairs, and outcomes on the same task were essentially uncorrelated between runs.
They also found regression to the mean in practice. Tasks picked because they had failed succeeded more often when simply rerun, and tasks picked because they had always succeeded fell from 100% to 92.9%. A retest against the original collection results would have reversed 22 of the 60 keep-or-revert decisions. Their response was more trials and decision thresholds calibrated to the measured noise. The payoff was that gains on the generated validation set tracked gains on the official tasks closely, with a correlation of 0.98 and differences of at most 2.1 points.
Limits the authors acknowledge
The paper is careful about scope. It studies one base model on two domains of one benchmark over two rounds. With 114 and 50 official tasks, most single updates are not individually significant, so the conclusions rest on cumulative gains. All systems used a DeepSeek user simulator, so absolute scores are not comparable to the public leaderboard. The authors also say that evolving each layer alone from the start, removing individual safeguards one at a time, and testing an editor larger than the agent would sharpen the picture. This is a preprint and its results have not yet been independently reproduced, although the authors say they are releasing the code, the task generator with its 2,200 verified tasks, the evolved skills, the trained adapters and the run records.
What this means for people building agents
Strip away the details and the paper offers a practical division of labour that applies well beyond customer service:
- Put facts and rules in text. Prices, fees, allowances and procedures belong in documents the agent can read and you can edit. In this study, training did not move that knowledge into the model, even when it was present throughout training.
- Use training for consistency. If an agent usually does the right thing but not always, that is where weight training earned its keep here, pushing always-solved tasks to 95% and above.
- Log what the agent read. Recording which documents were loaded before each action let a small model diagnose a structural flaw on its first attempt.
- Do not trust the model to judge its own edits. The method worked because code checks, adversarial self-review and statistical retests did the judging, not the 12B model's opinion.
- Budget for noise. Agent conversations vary far more between runs than many teams assume, so decisions based on one or two reruns can easily be wrong.
The broader point is encouraging for smaller organisations. On this benchmark, a 12B open model running on four GPUs, learning only from its own logs, got within reach of frontier models while keeping every conversation in-house. Whether that holds on messier real-world support queues is the next question, and the authors' released code should make it easier for others to find out.
This article is based on the arXiv preprint linked below. All figures are as reported by its authors.