Constrained outputs involve instructing the LLM to generate responses that adhere to specific limitations or formats. This could mean setting a word limit, specifying a response type (like “yes” or “no”), or requiring the output to match a particular pattern or structure.
Limiting the response to ‘Approved’ or ‘Denied’ ensures consistency and simplifies automated processing.Prompt:
Copy
Ask AI
Review the following application and respond with 'Approved' or 'Denied' only.Application Details: [Applicant's information and criteria]Decision:
Example 2: Short Answer Generation.
By specifying that the answer should be in one sentence, you prevent the model from providing overly long or off-topic responses. Prompt:Prompt:
Copy
Ask AI
Based on the text below, answer the question in one sentence.Text: 'The Great Barrier Reef is the world's largest coral reef system located in Australia.'Question: 'Where is the Great Barrier Reef located?'Answer:
Example 3: Technical writing.
Setting an exact word limit challenges the model to be concise and focus on the most important information.Prompt:
Copy
Ask AI
Summarize the following article in exactly 50 words.[Insert article text]Summary (50 words):