Jellyfish: A Large Language Model for Data Preprocessing

Haochen Zhang, Yuyang Dong, Chuan Xiao, Masafumi Oyamada

TL;DR

Jellyfish is a new suite of local, open-source Large Language Models (7B to 13B parameters) customized specifically for data preprocessing tasks like data cleaning and integration. By running locally on a single GPU, Jellyfish eliminates the data privacy risks and high API costs associated with commercial models like GPT-4 while delivering highly competitive performance and superior reasoning explanations.

What Problem Does This Paper Address?

Data preprocessing (DP)—which includes error detection, data imputation, schema matching, and entity matching—is a notorious bottleneck in data science pipelines. Historically, solving these tasks required fragmented, specialized machine learning models or brittle, handcrafted rules.

While commercial foundation models (like GPT-3.5 and GPT-4) have recently emerged as powerful, universal DP solvers due to their natural language interfaces, they present a massive roadblock for enterprise adoption: data security. Sending sensitive, proprietary, or regulated user data to external cloud APIs introduces severe data breach liabilities. Furthermore, commercial APIs are costly to scale and cannot be easily customized or fine-tuned for highly specialized domains.

The authors introduce Jellyfish to bridge this gap, providing a secure, local, and cost-effective alternative that runs on a single commodity GPU.

Methods

The authors developed Jellyfish by instruction-tuning three open-source base models: Mistral-7B, Llama 3-8B, and OpenOrca-Platypus2-13B. Their framework relies on three core techniques:

  1. Instance Serialization: Raw tabular data records are converted into structured natural language prompts that define the system role, task description, and specific questions.
  2. Knowledge Injection: The authors explicitly inject both general knowledge (e.g., instructing the model on how to interpret missing values or capitalization) and dataset-specific domain knowledge (e.g., noting that author names can appear in different formats) directly into the training prompts.
  3. Reasoning Data Distillation: To give the models interpretability, the authors used a larger open model (Mixtral-8x7B) to generate high-quality, step-by-step natural language explanations (Chain-of-Thought) for the preprocessing decisions. These explanations were distilled into the training data for the 7B and 8B Jellyfish variants.
Figure 1: Overview of instruction tuning for data preprocessing.

Datasets

The models were trained and evaluated across a suite of diverse, well-established data mining benchmarks spanning four "seen" tasks and two completely "unseen" tasks to test generalization:

  • Error Detection (ED): Adult, Hospital (Seen); Flights, Rayyan (Unseen)
  • Data Imputation (DI): Buy, Restaurant (Seen); Flipkart, Phone (Unseen)
  • Schema Matching (SM): MIMIC-III, Synthea (Seen); CMS (Unseen)
  • Entity Matching (EM): Amazon-Google, Beer, DBLP-ACM, DBLP-GoogleScholar, Fodors-Zagats, iTunes-Amazon (Seen); Abt-Buy, Walmart-Amazon (Unseen)
  • Unseen Evaluation Tasks: Column Type Annotation (SOTAB dataset) and Attribute Value Extraction (AE-110k and OA-Mine datasets).

Key Insights and Ideas

  • Task Synergy and Interference: Multi-task training on structured data is a delicate balancing act. The authors discovered that while training data from Error Detection and Schema Matching generally boosts performance across all other tasks, adding too much Data Imputation data can actually degrade the model's performance on adjacent tasks.
  • The Logic Alignment Trap: More reasoning data isn't always better. While distilling Mixtral's reasoning paths significantly improved the native Mistral and Llama 3 models, it severely degraded the OpenOrca-Platypus2-13B model. This suggests that if a base model's pre-existing logical tuning doesn't align with the distilled logic style, reasoning data can cause cognitive interference.
  • No Catastrophic Forgetting: Tuning these models heavily on structured, tabular preprocessing tasks did not ruin their general capabilities. On standard NLP benchmarks (like MMLU and GSM8K), the 8B and 13B Jellyfish models maintained virtually identical performance compared to their base models.

Key Results

  • Outperforming GPT-4 on Unseen Data: On the unseen Schema Matching dataset (CMS), Jellyfish-13B achieved an F1 score of 59.29, dramatically outperforming GPT-4, which lagged behind at a mediocre 19.35.
  • Superior Local Reasoning: In head-to-head interpretation matchups judged by GPT-4o, Jellyfish-8B's natural language explanations defeated GPT-3.5 on 10 out of 11 datasets, securing a 73.18% overall winning rate due to its deeper, more nuanced domain analysis.
Figure 2: Example prompt in instruction data. The leftmost column is description and not prompted to the model. Response indicates the answer to the prompt. Detailed prompts are provided in Ap- pendix B.
  • High Efficiency: Local inference is incredibly fast. Jellyfish models took between 0.07 and 0.15 seconds to process an instance on a single NVIDIA A100 GPU, whereas GPT-4 averaged 1 to 8 seconds per instance.

Limitations and Future Work

The primary limitation of Jellyfish is its instance-based design. Because the models process data row-by-row or pair-by-pair to stay within LLM token limits, they miss out on the holistic, table-wide context that traditional non-LLM methods leverage. This also limits processing throughput on massive, multi-million-row databases.

Additionally, the current iteration focuses strictly on relational tables and leaves out other vital preprocessing steps like data fusion and complex data transformations.

To address these constraints, the authors' future roadmap includes developing table-at-a-time prompting techniques, model quantization for lower VRAM footprints, and multi-agent architectures to support fully conversational, code-free data preprocessing pipelines.

Summary updated

BibTeX
@misc{zhang2023jellyfish,
  author = {Haochen Zhang and Yuyang Dong and Chuan Xiao and Masafumi Oyamada},
  title = {{Jellyfish: A Large Language Model for Data Preprocessing}},
  year = {2023},
  eprint = {2312.01678},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.01678},
}
Figure