Blogg

Using AI on PDFs and Long Documents

One of the most reliable AI tasks — with one mistake that costs people. Where to put your question, and the instruction that prevents invention.

4 min läsning

Det här inlägget har ännu inte översatts till ditt språk — visar engelska-versionen.

Handing a model a long document and asking questions about it is one of the most reliably useful things AI does. It is also where a specific, avoidable mistake costs people the most.

Why this works better than most AI tasks

When you paste a document, you have removed the gap the model would otherwise fill with invention. It is not recalling — it is reading something in front of it.

That makes document work substantially more reliable than general questions, and it is why "give it the material" is the most repeated advice in every guide worth reading.

The mistake that costs people

Putting your question before the document.

Both major model families weight later instructions more heavily. A question buried above forty pages of contract gets less attention than the same question placed after it.

Structure every document prompt this way:

  1. Brief context — what this is
  2. The document
  3. Your question
  4. Any constraints on the answer

The reordering alone measurably improves results, and almost nobody does it.

The instruction that prevents invention

Add this, always:

Answer only from the text below. If the answer is not in it, say "not covered" — do not infer or fill gaps.

Without it, a model asked about something absent from the document will produce a reasonable-sounding answer anyway, because that is what it does when information is missing. With it, you get an honest "not covered", which is the answer you actually needed.

What it handles well

  • Summarising for a decision"under 200 words, for someone who has to decide about this; lead with the decision, not the background"
  • Extraction into a table — obligations, dates, amounts, parties, action items
  • Finding specific provisions"where does this mention renewal terms?"
  • Comparing two documents"what changed between these versions?"
  • Explaining dense material — legal or technical text in plain language
  • Drafting questions"what should I ask before signing this?"

That last one is underrated. You do not have to trust its analysis to benefit from its list of things to check.

What goes wrong

Scanned PDFs. If the text is an image, the model may see nothing or see OCR errors. Check you can select the text before relying on the answer.

Tables and multi-column layouts. Column order is frequently mangled during extraction. Verify any figure you take from a table against the original.

Very long documents. Past the context window, the earliest content silently drops out. The model will still answer, based on what remains, with no indication that it lost the beginning.

Footnotes, headers and page furniture interleaved into the text, producing odd fragments mid-sentence.

Arithmetic across a document. Summing figures from a spreadsheet or a table is unreliable. Extract them, then use a calculator.

Working with something too long

Three approaches, in order of preference:

  1. Extract the relevant section first and give it only that. Best answers.
  2. Chunk it — analyse in sections, then summarise the summaries. Watch for things that span a boundary.
  3. Use a long-context model and accept that recall in the middle is weaker than at the start or end.

If a specific detail matters, find it and paste it. Do not trust retrieval across a hundred pages for something that has consequences.

Where to be careful

Legal, medical and financial documents are exactly where this is most tempting and most dangerous — not because the model is worse at them, but because you are less able to spot an error, and the consequences are larger.

Use it to understand and to generate questions. Do not use it to conclude.

Common questions

Can AI read PDFs? Yes, if the text is selectable. Scanned images need OCR first, and OCR errors propagate silently.

How long a document can it handle? Depends on the model's context window. Past it, the earliest content drops out without warning.

Is it accurate on documents? More reliable than general questions, because the material is in front of it. Still verify figures and anything from a table.

How do I stop it inventing details? "Answer only from the text below; if it is not there, say so." The single most effective document instruction.

Can it compare two documents? Yes, and it is one of the better uses — provided both fit in context.

Can it do maths on the numbers? Not reliably. Extract the figures, then calculate them yourself.

Should I use it for contracts? To understand one and to generate questions, yes. To decide whether to sign, no.

Ask questions of your own files

Summaries, extraction and comparison.

Upload a document