TLDR: A research paper details the MRT system, an AI-powered approach that uses Large Language Models to generate Python code for answering questions from large, complex tables. The system, which achieved 85% accuracy in a recent competition, breaks down the problem into multiple steps, including intelligent column selection, natural language instruction generation, and custom code functions, making it more robust and explainable for handling real-world tabular data.
In the rapidly evolving field of Artificial Intelligence, making sense of vast amounts of data is a constant challenge. One particularly complex area is “Table Question Answering” (TQA), where AI systems are tasked with finding answers to questions directly from structured tables, much like you might query a database. This task becomes even more daunting when dealing with very large tables that contain millions of records and numerous columns, often exceeding the processing capacity of even the most advanced Large Language Models (LLMs).
Understanding the Challenge of Table Question Answering
Traditional Natural Language Processing (NLP) methods and even modern LLMs face limitations when trying to process entire tables as context. This is because tables can be incredibly dense with information, leading to what’s known as a “context limitation” for LLMs. Imagine trying to fit an entire library into a small backpack – it’s just not feasible. This challenge is further complicated by the heterogeneity of real-world data, which is often less structured and more complex than academic datasets.
Introducing MRT: A Multi-Step Approach
To tackle these issues, researchers from Gradiant in Spain have developed an improved system called MRT (Maximizing Recovery from Tables with Multiple Steps). This system, detailed in their paper “MRT at IberLEF-2025 PRESTA Task: Maximizing Recovery from Tables with Multiple Steps”, is designed to answer questions from tables by generating and executing Python code. Unlike “end-to-end” solutions that try to do everything at once, MRT uses a sequential, “divide-and-conquer” strategy, breaking down the problem into smaller, manageable steps.
The core idea behind MRT is to use LLMs to generate Python code that can filter and process table data. The process begins with a “column descriptor” module that analyzes the table’s columns, understanding their content and data types. Next, an “explainer” module generates natural language instructions based on this analysis, outlining the steps needed to answer the question. These instructions are then translated into Python code by the “coder” module, which is subsequently executed by the “runner.” If errors occur during execution, the system can loop back to the coder to refine the code. Finally, an “interpreter” and “formatter” module extract and present the answer in the desired format.
A significant advantage of this multi-step approach is its explainability. Because each step is distinct, it’s easier to debug and understand why a particular answer was given or why an error occurred, offering greater transparency compared to black-box systems.
Addressing New Hurdles in the PRESTA Task
The MRT system was specifically adapted for the IberLEF 2025 PRESTA task (Questions and Answers about Tables in Spanish), which presented new and tougher challenges compared to previous tasks like SemEval. These challenges included tables with a much larger number of columns (averaging 174.1 columns compared to 24.8 in SemEval), ambiguous column names, and columns containing mixed data types (e.g., numbers and text in the same column).
Key Innovations in MRT for IberLEF 2025
To overcome these new obstacles and improve upon its previous version, MRT introduced several key features:
Smart Column Selection
A new “column selector” module was added to intelligently filter out irrelevant columns before feeding them to the LLM. This prevents the LLM from being overwhelmed by massive prompts, which could lead to errors or inefficient processing. It iteratively asks an LLM to identify potentially relevant columns, ensuring that crucial information isn’t missed while reducing prompt size.
Clearer Instructions for LLMs
The system now generates natural language instructions in a structured JSON format, making them more precise. It also includes a “clarification instruction” mechanism that corrects misspelled column names using techniques like Levenshtein distance and informs the LLM about the exact format of values in the database. For example, if a question mentions “January” but the table has “Enero,” the system clarifies this discrepancy, making the code generation more accurate. It also adds information about column types and example values to further assist the code generation process.
Pre-built Code Functions
Recognizing that LLMs sometimes struggle with complex coding patterns or make common mistakes (like misusing group_by), MRT now uses a set of pre-coded, generic Python functions. These functions handle common data tasks like counting occurrences or filtering data based on numerical conditions. By providing these “tools,” the LLM can focus on orchestrating the overall logic rather than generating every line of code from scratch, significantly reducing errors and improving efficiency.
Handling Data Variations with Fuzzy Matching
To address inconsistencies and typographical errors in categorical values (e.g., “item” vs. “items” or “iTem”), MRT incorporates “fuzzy matching” techniques. This means that if an exact match for a value isn’t found, the system can identify and use values that are very similar based on a defined similarity threshold. This makes the system more robust to real-world data variations and reduces false positives and negatives during data processing.
Performance and Insights
The MRT system achieved an impressive accuracy score of 85% in the IberLEF 2025 PRESTA task. While the validation set showed some variability, the test set results were consistently strong, particularly for boolean and numerical answers. Manual error analysis revealed that the primary sources of errors were issues with generating correct natural language instructions and occasionally removing relevant columns during the initial filtering stage. However, the new features significantly reduced common problems like wrong cell filtering and code exceptions seen in previous versions.
An ablation study, which involved testing the system with individual features turned off, showed that while the overall score differences were small due to the dataset’s size, the column selector module had a positive impact on execution time, making the system much faster.
Also Read:
- Unlocking Transparency in Table Question Answering with Code
- New RAG Framework Boosts AI’s Understanding of Enterprise Data
Looking Ahead
The researchers conclude that MRT offers an effective and explainable approach to table question answering, leveraging the power of LLMs for code generation. The system’s modular design allows for easy debugging and understanding of its decision-making process. Future work aims to test the system on even larger and more diverse datasets to further validate the impact of its innovative features and gain deeper insights into its performance across various scenarios.


