Page 5 of 8~120 min topic

Fine-tuning lab

Debug fact memorization and format regression

When training set includes tomorrow's promo price; model invents it after promo ends, the system must degrade on purpose without widening blast radius.

~15 min this pageDebugging

1Learn the idea

Read

Classify and bound retries

Map failure classes for POST /v1/fine_tuning/jobs: retryable vs fatal vs needs-human. Retries need budgets, jitter, and idempotency rules aligned to weights never encode store hours or prices; those stay in retrieval docs. The chapter’s signature failure — training set includes tomorrow's promo price; model invents it after promo ends — must take a deliberate branch, not a generic catch-all.

Read

Containment path

Implement the degrade/rollback/refuse behavior support ops manager reviewing tone before a seasonal campaign needs when FT-PROMO-LEAK-12 repeats. Prefer scoped controls (one flag, one weight, one tenant, one secret version) over fleet-wide restarts. Preserve evidence; do not delete logs to “clean the demo.”

Read

Implementation artifact

if unsupported_fact_rate > 0.05:
    raise SystemExit("abort: facts leaked into weights; scrub training set and rerun")

Read

Verify harm reduction

After containment, check tone_pass_rate and unsupported_fact_rate moves in the safe direction and watch for retry amplification. Write the stop condition that ends the incident response for this lab.

Read

Stage depth

Chaos note: inject only one fault class at a time and restore fixtures after. Watch for dual failures — dependency down and retry amplifier — which is how training set includes tomorrow's promo price; model invents it after promo ends becomes an outage. Customer communication templates (even if only for the drill) beat silence. If you queue deferred work, define poison-message handling. Budget documents should state the maximum extra spend allowed during retries. Close the loop by linking the containment action to a dashboard panel for tone_pass_rate and unsupported_fact_rate.

Read

Field notes for `fine-tuning-lab` / `failure-handling`

Draw a state diagram for degrade modes and put it in the repo as ASCII if needed. Cap concurrent retries across the process, not only per request. Ensure cancellation propagates to downstream HTTP clients. When failing closed, choose a user-visible message that does not leak internals. Practice the single command that flips the kill switch or weight to zero. After recovery, drain or inspect deferred work before declaring green. 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

Assume training set includes tomorrow's promo price; model invents it after promo ends is happening right now. Write the first safe action, the signal that confirms containment, and the action you will not take (infinite retry, broad restart, deleting evidence). Tie the plan to invariant: weights never encode store hours or prices; those stay in retrieval docs.

Check your understanding

Page assessment

Answer from memory. Completion is saved from this evidence, not from opening the next page.

1. Are retry budgets explicit?
2. Is containment scoped?
3. Do you preserve evidence for FT-PROMO-LEAK-12?

All responses are required.