TableGPT2: A Large Multimodal Model with Tabular Data Integration

Aofeng Su, Aowen Wang, Chao Ye, Chen Zhou, Ga Zhang, Gang Chen, Guangcheng Zhu, Haobo Wang, Haokai Xu, Hao Chen, Haoze Li, Haoxuan Lan, Jiaming Tian, Jing Yuan, Junbo Zhao, Junlin Zhou, Kaizhe Shou, Liangyu Zha, Lin Long, Liyao Li, Pengzuo Wu, Qi Zhang, Qingyi Huang, Saisai Yang, Tao Zhang, Wentao Ye, Wufang Zhu, Xiaomeng Hu, Xijun Gu, Xinjie Sun, Xiang Li, Yuhang Yang, Zhiqing XiaoarXiv 2024 · DOI

TL;DR

TableGPT2 is a new large multimodal model designed to tackle the under-developed area of tabular data integration in AI. By introducing a novel "semantic table encoder" and training on an unprecedented scale of tabular data, TableGPT2 significantly improves performance on table-centric tasks while retaining general language and coding abilities. This advancement is crucial for unlocking the potential of the vast amount of structured data used in business intelligence and beyond.

What Problem Does This Paper Address?

While large language models (LLMs) like GPT and LLaMA have revolutionized natural language processing, their ability to effectively handle tabular data remains a significant bottleneck. This is problematic because a vast majority of real-world data, estimated at over 70%, is structured in tables (databases, spreadsheets, etc.). Current LLMs often struggle with:

  • Vacuum operation: They are typically trained on text and don't inherently integrate with external data sources like databases.
  • Inefficient serialization: Converting tables into text formats (like Markdown) for LLMs to process is token-inefficient and can lead to loss of structural information.
  • Complexity of real-world tables: Tables often have irregular structures, missing values, ambiguous column names, and require nuanced understanding beyond simple text.
  • Business Intelligence (BI) demands: BI applications require precise, adaptable solutions for data analysis, which traditional LLMs, without specialized tabular understanding, often fail to provide.

This gap limits the application of powerful LLMs in critical domains like business intelligence, where tabular data is king.

Methods

TableGPT2 builds upon the Qwen2.5 architecture and introduces several key innovations:

  • Novel Semantic Table Encoder: This is the core of TableGPT2's tabular prowess. It's designed to capture both schema-level (column names, types) and cell-level information. It uses a bi-dimensional attention mechanism to understand row and column relationships without relying on positional embeddings (which are unsuitable for tables). It also employs column-wise contrastive learning to learn structure-aware representations.
  • Table-Language Adapter: This component bridges the gap between the table encoder's output and the LLM's text embeddings. It aggregates cell-level embeddings into compact column representations, making them compatible with the LLM.
  • Hybrid Table Representation: For dynamic context integration, it uses a unified representation that combines table metadata (schemas, example values) with the learned column embeddings.
  • Continual Pretraining (CPT): The model undergoes extensive CPT, with a significant portion dedicated to code and reasoning data, to enhance its general capabilities.
  • Supervised Fine-Tuning (SFT): A massive dataset of over 2.36 million query-table-output tuples is used for fine-tuning. This dataset is carefully curated to cover a wide range of BI-specific tasks, including multi-turn conversations, complex reasoning, and tool usage.
  • Agent Framework: An integrated agent workflow is provided, featuring prompt engineering, a secure code sandbox, and an evaluation module, enabling TableGPT2 to interact with tools and perform complex data analysis tasks.

