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 querying 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 \textbf{KaLM}, a \textit{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. Notably, our method achieves a significant performance boost in evaluations of knowledge-driven tasks, specifically embedding-based knowledge graph completion and generation-based knowledge graph question answering.
Following the Autoregressive Nature of LLM Embeddings via Compression and Alignment
Key Laboratory of AI Safety, Institute of Computing Technology, Chinese Academy of Sciences(中国科学院人工智能安全重点实验室,计算技术研究所);University of Chinese Academy of Sciences(中国科学院大学);Kuaishou Technology(快手科技)
Let LLMs Speak Embedding Languages: Generative Text Embeddings via Iterative Contrastive Refinement
Department of Computer Science and Information Engineering, National Taiwan University(国家台湾大学计算机科学与信息工程系);National Taiwan University AI Center of Research Excellence(国家台湾大学人工智能研究中心)
Seeing the Image: Prioritizing Visual Correlation by Contrastive Alignment
School of Computer Science, Wuhan University(武汉大学计算机学院);ByteDance Inc.(字节跳动公司);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院)