About the journal
Browse
Collections
Multimedia collections
Authors & reviewers
KaLM: knowledge-aligned autoregressive language modeling via dual-view knowledge graph contrastive learning
Peng YU , Cheng DENG , Beiya DAI , Luoyi FU , Xinbing WANG , Guihai CHEN , Ying WEN
Front. Comput. Sci. ›› 2027, Vol. 21 ›› Issue (2) : 2102348
Autoregressive large language models (LLMs) pre-trained by next token prediction are inherently proficient in generative tasks. However, their performance on knowledge-driven tasks such as factual knowledge reasoning remains unsatisfactory. Knowledge graphs (KGs), as high-quality structured knowledge bases, can provide reliable knowledge for LLMs, potentially compensating for their knowledge deficiencies. Aligning LLMs with explicit, structured knowledge from KGs has been a challenge; previous attempts either failed to effectively align knowledge representations or compromised the generative capabilities of LLMs, leading to less-than-optimal outcomes. This paper proposes KaLM, a Knowledge-aligned Language Modeling approach, which fine-tunes autoregressive LLMs to align with KG knowledge via the joint objective of explicit knowledge alignment and implicit knowledge alignment. The explicit knowledge alignment objective aims to directly optimize the knowledge representation of LLMs through dual-view knowledge graph contrastive learning. The implicit knowledge alignment objective focuses on incorporating textual patterns of knowledge into LLMs through triple completion language modeling. The proposed KaLM is a unified framework designed to leverage domain knowledge from KGs for post-training of LLMs, aiming to enhance their knowledge reasoning capabilities and achieve generalization of knowledge representations. Our method achieves a significant performance boost in evaluations of knowledge-driven tasks, particularly in embedding-based knowledge graph completion and generation-based knowledge graph question answering, and also demonstrates strong generalization in out-of-domain (OOD) knowledge representation experiments.
large language models / knowledge alignment / post training
| [1] |
|
| [2] |
|
| [3] |
|
| [4] |
|
| [5] |
|
| [6] |
|
| [7] |
|
| [8] |
Ethayarajh K. How contextual are contextualized word representations? Comparing the geometry of BERT, ELMo, and GPT-2 embeddings. In: Proceedings of 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP). 2019, 55–65 |
| [9] |
Li B, Zhou H, He J, Wang M, Yang Y, Li L. On the sentence embeddings from pre-trained language models. In: Proceedings of 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP). 2020, 9119–9130 |
| [10] |
|
| [11] |
|
| [12] |
|
| [13] |
|
| [14] |
|
| [15] |
Yao L, Peng J, Mao C, Luo Y. Exploring large language models for knowledge graph completion. In: Proceedings of 2025 IEEE International Conference on Acoustics, Speech and Signal Processing. 2025, 1–5 |
| [16] |
|
| [17] |
Fu P, Zhang Y, Wang H, Qiu W, Zhao J. Revisiting the knowledge injection frameworks. In: Proceedings of 2023 Conference on Empirical Methods in Natural Language Processing. 2023, 10983–10997 |
| [18] |
|
| [19] |
Jiang J, Zhou K, Dong Z, Ye K, Zhao X, Wen J R. StructGPT: A general framework for large language model to reason over structured data. In: Proceedings of 2023 Conference on Empirical Methods in Natural Language Processing. 2023, 9237–9251 |
| [20] |
|
| [21] |
|
| [22] |
|
| [23] |
|
| [24] |
|
| [25] |
Taori R, Gulrajani I, Zhang T, Dubois Y, Li X, Guestrin C, Liang P, Hashimoto T B. Stanford alpaca: An instruction-following llama model, 2023 |
| [26] |
|
| [27] |
|
| [28] |
|
| [29] |
|
| [30] |
|
| [31] |
|
| [32] |
|
| [33] |
|
| [34] |
|
| [35] |
|
| [36] |
|
| [37] |
|
| [38] |
|
| [39] |
|
| [40] |
|
| [41] |
|
| [42] |
Talmor A, Berant J. The web as a knowledge-base for answering complex questions. In: Proceedings of 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers). 2018, 641–651 |
| [43] |
|
| [44] |
|
| [45] |
|
| [46] |
|
| [47] |
|
| [48] |
|
| [49] |
|
| [50] |
|
| [51] |
|
Higher Education Press
/
| 〈 |
|
〉 |