Semantic-Condition Tuning: Fusing Graph Context with Large Language Models for Knowledge Graph Completion
Liu, Wen, Sun et al.
Fusing Knowledge Graphs with Large Language Models is crucial for knowledge-intensive tasks like knowledge graph completion. The prevailing paradigm, prefix-tuning, simply concatenates knowledge embeddings with text inputs. However, this shallow fusion overlooks the rich relational semantics within KGs and imposes a significant implicit reasoning burden on the LLM to correlate the prefix with the text. To address these, we propose Semantic-condition Tuning (SCT), a new knowledge injection paradigm comprising two key modules. First, a Semantic Graph Module employs a Graph Neural Network to extract a context-aware semantic condition from the local graph neighborhood, guided by knowledge-enhanced relations. Subsequently, this condition is passed to a Condition-Adaptive Fusion Module, which, in turn, adaptively modulates the textual embedding via two parameterized projectors, enabling a deep, feature-wise, and knowledge-aware interaction. The resulting pre-fused embedding is then fed into the LLM for fine-tuning. Extensive experiments on knowledge graph benchmarks demonstrate that SCT significantly outperforms prefix-tuning and other strong baselines. Our analysis confirms that by modulating the input representation with semantic graph context before LLM inference, SCT provides a more direct and potent signal, enabling more accurate and robust knowledge reasoning.
academic
Semantic-Condition Tuning: Fusing Graph Context with Large Language Models for Knowledge Graph Completion
This paper proposes Semantic-Condition Tuning (SCT), a novel knowledge injection paradigm to address the fusion of knowledge graphs with large language models in knowledge graph completion tasks. Traditional prefix tuning methods simply concatenate knowledge embeddings with text inputs, and this shallow fusion ignores the rich relational semantics in knowledge graphs while imposing a heavy implicit reasoning burden on LLMs. SCT comprises two key modules: a semantic graph module that uses graph neural networks to extract context-aware semantic conditions from local graph neighborhoods; and a condition-adaptive fusion module that adaptively modulates text embeddings through two parameterized projectors, enabling deep, feature-level, and knowledge-aware interactions.
Knowledge Graph Incompleteness: Real-world knowledge graphs are inherently incomplete, limiting their utility in downstream applications
Limitations of Shallow Fusion: Existing prefix tuning methods only perform simple concatenation operations, failing to fully exploit the structural information of knowledge graphs
Dynamicity of Relational Semantics: The meaning of relations changes dynamically based on surrounding semantic context, as illustrated in Figure 1 where the "treats" relation represents different treatment mechanisms in different contexts
Proposes SCT Framework: The first semantic condition tuning framework integrating context-aware and adaptive embedding fusion, overcoming the limitations of simple prefix tuning concatenation
Semantic Graph Module: Introduces a novel relation-centric message passing mechanism where neighbor selection is guided by explicit semantic similarity scores from knowledge-enhanced relation descriptions
Condition-Adaptive Fusion Module: Introduces a fusion mechanism that uses semantic conditions to learn direct feature-level affine transformations of input text embeddings, enabling deep synergistic integration of graph context
Performance Validation: Demonstrates state-of-the-art performance and high parameter efficiency of SCT across multiple benchmarks
A knowledge graph G is defined as a set of triples T = {(h, r, t) | h, t ∈ E, r ∈ R}, where E and R represent entity and relation sets respectively. The knowledge graph completion task is to infer missing elements in given triples, such as predicting the tail entity t for query (h, r, ?). In LLM-based KGC, this task is formalized as a text generation problem.
Semantic Enhancement Effects:
For query (Barack Obama, /government/politician/government_positions_held..., ?):
Without Knowledge Enhancement: Based on lexical overlap, Gov Position (Title) ranks high
With Knowledge Enhancement: Semantically related concepts like Person (Nationality) rank higher, reflecting the transition from shallow text matching to true semantic relevance
Hyperparameter Sensitivity:
The Top-K parameter achieves optimal performance at K=10 (MRR=0.471, Hits@1=0.380), with K=4 being insufficient and K=32 introducing noise.
The paper cites 80 related references covering multiple domains including knowledge graph embeddings, graph neural networks, and large language models, providing a solid theoretical foundation. Key references include classical KG embedding methods like TransE and RotatE, as well as representative LLM-KG fusion works like KG-BERT and KoPA.