T ab DSR : Decompose, Sanitize, and Reason for Complex Numerical Reasoning in Tabular Data (2025)

Abstract: Complex reasoning over tabular data is crucial in real-world data analysis, yet large language models (LLMs) often underperform due to complex queries, noisy data, and limited numerical capabilities. To address these issues, we propose TabDSR, a three-agent framework consisting of: (1) a query decomposer that breaks down complex questions, (2) a table sanitizer that cleans and filters noisy tables, and (3) a program-of-thoughts (PoT)-based reasoner that generates executable code to derive the final answer from the sanitized table. To ensure unbiased evaluation and mitigate data leakage, we introduce a new dataset, CalTab151, specifically designed for complex numerical reasoning over tables. Experimental results demonstrate that TabDSR consistently outperforms existing methods, achieving state-of-the-art (SOTA) performance with 8.79%, 6.08%, and 19.87% accuracy improvement on TAT-QA, TableBench, and CalTab151, respectively. Moreover, our framework integrates seamlessly with mainstream LLMs, providing a robust solution for complex tabular numerical reasoning. These findings highlight the effectiveness of our framework in enhancing LLM performance for complex tabular numerical reasoning.

## introduction table question answering (tqa) requires extracting and reasoning over numerical information from tabular data to produce correct answers. it has found broad application in financial tqa @xcite and mathematical reasoning with tabular data @xcite . although large language models (llms) exhibit strong general reasoning capabilities, real-world tqa remains challenging. tqa questions often demand multi-hop reasoning @xcite , involving multiple calculation steps, and visual table conversions can introduce noise, further degrading performance. recently, agent-based approaches, such step 1: converted values: 1.24, 3.71, 1.55 step 2: compute the average: @xmath0.24 + 3.71 + 1.55) / 3 = 6.1 / 3 = 2.04 step 3: final answer: 2.04 2013 2013 region general piedmont 3.09 1.24 (approx) campania 1.03 3.71 (esmated) lazio 4.33 1.55 what is the average percentage of votes for the 2013 general election across all regions? program-of-thought (pot) @xmath1.mean() @xmath2.shape[0] print(average_2013_general) chain-of-thought (cot) type error: could not convert string "1.24(approx)", "3.71(estimated)" to numeric. key error: '2013 general'. multi-level header result in errors in program column name recognition. calculation error: a computational error occurred during the reasoning process. answer error: only sub-question 1 has been answered, without addressing subquestion 2. tabdsr (ours) agent 1: query decomposer agent what is the average percentage of votes for the 2013 general election across all regions, and how many regions have a election percentage greater than 2% in the year? sub-question 1 how many regions have a election percentage greater than 2% in 2013 general? sub-question 2 agent 2: table sanitizer agent 2013 region 2013 general piedmont 3.09 1.24 campania 1.03 3.71 lazio 4.33 1.55 step 1 step 2 step 3 multi-level header merging numerical column identification cell sanitization agent 3: pot-based reasoner agent ## tabdsr task formulation the goal of table question answering (tqa) is to predict an answer a given two table strings: a table t and a question q. as illustrated in figure 2 , our tabdsr framework addresses tqa's numerical reasoning challenges via three specialized agents, each responsible for a key component of the reasoning pipeline. ## construction of caltab151 to ensure a fair evaluation that mitigates data leakage from existing public datasets, we propose an annotation framework combining llm-generated queries with human-verified answers (details in appendix b). this process culminates in a highquality numerical reasoning dataset, caltab151 , composed of 151 table samples drawn from tablebench @xcite (84), finqa @xcite , tat-qa @xcite , and aitqa @xcite . we construct caltab151 through the six steps: (1) numerical perturbation: to maintain realistic yet varied numeric values, we randomly perturb cell values @xmath3. the prompt can be seen in figure 6 . (2) cell noise addition: to simulate natural table noise, we inject context-appropriate symbols (e.g., $, c, or %) into randomly chosen numeric columns, aligned with their semantic relevance. (3) structural randomization: we enhance structural diversity by shuffling rows or columns and randomly deleting a subset of them, thereby introducing a broader range of table configurations. (4) random null value filling: to model incomplete data, we replace 2-4 cells with labels such as "none", "null", "n/a", "???", or "-". (5) multi-hop question generation: to increase question complexity, we construct an agent for generating multi-hop questions, where each question consists of multiple sub-questions, with each subsequent question depending on the answer to the previous one. the agent guides the model to generate two sub-questions and then merge them into a coherent two-hop question based on natural semantics, ensuring the coherent question is contextually relevant. the prompt can be seen in figure 5 . (6) answer annotation: finally, to ensure data accuracy, human annotators manually calculate and verify answers to all generated multi-hop questions. this multi-pronged approach produces a robust and realistic dataset that captures both the structural and semantic challenges of real-world tqa, providing a more reliable benchmark for evaluating llm-based numerical reasoning. ## conclusion we introduced tabdsr, a three-agent, promptbased framework that significantly elevates numerical reasoning in table question answering (tqa). our method consistently outperforms pre-trained models, fine-tuned llms, and other prompt-based solutions, demonstrating its effectiveness in handling complex tabular data. by decomposing multihop questions and sanitizing noisy table content, tabdsr fully harnesses the inherent numerical reasoning capabilities of llms, enhancing their performance regardless of parameter size. this work also has practical implications for various real-world domains-such as finance, business intelligence, healthcare, and e-commerce-where robust analysis of complex, noisy tabular data is critical. the prompt-based nature of tabdsr lowers barriers to adoption by reducing the need for extensive data annotation or specialized training, enabling more cost-effective and scalable deployment of powerful tqa systems. moreover, our framework's transferability across diverse model architectures highlights its potential for broader integration into enterprise workflows, data analytics platforms, and decision-support systems that require reliable, multi-step numerical calculations over large datasets. we hope these findings inspire further research and innovation in complex numerical reasoning for tqa, spurring the development of even more versatile and efficient solutions.