Skip to content
Draft
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1ec93b7
add auto-improvement classification blog draft
annabellscha Jun 11, 2026
ceaa8f0
clarify validation split takeaway
annabellscha Jun 11, 2026
a65b255
link blog references to docs
annabellscha Jun 11, 2026
daebe28
reframe blog around evaluation failure
annabellscha Jun 11, 2026
e4b5997
sharpen core takeaway
annabellscha Jun 11, 2026
335669a
shorten blog intro
annabellscha Jun 11, 2026
3ab266c
frame blog around validation and test data
annabellscha Jun 11, 2026
d1ddf60
strengthen blog structure and conclusion
annabellscha Jun 11, 2026
d2b7ec4
remove tl;dr section
annabellscha Jun 11, 2026
a302723
rename loop section heading
annabellscha Jun 11, 2026
9a02f0d
rewrite intro around main thesis
annabellscha Jun 11, 2026
ef727d8
update blog title
annabellscha Jun 11, 2026
398221b
soften framing around auto improvement
annabellscha Jun 11, 2026
f26a01a
add alternate fable and langfuse blog draft
annabellscha Jun 11, 2026
434c503
reframe intro around loops interest
annabellscha Jun 11, 2026
802ab6c
rewrite intro tone in our own voice
annabellscha Jun 11, 2026
ee198d9
tie intro to broader AI engineering loop post
annabellscha Jun 11, 2026
4ae98e4
rewrite intro around loop design thesis
annabellscha Jun 11, 2026
54d08df
remove loops promo image from intro
annabellscha Jun 11, 2026
0417992
break up intro wall of text
annabellscha Jun 11, 2026
1693f3f
revert intro formatting experiment
annabellscha Jun 11, 2026
e20bb64
tighten intro by folding fable setup into next paragraph
annabellscha Jun 11, 2026
7fe5a46
reorder intro around concrete experiment
annabellscha Jun 11, 2026
4dc5f3f
restructure middle and answer dataset question
annabellscha Jun 11, 2026
acd35e3
remove redundant what we learned section
annabellscha Jun 11, 2026
796ba20
tighten opening around loop design
annabellscha Jun 11, 2026
d561057
mention environment in loop design opener
annabellscha Jun 11, 2026
635950e
update blog title to validation gap framing
annabellscha Jun 11, 2026
99f14ce
clarify intro thesis about benchmark signal
annabellscha Jun 11, 2026
d89a078
refine intro framing around judgment and bridge
annabellscha Jun 11, 2026
66d94e8
tighten intro transition around benchmark signal
annabellscha Jun 11, 2026
6b35cf2
cut blog draft by half
annabellscha Jun 11, 2026
c27fd38
move ai engineering loop tie-in to ending
annabellscha Jun 11, 2026
1cf67f9
add screenshot placeholders and model footnote
annabellscha Jun 11, 2026
b27bbc0
add kaggle dataset link
annabellscha Jun 11, 2026
a2cd862
clarify shared errors were on test
annabellscha Jun 11, 2026
0d5c230
clarify starting prompt was just label list
annabellscha Jun 11, 2026
537c809
make model footnote visually distinct
annabellscha Jun 11, 2026
35d8261
remove alternate auto improvement blog draft
annabellscha Jun 11, 2026
ee55349
retie intro to peter steinberger framing
annabellscha Jun 11, 2026
ea7eddc
add peter steinberger intro screenshot
annabellscha Jun 11, 2026
5e45c8e
reframe intro around steipete and bcherny
annabellscha Jun 11, 2026
5ebee00
revert opener to peter-only framing
annabellscha Jun 11, 2026
f4b9d3e
restore bcherny opener
annabellscha Jun 11, 2026
8adcf41
restore steipete intro and screenshot
annabellscha Jun 11, 2026
61d602a
expand round tables with v1 v3 and reasoning run
annabellscha Jun 12, 2026
f1f53f3
soften model-choice footnote
annabellscha Jun 12, 2026
081e2a0
soften claims in round two analysis
annabellscha Jun 12, 2026
20082e2
clarify fuzzy boundary explanation
annabellscha Jun 12, 2026
c233bfe
clarify fable stopped short of 95 percent
annabellscha Jun 12, 2026
bacd3e3
split fuzzy-boundary point into new paragraph
annabellscha Jun 12, 2026
471ef99
clarify round two result takeaway
annabellscha Jun 12, 2026
5729b20
rewrite auto-improvement blog framing
annabellscha Jun 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
title: "97% on train, 82% on test: auto-improvement loops have a validation gap"
date: 2026/06/10
description: "Claude Fable 5 had just come out, so we used it to run an auto-improvement loop end to end. It improved train accuracy fast. What it really taught us was how much a validation split matters."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the word "matters" has become an AI word for me

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could say "the importance of a good validation split"

tag: engineering
author: Annabell
---

