WhoBuilt

Stop Burning Tokens: Why self-improvement needs domain expertise first

Jul 18, 2026· 18 min· 10K views·Watch on YouTube

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.

Why coding loops are easier to optimize

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.

A prompt optimization experiment

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.

Clear feedback drove the biggest gain

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.

Turn domain quality into useful signals

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.

Build and maintain the evaluation set with experts

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

Related talks