The Table Says Otherwise: Testing LLMs with Counterfactual Relational Data

Xinzhi Wang, Chunwei Liu · 2026

Read The Table Says Otherwise: Testing LLMs with Counterfactual Relational Data by Xinzhi Wang, Chunwei Liu (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2606-23667.txt.

Introduction

Wang and Liu test whether language models answer questions from a given table or from memory, in a 2026 paper on database question answering. Models now answer natural language questions over structured tables. When a table holds familiar real world facts, a correct answer might come from reading the table or from recalling pretraining knowledge. For database work the table must be the source of truth, since values may be private or hypothetical.

Their benchmark, ContraTable, pairs two databases with the same schemas and links. One holds real facts about countries, clubs, and players. The other changes selected attributes while keeping the structure identical. Two hundred fourteen matched questions span simple lookups, multi table joins, and reasoning over time. Strong models handle direct lookups well, but reliability falls as joins and comparisons grow. The accuracy gap shows models leaning on what they already know whenever table evidence clashes with familiar facts.

Catalog record

CREATORXinzhi Wang, Chunwei Liu
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE24 KB
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2606.23667

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

The Table Says Otherwise: Testing LLMs with Counterfactual Relational Data Xinzhi Wang, Chunwei Liu Abstract . Large language models (LLMs) are increasingly used to answer natural-language questions over structured data. However, when a table contains familiar real-world facts, it is unclear whether the model answers by reading the provided data or by recalling knowledge learned during pretraining. This distinction is important for database applications, where the provided tables should be the source of truth. In this paper, we introduce ContraTable , a paired original–counterfactual benchmark for evaluating whether LLMs ground their answers in relational tables. We build the benchmark with two aligned versions: an original database with real-world facts and a counterfactual database that preserves the same schemas, identifiers, and relationships while changing selected country, club, and player attributes. We design 214 matched questions across three levels: single-table lookup, multi-table lookup, and multi-table temporal reasoning. Experiments on commercial closed-source and open-source models show that strong instruction-tuned models can often handle direct lookup, but their reliability drops as questions require joins, comparison, and temporal reasoning. The gap between original and counterfactual accuracy reveals that models may fall back on prior knowledge when table evidence conflicts with familiar facts. These results suggest that table-QA evaluation should measure not only accuracy, but also faithfulness to the provided database. † † authors: . VLDB Workshop Reference Format: VLDB 2026 Workshop: NOVAS. † † This work is licensed under the Creative Commons BY-NC-ND 4.0 International License. Visit https://creativecommons.org/licenses/by-nc-nd/4.0/ to view a copy of this license. For any use beyond those covered by this license, obtain permission by emailing [email protected] . Copyright is held by the owner/author(s). Publication rights licensed to the VLDB Endowment. Proceedings of the VLDB Endowment. ISSN 2150-8097. VLDB Workshop Artifact Availability: The source code, data, and/or other artifacts have been made available at https://github.com/AuroraWXZ/LLM_understand_table . 1. Introduction Large language models (LLMs) are increasingly used as natural-language interfaces to data. Prior work has studied question answering over free-form documents and images ( 20 ; 13 ; 1 ; 15 ) , while recent data-management systems and benchmarks explore how LLMs can help users interact with structured and semi-structured data ( 19 ; 12 ; 10 ; 24 ; 23 ; 2 ; 27 ; 4 ; 7 ; 26 ) . A simple and flexible approach is to provide a small set of related tables and ask questions in natural language, avoiding the need to write SQL. However, this setting raises a key question: when an LLM answers a table-based question, does the answer come from the provided tables or from knowledge learned during pretraining ( 9 ; 21 ) ? This distinction is important for database applications, where the provided data should be the source of truth. Table values may be private, local, recently updated, or hypothetical, and may intentionally differ from public knowledge in settings such as simulation, what-if analysis, data cleaning, or testing. If an LLM replaces table evidence with familiar facts from pretraining, it may produce an answer that sounds plausible but is wrong with respect to the database. Existing table question-answering benchmarks make this behavior hard to isolate, because many are built from real-world entities that may already appear in pretraining data ( 19 ; 12 ; 10 ; 2 ; 27 ; 4 ) . As a result, benchmark accuracy can mix two abilities: reasoning over the given tables and recalling world knowledge. A high score may therefore overestimate how faithfully a model follows the provided tables. To separate these two abilities, we draw inspiration from knowledge-editing research, where counterfactual facts are used to test whether a model follows newly provided information or returns a familiar real-world answer ( 16 ; 17 ; 8 ; 5 ) . We adapt this idea from isolated facts to relational databases. Instead of changing a single statement, we construct a counterfactual database that preserves the original schema, identifiers, and relational structure, while replacing selected values with valid conflicting values. This design lets us compare model behavior when the table agrees with real-world knowledge and when it conflicts with it. In this paper, we introduce ContraTable , a paired original–counterfactual benchmark built from a football transfer-market database. This domain is well suited for our goal: many facts about countries, clubs, and players are likely to be known by LLMs ( 9 ; 21 ) , while the database also contains rich relational and temporal structure through players, clubs, countries, competitions, games, appearances, and transfers. The original database contains real-world facts. The counterfactual database keeps the same schemas and relationships, but changes selected attributes such as country capitals, continents, confederations, club countries, domestic competitions, stadiums, player citizenship, birth information, preferred foot, height, and date of birth. The reference answer always follows the provided database. We organize questions into three levels, from single-table lookup to joins and temporal reasoning, to test how grounding changes with reasoning difficulty. We evaluate both commercial closed-source models and open-source models. Our results show that strong instruction-tuned models can often handle direct lookup questions, even when the table contains counterfactual values. However, as questions require joins, comparison, and temporal reasoning, the gap between original and counterfactual accuracy becomes larger. This counterfactual gap suggests that models become less faithful to the provided database when the reasoning path is harder and the table conflicts with familiar knowledge. Stronger models and instruction tuning improve overall accuracy, but they do not fully remove this effect. In summary, this paper makes the following contributions: • We introduce ContraTable , a paired original–counterfactual benchmark for testing whether LLMs follow tables or prior knowledge. • We build a consistent counterfactual football database that preserves structure while changing selected real-world facts. • We design questions spanning lookup, joins, and temporal reasoning to study grounding under increasing complexity. • We show across commercial and open-source LLMs that table grounding weakens as reasoning paths become more complex. 2. Related Works Prior work on table question answering evaluates capabilities such as cell lookup, fact verification, numerical operations, and compositional reasoning over structured data. Recent studies directly serialize tables for general-purpose LLMs and show that they can perform competitively on established table-QA benchmarks, particularly with few-shot or chain-of-thought prompting ( 3 ) . However, performance is sensitive to factors such as table format, row order, prompt design, and table size ( 22 ) . Moreover, because these benchmarks commonly contain real-world entities and facts, answer accuracy may conflate reasoning over the supplied table with factual knowledge recalled from pretraining. Related QA research distinguishes knowledge stored in model parameters from evidence supplied in the input. 14 show that models may prefer memorized answers when contextual evidence conflicts with their parametric knowledge . DisentQA further uses counterfactual passages to separate answers derived from these two sources ( 18 ) . These studies motivate conflict-based evaluation as a test of grounding, but primarily consider unstructured textual contexts rather than relational tables. Knowledge-editing research provides the closest methodological precedent. ROME introduced CounterFact, which uses counterfactual fact associations to evaluate editing success, generalization, and specificity ( 16 ) . CounterFact+ subsequently strengthened the benchmark by dynamically testing unintended effects on related model outputs ( 11 ) . Later benchmarks examine more complex consequences: MQuAKE tests

Read the complete text