pith. sign in

arxiv: 2606.11946 · v1 · pith:STH7TQTOnew · submitted 2026-06-10 · 💻 cs.DB · cs.CC· cs.LG· cs.LO

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

Pith reviewed 2026-06-27 07:41 UTC · model grok-4.3

classification 💻 cs.DB cs.CCcs.LGcs.LO
keywords Neuro-Relational ProgramsDatalogneural networksrelational databasesquery languageGNNexpressive powerFOCQ
0
0 comments X

The pith

Neuro-Relational Programs extend Datalog-style rules with embedding operations to interleave relational reasoning and neural computation in a single declarative language.

A machine-rendered reading of the paper's core claim, the machinery that carries it, and where it could break.

The paper presents Neuro-Relational Programs as a declarative query language for relational databases in which facts are associated with numeric vector embeddings. It extends Datalog rules to include operations that combine, aggregate, and transform these embeddings. This approach allows the same program to function both as a query plan with trainable parts and as a neural architecture that incorporates relational structure. Natural fragments of the language recover existing models such as Graph Neural Networks and Deep Homomorphism Networks, while the full language is characterized in terms of an extension of first-order logic with counting. This unification matters because it provides a general framework for neural computation directly over structured relational data rather than through graph conversions.

Core claim

Neuro-Relational Programs (NRPs) are introduced as a formalism that extends Datalog-style rules with operations on embeddings. This enables interleaving relational reasoning and learnable neural components. Syntactic fragments recover existing architectures like Deep Homomorphism Networks, and the expressive power with ReLU-FFN transformations is characterized by FOCQ over real-weighted structures, connecting to uniform TC^0 over ordered databases.

What carries the argument

Neuro-Relational Programs, which extend Datalog with embedding combination, aggregation, and transformation operations.

If this is right

  • Zero-ary NRPs correspond to non-adaptive query algorithms.
  • Monadic NRPs generalize GNN-style message passing and precisely capture Deep Homomorphism Networks.
  • Frontier-guarded NRPs over databases with row-ids extend the homomorphism network connection.
  • Unrestricted NRPs with ReLU-FFN transformations have expressive power exactly characterized by FOCQ.
  • The framework establishes a precise connection with uniform TC^0 over ordered databases.

Where Pith is reading between the lines

These are editorial extensions of the paper, not claims the author makes directly.

  • Database systems could incorporate NRP execution engines to support trainable queries natively.
  • Optimization techniques from query processing might be applied to neural model training in this setting.
  • Further fragments of NRPs could be identified to match other neural architectures like transformers over relations.
  • Implementation in practice would allow end-to-end training of relational neural models without manual graph construction.

Load-bearing premise

The syntactic fragments of NRPs precisely recover existing architectures such as Deep Homomorphism Networks, and the expressive power of unrestricted NRPs with ReLU-FFN is exactly characterized by FOCQ over real-weighted structures.

What would settle it

Finding a specific neural architecture that cannot be expressed by any corresponding NRP fragment, or an NRP computation that cannot be captured by FOCQ.

read the original abstract

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.

Editorial analysis

A structured set of objections, weighed in public.

Desk editor's note, referee report, simulated authors' rebuttal, and a circularity audit. Tearing a paper down is the easy half of reading it; the pith above is the substance, this is the friction.

Referee Report

0 major / 3 minor

Summary. The paper introduces Neuro-Relational Programs (NRPs), a declarative query language extending Datalog-style rules with operations to combine, aggregate, and transform tuple embeddings. NRPs interleave relational reasoning and learnable neural components. The paper claims that natural syntactic fragments recover existing architectures (zero-ary NRPs correspond to non-adaptive query algorithms; monadic NRPs generalize GNN-style message passing and precisely capture Deep Homomorphism Networks, with an extension to frontier-guarded NRPs over databases with row-ids) and that unrestricted NRPs with ReLU-FFN transformations are exactly characterized by FOCQ over real-weighted structures, yielding a connection to uniform TC^0 over ordered databases.

