Topology-Injected Masked Fine Tuning for Graph-Conditioned Language Models
Abstract
Conditioning a language model on non-linguistic structure requires deciding where in its representation space that structure should enter. The dominant convention projects a graph encoder’s output into the token embedding space and prepends it as a prefix, leaving the entity’s own textual representation untouched. We study an alternative: replacing the entity’s token embeddings in place, at the positions where the entity is actually mentioned. We propose Topology-Injected Masked Fine-Tuning (TIM-FT), a masked fine-tuning scheme that teaches the language model to condition on structural graph embeddings without expanding its vocabulary. TIM-FT is length-preserving and targets the realistic regime in which a structural representation exists for only a minority of entities. On two public temporal-graph benchmarks, in-place replacement outperforms four prefix-based fusion schemes and five further baselines across all ten evaluated configurations, while prefix-based fusion of the same embeddings does not reliably improve on a text-only model.