A library hours bot invents branch codes that do not exist in the facilities table. Which technique best blocks those invented IDs?
Select an answer to reveal the explanation.
Short Explanation
Branch codes aren’t creative writing—they’re inventory keys. Wire constrained decoding to the live facilities table so the hours bot can only say IDs that actually exist.
Full Explanation
Constraining decoding to store IDs present in the live facilities inventory best blocks a library hours bot from inventing branch codes. The facilities table is the system of record; decoding-time allow-listing (or equivalent constrained generation against that inventory) ensures emitted IDs are real branches residents can visit. This is stronger than hoping prompt wording alone prevents vanity codes. Prompting the model to invent memorable vanity codes for marketing campaigns deliberately encourages non-inventory IDs and breaks downstream lookups for hours and locations. Training only on fiction blurbs so facility IDs never appear avoids ID hallucination by starving the model of operational identifiers, which also prevents answering real hours questions correctly. Increasing nucleus sampling so rare fabricated codes become more likely widens the tail of the distribution and makes invented IDs more probable, worsening the failure mode. Exam caveat: constraints must track the live inventory—stale allow-lists will block new branches or permit closed ones—so refresh the constrained set from the facilities table on a known cadence. Operational check: sync the decoding allow-list from the facilities API, probe with neighborhood queries that previously produced fake branch codes, and assert every emitted code resolves in the live table before the hours answer is shown.