Abstract
Query-focused table summarization requires generating natural language summaries of tabular data conditioned on a user query, enabling users to access insights beyond fact retrieval. Existing approaches face key limitations: table-to-text models require costly fine-tuning and struggle with complex reasoning, prompt-based LLM methods suffer from token-limit and efficiency issues while exposing sensitive data, and prior agentic pipelines often rely on decomposition, planning, or manual templates that lack robustness and scalability. To mitigate these issues, we introduce an agentic workflow, FACTS, a Fast, Accurate, and Privacy-Compliant Table Summarization approach via Offline Template Generation. FACTS produces offline templates, consisting of SQL queries and Jinja2 templates, which can be rendered into natural language summaries and are reusable across multiple tables sharing the same schema. It enables fast summarization through reusable offline templates, accurate outputs with executable SQL queries, and privacy compliance by sending only table schemas to LLMs. Evaluations on widely-used benchmarks show that FACTS consistently outperforms baseline methods, establishing it as a practical solution for real-world query-focused table summarization.
Introduction
Summarizing tables based on specific user queries—such as "Summarize the gross income for each year in this 10-year dataset"—is a complex task for current AI systems. Traditional approaches typically fall into two categories, both with significant drawbacks. First, prompt-based methods often send entire tables to Large Language Models (LLMs), which is slow, expensive, and risks exposing sensitive data to external providers. Second, direct text generation frequently leads to hallucinations, where models miscalculate or invent data points.
FACTS (Fast, Accurate, and Privacy-Compliant Table Summarization) addresses these issues by decoupling summarization logic from the raw data. Instead of processing data directly, it generates reusable "offline templates."
The FACTS Framework
The core innovation of FACTS is an agentic workflow that shifts the focus from data processing to logic generation. By asking an LLM to write a template for how to read any table with a specific schema, the system avoids the pitfalls of direct data exposure.
The workflow proceeds through three distinct stages:
- Schema-Guided Specification: The agent analyzes table headers (not the data itself) to generate clarifying questions and filtering rules, ensuring the user's intent is precisely captured.
- SQL Query Generation: The agent synthesizes SQL queries to extract necessary facts. These queries are executed locally against the data to verify their correctness.
- Jinja2 Template Generation: The agent creates a Jinja2 template that formats the SQL results into a natural language narrative.
To ensure high-quality outputs, FACTS employs an LLM Council—an ensemble of models that vote on each step and provide iterative feedback until the generated code is bug-free.
Key Insights
- Privacy by Design: By only sending the table schema (column names and types) to the LLM, FACTS ensures that sensitive data never leaves the local environment.
- Reusability: Once a template is generated for a specific query and schema, it can be applied to thousands of similar tables instantly without further LLM calls.
- Execution-Guided Refinement: Local execution of generated SQL allows the system to feed error messages back to the LLM Council, achieving a 100% SQL pass rate and eliminating syntax errors common in single-shot AI coding.
Evaluation and Results
FACTS was evaluated on three major benchmarks: FeTaQA (factual summaries), QTSumm (narrative summaries), and QFMTS (multi-table reasoning).
- Accuracy: FACTS consistently outperformed baselines like DirectSumm and SPaGe across all three datasets in terms of BLEU, ROUGE-L, and METEOR scores.
- Scalability: Unlike competing methods where costs scale with table size, FACTS's processing time remains flat as table rows increase because the LLM only analyzes the schema once.
- Robustness: The iterative refinement loop allowed FACTS to reach 100% SQL success, compared to approximately 83% for single-call LLM methods.
Conclusion
FACTS provides a robust, scalable, and privacy-compliant solution for query-focused table summarization. By generating reusable offline templates through an agentic workflow, it overcomes the token limits and privacy concerns of traditional LLM approaches. Future work will explore expanding this framework to handle unstructured tables and more complex cross-database reasoning tasks.
Summary updated