Notes

Document Question Answering

Ask a question, get an answer drawn from a specific set of documents rather than from whatever the model absorbed during training. Document question answering is that application — the insurance policy, the 80-page contract, the equipment manual, the quarter's filings — and it is where "the model sounds confident" and "the model is right" come apart most expensively.

Two ways to get the text in

Either retrieve the relevant passages and place them in the prompt, which is a RAG pipeline and scales to a corpus no context window could hold; or put the whole document into the context window of a long-context model, which removes retrieval error altogether but pays for every token on every question and degrades on material buried in the middle of a very long input.

What makes it hard
  • Scattered answers: a clause in section 3 has to be combined with a definition in the appendix before the answer is correct.
  • Messy sources: tables, figures and scanned PDFs, where text extraction sets the ceiling before the model sees anything.
  • Absent answers: when the documents do not cover the question, the correct output is "not stated here", and a fluent invention is the failure that gets these systems withdrawn.
How it is judged

Fluency counts for nothing here; groundedness is everything. A deployed system is measured on whether each claim traces to a cited span a human can open and check, and on how reliably it refuses. That is why citation and attribution are built into the pipeline rather than bolted on, and why evaluation sets for this work deliberately include questions with no answer at all.

Document question answering answers a user's question from a supplied document set rather than from the model's trained-in knowledge, either by retrieving the relevant passages into the prompt or by placing a whole document in a long context window. It is judged on groundedness — whether every claim traces to a citable span — and on correctly refusing questions the documents do not cover. Contracts, policies, manuals and filings are the typical material, where a confident wrong answer carries real cost.

Imagine handing a sharp new assistant a thick folder and asking, "does this policy cover flood damage?" You want the answer and the page it came from, not a guess. Document question answering is software that does exactly that: it searches your own documents, reads the relevant parts, and answers from them. Two habits make it genuinely useful. It shows you where the answer came from, so you can check it yourself. And it says "that isn't in here" instead of inventing something reassuring. The second habit is much harder to build than the first, and it is what separates a helpful assistant from a liability.