FACTS: Table Summarization via Offline Template Generation with Agentic Workflows

Ye Yuan, Mohammad Amin Shabani, Siqi Liu

TL;DR

FACTS (Fast, Accurate, and Privacy-Compliant Table Summarization) is an agentic framework that generates reusable "offline templates"—combinations of SQL queries and Jinja2 formatting—to summarize tabular data. By decoupling the summarization logic from the raw data, it achieves state-of-the-art accuracy while ensuring sensitive information never leaves local servers and enabling near-instant scaling to massive datasets.

What Problem Does This Paper Address?

Summarizing tables based on specific user queries (e.g., "Summarize the gross income for each year in this 10-year dataset") is surprisingly difficult for AI.

Current approaches generally fall into two traps:

  1. The Privacy & Scale Trap: Prompt-based methods send the entire table to a Large Language Model (LLM). This is slow, expensive, hits "token limits" for large tables, and—most importantly—exposes sensitive data to external API providers.
  2. The Reasoning Trap: Direct text generation often leads to "hallucinations" where the AI makes up numbers or fails at basic math.

Furthermore, most existing systems are "one-and-done." If you have 100 tables with the same structure (like monthly bank statements), current systems re-process every single one from scratch, wasting time and money.

Methods

The authors introduce FACTS, an agentic workflow that shifts the heavy lifting from "data processing" to "logic generation." Instead of asking an LLM to read a table, FACTS asks the LLM to write a template for how to read any table with that specific schema.

The workflow consists of three stages:

  1. Schema-Guided Specification: The agent looks at the table headers (not the data) and generates clarifying questions and filtering rules to pin down exactly what the user wants.
  2. SQL Query Generation: The agent synthesizes SQL queries to extract the necessary facts. These are executed locally against the data to ensure they work.
  3. Jinja2 Template Generation: The agent creates a Jinja2 template (a standard web-dev tool) that takes the SQL results and "fills in the blanks" to create a natural language narrative.

The "LLM Council": To ensure these templates are perfect, FACTS uses an ensemble of different models (e.g., GPT-4o, Claude, DeepSeek) that act as a "council." They vote on the quality of each step and provide iterative feedback until the code is bug-free.

Datasets

The framework was evaluated on three major benchmarks:

  • FeTaQA: Wikipedia-based tables paired with short factual summaries.
  • QTSumm: Wikipedia tables requiring longer, paragraph-style narrative summaries.
  • QFMTS: A challenging multi-table dataset that requires joining information across different schemas.

Key Insights and Ideas

  • Decoupling Logic from Data: This is the core "aha" moment. You don't need to see the actual numbers in a "Salary" column to write the SQL query SELECT SUM(Salary). By only sending the schema (column names and types) to the LLM, the system becomes inherently privacy-compliant.
  • Write Once, Run Anywhere: Because the output is a template (SQL + Jinja2), it is reusable. Once FACTS generates a template for a specific query on a specific schema, you can apply it to thousands of similar tables instantly without ever calling an LLM again.
  • Execution-Guided Refinement: By running the generated SQL locally and feeding error messages back to the "Council," the system achieves a 100% SQL pass rate, virtually eliminating the syntax errors common in single-shot AI coding.

Key Results

  • Superior Accuracy: FACTS consistently outperformed baselines like DirectSumm and SPaGe across all three datasets in terms of BLEU, ROUGE-L, and METEOR scores.
  • Perfect Robustness: While "Single-Call" LLM methods had a SQL success rate of ~83%, FACTS achieved 100% due to its iterative refinement loop.
  • Flat Scalability: In tests where table size increased from 100 to 1,000 rows, the runtime for FACTS remained flat, whereas competing methods saw their costs and processing times skyrocket as they tried to "read" more rows.
  • Massive Speedup: For recurring queries across 100 tables, FACTS was significantly faster because it only performed the expensive LLM "thinking" once.

Limitations and Future Work

  • Schema Dependency: The system relies heavily on clear column names. If a table has cryptic headers (e.g., "Col_A", "Col_B"), the agent might struggle to generate accurate SQL without more context.
  • SQL-Centric: The current implementation is optimized for relational data. Handling highly unstructured "tables" or those requiring complex Python-based data science libraries (beyond SQL) is a potential area for expansion.
  • Future Directions: The authors suggest exploring how this "offline template" approach could be applied to even more complex multi-table reasoning and cross-database summarization.

Summary updated

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 Jinja$2$ 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.
BibTeX
@inproceedings{yuan2026facts,
  author = {Ye Yuan and Mohammad Amin Shabani and Siqi Liu},
  title = {{FACTS: Table Summarization via Offline Template Generation with Agentic Workflows}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.findings-acl.453},
}

Loading related content...

Figure