Abstract
Inferring meta information about tables, such as column headers or relationships between columns, is an active research topic in data management as we find many tables are missing some of this information. In this paper, we study the problem of annotating table columns (i.e., predicting column types and the relationships between columns) using only information from the table itself. We develop a multi-task learning framework (called Doduo) based on pre-trained language models, which takes the entire table as input and predicts column types/relations using a single model. Experimental results show that Doduo establishes new state-of-the-art performance on two benchmarks for the column type prediction and column relation prediction tasks with up to 4.0% and 11.9% improvements, respectively. We report that Doduo can already outperform the previous state-of-the-art performance with a minimal number of tokens, only 8 tokens per column. We release a toolbox (https://github.com/megagonlabs/doduo) and confirm the effectiveness of Doduo on a real-world data science problem through a case study.
Introduction
Data scientists frequently encounter "orphan" tables—datasets that lack headers, descriptions, or defined relationships between columns. While standard database types like integer or string provide basic structural information, they are insufficient for modern data discovery. To truly integrate and understand data, we require semantic types (e.g., "director," "city," "population").
Existing solutions often process columns in isolation, ignoring the rich context provided by neighboring columns, or rely heavily on external Knowledge Bases (KBs) and manual feature engineering. This paper introduces Doduo, a multi-task learning framework that leverages pre-trained language models to capture the holistic context of a table.
The Doduo Framework
Named after the two-headed Pokémon to represent its dual-task nature, Doduo is built on the Transformer-based BERT model. It introduces several key innovations to adapt language models for tabular data:
- Table-wise Serialization: Unlike models that process columns individually, Doduo serializes the entire table into a single sequence. It appends a special
[CLS]token to the start of each column. The Transformer’s self-attention mechanism allows every token to "attend" to every other token across the table, capturing both intra-column and inter-column dependencies. - Multi-task Learning (MTL): Doduo is trained to solve two problems simultaneously: Column Type Prediction (classifying a single column) and Column Relation Prediction (identifying the relationship between a pair of columns). A shared BERT base with specialized output heads allows these tasks to share semantic knowledge.
- Contextualized Embeddings: By using the output of the
[CLS]tokens as column representations, the model creates embeddings sensitive to the specific table context. For example, the name "George Miller" is embedded differently if adjacent columns suggest he is a filmmaker versus a politician.
Experimental Results
Doduo was evaluated on two major benchmarks: WikiTable (580,000+ tables from Wikipedia) and VizNet (78,000 tables from the WebTables corpus).
Performance and Efficiency
Doduo established new state-of-the-art (SOTA) performance on both benchmarks. On WikiTable, it achieved a 4.0% improvement in type prediction and an 11.9% improvement in relation prediction over previous models like TURL and Sato.
One of the most significant findings was Doduo's extreme data efficiency. The model outperformed previous SOTA results using only 8 tokens per column, suggesting that the semantic signal for a column's identity is highly concentrated in just a few sample values.
Robustness and Transferability
The model proved robust to noise, maintaining effectiveness even when rows and columns were shuffled. In a real-world case study using an enterprise HR database, Doduo’s contextualized embeddings significantly outperformed traditional schema matching tools (like COMA) and non-contextual embeddings (like fastText) for clustering similar columns, demonstrating strong transferability to private, non-Wikipedia data.
Discussion and Future Work
While Doduo represents a significant step forward, it faces certain limitations. Like other BERT-based models, it is constrained by a 512-token input limit, which requires clustering for very "wide" tables. Additionally, the current model treats all cell values as strings, lacking explicit mathematical reasoning for numeric data.
Future research will explore "multi-table modeling" to capture context across foreign keys in relational databases and investigate methods to handle "dirty" data more gracefully. By tapping into the latent knowledge of pre-trained language models, Doduo demonstrates that external Knowledge Bases are not always necessary for high-quality semantic annotation.
Summary updated