Structured output
Also called structured outputs
Model output in a fixed machine-readable format, such as JSON with known keys or one label from a list, so code can parse and use it.
Interview questions about Structured output
- Design an LLM API pipeline that prompts for structured output and validates what comes back.
Template the prompt with the schema and one example, and use the API's JSON or structured-output mode if it has one.
- Should you turn on grammar-constrained decoding for every structured output? What would you watch?
Not blindly. It needs a grammar per format, can add latency, and output cut off at the length limit is still unparsable.
- Your LLM writes documents that must follow a strict Word formatting schema: styles, heading levels, tables. How do you make its output conform?
Don't ask the model for Word markup. Have it emit structured output, JSON with only allowed blocks such as heading with level, paragraph, list and table, each…
- Design an enterprise research assistant where every claim in the answer carries a citation the user can verify.
Make citation part of generation, not decoration. Retrieve with hybrid search and a reranker, respecting document permissions, and give each passage an id.