让数据库查询直接支持深度学习,无需数据导出。
Incorporating Deep Learning Design in Database Queries
- 为每条数据记录附加可学习的向量嵌入,实现数据与模型联合处理。
- 在真实数据库上运行图神经网络,性能接近专用框架。
- 适合想用数据库原生能力做深度学习的研究者和工程师。
传统深度学习在关系型数据库上的实现需将数据转换为图结构,并在外部机器学习系统中运行图神经网络,带来显著工程开销。这类网络实际是对元组嵌入进行操作,捕捉由关系连接引发的交互。基于这一自然对应关系,我们提出将深度学习与数据库查询深度融合的新方法:为每个元组关联可学习的向量嵌入,使查询能同时处理数据与嵌入,输入带嵌入的关系映射到输出带嵌入的关系。该方法提供了关系型深度学习的声明式基础,便于与数据库系统集成、优化与推广。我们实现了名为 RelaNN 的原型系统,基于 PyTorch 与 cuDF,成功部署了多种图学习模型,包括图卷积网络、异构图变压器、超图神经网络与深度同态网络。代码简洁且运行效率媲美专用框架,证明了在数据库中实现前沿神经网络如写查询般简单可行。
原文摘要 · Abstract (English)
Deep learning over relational databases is conventionally realized by translating data into graph representations and applying graph-based neural networks within external frameworks. This round-trip between the database and external machine learning (ML) systems introduces non-trivial engineering overhead. In effect, these graph neural networks operate on tuple embeddings and manipulate them in ways that capture the interactions induced by relational joins. Given this natural correspondence, there is no fundamental reason why specifying a neural network over relational data should be substantially harder than querying it. We propose an approach that naturally integrates deep learning with database queries. The key idea is to associate each tuple with provenance, represented as a vector embedding with learnable parameters. Queries are lifted to operate jointly on data and embeddings, mapping input relations with embedded tuples to output relations with embedded tuples. This approach provides a declarative foundation for relational deep learning, facilitating integration with database systems, optimization, and wide adoption. We describe RelaNN, a proof-of-concept implementation of this approach built on top of PyTorch and cuDF. We illustrate the utility of RelaNN by implementing various graph-learning models, including graph convolutional networks, heterogeneous graph transformers, hypergraph neural networks and deep homomorphism networks. The simplicity of the programs and their competitive runtime performance demonstrate a concrete path toward making the implementation of state-of-the-art neural networks over databases as simple as writing a query.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。