import { BlogHeader } from "@/components/blog/BlogHeader";
import { Frame } from "@/components/Frame";

<BlogHeader
title="97% on train, 82% on test: auto-improvement loops have a validation gap"
description="Claude Fable 5 had just come out, so we used it to run an auto-improvement loop end to end. It improved train accuracy fast. What it really taught us was how much a validation split matters."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would address that steipete is talking about personal coding agents, and Langfuse generally is used for agents that you deploy for users

date="June 10, 2026"
authors={["annabellschafer"]}
/>

Loop-shaped workflows are having a moment. `@steipete` put it plainly: you should not be prompting coding agents anymore, you should be designing loops that prompt your agents.

<Frame>
![Peter Steinberger post about designing loops that prompt your agents](/images/blog/2026-06-10-auto-improvement-classification/peter-steinberger-design-loops.png)
</Frame>

We designed a loop and gave Claude Fable 5 a classification task: a train/test split in [Langfuse Datasets](/docs/evaluation/experiments/datasets), a prompt in [Prompt Management](/docs/prompt-management/get-started), and a goal: hit 95% accuracy or stop at 15 runs. Train accuracy went from 78% to 97% in four runs. Test performance barely moved. The 11 remaining errors on test were shared across every prompt variant.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd not mention too many specifics here, and instead mention this in the "the task and setup" section. This paragraph could become

We designed a loop and gave Claude Fable 5 a classification task. The loop did its job, but it surfaced a dataset problem: while train accuracy improved, test performance barely moved.


The loop did its job. What it surfaced was a dataset problem.

## The task and setup

Our task was to classify arXiv papers into one of 10 categories from title, authors, and abstract, using this [Kaggle dataset](https://www.kaggle.com/datasets/sumitm004/arxiv-scientific-research-papers-dataset). We picked classification because it gives you a crisp target function: exact-match accuracy.

- a train split with 200 labeled examples and a held-out test split with 100 in [**Langfuse Datasets**](/docs/evaluation/experiments/datasets)
- a prompt in [**Prompt Management**](/docs/prompt-management/get-started)
- a small runner built with [**Langfuse Experiments via the SDK**](/docs/evaluation/experiments/experiments-via-sdk)
- `gpt-4o-mini` as the task model<sup id="fnref-model-choice"><a href="#fn-model-choice">1</a></sup>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd explain the improvement loop before this, and explicitly mention that there is a task model, used for the classification task, and an optimizer model, that runs experiments to improve that classification task. If not explained people might be confused because you mentioned using Claude Fable 5 in the intro, and here it mentions gpt-4o-mini

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, the o renders weird, not sure why though?

Image


The starting prompt was minimal, consisting only of a list of labels with instructions to pick one. After each run, the agent reviewed the errors, wrote [comments](/docs/observability/features/comments) on the [Langfuse trace](/docs/observability/data-model#traces), published a new [prompt version](/docs/prompt-management/features/prompt-version-control), and ran again.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have the first prompt version shown, could be in an expandable component if it takes up much space


_Suggested platform screenshot: the Langfuse workbench for this loop, showing the dataset, prompt, and experiment setup together._

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just flagging, I think this is still a todo in the doc

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I like to mark with yellow, makes it impossible to look over :) )


<Frame fullWidth>
![Diagram of the autonomous training loop: start from a base prompt, run the train split, score rows, comment on errors, revise the prompt, and then run the held-out test split once](/images/blog/2026-06-10-auto-improvement-classification/fable-classification-loop-diagram.png)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would make the formatting better here

  • "revise and run again" overlaps with TRAIN LOOP box edge
  • "pass ->" too close to the revise prompt box

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also try to remove the bottom line of text in each box. It feels a bit noisy now

</Frame>

## Round 1: the hill sprint

The first round optimized fast:

| Prompt | Train | Test | Gap |
| --- | ---: | ---: | ---: |
| v1 - flat label list | 78.0% | - | - |
| v2 - general definitions | 90.5% | **84.0%** | 6.5 |
| v3 - sharpened boundary rules | 90.0% | - | - |
| v4 - train-derived precedents | **97.0%** | 82.0% | **15.0** |

Moving from a flat label list to general definitions was real progress. But once the agent started encoding concrete precedents from the training failures, train accuracy jumped while generalization got worse. The prompt that looked best on train was not the one that held up on test.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"was real progress" sounds a bit weird


_Suggested platform screenshot: the Langfuse runs overview comparing prompt versions and scores across the experiment history._

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also flagging this todo


## Round 2: "generalize this time"

So we restarted from the more general prompt and changed the rules: no single-paper precedents, only class-level principles, and no touching the test set.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"no touching the test set": I assume they also couldn't touch the test set before? If so, remove this part.
If they could touch the test set before, this needs to be clarified (and defended)


