Modality-free Graph In-context Alignment
Wei Zhuo, Siqiang Luo · 2026
Read Modality-free Graph In-context Alignment by Wei Zhuo, Siqiang Luo (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2603-13434.txt.
Introduction
Wei Zhuo and Siqiang Luo present MF-GIA, a way to make graph encoders work across domains with few examples. A pretrained encoder is normally fixed, so it cannot adapt to a new task on the fly. MF-GIA reads domain traits from gradient fingerprints, which are small summaries of how the model reacts. These drive light changes that align features and labels into one shared space. A dual attention step learns to match queries with support examples. At test time, a few support examples trigger the alignment.
Catalog record
| CREATOR | Wei Zhuo, Siqiang Luo |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 102518 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2603.13434
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Modality-free Graph In-context Alignment Wei Zhuo, Siqiang Luo Abstract In-context learning (ICL) converts static encoders into task-conditioned reasoners, enabling adaptation to new data from just a few examples without updating pretrained parameters. This capability is essential for graph foundation models (GFMs) to approach LLM-level generality. Yet current GFMs struggle with cross-domain alignment, typically relying on modality-specific encoders that fail when graphs are pre-vectorized or raw data is inaccessible. In this paper, we introduce M odality- F ree G raph I n-context A lignment (MF-GIA), a framework that makes a pretrained graph encoder promptable for few-shot prediction across heterogeneous domains without modality assumptions. MF-GIA captures domain characteristics through gradient fingerprints, which parameterize lightweight transformations that align pre-encoded features and indexed labels into unified semantic spaces. During pretraining, a dual prompt-aware attention mechanism with episodic objective learns to match queries against aligned support examples to establish prompt-based reasoning capabilities. At inference, MF-GIA performs parameter-update-free adaptation using only a few-shot support set to trigger cross-domain alignment and enable immediate prediction on unseen domains. Experiments demonstrate that MF-GIA achieves superior few-shot performance across diverse graph domains and strong generalization to unseen domains. The code is available at https://github.com/JhuoW/MF-GIA . 1 Introduction Table 1: Comparison of methods with respect to the three main criteria of true ICL. Method Post-Training Free Domain Alignment Modality-Free SSL-GNN ✗ ✗ ✓ All in One ( 51 ) ✗ ✗ ✓ GPF ( 8 ) ✓ ✗ ✓ GCOPE ( 67 ) ✗ ✓ ✓ GFT ( 58 ) ✗ ✓ ✗ Prodigy ( 22 ) ✓ ✗ ✓ Unigraph ( 16 ) ✓ ✓ ✗ AutoGFM ( 3 ) ✗ ✓ ✗ GraphAlign ( 18 ) ✓ ✓ ✗ OFA ( 30 ) ✓ ✓ ✗ GOFA ( 26 ) ✓ ✓ ✗ MF-GIA ✓ ✓ ✓ The remarkable success of Large Language Models (LLMs) has fundamentally revolutionized AI, with in-context learning ( 2 ; 66 ; 35 ) emerging as a pivotal capability that enables these models to adapt to new tasks through mere exposure to a few demonstration examples, without any parameter updates like fine-tuning. This paradigm shift, from task-specific fine-tuning to prompt-based adaptation, naturally sparks a profound question for the graph learning community: Can we achieve similar foundation-level generality for graph-structured data? Unlike sequential text where context flows naturally, graphs encode complex topological patterns, multi-hop dependencies, and heterogeneous node and edge attributions that demand fundamentally new approaches to demonstration selection, prompt design, and reasoning. Achieving true graph in-context learning demands three fundamental criteria that remain elusive in existing methods. First, post-training-free inference is essential for genuine ICL, where models must adapt to new tasks through demonstrations alone, without fine-tuning or learnable prompt engineering. Second, cross-domain alignment enables a single model to reason across diverse graph types within a unified semantic space, mirroring LLMs’ domain-agnostic capabilities. Third, modality-free operation ensures that the model can process arbitrary pre-encoded graphs without requesting raw data, crucial for the heterogeneous domains of real-world graphs. As shown in Table 1 , prior approaches fall short of meeting all three criteria at once: self-supervised GNNs ( 61 ; 44 ) and GFMs like All in One ( 51 ) , GCOPE ( 67 ) , and GFT ( 58 ) compromise ICL through required post-training on downstream graphs, where All in One trains task-specific prompts while GCOPE and GFT require fine-tuning; GPF ( 8 ) and Prodigy ( 22 ) lack cross-domain alignment, limiting their generalization on graphs from unseen domains; recent advances like UniGraph ( 16 ) , GraphAlign ( 18 ) , and OFA ( 30 ) achieve alignment and post-training-free inference, yet sacrifice modality freedom by requiring conversion to a single unified modality (e.g., text-attributed graphs) for alignment, making them inapplicable when raw data are inaccessible or when graphs are already pre-encoded by domain-specific pipelines. More related work is discussed in Appendix A . In this work, we present Modality-free Graph In-context Alignment (MF-GIA), the first GFM to achieve all three criteria for true in-context learning on graphs. Our key insight is that the interaction between a graph and a shared frozen encoder reveals its domain characteristics, which can be captured by a gradient fingerprint: a single-step parameter update that encodes how features, labels, and structure jointly influence the model. This fingerprint drives lightweight domain-conditioned transformations that align pre-encoded features and graph-local label IDs into unified semantic spaces, where related domains occupy neighboring subspaces while preserving intra-domain geometry, thereby achieving modality-free domain alignment. The aligned features and labels are then processed by Dual Prompt-Aware Attention (DPAA) optimized with an episodic objective that learns to match queries against support examples. This approach establishes prompt-based in-context reasoning that simulates the few-shot scenarios faced at test time. At inference, given a few labeled examples as prompts, MF-GIA computes the fingerprint, instantiates the aligners, and performs parameter-update-free prediction on unseen domains. Experiments across diverse benchmarks demonstrate that MF-GIA excels at few-shot node-level tasks, generalizes to entirely unseen domains without additional training, and transfers seamlessly to edge-level tasks. These results bring GFMs closer to the universal in-context learning capabilities exhibited by LLMs. 2 Preliminaries Following the ICL setup of the pioneering work Prodigy ( 22 ) , we study few-shot, prompt-based node and edge classification. In this section, we formalize graph ICL as episodic classification over graphs and introduce a modality-free alignment perspective that standardizes features and labels across domains. 2.1 Graph In-context Learning Let \mathcal{G}=\{G_{1},G_{2},\cdots,G_{M}\} denote a collection of M graphs drawn from heterogeneous domains, where each graph G_{i}=(V_{i},E_{i},\mathbf{X}_{i},\mathbf{Y}_{i}) comprises a node set V_{i} , an edge set E_{i}\subseteq V_{i}\times V_{i} , node features \mathbf{X}_{i}=\{x_{i,1},\cdots,x_{i,|V_{i}|}\}\in\mathbb{R}^{|V_{i}|\times d_{i}} , and labels \mathbf{Y}_{i} . The node features \mathbf{X}_{i} may exist in domain-specific formats (e.g., dense vectors, categorical attributes, IDs), with potentially different dimensions d_{i} . To pretrain a universal model across these graphs with a common input width, following ( 62 ; 67 ) , we first unify feature dimensions to d_{o} by applying SVD on each \mathbf{X}_{i}\leftarrow\mathrm{SVD}(\mathbf{X}_{i})\in\mathbb{R}^{|V_{i}|\times d_{o}} . Depending on the task, \mathbf{Y}_{i} is either a node-label vector \mathbf{Y}^{\text{node}}_{i}=\{0,1,\cdots,C_{i}^{\text{node}}-1\}^{|V_{i}|} or an edge-label vector \mathbf{Y}^{\text{edge}}_{i}=\{0,1,\cdots,C_{i}^{\text{edge}}-1\}^{|E_{i}|} , where C_{i}^{\text{node}} and C_{i}^{\text{edge}} denote the number of node and edge classes in G_{i} , respectively. A universal GNN encoder f_{\theta}:\mathbb{R}^{d_{o}}\rightarrow\mathbb{R}^{d} maps graph items (nodes or edges) to d -dimensional representations. For node classification, the representation of v\in V_{i} is h_{i,v}=f_{\theta}(v;G_{i})\in\mathbb{R}^{d} . For edge classification, we analogously obtain \mathbf{h}_{i,e}=f_{\theta}(e;G_{i}) for e\in E_{i} using endpoint features and structure as needed. We use the generic symbol w to denote an item ( w=v or w=e ). Figure 1: Overview of MF-GIA. (Left) Modality-free Alignment: The pretraining graphs are mapped to a unified space via domain-conditioned transformations. Domain descriptors e ensure similar domains occupy neighboring subspaces. (Middle) Episodic Pretraining: The model learns from m -way k -shot episodes using domain-aligned features and labels. The DPAA mechanism matches queries to classes using only prompts as context. (Right) In-context Prediction: For an unseen graph, the frozen model performs few-shot classification using the support set as a prompt. Given \mathcal{G} as a pretraining corpus with M graphs and a target graph G_{\text{new}}=(V_{\text{new}},E_{\text{new}},\mathbf{X}_{\text{new}},\mathbf{Y}_{\text{new}}) from an unseen domain with C_{\text{new}} classes, graph in-context learning aims to classify graph items in G_{\text{new}} using a few labeled examples per class