PLOG: Table-to-Logic Pretraining for Logical Table-to-Text Generation

Ao Liu, Haoyu Dong, Naoaki Okazaki, Shi Han, Dongmei Zhang · DOI

Abstract

While modern language models demonstrate high fluency in data-to-text generation, they frequently suffer from logical hallucinations, producing descriptions that are factually inconsistent with the underlying tabular data. This paper presents PLOG (Pretrained Logical Form Generator), a framework that addresses this gap by introducing an intermediate pretraining stage focused on logical reasoning. By training models to map tables to unambiguous logical forms using large-scale synthetic data, PLOG significantly enhances the logical fidelity of the resulting natural language descriptions.

1. Introduction

Generating natural language from structured data, such as tables, is a cornerstone of automated reporting and data analysis. However, the transition from a 2D grid of values to a coherent narrative requires more than linguistic fluency; it requires logical inference. Current state-of-the-art models like BART and T5 often fail this requirement, producing "fluent nonsense"—sentences that sound grammatically perfect but contain factual errors regarding the data they describe.

To mitigate these hallucinations, we introduce PLOG. The core philosophy of PLOG is to teach the model how to reason about table structures through a formal logic intermediate before tasking it with natural language generation. This approach bridges the gap between raw data and truthful storytelling.

2. The Challenge of Logical Table-to-Text

Logical table-to-text generation is difficult for two primary reasons:

  1. Semantic Ambiguity: Natural language is inherently imprecise. A single sentence can map to multiple logical interpretations, making it a noisy signal for a model attempting to learn mathematical or comparative operations.
  2. Data Scarcity: Manually annotating tables with complex, logically sound descriptions is labor-intensive and expensive. Consequently, existing datasets are often too small to teach deep neural models the nuances of multi-step reasoning (e.g., filtering, counting, and comparing).

3. The PLOG Framework

PLOG employs a two-stage training pipeline designed to instill a robust understanding of logic before the final generation task.

3.1 Table-to-Logic Pretraining

In the first stage, the model is trained to generate a structured logical form (a mini-program) from a table. To overcome data scarcity, the researchers utilized Execution-Guided Sampling. By taking logical templates and executing them against thousands of tables, they identified valid table-logic pairs. If a template (e.g., "Which row has the maximum value in column X?") returned a valid result, the pair was added to the synthetic pretraining corpus, which eventually comprised between 426k and 800k examples.

3.2 Numerical Pre-Computation

To assist the model with complex operations, PLOG incorporates numerical pre-computation. This involves augmenting the table input string with auxiliary information, such as row ranks (e.g., 1st, 2nd) and aggregate statistics (sums, averages). This reduces the computational burden on the transformer layers, allowing them to focus on high-level reasoning.

3.3 Task-Specific Finetuning

Following pretraining, the model is finetuned on standard table-to-text benchmarks. During this phase, the model learns to translate its internal logical understanding into fluent natural language. Notably, even if the model does not explicitly generate a logical form during final inference, the pretraining phase fundamentally alters its perception of tabular structures.

4. Experimental Evaluation

4.1 Datasets

The framework was evaluated on two primary benchmarks:

  • LOGICNLG: A standard dataset for logical table-to-text generation based on Wikipedia tables.
  • CONTLOG: A new "Controlled Logical" dataset introduced by the authors. Derived from LOGIC2TEXT, it provides specific "highlighted cells" as hints to ensure the model focuses on specific facts, thereby reducing uncontrollable content selection.

4.2 Model Performance

The researchers compared T5 and BART architectures. A key finding was that T5-large was significantly more adept at learning the rigid syntax of logical forms than BART-large, which frequently produced syntax errors (e.g., mismatched brackets). However, both architectures showed marked improvement in the final text generation task after logical pretraining.

5. Key Results

  • Improved Fidelity: On the LOGICNLG benchmark, PLOG (T5-large) improved logical accuracy—measured by TAPEX-Acc—by approximately 10% over the standard T5-large baseline.
  • Human Evaluation: Human judges rated PLOG-generated sentences as "Correct" significantly more often than baseline models. On the CONTLOG dataset, PLOG achieved a 79% accuracy rate according to human assessment.
  • Fluency Preservation: Despite the rigorous focus on logic, PLOG maintained or slightly improved BLEU scores, indicating that logical grounding does not come at the expense of writing quality.

6. Discussion and Limitations

While PLOG represents a significant step forward, several challenges remain. The serialization of 2D tables into 1D strings remains a bottleneck for very large tables due to token limits. Additionally, the current framework is constrained to seven logic types (e.g., count, superlative, comparative). Extending the model to handle more complex operations like medians or standard deviations would require expanding the logical schema.

7. Conclusion

PLOG demonstrates that teaching AI to "think" in formal logic before it "speaks" in natural language is a powerful strategy for reducing hallucinations in data-to-text tasks. By using logic as a universal intermediate, PLOG provides a scalable roadmap for developing more reliable and factually accurate automated reporting systems.

Summary updated

BibTeX
@inproceedings{liu2022plog,
  author = {Ao Liu and Haoyu Dong and Naoaki Okazaki and Shi Han and Dongmei Zhang},
  title = {{PLOG: Table-to-Logic Pretraining for Logical Table-to-Text Generation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2022},
  doi = {10.18653/v1/2022.emnlp-main.373},
}
Figure