| Prompt | Train | Test | Gap |
| --- | ---: | ---: | ---: |
| v2 - general definitions, round 1 | 90.5% | **84.0%** | 6.5 |
| v5 - reasoning field, round 2 | 84.0% | - | - |
| v9 - general principles, round 2 | 94.0% | 81.0% | 13.0 |

Only selected prompts were run on the held-out test split.

The disciplined second round did not produce better held-out results. Adding a `reasoning` field also did not help: in our runs, it seemed to encourage the model to rationalize surface cues instead of resolving the label boundary.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I'm a bit lost

  • "disciplined round"?
  • rationalize surface cues instead of resolving label boundary: what does that mean? --> best to give an example, or leave it out


By the end, Fable's own analysis suggested that many of the remaining errors sat on genuinely fuzzy category boundaries, so it stopped before hitting the 95% target. Pushing further likely would have required adding increasingly specific case-by-case rules, rather than finding broader principles that generalized.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genuinely = AI tell


The final prompt version of round 2 hit 81.0% accuracy on test. That is a 13-point gap to the train set, and very much in line with the drop between train and test in round 1. It just took more turns to get to the point of overfitting.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was confused with round 1 / round 2 and the iteration numbers. Can we use something other than numbers for the rounds?


In the end, the best-performing prompt on test was still `v2` from the first round. That iteration simply added broad descriptions to the label-only version, and it generalized best.

_Suggested platform screenshot: one recurring hard example in Langfuse, with the trace and annotation showing why the boundary case stayed unresolved._

## What the dataset would have needed

Based on these runs, the dataset likely needed three things:

**1. A real validation split.** We had train for fitting and test for the final check, but nothing in between. So the loop selected prompt versions on train accuracy alone.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not clear to me, does this mean we needed a third set? What would the function of that set be?


**2. More repeated edge cases.** The hard errors clustered around a few label boundaries, especially Information Retrieval vs. Databases, Human-Computer Interaction vs. Computers and Society, and subject vs. representation for audio papers. A stronger benchmark would have forced new rules to prove themselves across multiple similar cases.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The hard errors clustered around a few label boundaries, especially Information Retrieval vs. Databases, Human-Computer Interaction vs. Computers and Society, and subject vs. representation for audio papers." --> The section feels like a conclusion section to me, I don't expect to read new information here. I'd discuss these specific errors earlier and then reference them here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

benchmark --> dataset (we call it dataset earlier)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"forced new rules to prove themselves across multiple similar cases." --> this sounds contradictory, what exactly does this mean?


**3. Clearer policy for ambiguous papers.** Some of the shared errors look genuinely arguable. If the benchmark wants one exact label, it needs sharper tie-break rules, better canonical examples, and maybe even an `unsure` or multi-label policy.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

genuinely = AI tell

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this point and point 2 are about the same thing, maybe cut one of them?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

benchmark -> dataset


That is the real lesson: the loop did its job. It surfaced, quickly, that the next bottleneck was not another prompt tweak. It was the dataset.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd leave this out


## Where this is actually useful today

None of this means "do not automate the loop." It means: automate the inner loop, own the outer one.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"automate the inner loop, not the outer one": what do you mean by that? In my head the 2 loops are

  1. the auto-improvement loop that Fable runs (outer)
  2. classification loop on the dataset by gpt 40 (inner)
    (but that wouldn't make sense given this post is about auto improvement)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah reading further I see what you mean with each. I wonder if the human-owned part is actually a loop though (the post also didn't describe it as a loop), would actually cut the inner vs outer loop here, I think it would confuse people


- **Agent-owned:** running experiments, scoring, per-error annotation, drafting hypothesis-driven prompt revisions, diffing errors across runs, flagging plateaus
- **Human-owned:** the target function, including the validation and held-out test data nobody optimizes against, dataset composition, when to restart with different constraints, and when to stop

As we argued in [AI is eating the AI engineering loop](/blog/2026-06-09-ai-is-eating-ai-engineering), the mechanics aren't the hard part anymore. This experiment shows what the hard part actually is: the target function, the dataset, and the judgment calls nobody automates against.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading this, I would actually frame this post as an illustration of how lack of human judgement in parts of the AI engineering loop result in suboptimal agents.


This is exactly what Langfuse is good for: [datasets](/docs/evaluation/experiments/datasets), [prompt versioning](/docs/prompt-management/features/prompt-version-control), [experiments](/docs/evaluation/core-concepts#experiments), and [trace comments](/docs/observability/features/comments) give the agent a workbench and an audit trail.

<Callout type="info">
<span id="fn-model-choice"><sup>1</sup> We used <code>gpt-4o-mini</code> because one realistic production strategy for a narrow, repetitive classification task like this is to tune a cheaper model rather than default to a frontier model. A stronger model likely would have performed better out of the box, but that would have tested a different tradeoff.</span>
</Callout>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading