Fine-tuning lab
Measure base vs prompt-only vs adapter quality
Executable checks prove weights never encode store hours or prices; those stay in retrieval docs on fixtures — including the known misshape behind FT-PROMO-LEAK-12.
1Learn the idea
Read
Schema and policy checks
Add executable validation at the trust boundaries of LoRA adapter that keeps support replies in brand voice while facts stay in RAG. Reject unknown fields where they matter, bound string sizes, and coerce only after auth/signature checks when raw bytes are security-relevant. Invariant under test: weights never encode store hours or prices; those stay in retrieval docs. A TypeScript type or Python annotation is not runtime validation — pair them with parsers.
Read
Golden and adversarial fixtures
Automate the fixtures from setup, including a recreation of FT-PROMO-LEAK-12. Assert both the visible error and the absence of side effects (no provider call, no queue write, no flag flip). Where metrics matter, assert label enums stay bounded.
Read
Implementation artifact
def score_tone(pred, gold_rubric) -> float:
return sum(r in pred.lower() for r in gold_rubric) / len(gold_rubric)
assert score_tone(sample, ["glad to help", "policy"]) >= 0.5
Read
Gate semantics
Document which failures are client mistakes (4xx) versus operator/config mistakes (5xx/503). Oracle still stands: held-out tone score ≥ 0.82 and factual hallucination rate ≤ 0.05 on 40 gold pairs. Validation should make accidental “success with empty body” impossible for support ops manager reviewing tone before a seasonal campaign.
Read
Stage depth
Property ideas: shuffled field order, Unicode edges, maximum-length strings, and replayed timestamps. Where money, identity, or citations matter, assertion messages should cite the field name. Do not snapshot entire provider payloads in tests; assert semantically. If validation fails open “to keep the demo working,” you have inverted the lab. Tie at least one CI job to the FT-PROMO-LEAK-12 fixture so main cannot regress silently. Re-read weights never encode store hours or prices; those stay in retrieval docs after each new parser — convenience helpers love to bypass it.
Read
Field notes for `fine-tuning-lab` / `validation`
Table-drive status codes and error codes so reviewers see coverage at a glance. Include a Unicode normalization case if user text is accepted. Verify that oversized bodies fail before CPU-heavy work. Where digests or versions are pinned, assert mismatch behavior. Keep golden files small enough to read in review. CI should fail on skipped tests that mark the incident fixture as xfail without a ticket link. In this chapter the product is LoRA adapter that keeps support replies in brand voice while facts stay in RAG, the human stakeholder is support ops manager reviewing tone before a seasonal campaign, and the incident id you design against is FT-PROMO-LEAK-12. Re-state the oracle in your notes — held-out tone score ≥ 0.82 and factual hallucination rate ≤ 0.05 on 40 gold pairs — and keep the invariant visible: weights never encode store hours or prices; those stay in retrieval docs. Track tone_pass_rate and unsupported_fact_rate as the scoreboard. Surface under change control: POST /v1/fine_tuning/jobs. If you only have forty minutes, finish the fixture for training set includes tomorrow's promo price; model invents it after promo ends before polishing UI. Promotion language stays ternary: promote, hold, or roll back based on evidence, not hope.
Go deeper
Before you start
Why this matters
List three fixtures: one golden success, one schema/auth reject, and one regression for FT-PROMO-LEAK-12. For each, write the exact assertion (status, code, metric, or citation) that must turn red if broken.
Related lessons
Check your understanding
Page assessment
Answer from memory. Completion is saved from this evidence, not from opening the next page.
All responses are required.