用大模型动态生成查询模板,让图神经网络只加载相关部分,提速28倍还省98%内存。
An LLM-Guided Query-Aware Inference System for GNN Models on Large Knowledge Graphs

- 用大模型分析查询语义,只加载子图相关的模型组件。
- 在4200万节点的大知识图谱上,推理速度提升28倍,内存降低98%。
- 适合需要高效推理的智能问答、推荐系统等场景。
大规模知识图谱上的图神经网络(GNN)推理对众多实际应用至关重要。由于每条推理查询涉及的目标节点数量不同,且子图结构与密度各异,导致计算成本高且复杂度不一。现有加速方法如剪枝、量化和知识蒸馏虽能生成更小模型,但未根据查询结构或语义进行适配,且模型以整体文件形式存储,必须全部加载,无法仅提取与目标节点语义相关的邻近节点及对应模型组件,造成大量数据加载和冗余计算。本文提出KG-WISE,一种面向大规模知识图谱的任务驱动推理范式。该方法将训练好的GNN模型分解为细粒度组件,可依据查询子图结构按需加载;并利用大语言模型(LLM)生成可复用的查询模板,自动提取语义相关的子图,实现查询感知的紧凑模型实例化。我们在六个大规模知识图谱上评估了KG-WISE,最大规模达4200万节点、1.66亿边。结果表明,相比当前最优系统,KG-WISE推理速度最高提升28倍,内存占用降低98%,同时保持甚至提升了准确率,适用于商业与开源双类大语言模型。
原文摘要 · Abstract (English)
Efficient inference for graph neural networks (GNNs) on large knowledge graphs (KGs) is essential for many real-world applications. GNN inference queries are computationally expensive and vary in complexity, as each involves a different number of target nodes linked to subgraphs of diverse densities and structures. Existing acceleration methods, such as pruning, quantization, and knowledge distillation, instantiate smaller models but do not adapt them to the structure or semantics of individual queries. They also store models as monolithic files that must be fully loaded, and miss the opportunity to retrieve only the neighboring nodes and corresponding model components that are semantically relevant to the target nodes. These limitations lead to excessive data loading and redundant computation on large KGs. This paper presents KG-WISE, a task-driven inference paradigm for large KGs. KG-WISE decomposes trained GNN models into fine-grained components that can be partially loaded based on the structure of the queried subgraph. It employs large language models (LLMs) to generate reusable query templates that extract semantically relevant subgraphs for each task, enabling query-aware and compact model instantiation. We evaluate KG-WISE on six large KGs with up to 42 million nodes and 166 million edges. KG-WISE achieves up to 28x faster inference and 98% lower memory usage than state-of-the-art systems while maintaining or improving accuracy across both commercial and open-weight LLMs.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。