Abstract
Recent advances in language models opened new opportunities to address complex schema matching tasks. Schema matching approaches have been proposed that demonstrate the usefulness of language models, but they have also uncovered important limitations: Small language models (SLMs) require training data (which can be both expensive and challenging to obtain), and large language models (LLMs) often incur high computational costs and must deal with constraints imposed by context windows. We present Magneto, a cost-effective and accurate solution for schema matching that combines the advantages of SLMs and LLMs to address their limitations. By structuring the schema matching pipeline in two phases, retrieval and reranking, Magneto can use computationally efficient SLM-based strategies to derive candidate matches which can then be reranked by LLMs, thus making it possible to reduce runtime without compromising matching accuracy. We propose a self-supervised approach to fine-tune SLMs which uses LLMs to generate syntactically diverse training data, and prompting strategies that are effective for reranking. We also introduce a new benchmark, developed in collaboration with domain experts, which includes real biomedical datasets and presents new challenges to schema matching methods. Through a detailed experimental evaluation, using both our new and existing benchmarks, we show that Magneto is scalable and attains high accuracy for datasets from different domains.
Introduction
Schema matching—the identification of semantically equivalent columns across disparate databases—is a fundamental yet labor-intensive bottleneck in data integration. While critical for domains ranging from scientific research to public policy, the task remains largely manual and error-prone. Traditional algorithmic approaches often struggle with cryptic column names (e.g., Histologic_Grade vs. tumor_grade) or heterogeneous data values.
Recent efforts to leverage Language Models (LMs) have encountered a significant trade-off. Small Language Models (SLMs) offer high throughput but typically require extensive, manually labeled domain-specific training data. Conversely, Large Language Models (LLMs) possess sophisticated reasoning capabilities but are hampered by high inference costs, slow runtimes, and strict context window limits that prevent the processing of large schemas. Magneto bridges this gap by introducing a hybrid "retrieve-and-rerank" architecture.
Methods
Magneto's architecture is designed to optimize both accuracy and efficiency through a two-stage process.
1. Candidate Retrieval (SLM Phase)
In the first stage, an SLM (such as MPNet) generates vector embeddings for columns to rapidly narrow the search space. To overcome the scarcity of labeled data, Magneto employs a novel self-supervised fine-tuning approach. An LLM is used to "bootstrap" the SLM by generating synthetic training data—creating semantically similar but syntactically diverse versions of target columns. The SLM is then fine-tuned using contrastive learning (triplet loss) to cluster related concepts in the embedding space.
2. Match Reranking (LLM Phase)
The top-K candidates identified by the SLM are passed to an LLM (e.g., GPT-4o-mini) for final verification. Magneto utilizes a scoring-oriented prompting strategy, where the LLM assigns a similarity score (0.0 to 1.0) to each candidate. This approach facilitates more robust global ranking compared to simple categorical ranking. The pipeline also incorporates Priority Sampling to select representative data values and specialized Column Serialization techniques to optimize the textual representation of table structures for the models.
Evaluation and Results
The framework was evaluated using the standard Valentine Benchmark and a newly introduced GDC Benchmark. The latter, developed with biomedical experts, consists of real-world dataset pairs mapped to the National Cancer Institute’s Genomic Data Commons standard, representing a significant increase in difficulty over existing benchmarks.
Accuracy and Scalability
Experimental results demonstrate that Magneto-ft-llm (the fine-tuned hybrid version) significantly outperforms state-of-the-art baselines like Unicorn and ISResMat on the GDC benchmark. While pure LLM approaches often fail or time out on large schemas, Magneto maintains stable performance. For instance, Magneto-zs-bp (the zero-shot version) provides results in under 33 seconds, whereas competing methods scale exponentially in runtime.
Key Insights
- LLM-Guided Bootstrapping: Using LLMs to generate synthetic data effectively transfers broad world knowledge into specialized, lightweight SLMs.
- Retrieval as a Filter: By using the SLM to filter noise, the LLM can focus its reasoning power on the most plausible candidates within its context window.
- Prompt Engineering: Fine-tuned models benefit from verbose serialization (e.g., "Type:" and "Values:" prefixes), while zero-shot models perform better with simple header repetition to maintain focus.
Conclusion
Magneto provides a scalable and accurate solution for schema matching by strategically combining the strengths of SLMs and LLMs. By leveraging synthetic data for SLM fine-tuning and a two-stage pipeline, it achieves high performance on complex biomedical data without the prohibitive costs of pure LLM solutions. Future research will focus on addressing the "retrieval bottleneck"—ensuring the correct match is captured in the initial Top-K candidates—and exploring automated prompt optimization frameworks.
Summary updated