ModelRefs / Table Question Answering — AI Glossary

Table Question Answering — AI Glossary

An AI task answering natural language questions about structured tabular data (spreadsheets, HTML tables, database tables).

Overview

Table QA methods: text-to-SQL (convert question to SQL, execute against database), table linearization (flatten table rows as text, feed to LLM), and specialized table transformers (TAPAS, OmniTab). Challenged by multi-hop aggregations, implicit relationships, and ambiguous column names. Relevant for BI copilots and data analyst AI.

Reference details

Topicapplications
Last reviewed2026-06-24

How it works

  1. The table is serialised into the prompt, which is the whole method and also its constraint: a markdown or delimited rendering with a header row is what the model reads, and every cell consumes tokens.
  2. Large tables must be reduced first — column selection against the question, row filtering, or sampling — because a table that does not fit the context cannot be answered from at all.
  3. The model locates the relevant cells by matching the question's entities against headers and values. Ambiguous or abbreviated column names are the dominant source of error, since nothing else in the prompt says what a column means.
  4. Reasoning over located cells is where aggregation happens, and this is the weak point: summing a long column is arithmetic performed token by token, so accuracy falls with row count in a way that no prompt fixes.
  5. The robust pattern delegates the arithmetic instead of performing it — generate a query or a short program, execute it, and return the computed result, which makes the aggregation exact.
  6. Multi-hop questions compound both failure modes, requiring a correct lookup, a correct intermediate value, and a correct second lookup conditioned on it.

Example: Why delegating the arithmetic is not an optimisation

A question asks for the total of a 200-row column. Reading cells into the prompt and summing in-context means 200 additions performed as text generation. If each step is right with probability 0.999 — a generous assumption for token-level arithmetic — the whole sum is right with probability 0.999^200 = 0.819, so about 18% of answers are wrong, and wrong by an amount that looks plausible. At 0.995 per step it is 0.995^200 = 0.367, wrong about 63% of the time. Generating `SELECT SUM(amount) FROM t` instead moves the 200 additions to a database that performs them exactly: the model only has to get one query right, and that query is reviewable before it runs. The error rate drops from 'compounding with row count' to 'one chance to misread the question', which is a different kind of risk and a much smaller one.

Commonly confused with

Table QA is not text-to-SQL, although text-to-SQL is often the best way to implement it. Table QA is the task — answer a question about tabular data; text-to-SQL is one approach, requiring a database engine. The other approaches linearise the table into the prompt or use a table-specific encoder, and they work where no engine exists, such as a spreadsheet pasted into a chat. The practical rule follows the data: if an engine is available and the table is large, delegate; if the table is small and attached, linearise.

When to use it

Reach for it when:

  • Small to medium tables with no database behind them — uploaded spreadsheets, scraped HTML tables, report extracts.
  • Lookup and comparison questions, where the answer is in a cell or a comparison of two, and no aggregation is required.
  • Exploratory questions over heterogeneous tables whose schemas are unknown ahead of time.
  • As a layer over a query generator, where the model interprets the question and an engine computes the answer.

Reach for something else when:

  • Aggregations over many rows performed in-context, where per-step error compounds and plausible wrong totals are the normal failure.
  • Tables too large for the context window, where the reduction step decides the answer and is itself unvalidated.
  • Tables with cryptic headers and no documentation, since column meaning is not recoverable from values alone.
  • When a database and a schema exist. Then this is text-to-SQL, and the engine should do the arithmetic.

Continue your research

Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to Table Question Answering — AI Glossary.

Frequently asked questions

What is Table Question Answering?

An AI task answering natural language questions about structured tabular data (spreadsheets, HTML tables, database tables).

What concepts are related to Table Question Answering?

Closely related concepts include text to sql, data analyst ai, document qa.