Coding loops benefit from a clear target: whether the code compiles. In domains such as medicine, compliance, and healthcare, success is harder to define, so teams need to invest in understanding what they want the system to do and how to evaluate it.
Stop Burning Tokens: Why self-improvement needs domain expertise first
Speaker
Annabell Schäfer, growth engineer at Langfuse, explains how domain expertise and high-signal evaluation help teams improve AI applications, speaking on the AI Engineer channel.
Schäfer describes a self-optimization loop for classifying arXiv papers from their titles and abstracts. It used 200 fit examples, 100 validation examples, and 300 test examples, with a simple GPT-5 Nano prompt and Claude Code running the optimization process.
The loop analyzed errors on the fit set, proposed prompt changes, and kept changes only when validation accuracy improved. Accuracy rose from 68% to 83% by the third or fourth iteration, then plateaued; test accuracy reached 80.2%. The first update added decision rules for confusing labels and examples of commonly misclassified papers.
Broad scores such as correctness or helpfulness can be inconsistent and offer little guidance for automatic improvement. Schäfer recommends criteria tied to application needs, such as checking whether an answer is supported by retrieved context, whether brand names are preserved, or which known failure type occurred.
Work with domain experts to review examples, uncover implicit decision rules, identify failure modes, and define what good output means. Review production data with people over time, use representative examples and validation to check generalization, and give the loop stopping rules or an escape hatch so it does not waste tokens.
Takeaways
- Define concrete, high-signal quality checks before asking an agent to optimize an AI application.
- Use fit, validation, and test data to catch overfitting and measure performance on untouched examples.
- Study error clusters and translate expert judgment into rules, examples, or failure categories.
- Review production outputs with domain experts because user needs and failure modes can change.
- Set stopping criteria and an escape hatch so optimization does not run indefinitely.
Mentioned in this talk
Search inside this talk
What was claimed 4
- works atAnnabell Schäfer works at LangfuseProduct Marketing Engineer
“I'm a growth engineer at Langfuse”
YouTube Verified2 sources· Talk, Web· archived
- featureLangfuse: Open-source observability and evaluation platform for AI systems
“the largest open-source observability and evaluation platform for your AI system”
YouTube Unverified1 source· Talk
- uses
“runs through Claude Code, leveraging Claude Sonnet 4.8”
YouTube Unverified1 source· Talk
- metricdata flywheel: Classification accuracy rose by 15 percentage points from baseline; final test accuracy was 80.2%
“a 15-point increase from our baseline”
YouTube Unverified1 source· Talk











