Speaker Notes

Your Old Prompts Are Making Claude Worse - Lance Martin, Anthropic

Frontier models make legacy prompt engineering techniques obsolete, demanding a shift toward strict cache management, automated evaluation-driven optimization, and robust agent architectures.

AI Engineer · 1:04:02 · YouTube ↗

Talk · Solo speaker  Advanced · Concepts and prompt optimization

Highlights

8 clips · 9 min of 64 min
    • Prompts accumulate technical debt just like code over multiple model generations.
    • Frontier models naturally think and verify, making explicit step-by-step instructions redundant.
    • Legacy boosters increase token costs and can degrade modern model performance.
    • Even a single-byte change in your prompt prefix will invalidate the prompt cache.
    • Multi-turn agents must carefully structure context to maintain high cache hit rates.
    • Tracking cache hit rates is critical for managing application economics.
    • Autonomous hill climbing can overfit to specific evaluation tasks and fail in production.
    • Splitting evaluations into train and test sets provides an early signal for overfitting.
    • The hill climber should only reflect on training failures while tracking test performance.
    • Long-duration agents require separating the harness brain from sandboxed execution environments.
    • Using independent append-only session logs allows recovery if the harness or sandbox crashes.
    • Sandboxes and harnesses can be independently booted and managed by an orchestrator.
    • Prompts are easy to modify but highly prone to overfitting during automated hill climbing.
    • Claude can shape prompts to pass specific evals without representing true production behavior.
    • Regularization and proper train/test splits are necessary safeguards when optimizing prompts.
    • Avoid ambiguous scales like zero to five; prefer binary classification for reliable grading.
    • Test your grading rubrics across multiple models to check for consensus and low variance.
    • Pairwise comparisons are often much easier for humans and models to evaluate than absolute grading.
    • A stronger model running at low effort is often more token-efficient than a weaker model running at high effort.
    • Hill climbing can automatically search through model effort configurations to find the optimal sweet spot.
    • Starting at max effort wastes tokens; begin with smarter models at low effort and scale up only if needed.
    • Isolating the context object from the execution harness prevents data loss during compaction events.
    • An independent context object allows the model to perpetually interrogate past session logs via tools.
    • This recursive language model pattern significantly enhances reliability and recoverability for long-duration agents.

Questions this video answers

7 · every answer cites the moment it was said
01 How do legacy prompt boosters affect frontier models? 2 sources · 1:43

Legacy techniques like step-by-step instructions and verification rituals are unnecessary for frontier models because they already reason effectively. Using these outdated boosters actually increases token costs and can degrade model performance. Therefore, developers should audit their prompts to remove these anti-patterns.

02 Why is prompt caching critical for multi-turn agent applications? 2 sources · 5:47

Multi-turn agents repeat a significant amount of context across turns, making prompt caching essential for controlling costs. Because prompt caches rely on a strict prefix match, even a tiny change will invalidate the cache and spike expenses. Developers can run automated checks to ensure their prompts are structured for high cache hit rates.

03 How does autonomous hill climbing prevent overfitting on evaluation sets? 2 sources · 13:51

Automated hill climbing uses statistical principles by splitting evaluation data into separate test and train sets. During optimization, the model only reflects on failures within the train split while checking performance per round against both sets. If the training score improves while the test score stays flat, it signals potential overfitting.

04 How should I structure evals for subjective or open-ended tasks? 3 sources · 31:00

Use well-structured rubrics with crisp, simple binary classification rather than ambiguous arbitrary scales like zero to five. Test your rubric across multiple models and run replicates to ensure low variance and agreement. Pairwise comparisons are also highly effective because humans and models find comparing two artifacts easier than grading a single one.

05 What should I do if my hill climbing loop gets stuck? 2 sources · 36:47

Hill climbing is not guaranteed to converge, and getting stuck often indicates poorly structured evals rather than model failure. Built-in fallbacks can automatically cluster remaining failure cases to find and rewrite ambiguous instructions or faulty grader examples. Ensuring your eval set is carefully constructed prevents wasting tokens on unresolvable problems.

06 How should I configure model effort during optimization? 2 sources · 39:24

When searching through model effort configurations, apply the principle that a stronger model at lower effort is typically more token efficient and cheaper than a weaker model at high effort. You can use hill climbing to search different model effort combinations until performance drops below the baseline. Starting with a smart model at low effort is often the sweet spot for cost performance.

07 What architectural pattern improves context engineering reliability for long-duration agents? 2 sources · 57:47

Decoupling the brain and hands by keeping the context object independent from the harness significantly improves context engineering reliability. This architecture ensures the context is always recoverable through different tools rather than being permanently lost during compaction events. Storing state in an independent object allows long-duration agents to successfully revisit and interrogate past session logs.

Section-by-section summary

16 parts

Applications often sit inside the Pareto frontier due to misconfigurations

