DeepJoin: Joinable Table Discovery with Pre-trained Language Models

Yuyang Dong, Chuan Xiao, Takuma Nozawa, Masafumi Enomoto, Masafumi Oyamada

TL;DR

DeepJoin is a deep learning framework that uses fine-tuned Pre-trained Language Models (PLMs) to discover joinable tables in massive data lakes. By transforming columns into fixed-length embeddings, it handles both exact (equi-join) and fuzzy (semantic) joins with high precision and sublinear search time, outperforming traditional exact algorithms by up to 100x.

What Problem Does This Paper Address?

In modern data management, "data lakes" often contain millions of tables. Finding which tables can be joined with a query table is a critical step for data enrichment and analysis. However, existing solutions face three major hurdles:

  1. Join Diversity: Most tools are specialized for either equi-joins (exact string matches) or semantic joins (matching by meaning, e.g., "USA" vs. "United States"), but rarely both.
  2. Scalability: Exact algorithms like JOSIE or PEXESO have a time complexity that scales linearly with the number of columns and their sizes, making them sluggish on "billion-scale" repositories.
  3. Precision vs. Speed: Approximate methods like LSH Ensemble are faster but often suffer from low precision due to the way they simplify join conditions.

DeepJoin aims to provide a "two-birds-with-one-stone" solution: a single framework that is accurate, handles both join types, and scales efficiently.

Methods

DeepJoin treats table discovery as an embedding-based retrieval task. The process follows three main steps:

  • Column-to-Text Transformation: Since PLMs like BERT take text sequences as input, the authors use "prompt engineering" to turn a column into a string. They tested seven variations, finding that a combination of the table title, column name, statistical metadata (like average cell length), and a sample of cell values performed best.
  • PLM Fine-Tuning: The model (using architectures like DistilBERT or MPNet) is fine-tuned using metric learning. It learns to map joinable columns to nearby points in a high-dimensional vector space. To make the model "order-insensitive" (since the order of rows in a table shouldn't matter for a join), they use a data augmentation technique that shuffles cell values during training.
  • Efficient Search: Once columns are converted into fixed-length vectors, DeepJoin uses Approximate Nearest Neighbor Search (ANNS)—specifically the HNSW algorithm. This allows the system to find the top-$k$ most joinable tables in sublinear time relative to the repository size.

Datasets

The authors evaluated DeepJoin on two large-scale real-world benchmarks:

  • Webtable: Relational tables extracted from the WDC Web Table Corpus.
  • Wikitable: Relational tables sourced from Wikipedia.

To test generalization, they trained the model on a small subset (30,000 columns) and evaluated it on a massive repository of 1 million columns.

Key Insights and Ideas

  • The Power of Attention: The authors point out that the attention mechanism in PLMs is uniquely suited for this task. It can capture the semantics needed for fuzzy joins while simultaneously learning to "focus" on specific tokens that indicate exact matches in equi-joins.
  • Fixed-Length Efficiency: By encoding an entire column (regardless of its number of rows) into a single fixed-length vector, the search time becomes independent of the column's original size.
  • Generalization from Small Data: One of the most impressive findings is that DeepJoin generalizes remarkably well. By seeing only a tiny fraction of the corpus during training, it learns the underlying "concept" of joinability and applies it successfully to millions of unseen tables.
  • Metadata is a Signal: Including the table title and column name significantly boosts performance. The model uses this context to disambiguate columns that might have similar-looking data but different meanings.

Key Results

  • Superior Accuracy: DeepJoin achieved an average precision of 72% for equi-joins and 91% for semantic joins. It consistently outperformed LSH Ensemble and other embedding baselines like TaBERT and TURL.
  • Massive Speedup: When equipped with a GPU, DeepJoin is up to two orders of magnitude (100x-400x) faster than exact solutions like JOSIE and PEXESO. Even on a standard CPU, it remains 7x to 57x faster.
  • Human-Level Semantics: In evaluations against labels provided by human experts, DeepJoin was actually more accurate than "exact" semantic join algorithms. This is because the PLM captures nuanced relationships that fixed-threshold word embeddings miss.

Limitations and Future Work

  • Cardinality Constraints: PLMs have a maximum input length (e.g., 512 tokens). For very "tall" columns with thousands of unique values, DeepJoin must rely on frequency-based sampling to select which values to include in the text sequence.
  • Numerical Data: The current work focuses primarily on textual attributes. Discovering joins based on numerical distributions (e.g., matching a column of ages to another column of ages) remains a separate challenge.
  • Two-Stage Retrieval: The authors suggest that while DeepJoin is excellent at finding candidates, its performance could be further enhanced by a "two-stage" architecture where a faster model finds candidates and a more complex model re-ranks them.

Summary updated

BibTeX
@article{dong2023deepjoin,
  author = {Yuyang Dong and Chuan Xiao and Takuma Nozawa and Masafumi Enomoto and Masafumi Oyamada},
  title = {{DeepJoin: Joinable Table Discovery with Pre-trained Language Models}},
  journal = {Proc. VLDB Endow.},
  year = {2023},
  doi = {10.14778/3603581.3603587},
}
Figure