Skip to content

    Forward Deployed Engineer

    Baseline vs Strategy Evaluation with a Golden Set

    Measure a baseline and two retrieval strategies on a golden set with one reproducible harness, read the results table honestly and judge which gaps are real.

    By Published 7 min read

    • fde
    • evaluation
    • baseline
    • rag
    • metrics
    Share

    This lesson is part of Forward Deployed Engineer: Evaluate and Capstone. Enroll for free, then sign in, to read it in full.

    What you'll learn: how to run a baseline and two strategies through one harness on one golden set, read the capstone's results table, and tell a real difference from noise.

    At a glance

    Figure 1. The evaluation pipeline

    flowchart LR accTitle: Evaluation pipeline accDescr: The golden set feeds one run per question and strategy through the same discovery pipeline with a deterministic mock provider. Each run is graded by a scoring function into a row. Rows are summarised into metrics and written to latest.json and latest.md. G["data/eval/golden_set.json, 36 questions"] --> R["run_discovery per question and strategy, mock provider"] S["Strategy: baseline, A, B"] --> R R --> D["grade: one row per run"] D --> M["summarise: metrics per strategy"] M --> O["eval/results/latest.json and latest.md"]

    How to read this: the only thing that changes between the three runs is the strategy switches, so any difference in a row comes from them.

    • Measure the simplest thing that could work first, or you cannot say what a change bought.
    • Change one idea per strategy and name the switches.
    • The scoring rule is code, fixed before the run.
    • Compare per question, not only in averages.
    • On 36 questions a one-question gap is noise; count safety failures separately.

    Scenario

    Composite scenario, not a real company. Lumen Industrial Supply wants its product-discovery assistant live for public customers and has three candidate setups: keyword search over every document, the same with partner-only content filtered out in the query, and a third that also drops superseded datasheets and flags contradictions. The head of sales engineering asks which to ship and why. All figures come from the previous lesson's golden set and a mock provider.

    What you will be able to do

    • Read each column of the results table.
    • Explain which questions a strategy moved.
    • Judge a gap on 36 questions with a Wilson interval.
    • Show a result is reproducible, and name the column that is not.

    Prerequisites

    Build a golden set, Evaluating retrieval and answers; failure modes and AI Architect: Evaluation, which explains the intervals used here.

    Core ideas

    One scoring rule, three switches

    Figure 2. The three strategies

    Strategy Metadata filter in the query Context budget Superseded excluded, conflicts flagged
    baseline no no no
    A yes yes no
    B yes yes yes

    How to read this: each row adds to the one above, so a difference belongs to the switch that changed.

    Production runs B.

    Verified: capstone/fde-product-discovery-copilot/app/discovery.py

    BASELINE = Strategy("baseline", metadata_filter=False, context_budget=False, conflict_handling=False)
    STRATEGY_A = Strategy("A", metadata_filter=True, context_budget=True, conflict_handling=False)
    STRATEGY_B = Strategy("B", metadata_filter=True, context_budget=True, conflict_handling=True)
    STRATEGIES = {s.name: s for s in (BASELINE, STRATEGY_A, STRATEGY_B)}

    Predict first. Which of these columns would you expect to differ between strategies: document recall, access leaks, stale citations, groundedness?

    Answer

    Access leaks and stale citations differ, because the switches remove partner-only and superseded documents. Document recall does not, because they never re-rank the rest. Groundedness does not either, for a reason below.

    The real results

    Figure 3. Results on 36 golden questions, mock provider (from eval/results/latest.md)

    Strategy Doc recall@3 SKU recall@3 Groundedness Refusal accuracy Clarify accuracy Access leaks Stale citations Conflicts flagged
    baseline 94.2% 95.7% 100.0% 94.4% 100.0% 5 2 0.0%
    A 94.2% 97.8% 100.0% 97.2% 100.0% 0 2 0.0%
    B 94.2% 97.8% 100.0% 97.2% 100.0% 0 0 100.0%

    How to read this: read down a column to see what a switch bought.

    Latency and tokens are in the next lesson. The per-question rows show what each strategy moved:

    • Baseline to A: q08, q10, q12, q33 and q34 stop exposing partner-only content (5 leaks to 0). q33, a partner price question, becomes a refusal. q34's SKU recall rises from 50% to 100%.
    • A to B: q13 and q22 stop citing the superseded datasheet. q20 and q21, the conflict questions, now carry a "documents disagree" question.

    Doc recall@3 is the share of expected documents among the first three distinct documents in the model's context (eval/metrics.py).

    Why doc recall is the same everywhere

    All three use the same keyword ranking. A filter removes partner-only chunks and a flag marks superseded ones, but neither reorders the rest. Doc recall is identical for 36 of 36 questions.

    So the strategies differ on safety and staleness, not retrieval quality.

    Why groundedness is 100% under the mock

    The mock provider is a rule-based stand-in for a model. It copies sentences from its context, so no claim falls outside it. The metric works (a test forges a number and the flag turns false); the mock never forges.

    Treat 100% as a statement about the mock.

    Is one question a difference?

    Refusal accuracy is 34 of 36 for the baseline and 35 of 36 for A and B: one question, q33. A Wilson interval puts a range around each rate, and unlike the normal approximation it cannot go below zero (NIST handbook).

    Refusal accuracy: correct refuse-or-not decisions out of 36 questions (interactive when JavaScript is on)
    Baseline (34 of 36)94.4%, interval 81.9% to 98.5%, baseline
    Strategy A (35 of 36)97.2%, interval 85.8% to 99.5%, within noise of the baseline
    Strategy B (35 of 36)97.2%, interval 85.8% to 99.5%, within noise of the baseline

    Figure 4. Is this gap real?

    flowchart TD accTitle: Deciding whether a gap between strategies is real accDescr: First check whether the metric is a safety count such as leaks; a nonzero count is a defect regardless of the sample size. Otherwise compute a Wilson interval for each strategy. If the intervals overlap, the gap is within noise on this sample and you need more questions. If they do not overlap, the gap is likely real. A{"Is it a safety count, like leaks?"} -- yes --> B["Any nonzero value is a defect, fix it"] A -- no --> C["Wilson interval for each strategy"] C --> D{"Do the intervals overlap?"} D -- yes --> E["Within noise: write more questions"] D -- no --> F["Likely real: report it with its interval"]

    How to read this: safety counts skip the statistics, and everything else needs an interval before you call it a win.

    The widget starts with 94.4% for the baseline (interval 81.9% to 98.5%) and 97.2% for A and B (85.8% to 99.5%). The intervals overlap, so the refusal gain is within noise. Leaks are different: zero is a requirement, not a rate, so 5 to 0 matters even though 34 to 35 does not.

    At the customer: asked "Is strategy B better?", say what it fixes (5 leaks, 2 stale citations, 2 unflagged conflicts), what it does not (document recall) and that the set is small and written by the author who tuned the system.

    Worked example

    Assumptions:

    • Scores come from the capstone harness with the mock provider.

    A question passes when "refused or not" matches the label. The baseline misses q33 (answered, expected refuse) and q36 (clarified, expected refuse), so 36 - 2 = 34. A and B miss only q36, so 35. In fractions: 34 / 36 = 0.944 and 35 / 36 = 0.972.

    The baseline's 5 leaks are three ordinary discovery questions (q08, q10, q12) and two access-control questions (q33, q34): no adversarial question needed, only an unfiltered index.

    Build it

    The lesson code works on the dictionary evaluate returns. compare_refusals adds the intervals.

    Verified: capstone/fde-product-discovery-copilot/lessons/M6-L2/m6_l2_compare.py

    def compare_refusals(result: dict[str, Any]) -> list[dict[str, Any]]:
        """One line per strategy; the first strategy is the baseline. 'within noise' means the intervals overlap."""
        lines: list[dict[str, Any]] = []
        base: tuple[float, float] | None = None
        for name, data in result["strategies"].items():
            passes, n = refusal_passes(data["rows"])
            low, high = wilson_interval(passes, n)
            base = base or (low, high)
            verdict = "baseline" if not lines else ("within noise" if low <= base[1] and high >= base[0] else "different")
            lines.append({"strategy": name, "passes": passes, "n": n, "rate": passes / n, "lower": low, "upper": high, "verdict": verdict})
        return lines

    fingerprint hashes every number that must repeat, after without_latency drops the one column that varies.

    Verified: capstone/fde-product-discovery-copilot/lessons/M6-L2/m6_l2_compare.py

    def fingerprint(result: dict[str, Any]) -> str:
        """A hash of every number that must repeat exactly. Latency is excluded because it never does."""
        text = json.dumps(without_latency(result), sort_keys=True)
        return hashlib.sha256(text.encode("utf-8")).hexdigest()[:12]

    Printing compare_refusals for a fresh run gives this real output:

    baseline 34/36 94.4% 81.9% to 98.5% baseline
    A 35/36 97.2% 85.8% to 99.5% within noise
    B 35/36 97.2% 85.8% to 99.5% within noise

    Exercise

    Add a strategy C: B with the context budget off. Run all four through evaluate, then use questions_that_moved(result, "B", "C") and the metrics to say what the budget does here.

    Acceptance criteria:

    • C has context_budget=False and the other switches as in B.
    • You report which metrics changed and which questions moved.
    • You say whether the data justifies keeping the budget.

    Done when your answer names its evidence and what 36 short questions cannot show.

    Hint 1: build C without editing the capstone

    Strategy("C", metadata_filter=True, context_budget=False, conflict_handling=True). Pass it to evaluate beside the other three.

    Hint 2: look at tokens as well as quality

    Compare input_tokens in metrics for B and C. If equal, the cap never cut anything.

    Common mistakes

    • Comparing averages only. Diff the rows.
    • Changing the scorer between runs. The numbers stop being comparable.
    • Reading a one-question gap as a win. On 36 questions one question is 2.8 percentage points.
    • Averaging safety away. A rate hides a single leak. Report leaks as counts.

    Knowledge check

    1. Why is a baseline run before any improvement?

    Without it you cannot say what a change bought. The baseline's 5 leaks and 2 stale citations make the two fixes measurable.

    2. Why is doc recall@3 the same for baseline, A and B?

    All three use the same keyword ranking, and removing chunks does not reorder the rest. The experiment cannot separate them on retrieval quality.

    3. What does 100% groundedness mean under the mock provider?

    The mock copies sentences from its context, so no claim falls outside it. That does not show the pipeline resists invention, because the mock never invents.

    4. Refusal accuracy went from 34/36 to 35/36. Is that a real improvement?

    Not on its own. The intervals, 81.9% to 98.5% and 85.8% to 99.5%, overlap widely. The reason to prefer A is the 5 leaks it removes, a safety count and not a rate.

    5. Which column is not reproducible, and how do you prove the rest is?

    Latency, because it is wall-clock time. Drop it, hash the rest and compare two runs: equal hashes mean every other number repeated.

    You can now

    • Say what each results column measures.
    • Name the questions each strategy moved.
    • Say why recall and groundedness cannot separate these strategies.
    • Use a Wilson interval to judge a small gap.

    In the interview: "How would you compare two retrieval strategies for a customer?" A good answer: fix the golden set and scorer first, run a simple baseline, change one idea per strategy, compare per question, add an interval for small samples, report safety failures as counts, and say what the experiment cannot show.

    Further reading

    Last verified: 2026-11-02

    Next

    Latency, tokens, cost and failure capture

    Enroll to keep reading

    Lesson 2 of 8 · Forward Deployed Engineer: Evaluate and Capstone

    Measure a baseline and two retrieval strategies on a golden set with one reproducible harness, read the results table honestly and judge which gaps are real.

    In the rest of this lesson

    • Worked example
    • Build it
    • Exercise
    • Common mistakes
    • Knowledge check
    • You can now

    Enrolling is free. It unlocks every lesson in Forward Deployed Engineer: Evaluate and Capstone, tracks your progress across devices and keeps your quiz scores. The newsletter is optional.

    Ask about this article

    Get answers grounded in this post. AI-generated — based on this article, and may be imperfect.

    Scaled AI Weekly

    Enjoyed this? Get more like it every Monday.

    Real architecture decisions, LLMOps patterns that survive production, and engineering leadership advice — from 12+ years of building at enterprise scale. Free. No spam. Unsubscribe anytime.

    Get new articles by email

    Free. We email a confirmation link first, and you can unsubscribe from any email.

    Join engineers building production AI systems

    Comments