Datasets

  • Training Data:
    • Continual Pretraining: 86 billion tokens from diverse sources including Python and SQL code, general textbooks (finance, math, biology), and data analysis materials.
  • Supervised Fine-Tuning: Over 2.36 million high-quality query-table-output tuples, derived from 593.8K tables.
  • Evaluation Datasets:
    • Existing Benchmarks: A comprehensive collection including TURL, HiTab, HybridQA, WikiTableQuestion, WikiSQL, FeTaQA, TabFact, FEVEROUS, ToTTo, BIRD, Spider, and TableBench.
  • New Benchmark: RealTabBench: A newly constructed dataset focusing on more challenging, realistic BI scenarios. It features 360 complex data tables with irregular layouts, ambiguous entries, and intricate query sentences, aiming to better reflect real-world data challenges.

Key Insights and Ideas

  • Tabular data is a goldmine: The paper strongly emphasizes that tabular data is as abundant and critical as text or images, yet significantly less explored by LLMs.
  • Dedicated table encoder is crucial: Simply serializing tables into text is insufficient. A specialized encoder that understands table structure and semantics is key to unlocking performance.
  • Scale matters for tables too: Just as with text and vision models, massive datasets are essential for training robust tabular models. The scale of data used for TableGPT2 is unprecedented.
  • BI demands are unique: The paper highlights that BI tasks require more than just basic table understanding; they involve complex reasoning, multi-turn interactions, and code generation, necessitating specialized training.
  • Generalization is possible: A key finding is that TableGPT2 can achieve superior performance on table-specific tasks without sacrificing its general language and coding abilities, addressing a common trade-off in specialized models.

Key Results

  • Significant Performance Gains: TableGPT2 achieved an average performance improvement of 35.20% for the 7B model and 49.32% for the 72B model over prior benchmark-neutral LLMs across 23 benchmarking metrics.
  • State-of-the-Art on Complex Tasks: On challenging benchmarks like HiTab (hierarchically structured tables), TableGPT2 showed a substantial improvement, achieving over a 60% absolute increase in execution accuracy compared to Qwen2.5.
  • Competitive with GPT-40: On certain benchmarks, TableGPT2's performance was superior or comparable to GPT-40.
  • Robust General Capabilities: TableGPT2 maintained strong performance on general coding and language comprehension benchmarks (MBPP, HumanEval, CMMLU, MMLU), demonstrating no degradation in general competency.

Limitations and Future Work

  • Encoder Model Preparation: The encoder model is still under preparation for full integration with advanced training frameworks like DeepSpeed and vLLM.
  • RealTabBench Subset Release: Only a subset of the RealTabBench dataset is publicly released, with the remainder reserved for future evaluation.
  • Handling Irregular Tables: While TableGPT2 shows promise, handling highly irregular tables (like those in Excel or Pages) still presents room for improvement, especially for production use. The authors suggest that addressing these irregularities might need to start at the pretraining stage.
  • Multi-agent Systems: The authors acknowledge that a single end-to-end LLM may not fully solve complex, real-world problems independently. They are exploring multi-agent systems where specialized LLMs collaborate, suggesting this as a promising direction for handling intricate workflows.
  • Domain-Specific Languages (DSLs): Adapting LLMs to enterprise-specific DSLs or pseudo-code remains a challenge, and the development of interpreters for these domains is suggested.

Summary updated

BibTeX
@misc{su2024tablegpt,
  author = {Aofeng Su and Aowen Wang and Chao Ye and Chen Zhou and Ga Zhang and Gang Chen and Guangcheng Zhu and Haobo Wang and Haokai Xu and Hao Chen and Haoze Li and Haoxuan Lan and Jiaming Tian and Jing Yuan and Junbo Zhao and Junlin Zhou and Kaizhe Shou and Liangyu Zha and Lin Long and Liyao Li and Pengzuo Wu and Qi Zhang and Qingyi Huang and Saisai Yang and Tao Zhang and Wentao Ye and Wufang Zhu and Xiaomeng Hu and Xijun Gu and Xinjie Sun and Xiang Li and Yuhang Yang and Zhiqing Xiao},
  title = {{TableGPT2: A Large Multimodal Model with Tabular Data Integration}},
  year = {2024},
  eprint = {2411.02059},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2411.02059},
}
Figure