Developers typically view cost and quality as a fixed trade-off along a Pareto frontier. However, minor configuration mistakes often leave applications performing below their actual capability. Identifying and fixing these issues unlocks better performance at a lower cost.

Remove legacy prompt boosters and verification rituals

Older models required explicit instructions like think step-by-step or double-check your work to reason effectively. Frontier models handle this natively, and retaining these prompts unnecessarily inflates token costs and confuses instruction following. Automated audit commands can scan and clean up these anti-patterns.

Maximize prompt cache hit rates for multi-turn agents

Multi-turn agent applications repeatedly send growing context windows across turns, making prompt caching essential for cost and latency. Because caches rely on strict prefix matching, minor prompt modifications break the cache. Organizing prompts hierarchically and tracking hit rates can slash costs by up to 72%.

Design evaluations with clear headroom and low variance

Autonomous self-correction requires well-structured evaluations that scale predictably with model capability and thinking budget. Evaluations must avoid ambiguous tasks that saturate performance prematurely. Ensuring low run variance prevents wasting tokens on un-gameable metrics.

Split evaluation data to prevent hill climbing overfitting

Frontier models can autonomously hill climb on evaluations to rapidly improve performance. Without proper safeguards, this optimization heavily overfits to bespoke test distributions and fails in production. Implementing rigorous train-test splits provides early warnings when training gains diverge from test performance.

Use automated hill climbing to aggressively reduce costs

Hill climbing can be guided to optimize for cost reduction rather than raw performance gains. By searching through model tiers, effort levels, and prompt variants, the system can find configurations that maintain output parity while slashing costs by up to 90%. Higher models running at lower effort often outperform cheaper models at high effort.

Architect long-duration agents with recoverable components

As agent tasks extend from minutes to days, reliability and security requirements change fundamentally. Decoupling the agent brain harness from sandboxed execution and storing secrets in vaults prevents catastrophic failures. Independent, append-only session logs ensure systems can recover gracefully if a sandbox or harness crashes.

Use binary rubrics and pairwise comparisons for LLM grading

Open-ended or squishy evaluation domains require careful rubric design to avoid noisy model judgments. Avoid ambiguous scales and instead use binary classifiers or multiple structured checks. Pairwise comparisons are often more reliable than absolute scoring for both humans and models.

Binary rubrics and pairwise comparisons ensure reliable evaluation

For open-ended criteria, replace ambiguous grading scales with crisp binary classifiers or pairwise comparisons. Validating grades across multiple model classes and running replicates ensures low variance and trustworthy evaluation signals.

Build eval distributions from first principles, not model failures

Sampling eval cases exclusively from the specific failure modes of a single model creates a jagged distribution that fails when you upgrade models. Instead, curate eval sets from first principles, human intuition, and real production data.

Clustering remaining failure cases helps diagnose stuck hill climbers

Hill climbing is not guaranteed to converge, and stalls are frequently caused by poorly structured or ambiguous evaluation examples rather than model limitations. Built-in mechanisms that cluster remaining failure cases help automatically identify and rewrite faulty eval criteria.

Prioritize stronger models at low effort over weaker models at high effort

Leveraging frontier models at lower effort configurations yields better token efficiency and lower costs than pushing smaller models to maximum effort. Hill climbing loops can effectively search through these model and effort parameters if a solid eval set is present.

Combine human taste with Claude-driven trace analysis

Humans should steer the high-level goals and product taste, while Claude can autonomously analyze raw execution traces to surface problematic patterns. This collaboration streamlines the creation of effective offline evaluations from real-world usage.

Retire legacy prompt anti-patterns for frontier models

Many classic prompt engineering tricks and boosters are obsolete anti-patterns that latest-generation frontier models no longer require. When migrating to newer models, strip out these legacy constraints to let the model operate naturally.

Decouple the context object from the harness for robust long-term agents

Context engineering reliability relies on keeping the context object completely independent from the execution harness so it never gets permanently lost during compaction. Allowing the model to query an externalized session log enables reliable long-horizon agent execution.

Continuously feed production failures into offline regression loops

As models improve, your evals should reflect rising performance trends or they need to be updated. A robust outer loop involves capturing poorly scored production traces, turning them into offline regression tests, and hill climbing until failures disappear.

0:00 / 1:04:02
k play/pause · f fullscreen · m mute
n next · p previous clip · t highlights/full
< > slower/faster · / search what was said
  • Prompt cache8× · first 5:32

    A caching mechanism used to store and reuse repeated prompt contexts at a lower cost and higher speed.

  • Hill climbing35× · first 9:10

    An autonomous optimization process where a model iteratively improves its prompts or skills based on evaluation feedback.

  • Pairwise comparisons2× · first 31:55

    An evaluation method where models or humans compare two artifacts to determine which one is better.

  • Recursive language model3× · first 57:41

    An architectural pattern that decouples the context object from the harness to allow independent session log interrogation.