NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Unleashing the Power of LLMs as Multi-Modal Encoders for Text and Graph-Structured Data

Jiacheng Lin, Kun Qian, Haoyu Han, Nurendra Choudhary, Tianxin Wei, Zhongruo Wang, Sahika Genc, Edward W. Huang, Sheng Wang, Karthik Subbian, Danai Koutra, Jimeng SunarXiv 2024 · DOI

TL;DR

This paper introduces GT2Vec, a novel framework that leverages Large Language Models (LLMs) to create unified embeddings for text and graph-structured data. By using an MLP adapter to project graph embeddings into the LLM's space and employing contrastive learning for alignment, GT2Vec significantly improves performance on tasks like question answering, classification, and retrieval, outperforming existing methods.

What Problem Does This Paper Address?

Natural language processing (NLP) tasks often benefit from incorporating structured information, such as knowledge graphs (KGs). While text embeddings are standard, integrating graph data has been challenging. Previous methods, relying on MLPs or shallow transformers, struggle to fully exploit the rich, heterogeneous information present in both text and graphs. This limitation hinders the creation of truly comprehensive and expressive joint embeddings, impacting performance on downstream tasks. The authors aim to bridge this gap by proposing a method that effectively fuses text and graph information using the advanced capabilities of LLMs.

Methods

GT2Vec's core innovation lies in its use of LLMs as powerful encoders for multimodal data. The framework consists of three main components:

  • Graph Encoder: A Graph Attention Network (GAT) is used to extract embeddings from the input graph. A novel step involves adding a "query node" to the graph, initialized by encoding the input query text, and connecting it to relevant nodes in the graph to enhance context.
  • MLP Adapter: Graph embeddings are transformed into the same embedding space as text embeddings using a two-layer MLP. This allows the LLM to process both modalities together.
  • LLM Backbone: The transformed graph embeddings are prepended to the text embeddings, forming a unified input sequence for the LLM. The LLM then processes this sequence to generate joint embeddings.
  • Contrastive Learning for Alignment: To ensure better alignment between graph and text representations, GT2Vec employs contrastive learning. This involves creating positive pairs (original graph + text) and negative pairs (unrelated graph-text combinations) to train the model to distinguish between semantically aligned and unaligned data. This alignment is crucial for richer, more integrated representations.

Datasets

The authors evaluated GT2Vec on several datasets across three tasks:

  • KG-Contextualized QA: CommonsenseQA, OpenBookQA, and MedQA-USMLE. These datasets involve answering questions using both text and a subgraph context from a KG.
  • Graph-Text Pair Classification: A dataset constructed from WebNLG, focusing on determining the relevance between a graph and its textual description.
  • Retrieval: SciFact and FiQA, which involve retrieving relevant documents or sentences based on a query with graph context.

Key Insights and Ideas

  • LLMs as Multimodal Encoders: The paper demonstrates that LLMs, traditionally used for generation, can be highly effective as encoders for multimodal data, surpassing previous methods that relied on simpler architectures.
  • Graph-Text Alignment is Crucial: The contrastive learning mechanism for aligning graph and text embeddings is shown to be vital for improving performance, directly correlating with better accuracy.
  • Unified Embedding Space: Projecting graph embeddings into the LLM's text embedding space is a key enabler for seamless integration and joint processing.
  • Robustness to LLM Choice: GT2Vec shows flexibility in adopting various LLM backbones, with larger models generally yielding better performance.

Key Results

GT2Vec consistently outperformed existing baselines across all evaluated tasks and datasets.

  • KG-Contextualized QA: Achieved state-of-the-art results, with test accuracies of 81.39% on CommonsenseQA and 88.13% on OpenBookQA (and 93.67% with scientific facts). On MedQA-USMLE, it reached 53.4%, outperforming domain-specific models.
  • Graph-Text Pair Classification: Achieved 89.70% accuracy on the WebNLG dataset, significantly outperforming baselines by at least 4.72%.
  • Retrieval: Achieved the best performance on both SciFact and FiQA datasets, as measured by NDCG@10.

Ablation studies confirmed the importance of graph context information and the graph-text alignment strategy.

Limitations and Future Work

  • Limited Modalities: GT2Vec currently focuses on text and graphs. Incorporating other modalities like images is a potential area for future research.
  • Alignment Refinement: While effective, further opportunities may exist to refine the graph-text alignment for even broader generalization across diverse tasks and domains.

Summary updated

BibTeX
@misc{lin2024unleashing,
  author = {Jiacheng Lin and Kun Qian and Haoyu Han and Nurendra Choudhary and Tianxin Wei and Zhongruo Wang and Sahika Genc and Edward W. Huang and Sheng Wang and Karthik Subbian and Danai Koutra and Jimeng Sun},
  title = {{Unleashing the Power of LLMs as Multi-Modal Encoders for Text and Graph-Structured Data}},
  year = {2024},
  eprint = {2410.11235},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.11235},
}
Figure