arXiv:2606.11946cs.DBcs.CC2026-06

将神经网络与关系查询统一在可学习的程序语言中,实现数据推理与深度学习的无缝结合。

Neuro-Relational Programs: Unifying Queries and Neural Computation over Structured Data

  • 设计一种新型声明式查询语言,融合关系推理与可训练神经组件。
  • 通过嵌入向量的组合与聚合,实现对结构化数据的联合计算与查询。
  • 适用于需要深度融合逻辑规则与神经网络的研究者,如知识图谱、数据库推理。

传统深度学习处理关系型数据库时,通常将数据转为图结构并使用图神经网络(GNNs)建模。近期方法则直接在数据库上操作,将元组映射为嵌入向量,并扩展查询机制以联合处理嵌入与关系内容。受此启发,本文提出神经-关系程序(Neuro-Relational Programs, NRPs),一种带数值向量嵌入的事实关系数据库声明式查询语言。NRPs在类Datalog规则中引入嵌入的组合、聚合与变换操作,使关系推理与可学习神经组件在同一形式体系中交织。该框架既可作为含可训练组件的查询计划,也可视为具有内置关系结构的神经架构。NRPs的自然语法片段能恢复现有模型与查询形式:零元NRPs对应非自适应查询算法;一元NRPs推广了GNN式消息传递,并精确刻画了深度同态网络(Deep Homomorphism Networks);我们还将这一关联扩展至带有行标识符的数据库上的前缘保护型NRPs。通过引入带有计数的首阶逻辑(FOCQ),在实权结构上解释,我们表征了使用ReLU-FFN变换的无限制NRPs的表达能力,揭示其与有序数据库上的均匀TC$^0$之间的精确对应关系。这些结果确立了NRPs作为关系数据上查询与神经计算的通用声明式框架。

原文摘要 · Abstract (English)

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.

关系推理神经程序数据库可学习查询

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。