Lune

ACL Findings2026

LLM-FK: Multi-Agent LLM Reasoning for Foreign Key Detection in Large-Scale Complex Databases

Zijian Tang, Ying Zhang, Sibo Cai, Ruoxuan Wang

Abstract

Detecting missing foreign keys (FKs) requires accurately modeling semantic dependencies across database schemas, which conventional heuristic-based methods are fundamentally limited in capturing. We propose LLM-FK, the first fully automated multi-agent framework for FK detection, designed to address three core challenges that hinder naive LLM-based solutions in large-scale complex databases: combinatorial search space explosion, ambiguous inference under limited context, and global inconsistency arising from isolated local predictions. LLM-FK coordinates four specialized agents: a Profiler that decomposes the FK detection problem into the task of validating FK candidate column pairs and prunes the search space via a unique-key-driven schema decomposition strategy; an Interpreter that injects self-augmented domain knowledge; a Refiner that constructs compact structural representations and performs multi-perspective chain-of-thought reasoning; and a Verifier that enforces schema-wide consistency through a holistic conflict resolution strategy. Experiments on five benchmark datasets demonstrate that LLM-FK consistently achieves F1-scores above 93%, surpassing existing baselines by 15% on the large-scale MusicBrainz database, while reducing the candidate search space by two to three orders of magnitude without losing true FKs and maintaining robustness under challenging conditions like missing data. These results demonstrate the effectiveness and scalability of LLM-FK in real-world databases.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

Questions to start from

Lune can draw on

the full paper · related work

Get the answer

Free to start. No credit card required.

Lineage

  • How Large Language Models Will Disrupt Data Management cites Can Foundation Models Wrangle Your Data?
  • How Large Language Models Will Disrupt Data Management cites Language Models are Few-Shot Learners
  • Can Foundation Models Wrangle Your Data? cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Builds on18

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Text-to-SQL Empowered by Large Language Models: A Benchmark EvaluationDawei Gao, Haibin Wang, Yaliang Li, Xiuyu Sun et al.VLDB 2024 · 609 citations
  3. Can Foundation Models Wrangle Your Data?Avanika Narayan, Ines Chami, Laurel J. Orr, Christopher RéVLDB 2023 · 325 citations
  4. How Large Language Models Will Disrupt Data ManagementRaul Castro Fernandez, Aaron J. Elmore, Michael J. Franklin, Sanjay Krishnan et al.VLDB 2023 · 127 citations
  5. TableRAG: Million-Token Table Understanding with Language ModelsSi-An Chen, Lesly Miculicich, Julian Eisenschlos, Zifeng Wang et al.NeurIPS 2024 · 86 citations

Related papers

  1. SQLAgent: Learning to Explore Before Generating as a Data EngineerWenjia Jiang, Yiwei Wang, Boyan Han, Joey Tianyi Zhou et al.ACL Findings 2026
  2. Symphony: A Cognitively-Inspired Multi-Agent System for Long-Video UnderstandingHaiyang Yan, Hongyun Zhou, Peng Xu, Xiaoxue Feng et al.CVPR 2026 · 8 citations
  3. KARMA: Leveraging Multi-Agent LLMs for Automated Knowledge Graph EnrichmentYuxing Lu, Wei Wu, Xukai Zhao, Rui Peng et al.NeurIPS 2025 · 41 citations
  4. DataSeer: A Manager-Centric Collaborative Multi-Agent Framework with Multi-Branch Reasoning for Automated Insight DiscoverySuchen Liu, Yuanfeng Song, Jun Gao, Xing ChenACL Findings 2026
  5. S-DAG: A Subject-Based Directed Acyclic Graph for Multi-Agent Heterogeneous ReasoningJiangwen Dong, Zehui Lin, Wanyu Lin, Mingjin ZhangAAAI 2026 · 4 citations
Dusk over the sea between two cliffs drawn in fine vertical lines