Enhancing In-Context Learning of Large Language Models for Knowledge Graph Reasoning via Rule-and-Reinforce Selected Triples
Source abstract
Abstract
Knowledge graph (KG) reasoning aims to obtain new knowledge based on existing data. Utilizing large language models (LLMs) through in-context learning for KG reasoning has become a significant direction. However, existing methods mainly extract in-context triples by manually defined standards (such as the neighbors that are directly linked with the query triple), without considering whether they are useful for LLM reasoning. Furthermore, the triples beyond the neighbors can also provide important clues for reasoning. Therefore, it is necessary to extract more useful in-context triples of LLMs for KG reasoning. This paper proposes a rule-and-reinforce in-context triple extraction method to enhance the in-context learning of LLMs for KG reasoning. First, we collect the in-context triples specific to each query triple with the guidance of logical rules, and a neural extractor is pre-trained by the collected triples. Subsequently, the feedback of LLMs is collected as rewards to further optimize the extractor, where the policy gradient is utilized to encourage the extractor to explore more useful triples that yield higher rewards. The experimental results on five different knowledge graphs demonstrate that the proposed method can effectively improve the reasoning performance of LLMs. Compared to the traditional reasoning method AnyBURL, the greatest improvement is 0.147 on Hits@10, FB15k-237.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Advanced Graph Neural Networks · Topic Modeling · Data Quality and Management
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
College of Information Engineering, Capital Normal University, Beijing 100048, China
References (48)
Show source-provided references
1. A survey on knowledge graphs: Representation, acquisition, and applications10.1109/TNNLS.2021.3070843 ↗
2. Ren, Z., Zhao, Y., and Zong, C. (2023, January 6–10). Towards Informative Open-ended Text Generation with Dynamic Knowledge Triples. Proceedings of the Empirical Methods in Natural Language Processing 2023, Singapore.10.18653/v1/2023.findings-emnlp.210 ↗
3. Robust cross-lingual knowledge base question answering via knowledge distillation
4. Zhao, Y., Xiang, L., Zhu, J., Zhang, J., Zhou, Y., and Zong, C. (2020, January 8–13). Knowledge graph enhanced neural machine translation via multi-task learning on sub-entity granularity. Proceedings of the 28th International Conference on Computational Linguistics, Barcelona, Spain.10.18653/v1/2020.coling-main.397 ↗
5. Zhao, Y., Zhang, J., Zhou, Y., and Zong, C. (2021, January 7–15). Knowledge graphs enhanced neural machine translation. Proceedings of the Twenty-Ninth International Conference on International Joint Conferences on Artificial Intelligence, Yokohama, Japan.10.24963/ijcai.2020/559 ↗
6. Zhang, W., Chen, J., Li, J., Xu, Z., Pan, J.Z., and Chen, H. (2022). Knowledge graph reasoning with logics and embeddings: Survey and perspective. arXiv.
7. Knowledge graph quality management: A comprehensive survey
8. A comprehensive overview of knowledge graph completion10.1016/j.knosys.2022.109597 ↗
9. Jia, N., and Yao, C. (2024). A Brief Survey on Deep Learning-Based Temporal Knowledge Graph Completion. Appl. Sci., 14.10.3390/app14198871 ↗
10. Liang, Y., Zhang, Y., Ma, C., Zhang, Z., Zhao, Y., Xiang, L., Zong, C., and Zhou, Y. (2024, January 16–21). Document Image Machine Translation with Dynamic Multi-pre-trained Models Assembling. Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), Mexico City, Mexico.10.18653/v1/2024.naacl-long.392 ↗
11. Krawczyk, N., Probierz, B., and Kozak, J. (2024). Towards AI-Generated Essay Classification Using Numerical Text Representation. Appl. Sci., 14.10.3390/app14219795 ↗
12. Iaroshev, I., Pillai, R., Vaglietti, L., and Hanne, T. (2024). Evaluating Retrieval-Augmented Generation Models for Financial Report Question and Answering. Appl. Sci., 14.10.3390/app14209318 ↗
13. A survey of knowledge enhanced pre-trained language models10.1109/TKDE.2023.3310002 ↗
14. Wang, X., Zhu, W., Saxon, M., Steyvers, M., and Wang, W.Y. (2024). Large language models are latent variable models: Explaining and finding good demonstrations for in-context learning. Advances in Neural Information Processing Systems, Proceedings of the Thirty-seventh Conference on Neural Information Processing Systems, New Orleans, LA, USA, 10–16 December 2023, Curran Associates, Inc.
15. Zhou, D., Schärli, N., Hou, L., Wei, J., Scales, N., Wang, X., Schuurmans, D., Cui, C., Bousquet, O., and Le, Q.V. (2023, January 1–5). Least-to-Most Prompting Enables Complex Reasoning in Large Language Models. Proceedings of the Eleventh International Conference on Learning Representations, Kigali, Rwanda.
16. Translating embeddings for modeling multi-relational data
17. Wang, Z., Zhang, J., Feng, J., and Chen, Z. (2014, January 27–31). Knowledge graph embedding by translating on hyperplanes. Proceedings of the AAAI Conference on Artificial Intelligence, Québec City, QC, Canada.10.1609/aaai.v28i1.8870 ↗
18. Lin, Y., Liu, Z., Sun, M., Liu, Y., and Zhu, X. (2015, January 25–30). Learning entity and relation embeddings for knowledge graph completion. Proceedings of the AAAI Conference on Artificial Intelligence, Austin, TX, USA.10.1609/aaai.v29i1.9491 ↗
19. Ji, G., He, S., Xu, L., Liu, K., and Zhao, J. (2015, January 26–31). Knowledge graph embedding via dynamic mapping matrix. Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), Beijing, China.10.3115/v1/P15-1067 ↗
20. Trouillon, T., Welbl, J., Riedel, S., Gaussier, É., and Bouchard, G. (2016, January 19–24). Complex embeddings for simple link prediction. Proceedings of the International Conference on Machine Learning. PMLR, New York, NY, USA.
21. Sun, Z., Deng, Z.H., Nie, J.Y., and Tang, J. (2019, January 6–9). RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space. Proceedings of the International Conference on Learning Representations, New Orleans, LA, USA.
22. Galárraga, L.A., Teflioudi, C., Hose, K., and Suchanek, F. (2013, January 13–17). AMIE: Association rule mining under incomplete evidence in ontological knowledge bases. Proceedings of the 22nd International Conference on World Wide Web, Rio de Janeiro, Brazil.10.1145/2488388.2488425 ↗
23. Fast rule mining in ontological knowledge bases with AMIE+10.1007/s00778-015-0394-1 ↗
24. Lajus, J., Galárraga, L., and Suchanek, F. (2020). Fast and exact rule mining with AMIE 3. The Semantic Web: 17th International Conference, ESWC 2020, Springer.10.1007/978-3-030-49461-2_3 ↗
25. An embedding-based approach to rule learning in knowledge graphs10.1109/TKDE.2019.2941685 ↗
26. Yang, F., Yang, Z., and Cohen, W.W. (2017). Differentiable learning of logical rules for knowledge base reasoning. Advances in Neural Information Processing Systems, Proceedings of the Thirty-First Annual Conference on Neural Information Processing Systems, Long Beach, CA, USA, 4–9 December 2017, Curran Associates, Inc.
27. Meilicke, C., Chekol, M.W., Ruffinelli, D., and Stuckenschmidt, H. (2019, January 10–16). Anytime bottom-up rule learning for knowledge graph completion. Proceedings of the 28th International Joint Conference on Artificial Intelligence, Macao, China.10.24963/ijcai.2019/435 ↗
28. Yao, L., Mao, C., and Luo, Y. (2019). KG-BERT: BERT for knowledge graph completion. arXiv.
29. Kenton, J.D.M.W.C., and Toutanova, L.K. (2019, January 2–7). Bert: Pre-training of deep bidirectional transformers for language understanding. Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Minneapolis, MN, USA.
30. Saxena, A., Kochsiek, A., and Gemulla, R. (2022, January 22–27). Sequence-to-Sequence Knowledge Graph Completion and Question Answering. Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Dublin, Ireland.10.18653/v1/2022.acl-long.201 ↗
31. Exploring the limits of transfer learning with a unified text-to-text transformer
32. Xie, X., Zhang, N., Li, Z., Deng, S., Chen, H., Xiong, F., Chen, M., and Chen, H. (2022, January 25–29). From discrimination to generation: Knowledge graph completion with generative transformer. Proceedings of the Companion Proceedings of the Web Conference 2022, Lyon, France.10.1145/3487553.3524238 ↗
33. Lewis, M. (2019). Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension. arXiv.10.18653/v1/2020.acl-main.703 ↗
34. Llms for knowledge graph construction and reasoning: Recent capabilities and future opportunities10.1007/s11280-024-01297-w ↗
35. Baek, J., Aji, A.F., and Saffari, A. (2023). Knowledge-augmented language model prompting for zero-shot knowledge graph question answering. arXiv.10.18653/v1/2023.nlrse-1.7 ↗
36. Zhang, Y., Chen, Z., Zhang, W., and Chen, H. (November, January 28). Making Large Language Models Perform Better in Knowledge Graph Completion. Proceedings of the 32nd ACM International Conference on Multimedia, Melbourne, Australia.
37. Wei, Y., Huang, Q., Zhang, Y., and Kwok, J. (2023, January 6–10). KICGPT: Large Language Model with Knowledge in Context for Knowledge Graph Completion. Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, Singapore.10.18653/v1/2023.findings-emnlp.580 ↗
38. Dettmers, T., Minervini, P., Stenetorp, P., and Riedel, S. (2018, January 2–7). Convolutional 2d knowledge graph embeddings. Proceedings of the AAAI Conference on Artificial Intelligence, New Orleans, LA, USA.10.1609/aaai.v32i1.11573 ↗
39. WordNet: A lexical database for English10.1145/219717.219748 ↗
40. Bollacker, K., Evans, C., Paritosh, P., Sturge, T., and Taylor, J. (2008, January 10–12). Freebase: A collaboratively created graph database for structuring human knowledge. Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data, Vancouver, BC, Canada.10.1145/1376616.1376746 ↗
41. Toutanova, K., and Chen, D. (2015, January 26–31). Observed versus latent features for knowledge base and text inference. Proceedings of the 3rd Workshop on Continuous Vector Space Models and Their Compositionality, Beijing, China.10.18653/v1/W15-4007 ↗
42. Akrami, F., Saeef, M.S., Zhang, Q., Hu, W., and Li, C. (2020, January 14–19). Realistic re-evaluation of knowledge graph completion methods: An experimental study. Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data, Portland, OR, USA.10.1145/3318464.3380599 ↗
43. KEPLER: A Unified Model for Knowledge Embedding and Pre-trained Language Representation10.1162/tacl_a_00360 ↗
44. Wikidata: A free collaborative knowledgebase10.1145/2629489 ↗
45. Wang, S., Li, S., and Zou, L. (2023, January 17–20). Analogy-Triple Enhanced Fine-Grained Transformer for Sparse Knowledge Graph Completion. Proceedings of the International Conference on Database Systems for Advanced Applications, Tianjin, China.10.1007/978-3-031-30672-3_50 ↗
46. Vaswani, A. (2017, January 4–9). Attention is all you need. In Advances in Neural Information Processing Systems. Proceedings of the 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA.
47. Transformer: A general framework from machine translation to others10.1007/s11633-022-1393-5 ↗
48. Tan, Z., Zhang, J., Huang, X., Chen, G., Wang, S., Sun, M., Luan, H., and Liu, Y. (2020, January 6–9). THUMT: An open-source toolkit for neural machine translation. Proceedings of the 14th Conference of the Association for Machine Translation in the Americas (Volume 1: Research Track), Online.10.1016/j.aiopen.2020.11.001 ↗