Significance. If the claimed syntactic recoveries and the FOCQ characterization hold, the work supplies a single declarative formalism that unifies relational query evaluation with neural computation over structured data. The precise capture of Deep Homomorphism Networks and the link to descriptive complexity provide a theoretical bridge between database theory and neural architectures that could support both analysis of existing models and design of new ones.

minor comments (3)
  1. [Abstract] Abstract: the phrase 'precisely capture Deep Homomorphism Networks' is stated without indicating the syntactic fragment or the direction of the equivalence (simulation both ways); a parenthetical reference to the relevant theorem would improve precision.
  2. [Abstract] Abstract: 'databases with row-ids' is introduced without a definition or citation; a one-sentence gloss on how row-ids are represented in the relational signature would aid readers unfamiliar with the extension.
  3. [Abstract] Abstract: the final sentence claims a 'precise connection with uniform TC^0' but does not indicate whether this follows directly from the FOCQ characterization or requires an additional reduction; clarifying the logical step would strengthen the abstract.

Simulated Author's Rebuttal

0 responses · 0 unresolved

We thank the referee for their positive summary of the paper and for recommending minor revision. No specific major comments were provided in the report, so we have no points to address point-by-point at this time. We are happy to incorporate any additional feedback or clarifications if the editor or referee has further remarks.

Circularity Check

0 steps flagged

No significant circularity

full rationale

The abstract and context define NRPs declaratively as an extension of Datalog with embedding operations and state characterizations of fragments (e.g., monadic NRPs capturing Deep Homomorphism Networks) and expressive power (unrestricted NRPs equivalent to FOCQ) as results. No equations, derivations, fitted parameters, or self-citations appear in the provided text that reduce any claimed prediction or equivalence to an input by construction. The formalism is presented as self-contained against external benchmarks in descriptive complexity and neural query languages, with no load-bearing steps that collapse to self-definition or renaming.

Axiom & Free-Parameter Ledger

0 free parameters · 0 axioms · 0 invented entities

Abstract-only review yields no visible free parameters, axioms, or invented entities; the contribution is the language definition itself.

pith-pipeline@v0.9.1-grok · 5820 in / 1084 out tokens · 18510 ms · 2026-06-27T07:41:55.446202+00:00 · methodology

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Reference graph

Works this paper leans on

