Ask a model for a table of prices, and you will usually get a clean table with two or three numbers that are simply invented. Not wildly wrong numbers. Plausible ones, in the right column, at the right magnitude, which is worse, because nothing about the shape of the answer tells you it is wrong.
Tables fail more often than prose for a structural reason: a table is a format that is always full. Every cell must contain something, and a model that is asked to fill a cell will fill it. If the source document does not say what the refund window is, the model still has to put text in that cell.
The fix is not a better model. It is a prompt that makes "I do not know" a valid, required output, and that separates what the model must produce from what it must never do.
The three blocks
A reliable extraction prompt has three parts, in this order:
- OBJECTIVE. One deliverable, stated as a sentence, with the scope boundaries named.
- GUARDRAILS. The specific behaviors that are forbidden, and the exact fallback when data is missing.
- OUTPUT FORMAT. The literal structure of the response, with column names, types, order, and a ban on anything outside the structure.
They are not decorative. Each one removes a different failure mode, and leaving any of them out reliably brings that failure back.
A full example
[1. OBJECTIVE]
Extract the pricing tiers, hidden usage limits, and refund terms
from the attached document into a single comparison table.
Scope: only pricing and terms. Ignore marketing copy, testimonials,
and roadmap statements.
[2. ZERO-HALLUCINATION GUARDRAILS]
- Never estimate or infer a number that is not printed in the document.
- If a value is missing, write N/A. Do not leave a cell blank.
- If a value is stated ambiguously, write the exact quote in the cell
and flag it with (verify).
- Every non-N/A cell must include the section heading it came from
in the Source column.
- If the document has no pricing section at all, return exactly:
NO PRICING DATA FOUND, and stop.
[3. OUTPUT FORMAT]
Return only a Markdown table with these columns, in this order:
Tier | Monthly Price | Annual Price | Included Usage | Overage Rate | Refund Window | Source
No introduction, no summary, no commentary after the table.
Numbers keep their original currency and units.
Three things in that prompt do most of the work.
N/A is defined as a legal answer. The single most common cause of invented cells is a prompt that implies every cell will be filled. Saying "write N/A" gives the model a way out that is not a guess.
The quote-and-flag rule handles the ambiguous middle. Real documents say things like "from $12, depending on seat count". A model asked to normalise that will pick $12 and drop the condition. Requiring the quote preserves the condition and marks it for a human.
The Source column makes the output auditable. Without it, verification means re-reading the document against every row. With it, you can spot-check five rows and see whether the model is anchoring to real text or inventing structure.
What the format block prevents
Left unconstrained, models add value that costs you time:
- A summary paragraph before the table, which you then have to strip programmatically.
- Extra columns it decided were useful, breaking your parser.
- Unit conversions, so $12/mo quietly becomes $144/yr in the wrong column.
- Merged cells or nested bullets inside a cell, which most table parsers read as one broken row.
- Rows for products that were not in the document.
Naming the columns and forbidding text outside the table is cheaper than cleaning up after it.
Five checks worth running on any extracted table
- Row count. Does it match the number of tiers or items in the source, not the number of sections?
- Sum test. If the document states a total, does the column add up to it?
- N/A count. Zero N/A values on a dense document usually means the model guessed. Read the emptiest section first.
- Source spot check. Pick the three rows you care about most and confirm the quoted section actually contains the number.
- Type check. Prices numeric, dates in one format, no range where a single value was promised.
If any of these fail, do not re-prompt with "be more careful". Re-prompt with the specific cell, the source sentence, and the guardrail that was violated.
When this still fails
Three cases resist any prompt:
- Merged cells in scanned PDFs. The model sees text in reading order, not grid position. Extract to a real table first.
- Values only in images or charts. The model will read the axis labels and interpolate. Treat those cells as N/A and fill them by hand.
- Very long documents. Past a certain length, retrieval degrades and the guardrail gets ignored. Split by section and re-run per section.
The template, as a tool
If you want the three blocks generated for your own task, I built a free prompt builder that assembles them with one click and lets you choose a table, JSON, or checklist output. It runs in your browser, no signup:
https://dolit-kr.netlify.app/en/prompt-architect.html
The same hub has a token cost calculator for deciding whether that extraction pipeline should run on a subscription or on raw API billing:
https://dolit-kr.netlify.app/en/
Boring prompt structure beats clever prompt wording. The guardrail that says what to do when data is missing is usually the line that decides whether the table is usable.
Top comments (0)