20/38
Part 4 of 6 · Generation and latencyLearn and do
Generation: cited steps, or nothing
With the chunks chosen, the model writes the steps, and the format you ask for decides what you can check.
Ask for JSON, with a citation on every step
An invented example of an output contract that works:
{
"status": "answer",
"steps": [
{"text": "Confirm who cancelled and how long before check-in.", "cites": ["POL-118 s2 v14"]},
{"text": "Apply the refund rule for a host cancellation in that window.", "cites": ["POL-118 s3 v14"]},
{"text": "Offer rebooking help and note it on the ticket.", "cites": ["WF-042 s1 v3"]}
],
"draft_reply": "...",
"missing": []
}
statusisanswer,partialorabstain.- Every step cites at least one chunk from the prompt.
missinglists what the model needed and didn't find.
Ask for structured output, not prose. Airbnb's evaluation guide says the same: use structured outputs, JSON schemas, to ensure strict typing.
Three grounding rules:
- Use only the provided chunks. If a step needs a rule that isn't there, it goes in
missing. - Every step cites its chunk. No citation, no step.
- Amounts, dates and eligibility come from tool outputs, such as reservation data or a policy calculator. Never from the model's arithmetic or memory.
The last rule exists because a model trained on web text may have seen old versions of public help pages, and nothing stops it from reciting one. Grounding and citations keep the model's memory out of the answer.
In the editor, write contract_problems(output, prompt_ids): every way the model's JSON breaks the contract above. prompt_ids holds the ids of the chunks that went into the prompt.