Large Language Models (LLMs) are increasingly used to query knowledge graphs (KGs) due to their strong semantic understanding and extrapolation capabilities compared to traditional approaches. However, when KGs contain sensitive information and users lack local access to generative models, privacy becomes a critical concern. To address this issue, we propose a privacy-aware query generation approach for KGs. Our method identifies sensitive information in the graph based on its structure and omits such values before requesting the LLM to translate natural language questions into Cypher queries. Experimental results show that our approach effectively prevents sensitive data from being transmitted to third-party services, while maintaining a high level of query accuracy.
翻译:大语言模型凭借其强大的语义理解与外推能力,正日益被用于查询知识图谱。然而,当知识图谱包含敏感信息且用户无法本地访问生成模型时,隐私问题便成为关键挑战。为解决该问题,我们提出了一种面向知识图谱的隐私感知查询生成方法。该方法基于图结构识别其中的敏感信息,在请求大语言模型将自然语言问题转换为Cypher查询之前,先省略这些敏感值。实验结果表明,本方法能有效防止敏感数据传输至第三方服务,同时保持较高的查询准确率。