A technical writing platform uses Claude to generate API documentation from OpenAPI specifications. The generated docs must use the company's custom terminology (e.g., 'endpoint' must be called 'resource path,' 'response' must be called 'return payload'). The team observes that standard terminology appears in 15-20% of generated sections despite system prompt instructions. Temperature is already at 0.1. The team's options are: (A) increase few-shot examples to 20 pairs demonstrating correct terminology, (B) add a self-review step where Claude checks its own output for prohibited terms, (C) post-process with deterministic string replacement. Which approach is best for production, and what does the correct architecture look like?
Select an answer to reveal the explanation.
Short Explanation
Picture a spell-checker behind a good writer. The few-shot examples get you writing the right terms in the first place, and the find-and-replace pass catches whatever slips through, so you don't pay for a second model call to review the draft.
Full Explanation
The strongest production design layers a model-side technique with a deterministic safety net. Few-shot examples are one of the most reliable ways to steer Claude's wording, so examples showing 'resource path' and 'return payload' in context cut violations at generation time and keep the surrounding sentences fluent. Deterministic post-processing then replaces any remaining exact-match terms with complete reliability, which is what a hard compliance rule needs. Using few-shot examples alone still leaves a residual violation rate, because conditioning shifts probabilities but does not guarantee every token. A self-review pass adds a second API call with its own cost and latency, and the same model that just produced a term can miss it again, so it cannot promise full compliance. Using string replacement alone while deleting the examples and terminology instructions throws away the generation-time guidance, so more sentences need mechanical substitution and more of them read awkwardly, such as grammar that was built around the old noun. The saved input tokens do not offset that quality loss. On the exam, watch for options that sound correct about a tool's reliability but then remove a layer the design depends on. Operationally, log how often the replacement stage fires; a rising count means the examples need refreshing.