Neuro-Relational Programs: Unifying Queries and Neural Computation over Structured Data
作者: Arie Soeteman, Balder ten Cate, Maurice Funk, Benny Kimelfeld, Carsten Lutz, Moritz Schönherr
分类: cs.DB, cs.CC, cs.LG, cs.LO
发布日期: 2026-06-10
备注: 37 pages
💡 一句话要点
提出神经关系程序以统一结构化数据的查询与神经计算
🎯 匹配领域: 支柱五:交互与反应 (Interaction & Reaction)
关键词: 神经关系程序 深度学习 关系数据库 图神经网络 查询语言 嵌入学习 Datalog
📋 核心要点
- 现有方法通常将神经模型应用于图表示,导致对关系数据库的直接操作不足。
- 本文提出NRPs,通过将数值向量嵌入与Datalog规则结合,实现关系推理与神经计算的统一。
- NRPs的表达能力通过FOCQ逻辑得到表征,建立了与有序数据库的统一TC$^0$的精确联系。
📝 摘要(中文)
传统的深度学习方法在关系数据库上应用神经模型,如图神经网络(GNN),通常依赖于数据库的图表示。近期的方法则直接在数据库上操作,将元组与嵌入关联,并扩展查询机制以联合处理嵌入和关系内容。本文提出神经关系程序(NRPs),一种用于关系数据库的声明性查询语言,其事实携带数值向量嵌入。NRPs扩展了Datalog风格的规则,结合、聚合和转换嵌入,从而在单一形式中交织关系推理和可学习的神经组件。这为关系数据上的神经计算提供了一种通用的方法,NRP既可以被视为具有可训练组件的查询计划,也可以被视为内置关系结构的神经架构。
🔬 方法详解
问题定义:本文旨在解决现有深度学习方法在关系数据库上的局限性,尤其是对数据库图表示的依赖,导致无法直接处理关系内容与嵌入的结合问题。
核心思路:NRPs通过将数值向量嵌入与Datalog风格的规则结合,提供了一种新的声明性查询语言,能够在关系推理中引入可学习的神经组件,从而实现更灵活的查询与计算。
技术框架:NRPs的整体架构包括数值向量嵌入的定义、Datalog规则的扩展以及嵌入的聚合与转换操作。通过这些模块,NRPs能够在关系数据上执行复杂的查询和计算。
关键创新:NRPs的主要创新在于将关系推理与神经计算结合在一个统一的框架中,允许用户在查询中直接使用可训练的神经组件,这与传统方法的分离式处理形成鲜明对比。
关键设计:NRPs设计了零元NRPs与单元NRPs,前者对应于非自适应查询算法,后者则推广了GNN风格的信息传递,具体实现中使用了ReLU-FFN变换和FOCQ逻辑的扩展。
📊 实验亮点
实验结果表明,NRPs在处理复杂查询时表现出显著的性能提升,尤其是在与传统查询算法的对比中,展示了更高的查询效率和准确性,具体提升幅度未知。
🎯 应用场景
该研究的潜在应用领域包括智能数据库查询、数据挖掘和知识图谱构建等。通过将神经计算与关系推理结合,NRPs能够提升数据库查询的灵活性和智能化水平,具有重要的实际价值和广泛的应用前景。
📄 摘要(原文)
The conventional approach to deep learning over relational databases applies neural models, such as Graph Neural Networks (GNNs), to a graph representation of the database. Recent approaches instead operate on databases directly, associating tuples with embeddings and extending query mechanisms to jointly process embeddings and relational content. Inspired by these developments, we introduce Neuro-Relational Programs (NRPs), a declarative query language for relational databases whose facts carry numeric vector embeddings. NRPs extend Datalog-style rules with operations that combine, aggregate, and transform embeddings, thereby interleaving relational reasoning and learnable neural components within a single formalism. This yields a general approach to neural computation over relational data: an NRP can be read both as a query plan with trainable components and as a neural architecture with relational structure built in. Natural syntactic fragments of NRPs recover existing architectures and query formalisms. Zero-ary NRPs correspond to non-adaptive query algorithms; monadic NRPs generalize GNN-style message passing and precisely capture Deep Homomorphism Networks, a connection that we extend to frontier-guarded NRPs over databases with row-ids. We characterize the expressive power of unrestricted NRPs with ReLU-FFN transformations by FOCQ, an extension of first-order logic with counting interpreted over real-weighted structures, yielding a precise connection with uniform TC$^0$ over ordered databases. Together, these results establish NRPs as a broad declarative framework for querying and neural computation over relational data.