Skip to content

1.5 Structured Output Prompting

Downstream use

You need the output in a specific shape: a table for a spreadsheet, a checklist for a protocol, a structured plan you can paste straight into a document.

Consistency across runs

You are running the same prompt multiple times and need results in the same format every time, for example extracting data from a batch of papers.


Not every task needs the same structure. Here is a quick guide:

FormatBest forAvoid when
TableComparing items across shared dimensions, structured data, reference materialCells would need more than two sentences
Numbered listStep-by-step instructions, ranked items, sequential processesItems have no inherent order
Bullet points3-10 discrete items, quick scanning, brainstormingItems need comparison across attributes
Headings/sectionsMulti-part analysis, reports, long-form outputShort, single-topic answers
TemplateStandardised outputs you will reuse (protocols, forms, descriptions)Highly creative or exploratory tasks
ProseNuanced analysis, persuasive writing, discussion sectionsData needs to be scanned quickly

A simple rule from Google’s technical writing guide: if you can rearrange the items and the meaning stays the same, use bullets. If order matters, use numbers.


  1. Name the format explicitly - “Respond as a markdown table” or “Provide a numbered list” removes ambiguity. Without this, the AI picks whatever format it likes.

  2. Specify the structure - For tables, list the column headers. For sections, name the headings. For lists, say how many items you want. The more structure you define, the more consistent the output.

  3. Show an example when the format is complex - One well-crafted example of the desired output teaches format more reliably than a paragraph of instructions. The AI mimics the pattern.

  4. Keep reasoning and formatting separate - Research shows that strict format constraints can reduce reasoning quality. For complex tasks, ask the AI to think through the problem first, then present its conclusions in the requested format.

  5. State how to handle missing information - Tell the AI what to do when data is unavailable: “If information is not reported, enter NR.” This prevents the AI from guessing or skipping fields silently.


Extract structured data from a research paper:

Prompt: Literature data extraction
Extract the following information from the attached study
into a markdown table:
| Field | Extracted Data |
|-------|---------------|
| First author and year | |
| Study design | |
| Sample size (N) | |
| Study organism or system | |
| Location | |
| Key methods | |
| Primary outcome measure | |
| Main finding (with effect size and CI if available) | |
| Limitations noted by authors | |
Rules:
- If information is not reported, enter "NR"
- Include exact values with units
- Quote statistical results verbatim (e.g., "p = 0.03")

Structured output is not always the right choice. Use prose when:

  • Nuanced interpretation is needed - Discussion sections, theoretical arguments, and qualitative findings require narrative flow that tables break apart.
  • You are persuading - Grant significance sections and cover letters need a compelling story, not bullet points.
  • Ideas are deeply interconnected - When each point builds on the previous one, a list fragments the logic.

A useful hybrid: use structured prompts to extract and organise your raw material, then write the narrative yourself. The AI handles the tedious extraction; you handle the synthesis.



Based on materials from Prompt Engineering Guide, Vanderbilt Prompt Pattern Catalog, Tam et al. (2024) - Format Restrictions and LLM Performance, and Anthropic Prompting Best Practices.

Have structured output templates that work well for your research? Share them with RSO so we can add them to the library.