Output Control: Format, Tone, and Constraints
Control AI output precisely: specify formats (JSON, markdown, tables), constrain length, set tone, use negative prompting, and ensure deterministic results.
Premium Course Content
This lesson is part of a premium course. Upgrade to Pro to unlock all premium courses and content.
- Access all premium courses
- 1000+ AI skill templates included
- New content added weekly
You’ve defined the AI’s role (system prompt), taught it patterns (few-shot), and guided its thinking (reasoning techniques). The final piece: controlling exactly what the output looks like.
🔄 Quick Recall: In the previous lesson, you built system prompts with role definitions, behavioral guidelines, and scope boundaries. Now you’ll control the output itself — format, length, tone, and structure.
Format Control
Markdown Tables
<output_format>
Present the comparison as a markdown table with columns:
| Feature | Product A | Product B | Winner |
Include exactly 5 feature rows. In the Winner column,
put the product name or "Tie" if equal.
</output_format>
Numbered Lists with Constraints
<output_format>
Provide exactly 5 recommendations. Format each as:
[Number]. [Bold title] — [One-sentence explanation] ([Estimated effort: low/medium/high])
Example:
1. **Add caching layer** — Reduce database load by caching frequent queries (Estimated effort: medium)
</output_format>
JSON for Machine Consumption
<output_format>
Respond with a JSON array. Each object must have:
{
"category": string,
"priority": "critical" | "high" | "medium" | "low",
"description": string (max 50 words),
"estimated_hours": number
}
No text outside the JSON. No code fences.
</output_format>
✅ Quick Check: You ask the AI to “return CSV data.” It returns a table with visual formatting but not actual comma-separated values. How do you fix the prompt? (Answer: Be explicit about the raw format: “Return raw CSV data. First row is headers. Use commas as delimiters. Use double quotes around fields containing commas. No markdown table formatting, no explanation text. Start the response with the header row.”)
Length Control
Length is notoriously hard to control. The most effective techniques:
Word/Sentence Counts
Respond in exactly 3 sentences.
This works reasonably well. The AI may occasionally produce 2 or 4, but it’s close.
Template Filling
Complete this template:
Summary: [one sentence]
Key finding: [one sentence]
Action item: [one sentence]
Templates are more reliable than word counts because the AI fills a structure rather than counting.
Maximum Length + Explicit Stop
Maximum 100 words. After completing your response, write "[END]".
Do not continue past this marker.
Anchor Length to Reference
Write a response similar in length to the following example:
[paste an example of the desired length]
Tone and Voice Control
Tone Spectrum
Instead of just “formal” or “casual,” be specific about where on the spectrum:
Tone: Professional but approachable. Use contractions.
No jargon without explanation. First person plural ("we").
Similar to how Slack writes their product updates.
Voice Anchoring
Reference a known voice:
Write in the style of a Wall Street Journal technology column:
factual, authoritative, minimal adjectives, quotes from named sources.
Anti-Tone (Negative Prompting)
Sometimes defining what you DON’T want is easier:
Tone constraints:
- NOT academic (no passive voice, no hedging language)
- NOT marketing (no "revolutionary," "game-changing," "unleash")
- NOT casual (no "gonna," "kinda," slang)
- TARGET: Clear, direct, like a senior colleague explaining something
Negative Prompting
Explicitly banning common mistakes:
<constraints>
Do NOT:
- Start with "In today's fast-paced world" or any cliche opening
- Use the word "delve" or "dive into"
- Include disclaimers like "As an AI language model..."
- Add a conclusion paragraph that restates the introduction
- Use bullet points unless specifically requested
- Add emojis
</constraints>
Negative prompting works because AI models have strong default patterns. Banning specific patterns forces them to find alternatives.
✅ Quick Check: You add 20 “Do NOT” rules to a prompt. The output improves but the AI seems confused and contradicts itself. What happened? (Answer: Too many negative constraints compete with positive instructions. The AI spends processing capacity avoiding things rather than producing what you want. Limit negative constraints to 3-5 high-impact rules targeting your most common failures. For the rest, rely on positive instructions and good examples to guide the output.)
Temperature and Determinism
Most AI APIs expose a temperature parameter (0.0 to 1.0):
| Temperature | Effect | Best For |
|---|---|---|
| 0.0 | Most deterministic | Data extraction, classification, factual Q&A |
| 0.3-0.5 | Balanced | Analysis, summarization, professional writing |
| 0.7-0.9 | More creative | Brainstorming, creative writing, ideation |
| 1.0 | Most random | Experimental, maximum variety |
Rule of thumb: Lower temperature when you want consistency. Higher when you want creativity. For most professional tasks, 0.2-0.5 is ideal.
Combining Output Controls
A production-grade output specification:
<output_specification>
Format: Numbered list of findings
Length: Exactly 5 findings
Each finding: Bold title + 1-2 sentence explanation
Tone: Executive briefing — concise, no jargon, action-oriented
Include: One recommended next step after the findings
Exclude: Technical methodology, data sources, disclaimers
Do NOT:
- Exceed 200 words total
- Use passive voice
- Include hedging language ("might," "could potentially")
</output_specification>
Practice Exercise
- Write a prompt that forces exact JSON output — no text before or after
- Create a template-based prompt that controls length precisely (e.g., fill-in-the-blank format)
- Write a tone specification using both positive description and negative constraints
- Test the same prompt at temperature 0.0 and 0.7 — compare consistency vs. creativity
- Add 3 targeted negative constraints to a prompt and measure improvement
Key Takeaways
- Format control: templates and structural schemas are more reliable than verbal descriptions
- Length control: templates > word counts > “keep it short” — fill-in-the-blank is most precise
- Tone control: specific descriptions + reference voices + anti-tone constraints work together
- Negative prompting targets persistent failures — limit to 3-5 high-impact rules
- Temperature controls determinism: lower for consistency, higher for creativity
- Combine all controls into a single output specification for production prompts
Up Next
In the next lesson, you’ll learn prompt safety — how to defend against injection attacks, evaluate prompt reliability, and build robustness into your prompting workflows.
Knowledge Check
Complete the quiz above first
Lesson completed!