This question evaluates a candidate's ML system design skills for calibrating large language model outputs to strict document formatting schemas, covering schema representation, constraint enforcement, validation and repair, latency trade-offs, fallback strategies, and evaluation metrics.
You’re building an LLM-powered feature in a word processor (e.g., Microsoft Word) that generates content users can insert directly into a document (headings, bullets, tables, citations, styles, etc.). A common failure mode is that the LLM’s output does not conform to the required Word formatting/spec (wrong heading levels, broken lists, invalid table structure, missing citations, inconsistent styles).
Design an approach to calibrate and enforce that the LLM’s generated content matches a target Word formatting specification.