The Evolution of Table Question Answering
Most existing benchmarks for "Table Question Answering" (Table QA) are surprisingly shallow. They typically ask models to perform simple factual retrieval—such as "What was the revenue in Q3?"—or basic arithmetic. However, real-world data analysis is fundamentally application-driven.
If a manager asks, "Is our shop practicing age discrimination?", an AI cannot simply look up a single cell. It needs to analyze distributions, compare groups, and provide strategic interpretations based on the data. The challenge is that high-quality, expert-annotated data for these complex tasks is prohibitively expensive to collect. Furthermore, standard Large Language Models (LLMs) often struggle to bridge the gap between raw tabular data and the high-level reasoning required to provide genuinely helpful advice.
To address this, researchers have introduced DACO, a novel framework and dataset designed to shift AI from simple table-based question answering toward complex, multi-step data analysis. By leveraging LLMs to generate Python code for statistical processing and employing a unique fine-grained Reinforcement Learning from Human Feedback (RLHF) approach, DACO creates a system capable of providing human-like insights and strategic suggestions rather than just raw numbers.
The DACO Methodology
The authors propose a multi-stage approach to automate the creation of a high-quality analysis pipeline:
- Dataset Construction: The team collected 440 real-world databases (sourced from Spider and Kaggle, covering 160 topics) and used GPT-4 to generate approximately 2,000 complex, role-based queries.
- Code-Augmented Analysis: Instead of asking the LLM to guess the answer, the framework uses a multi-turn prompting strategy. The model writes Python code (using libraries like
pandas), executes it, observes the output, and then reasons about the next step. - Human-in-the-Loop Refinement: Researchers curated a "gold standard" test set of 100 samples (Test-H) where human annotators filtered and refined the best machine-generated insights into cohesive reports.
- Fine-grained RLHF (FG-RLHF): To train smaller, open-source models (like CodeGeeX2-6B), the team utilized RLHF with two novel reward models:
- Contribution RM: Rewards intermediate code steps that actively help reach the final answer.
- Regularization RM: Prevents "reward hacking," where a model might generate verbose but useless code just to appear busy.
Key Insights and Results
The DACO framework reveals several important insights about how AI handles structured data:
- Code as the Reasoning Bridge: For structured data, code generation isn't just a feature; it is the primary mechanism for reasoning. It allows the model to handle scale and complexity that would exceed its context window if it tried to read an entire database table directly.
- The "Helpfulness" Gap: Even GPT-4, the current state-of-the-art, was rated as less helpful than human-refined analysis in 58.1% of cases. This suggests that while AI excels at mathematical computation, it still struggles with the nuance of strategic, business-level suggestions.
- Fine-Grained Rewards Matter: Standard RLHF often only rewards the final output. By rewarding the process (individual code steps), the authors significantly boosted the model's ability to focus on the user's specific query. The reward models successfully learned to favor specific Python functions like
nlargest()andsort_values()—which extract significant features—while penalizing generic calls likedescribe()that don't directly answer the user's question.
In terms of performance, GPT-4 enhanced with code generation remains the top performer, achieving a helpfulness score of 50.79 on the automated test set. However, the fine-tuned 6B model (FG-RLHF) outperformed ChatGPT (without code generation) and significantly beat standard Supervised Fine-Tuning (SFT) models. In pairwise comparisons, the FG-RLHF model achieved a 57.72% win rate over the SFT baseline, proving that the fine-grained reward system successfully aligned the model with human-perceived helpfulness.
Limitations and Future Work
The authors acknowledge that evaluating "helpfulness" is inherently subjective. Using LLMs to evaluate other LLMs can also introduce biases. Additionally, while the model generates highly useful insights, human annotators did not fully verify the mathematical correctness of every single generated value, focusing instead on the overall utility of the analysis.
Future work will likely involve more advanced "agentic" designs. These could include models capable of creating their own tools or performing self-reflection to correct errors in their own code logic before presenting the final analysis to the user.
Summary updated