AGE: Adaptive-masking for Graph Embedding in Graph Retrieval-Augmented Generation
arXiv · HuggingFace · ▲2
Abstract (verbatim)
GraphRAG is an extension of retrieval-augmented generation (RAG) that supports large language models (LLMs) by referring to graph-structured data as external knowledge. While this technique ideally captures intricate relationships, it often struggles with graph representations for LLMs, particularly for frozen LLMs, due to the misalignment between graph-based and text-based latent features. We tackle this issue by introducing the {\it Adaptive-masking for Graph Embedding (AGE)}. AGE employs a Transformer in a mask-based self-supervised learning (SSL) approach. We designed the architecture similar to text embedding encoders, addressing the latent feature misalignment. In contrast to natural language texts, graphs are concise representations, and there exist {\it key nodes} that hold dominant contextual information, which are challenging to predict from their surroundings. Masking such key nodes leads to inefficiency in the SSL process. Therefore, AGE focuses on predicting nodes apart from key nodes, utilizing a learnable node sampler. Our experimental results indicate that AGE significantly improves approaches using non-parametric search component in GraphQA tasks, achieving superior accuracy across four benchmark datasets with distinct characteristics.
Background
Background Analysis
1. Technical Context
Large Language Models (LLMs) like GPT and Claude have advanced natural language understanding, but they struggle to access domain-specific structured knowledge (e.g., entity relationships in graphs) without retraining. Retrieval-Augmented Generation (RAG) addresses this by supplementing LLMs with external data, but traditional RAG fails to capture complex relationships effectively. Graph-Retrieval Augmented Generation (GraphRAG) improves this by using graph-structured data (nodes and edges) to represent relationships intuitively, which is useful in fields like healthcare or law (e.g., linking diseases to symptoms or regulations to cases). However, aligning graph structures with LLMs’ text-based representations remains challenging.
2. Previous Limitations
Existing approaches face two main issues:
- High Cost vs. Efficiency Tradeoff: Fine-tuning LLMs improves performance but is resource-intensive, while non-parametric retrievers (e.g., graph-based neural retrievers) are efficient but may miss critical nodes or include redundant information.
- Feature Misalignment: Graph embeddings often fail to match LLMs’ text-based feature spaces, leading to poor performance. For example, randomly masking nodes during self-supervised learning (SSL) disrupts key entities, degrading representation quality.
3. Proposed Solution
This paper introduces Adaptive-masking for Graph Embedding (AGE) to address these issues:
- Text-like Embedding Mechanism: AGE mimics LLMs’ mask-based SSL (e.g., RoBERTa) to align graph and text feature spaces, ensuring graph embeddings are interpretable by LLMs.
- Selective Node Masking: A reinforcement learning (RL)-trained sampler identifies "key nodes" (core entities) and masks only "auxiliary nodes" (secondary relationships), preserving graph integrity.
- JEPA Integration: The Joint-Embedding Predictive Architecture (JEPA) optimizes representations by eliminating redundant details, improving retrieval efficiency.
4. Key Differences
Unlike prior work, AGE:
- Optimizes Frozen LLMs: It enhances graph embeddings without fine-tuning LLMs, reducing computational costs.
- Adaptive Masking Strategy: RL-guided masking outperforms random masking by preserving critical nodes.
- Efficient Non-Parametric Retrieval: It achieves state-of-the-art (SOTA) results on benchmarks while maintaining low resource usage.
This approach provides a more accurate and efficient solution for GraphRAG in complex tasks like graph-based question answering.




