Self-Improvement Without Gradients

An LLM system can improve itself through root cause analysis and hypothesis testing. But which changes make the system better, and which only raise its score?
Root cause analysis and expert judgment in a live prior authorization system
Much of the work in bringing an LLM system to production is iteration: diagnosing its errors on labeled cases, and revising its prompts until it's accurate enough for the real world. In prior authorization, where a system decides whether requests for care meet the criteria of a clinical guideline, the standards for deployment are strict.
Over the past few months, we turned this iteration process into a self-improvement loop for a live prior authorization system we built with a client. Our approach is closer to recent auto-research frameworks than to gradient descent. With no meaningful gradients to compute over a closed LLM's prompts, the system diagnoses its own failures through root cause analysis (RCA) and treats each proposed change as a hypothesis it tests against its predicted outcomes. Optimized against a small gold dataset, however, the loop can raise its score while drifting from the guideline's intent. Its own tests do not catch the drift. When building a self-improving system, how can we distinguish changes that improve its decisions in production from changes that merely raise its score?
TL;DR
An LLM system can improve itself through a loop of evaluation, root cause analysis, hypothesis generation, and experimentation. The system's experiments can confirm that a change fixes the identified root cause without causing regressions, but not that the change reflects a sound interpretation of the clinical guideline. The system therefore re-represents its changes in the form that best matches how subject matter experts (SMEs) reason about the guideline, so that their judgment governs every change that reaches production. Over time, SMEs build an improved and aligned system.
Diagnosing failures with root cause analysis
The changes that SMEs evaluate begin with the cases the prior authorization system decided incorrectly. Without a gradient to guide its changes, the iteration system has to determine why each case failed. RCA answers this question in three steps (see Figure 1):
- Diagnose and record. Given an evaluated prompt that does not perform as expected, investigate all failure modes using the guideline, the prompt, and the reasoning trace for each failed case. Locate each failure mode's root cause in the responsible component, noting which cases each root cause accounts for.
- Group and distill. Group similar root causes together. Distill each group into a single refined root cause, aggregating the cases associated with it.
- Prioritize. Rank each refined root cause by how many cases its group accounts for. The count serves as a proxy for the expected impact of resolving each cause, so the iteration system addresses the highest-ranked causes first.
Frontier LLMs are strong at RCA, but they are not infallible. Two points of failure emerged frequently: first, root cause misattribution; second, over-clustering, or grouping together root causes that are actually distinct. One way to counter these failures, in the spirit of self-reflection: add a check that samples three of the cases associated with a refined root cause and validates whether they corroborate the finding.
But adding checks to the loop also increases cost and complexity. As with building increasingly multi-agentic solutions, and compound AI systems before them, a thorough cost-benefit analysis is what keeps the pursuit of accuracy from turning into bloat. We therefore treat system self-improvement as a multivariate optimization against not just accuracy metrics, but also cost and complexity.
Some failed cases pose a different problem: RCA can diagnose them correctly, but the solution requires knowledge that the iteration system doesn't have. Subject matter experts (SMEs) often interpret guidelines in ways that go beyond the text itself, based on their clinical expertise and their company's established approach to evaluating requests. For a guideline that limits a treatment to patients who are hemodynamically unstable, for example, the company's SMEs may have a particular understanding of what this requirement means. Working from the guideline alone, the prior authorization system relies on its own assumptions and may misclassify cases as a result.
Knowledge elicitation brings the SMEs into the loop. During the iteration process, the system actively raises a question for an SME, who can choose between two high-probability interpretations of the hemodynamic instability requirement or, if neither applies, provide a free-form answer. This mechanism allows the system to go beyond the guideline and the training dataset. The system continually learns how the company's experts interpret and apply the guideline, and can achieve better alignment.
Testing each fix as a hypothesis
Once RCA has identified a root cause, the iteration system must determine how to fix it. While the obvious test for any fix is its effect on performance, a higher score alone does not prove that the fix will succeed. For a more reliable signal, the system generates a hypothesis about which changes will correct the identified behavior, along with their expected downstream outcomes. The iteration system then tests the changes against these expected outcomes in two stages:
- Mini-batch. The iteration system evaluates the hypothesis on the failed cases that RCA associated with the root cause, as well as control cases to check for regressions.
- Full test suite. If the mini-batch results confirm the hypothesis, the system evaluates the changes on the full test suite.
If at any point the results do not match the expected outcomes, the system revises the hypothesis and the cycle repeats. The system keeps only the candidate versions that pass both stages and discards the rest.
Some of the discarded versions may have raised the score unexpectedly. The system still rejects them, because it has no direct way to determine whether the gain reflects a real improvement or an artifact of the evaluation set.
The score cannot make this distinction on its own. Precision and recall measure whether the prior authorization system has made the right decisions, but they do not capture other business-relevant qualities, like sound medical reasoning and factual accuracy. Evaluation datasets also rarely match the distribution of production cases. Given these limits, we trade fast gains for high-confidence, principled improvements that are less likely to overfit to the evaluation set.
Balancing exploration and exploitation
Testing every hypothesis this way is expensive. Each iteration cycle burns between hundreds of thousands and millions of tokens, and enterprise contracts with API providers set hard limits on requests per minute (RPM) and token use. These constraints force a tradeoff between exploration and exploitation.
The iteration system is depth-first, favoring exploitation. In each improvement cycle, the iteration system adopts the first candidate version that passes testing and raises the score; the next cycle then starts from there. The iteration system can also promote another candidate's hypothesis into the next cycle if it targets an unresolved root cause.
The greedy approach commits to the first successful fix, so it implicitly assumes that the order in which root causes are fixed does not affect the final score. But this assumption is often false, because one symptom can mask another and RCA may therefore fail to detect it.
Why the loop overfits
Hypothesis testing makes each change more reliable, while greedy search keeps the loop within budget. Neither prevents overfitting. In effect, the loop automates in-context learning, revising the content and structure of the model's context window instead of tuning weights. As with weight-based training, the loop can overfit to the data it learns from.
The risk is especially high in health insurance, where the cost of producing validated gold datasets can limit the number of cases available for optimization. Because a root cause may appear in only one or two cases within a small dataset, the fix can encode a coincidental similarity rather than a sound pattern that generalizes. Figure 3 walks through a synthetic example of overfitting, based on a case we encountered during testing.
In Figure 3's example, RCA diagnosed the original problem correctly. But the fix unmasked a second problem: the prior authorization system began approving every request with a tear, including those it should have rejected. In these cases, another condition better explained the patient's pain. Because these false positives lowered precision, the iteration system added rules telling the prompt to reject any request whose MRI report contained phrases like "suggestive of" or "cannot be excluded." Precision increased to 1.000. But because these phrases are common even when a diagnosis is clear, the rules also rejected most valid requests, bringing recall down to 0.300. Under the greedy approach, the system had committed to the first fix that raised precision and followed it to a dead end.
We observed in our experiments that overfitting was directly correlated with time spent optimizing. While reviewing the system versions from long optimization runs by hand, we found that the early changes were sound, but later changes introduced misalignment once the major gains had leveled off and the system kept pursuing further gains of the same kind.
This pattern most likely stems from a general bias toward action in LLMs, which anticipate issues from the presence of the request alone. When prompted to find the problems with these cases, the LLM performing RCA continues to report problems even after the iteration system has fixed the systematic failures. At this stage, the LLM is likely to identify root causes supported by only a few cases.
We can reduce this bias by prompting more carefully, but the LLM will still occasionally report spurious root causes. Because every version is recorded and auditable, we can inspect each change made by the iteration system and roll back to a state before the prompt began to overfit.
To maintain alignment, the automated self-improvement loop relies on SMEs to decide which candidate improvements should reach production. As the meniscal tear example shows, a change can raise precision on the evaluation set while introducing new errors in how the prior authorization system applies the guideline. To recognize errors like these, SMEs need a way to evaluate each edit against their own interpretation of the guideline.
Re-representing changes for SMEs
Testing shows whether the iteration system's edits raise the score, but SMEs decide whether the edits are clinically sound. Because the iteration system measures only the combined effect of the edits in each revised prompt, SMEs cannot review each edit in isolation. During development, we worked closely with SMEs to identify how to best represent the edits and reduce the burden of review. We call this approach re-representation: transforming data or functionality into the form that best aligns with the mental model of the SME.
We learned that the ideal oversight surface for SMEs is one in which the revised prompt is broken into atomic changes, the smallest units that can be reviewed on their own. Each atomic change is shown with the cases it reclassifies and its impact on precision and recall. With this re-representation, SMEs can ensure that the prior authorization system in production reflects their judgment on every edit instead of a single verdict on the revised prompt. Over time, SMEs can build an improved and aligned system.
In Figure 3's example, the accepted prompt reached a precision of 1.000 while rejecting most valid requests. Figure 4 re-represents an excerpt of the prompt for SME review, showing each edit separately with one of the cases it reclassifies.
During the improvement process, however, edits often build on one another. Given the token constraints in the deployed environment we were working in, we could not pre-compute the performance impact of individual atomic changes and all of their possible combinations. Instead, we designed the review to work in three steps:
- The SME accepts some atomic changes and declines others.
- The iteration system evaluates only the accepted changes, together as one combination, on the full test suite.
- The SME reviews the precision and recall scores for this combination and decides whether to promote it to production.
This trade-off saved tokens. But because edits often interact, an SME could accept most of a proposal and still be surprised by the score of their selection.
From automated iteration to aligned improvement
The iteration system now handles much of the work of improving the prior authorization system, from diagnosing failed cases to testing each fix against its predicted outcome. SMEs still decide which changes reach production. Under the deployment's token limits, their review stopped short of the ideal oversight surface in Figure 4.
Beyond what our experiments show, we expect the same loop to work for other LLM systems whose outputs can be scored against expected results. Where those results depend on how experts interpret a policy, the score will capture only part of what they know, as it did in prior authorization.
As a self-improving system takes on more of the iteration, experts must increasingly define what the loop is improving toward. The goal is a system that needs less of its experts' time with every cycle, while ensuring every change still answers to their judgment.
Citation
Distyl AI, "Self-improvement without gradients," Distyl AI Blog, Nov 2026.
@article{distyl2026selfimprovement,
author = {Distyl AI},
title = {Self-improvement without gradients},
journal = {Distyl AI Blog},
year = {2026},
month = {Nov},
}

