Pepelen
AI for Professionals: Using LLMs at Work

Lesson

Lesson 2: Constraints, style, and structured output

Add constraints (length, style, what to rely on) and request structured output (list, table, or JSON) so the answer is usable and predictable.

1 / 6

Constraints and structured output: making answers immediately usable

Constraints and structured output: making answers immediately usable

Without explicit constraints, the model decides how long, how formal, and how detailed to be — and it often over-explains. Constraints are guardrails you add to the prompt: a length limit ('in no more than 150 words'), a tone or style ('formal, no jargon'), a list of allowed sources ('based only on the attached policy document'), and things to avoid ('do not include pricing, do not use bullet points'). A single well-chosen constraint can cut revision time in half. Structured output means asking the model to return the answer in a specific machine-readable or visually scannable format. The three most common formats are: a bulleted list (good for steps, options, or criteria); a table with named columns (good for comparisons or side-by-side data); and JSON (good when the result will be processed by code or fed into another system). Specifying the format in the prompt makes the output predictable and saves reformatting work. Choose the format to match how the answer will be used downstream. If a colleague will read it in an email, a bulleted list is enough. If it goes into a spreadsheet, ask for a table. If code will parse it, ask for JSON with a defined set of keys. Here is a worked prompt that combines style, constraint, and structured output: 'You are a procurement analyst. Review the three vendor quotes below and compare them on Price, Delivery time, and Warranty. Write in a neutral, factual tone. Reply with a markdown table only — no introduction, no conclusion. Maximum 200 words.'
Lesson notes
Constraints and structured output: making answers immediately usable
Without explicit constraints, the model decides how long, how formal, and how detailed to be — and it often over-explains. Constraints are guardrails you add to the prompt: a length limit ('in no more than 150 words'), a tone or style ('formal, no jargon'), a list of allowed sources ('based only on the attached policy document'), and things to avoid ('do not include pricing, do not use bullet points'). A single well-chosen constraint can cut revision time in half. Structured output means asking the model to return the answer in a specific machine-readable or visually scannable format. The three most common formats are: a bulleted list (good for steps, options, or criteria); a table with named columns (good for comparisons or side-by-side data); and JSON (good when the result will be processed by code or fed into another system). Specifying the format in the prompt makes the output predictable and saves reformatting work. Choose the format to match how the answer will be used downstream. If a colleague will read it in an email, a bulleted list is enough. If it goes into a spreadsheet, ask for a table. If code will parse it, ask for JSON with a defined set of keys. Here is a worked prompt that combines style, constraint, and structured output: 'You are a procurement analyst. Review the three vendor quotes below and compare them on Price, Delivery time, and Warranty. Write in a neutral, factual tone. Reply with a markdown table only — no introduction, no conclusion. Maximum 200 words.'
Lesson 2: Constraints, style, and structured output — AI for Professionals: Using LLMs at Work