arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.07278cs.DB
收藏

LLM-FK:多智能体LLM推理用于大规模复杂数据库中的外键检测

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

Peking University(北京大学);The Open University of China(开放大学)

Zijian Tang, Ying Zhang, Sibo Cai, Ruoxuan Wang

AI总结:

LLM-FK通过多智能体框架解决大规模复杂数据库中外键检测的三大挑战,实现高精度和高效搜索。

摘要:

检测缺失的外键(FK)需要准确地建模数据库模式中的语义依赖关系,这使得基于启发式的传统方法在根本上无法捕捉到这些依赖关系。我们提出了LLM-FK,这是首个完全自动化的多智能体框架用于外键检测,旨在解决阻碍朴素LLM方法在大规模复杂数据库中的三个核心挑战:组合搜索空间爆炸、有限上下文中模糊推理以及由孤立局部预测导致的全局不一致。LLM-FK协调四个专门的智能体:一个剖析器将外键检测问题分解为验证外键候选列对的任务,并通过独特的键驱动模式分解策略剪枝搜索空间;一个解释器注入自我增强的领域知识;一个精炼器构建紧凑的结构表示并执行多视角的推理;一个验证器通过整体冲突解决策略确保模式的一致性。在五个基准数据集上的实验表明,LLM-FK在F1分数上始终超过93%,在大规模的MusicBrainz数据库上比现有基线高出15%,同时将候选搜索空间减少两到三个数量级而不丢失真正的外键,并在缺失数据等具有挑战性的条件下保持稳健。这些结果展示了LLM-FK在现实数据库中的有效性和可扩展性。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