An extraction task keeps returning inconsistent formats, even with clear instructions. What usually helps most?
Why A is the answer
Few-shot examples of the exact output
Examples show the output format directly, and they are often more reliable than more instructions.
In detail
- Examples show the exact format.
- Show edge cases in the examples.
Use case
An illustrative scenario, not a real incident.
A contract extractor returns varied formats. Two examples of the exact JSON settle it.
See it in different ways
flowchart TD
A{"What goes wrong?"} -->|"Wrong format"| B["Few-shot and structured output"]
A -->|"Logic errors"| C["Chain of thought"]
A -->|"Made-up facts"| D["Retrieval and grounding"]mindmap
root((Prompting))
Format drift
Few-shot examples
Structured output
Reasoning errors
Chain of thought
Simple tasks
Zero-shot
Domain words
Context in the promptflowchart LR S0["Add example input"] --> S1["Add exact output"] --> S2["New input"]
Key point: Examples show the format.
Why the other options are wrong
- B. A GPU with more memory for longer outputs
- Memory does not fix format.
- C. A model with a later knowledge cutoff
- A cutoff is unrelated.
- D. A higher temperature on each request
- That adds variety.