65 extracted references · 9 canonical work pages · 1 internal anchor

  1. [1]

    Mario Alviano, Matthias Lanzinger, Michael Morak, and Andreas Pieris. 2023. Generative Datalog with Stable Negation. InPODS. ACM, 21–32

  2. [2]

    Vince Bárány, Balder ten Cate, Benny Kimelfeld, Dan Olteanu, and Zografoula Vagena. 2017. Declarative Probabilistic Programming with Datalog.ACM Trans. Database Syst.42, 4 (2017), 22:1–22:35

  3. [3]

    Pablo Barceló, Floris Geerts, Matthias Lanzinger, Klara Pakhomenko, and Jan Van den Bussche. 2026. A Logical View of GNN-Style Computation and the Role of Activation Functions.Proc. ACM Manag. Data4, 2, Article 118 (May 2026), 19 pages

  4. [4]

    Pablo Barceló, Floris Geerts, Juan Reutter, and Maksimilian Ryschkov. 2021. Graph neural networks with local graph parameters. InProc. of NeurIPS. 25280–25293

  5. [5]

    David A Mix Barrington, Neil Immerman, and Howard Straubing. 1990. On uniformity within NC1.J. Comput. System Sci.41, 3 (1990), 274–306

  6. [6]

    Battaglia, Jessica B

    Peter W. Battaglia, Jessica B. Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinícius Flores Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, Çaglar Gülçehre, H. Francis Song, Andrew J. Ballard, Justin Gilmer, George E. Dahl, Ashish Vaswani, Kelsey R. Allen, Charles Nash, Victoria Langston, Chris Dyer, Nicolas H...

  7. [7]

    Bikram Pratim Bhuyan, Amar Ramdane-Cherif, Ravi Tomar, and T. P. Singh. 2024. Neuro-symbolic artificial intelligence: a survey.Neural Comput. Appl.36, 21 (2024), 12809–12844. doi:10.1007/s00521-024-09960-z

  8. [8]

    Thomas Bonald, Nathan de Lara, Quentin Lutz, and Bertrand Charpentier. 2020. Scikit-network: Graph Analysis in Python.J. Mach. Learn. Res.21 (2020), 185:1–185:6

  9. [9]

    Rajesh Bordawekar and Oded Shmueli. 2017. Using Word Embedding to Enable Semantic Queries in Relational Databases. InDEEM

  10. [10]

    Riccardo Cappuzzo, Paolo Papotti, and Saravanan Thirumuruganathan. 2020. Creating Embeddings of Heterogeneous Relational Datasets for Data Integration Tasks. InProceedings of the 2020 ACM SIGMOD International Conference on Management of Data. ACM, 1335–1349

  11. [11]

    Ashok K Chandra, Larry Stockmeyer, and Uzi Vishkin. 1984. Constant depth reducibility.SIAM J. Comput.13, 2 (1984), 423–439

  12. [12]

    Yijia Chen, Jörg Flum, Mingjun Liu, and Zhiyang Xun. 2025. On algorithms based on finitely many homomorphism counts.Information and Computation306 (2025), 105326. doi:10.1016/j.ic.2025.105326

  13. [13]

    Alexis Cvetkov-Iliev, Alexandre Allauzen, and Gaël Varoquaux. 2023. Relational data embeddings for feature enrichment with background information.Mach. Learn.112, 2 (2023), 687–720

  14. [14]

    Dalvi and Dan Suciu

    Nilesh N. Dalvi and Dan Suciu. 2004. Efficient Query Evaluation on Probabilistic Databases. InVLDB. 864–875

  15. [15]

    Daniel Deutch, Amir Gilad, and Yuval Moskovitch. 2018. Efficient provenance tracking for Datalog using top-k queries. VLDBJ27, 2 (2018), 245–269

  16. [16]

    Vijay Prakash Dwivedi and Xavier Bresson. 2021. A Generalization of Transformer Networks to Graphs.AAAI Workshop on Deep Learning on Graphs: Methods and Applications(2021)

  17. [17]

    Matthias Fey, Weihua Hu, Kexin Huang, Jan Eric Lenssen, Rishabh Ranjan, Joshua Robinson, Rex Ying, Jiaxuan You, and Jure Leskovec. 2024. Position: Relational Deep Learning - Graph Representation Learning on Relational Databases. InICML (Proceedings of Machine Learning Research). PMLR / OpenReview.net, 13592–13607

  18. [18]

    Matthias Fey and Jan Eric Lenssen. 2019. Fast Graph Representation Learning with PyTorch Geometric. InICLR 2019 Workshop on Representation Learning on Graphs and Manifolds

  19. [19]

    Floris Geerts. 2023. A Query Language Perspective on Graph Learning. InPODS. ACM, 373–379

  20. [20]

    Floris Geerts and Juan L. Reutter. 2022. Expressiveness and Approximation Properties of Graph Neural Networks. In ICLR. OpenReview.net

  21. [21]

    Schoenholz, Patrick F

    Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. 2017. Neural Message Passing for Quantum Chemistry. InProc. of ICML. 1263–1272. http://proceedings.mlr.press/v70/gilmer17a.html

  22. [22]

    Erich Grädel and Martin Otto. 1992. Inductive definability with counting on finite structures. InInternational Workshop on Computer Science Logic. Springer, 231–247

  23. [23]

    Green, Gregory Karvounarakis, and Val Tannen

    Todd J. Green, Gregory Karvounarakis, and Val Tannen. 2007. Provenance semirings. InPODS. ACM, 31–40

  24. [24]

    Martin Grohe. 2024. The descriptive complexity of graph neural networks.TheoretiCS3 (2024)

  25. [25]

    Martin Grohe, Benjamin Lucien Kaminski, Joost-Pieter Katoen, and Peter Lindner. 2020. Generative Datalog with Continuous Distributions. InPODS

  26. [26]

    Martin Grohe, Christoph Standke, Juno Steegmans, and Jan Van den Bussche. 2025. Query Languages for Neural Networks. InICDT (Leibniz International Proceedings in Informatics (LIPIcs), Vol. 328), Sudeepa Roy and Ahmet Kara (Eds.). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuhl, Germany, 9:1–9:18. doi:10.4230/LIPIcs.ICDT. Neuro-Relational Progr...

  27. [27]

    Martin Grohe, Christoph Standke, Juno Steegmans, and Jan Van den Bussche. 2026. Recursive Querying of Neural Networks via Weighted Structures.Proc. ACM Manag. Data4, 2, Article 115 (May 2026), 20 pages. doi:10.1145/3801911

  28. [28]

    20 Jérôme Leroux

    William Hesse, Eric Allender, and David A. Mix Barrington. 2002. Uniform constant-depth threshold circuits for division and iterated multiplication.J. Comput. System Sci.65, 4 (2002), 695–716. doi:10.1016/S0022-0000(02)00025-9 Special Issue on Complexity 2001

  29. [29]

    Kamruzzaman Sarker (Eds.)

    Pascal Hitzler and Md. Kamruzzaman Sarker (Eds.). 2021.Neuro-Symbolic Artificial Intelligence: The State of the Art. IOS Press

  30. [30]

    Ngo, and Kirk Pruhs

    Sungjin Im, Benjamin Moseley, Hung Q. Ngo, and Kirk Pruhs. 2024. Polynomial Time Convergence of the Iterative Evaluation of Datalogo Programs.Proc. ACM Manag. Data2, 5 (2024), 221:1–221:19

  31. [31]

    1987.Expressibility as a complexity measure: results and directions

    Neil Immerman. 1987.Expressibility as a complexity measure: results and directions. IEEE

  32. [32]

    doi: 10.1007/ 978-1-4612-0539-5

    Neil Immerman. 1999.Descriptive complexity. Springer. doi:10.1007/978-1-4612-0539-5

  33. [33]

    Jannik Irmai, Lucas Fabian Naumann, and Bjoern Andres. 2026. Graph Neural Networks with Triangle-Based Messages for the Multicut Problem.arXiv preprint arXiv:2605.13673(2026). arXiv:2605.13673 [cs.LG] doi:10.48550/arXiv.2605.13673

  34. [34]

    Myung Jun Kim, Léo Grinsztajn, and Gaël Varoquaux. 2024. CARTE: Pretraining and Transfer for Tabular Learning. InICML

  35. [35]

    Dietrich Kuske and Nicole Schweikardt. 2017. First-order logic with counting. InLICS. IEEE, 1–12

  36. [36]

    Patrick Lewis et al. 2020. Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. InNeurIPS

  37. [37]

    Ziyang Li, Jiani Huang, and Mayur Naik. 2023. Scallop: A Language for Neurosymbolic Programming.Proc. ACM Program. Lang.7 (2023), 1463–1487

  38. [38]

    Yuval Lev Lubarsky, Dean Light, Boaz Berger, Shunit Agmon, and Benny Kimelfeld. 2026. Incorporating Deep Learning Design in Database Queries.arXiv preprint arXiv:2605.24207(2026)

  39. [39]

    Yuval Lev Lubarsky, Jan Tönshoff, Martin Grohe, and Benny Kimelfeld. 2023. Selecting Walk Schemes for Database Embedding. InCIKM. ACM, 1677–1686

  40. [40]

    Takanori Maehara and Hoang NT. 2024. Deep homomorphism networks.Advances in Neural Information Processing Systems37 (2024), 56076–56107

  41. [41]

    Robin Manhaeve, Sebastijan Dumancic, Angelika Kimmig, Thomas Demeester, and Luc De Raedt. 2018. DeepProbLog: Neural Probabilistic Logic Programming. InNeurIPS. 3753–3763

  42. [42]

    Christopher Morris, Martin Ritzert, Matthias Fey, William L Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. 2019. Weisfeiler and Leman go neural: Higher-order graph neural networks. InProc. of AAAI. 4602–4609

  43. [43]

    Sidharth Mudgal, Han Li, Theodoros Rekatsinas, AnHai Doan, Youngchoon Park, Ganesh Krishnan, Rohit Deep, Esteban Arcaute, and Vijay Raghavendra. 2018. Deep Learning for Entity Matching: A Design Space Exploration. In SIGMOD Conference. ACM, 19–34

  44. [44]

    James Jie Pan, Jianguo Wang, and Guoliang Li. 2024. Survey of vector database management systems.VLDB J.33, 5 (2024)

  45. [45]

    Luc De Raedt, Angelika Kimmig, and Hannu Toivonen. 2007. ProbLog: A Probabilistic Prolog and Its Application in Link Discovery. InIJCAI

  46. [46]

    Joshua Robinson, Rishabh Ranjan, Weihua Hu, Kexin Huang, Jiaqi Han, Alejandro Dobles, Matthias Fey, Jan Eric Lenssen, Yiwen Yuan, Zecheng Zhang, Xinwei He, and Jure Leskovec. 2024. RelBench: A Bench- mark for Deep Learning on Relational Databases. InNeurIPS. http://papers.nips.cc/paper_files/paper/2024/hash/ 25cd345233c65fac1fec0ce61d0f7836-Abstract-Datas...

  47. [47]

    Moritz Schönherr, Balder ten Cate, Maurice Funk, Benny Kimelfeld, Carsten Lutz, and Arie Soeteman. 2026. Expressive Power of Deep Homomorphism Networks over Relational Databases. arXiv:2605.22852 [cs.DB] https://arxiv.org/abs/ 2605.22852

  48. [48]

    Sun, Abhinav Verma, Yisong Yue, and Swarat Chaudhuri

    Ameesh Shah, Eric Zhan, Jennifer J. Sun, Abhinav Verma, Yisong Yue, and Swarat Chaudhuri. 2020. Learning Differentiable Programs with Admissible Neural Heuristics. InNeurIPS

  49. [49]

    Gombolay

    Andrew Silva and Matthew C. Gombolay. 2021. Encoding Human Domain Knowledge to Warm Start Reinforcement Learning. InAAAI. AAAI Press, 5042–5050

  50. [50]

    Kolaitis, and Wei-Lin Wu

    Balder ten Cate, Victor Dalmau, Phokion G. Kolaitis, and Wei-Lin Wu. 2024. When Do Homomorphism Counts Help in Query Algorithms?. InICDT (LIPIcs, Vol. 290), Graham Cormode and Michael Shekelyan (Eds.). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 8:1–8:20. doi:10.4230/LIPIcs.ICDT.2024.8

  51. [51]

    Kolaitis, and Arnar Á

    Balder ten Cate, Phokion G. Kolaitis, and Arnar Á. Kristjánsson. 2025. Adaptive Query Algorithms for Relational Structures Based on Homomorphism Counts. InMFCS (Leibniz International Proceedings in Informatics (LIPIcs), Vol. 345), Paweł Gawrychowski, Filip Mazowiecki, and Michał Skrzypczak (Eds.). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, Dagstuh...

  52. [52]

    Jan Tönshoff, Neta Friedman, Martin Grohe, and Benny Kimelfeld. 2023. Stable Tuple Embeddings for Dynamic Databases. InICDE. IEEE, 1286–1299. 18 Arie Soeteman, Balder ten Cate, Maurice Funk, Benny Kimelfeld, Carsten Lutz, and Moritz Schönherr

  53. [53]

    Minjie Wang et al . 2019. Deep Graph Library: Towards Efficient and Scalable Deep Learning on Graphs.CoRR abs/1909.01315 (2019)

  54. [54]

    Xiao Wang, Houye Ji, Chuan Shi, Bai Wang, Yanfang Ye, Peng Cui, and Philip S. Yu. 2019. Heterogeneous Graph Attention Network. InWWW. ACM, 2022–2032

  55. [55]

    Xiaolong Wang, Yufei Ye, and Abhinav Gupta. 2018. Zero-Shot Recognition via Semantic Embeddings and Knowledge Graphs. InCVPR. Computer Vision Foundation / IEEE Computer Society, 6857–6866

  56. [56]

    Yanbo Wang, Xiyuan Wang, Quan Gan, Minjie Wang, Qibin Yang, David Wipf, and Muhan Zhang. 2025. Griffin: Towards a Graph-Centric Relational Database Foundation Model. InICML (Proceedings of Machine Learning Research). PMLR / OpenReview.net

  57. [57]

    2023.A Study of the Expressive Power of Homomorphism Counts

    Wei-Lin Wu. 2023.A Study of the Expressive Power of Homomorphism Counts. Ph. D. Dissertation. University of California, Santa Cruz, USA. https://www.escholarship.org/uc/item/4647715d

  58. [58]

    Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. 2019. How Powerful are Graph Neural Networks?. In Proc. of ICLR. OpenReview.net

  59. [59]

    Dongran Yu, Bo Yang, Dayou Liu, Hui Wang, and Shirui Pan. 2023. A survey on neural-symbolic learning systems. Neural Networks166 (2023), 105–126

  60. [60]

    Xin Zhang and Victor S. Sheng. 2024. Neuro-Symbolic AI: Explainability, Challenges, and Future Trends. arXiv:2411.04383 [cs.AI] https://arxiv.org/abs/2411.04383

  61. [61]

    Yuyu Zhang, Xinshi Chen, Yuan Yang, Arun Ramamurthy, Bo Li, Yuan Qi, and Le Song. 2020. Efficient Probabilistic Logic Reasoning with Graph Neural Networks. InICLR. OpenReview.net

  62. [62]

    Hangdong Zhao et al. 2024. Evaluating Datalog over Semirings: A Grounding-based Approach.Proc. ACM Manag. Data2, 2 (2024), 90

  63. [63]

    Jianan Zhao, Xiao Wang, Chuan Shi, Binbin Hu, Guojie Song, and Yanfang Ye. 2021. Heterogeneous Graph Structure Learning for Graph Neural Networks. InAAAI. AAAI Press, 4697–4705

  64. [64]

    Jie Zhou, Ganqu Cui, Shengding Hu, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, Lifeng Wang, Changcheng Li, and Maosong Sun. 2020. Graph neural networks: A review of methods and applications.AI Open1 (2020), 57–81. Neuro-Relational Programs: Unifying Queries and Neural Computation over Structured Data 19 A Example: relational graph construction and message pa...

  65. [65]

    , 𝑦𝑠 𝑗𝑠 𝑘𝑠 )

    with the variables additionally identified so thatu 𝑠 equals the projection (𝑦𝑠 𝑗𝑠 1 , . . . , 𝑦𝑠 𝑗𝑠 𝑘𝑠 ). In case one or more of the relations 𝑅 and 𝑄𝑠 are monadic EDBs with a positive embedding dimension, we replace them by1 ⟨0⟩-ary relations 𝑅◦ or 𝑄 ◦ 𝑠 , respectively, adding suitable transformation rules of the form 𝑅◦ (𝑥)⟨𝜇⟩ ⇐𝑅(𝑥) , in order to ensur...