arXiv:2610.06694cs.LGOct 2026

Manuscript Offprint

arXiv:2610.06694

To Learn is to Wander: Learning Across Graphs and Tasks with Random Walks

Louis Tichelman, Xingyue Huang, Jinwoo Kim, İsmail İlkan Ceylan

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Louis Tichelman1,2^{1,2}, Xingyue Huang3^{3}, Jinwoo Kim4^{4}, Ismail Ilkan Ceylan1,2,3^{1,2,3}

1^{1}TU Wien 2^{2}AITHYRA 3^{3}University of Oxford 4^{4}KAIST

Abstract. Graph foundation models aim to transfer across graphs, feature spaces, relational schemas, and prediction tasks, yet existing approaches typically generalize only within particular graph modalities or tasks. We propose WANDER, a graph foundation model designed to operate across these settings within a single pretrained checkpoint. Following the prior-predictive perspective, we formulate graph learning as completion of a partially observed graph. We realize this task-general view through a common interface based on random walks, allowing the same model to operate across homogeneous and multi-relational graphs with varying features, labels, and relational schemas. WANDER can increase its structural context at inference time without changing its learned parameters and, under suitable assumptions, universally approximates the corresponding Bayes-optimal predictor on bounded connected graphs. Empirically, a single pretrained checkpoint achieves state-of-the-art or highly competitive results across node classification, homogeneous link prediction, and knowledge-graph link prediction. Moreover, joint pretraining across graph modalities and tasks preserves performance in specialized settings while enabling positive transfer and the composition of separately learned capabilities at inference time.

Code: https://github.com/louistichelman/wander-gfm

1 Introduction

Graph-structured data arises across a wide range of domains, from molecules and citation networks to social systems and knowledge graphs (Pei et al., 2020; Liben-Nowell and Kleinberg, 2003; Huang et al., 2023b). These domains differ in the information associated with their graphs and in the prediction problems of interest, and graph-learning models have traditionally been trained end-to-end for a specific task setting. Graph foundation models aim to make learning on such data more general: rather than training a separate model for every graph and task, the goal is to learn models that transfer across graphs, feature spaces, relation types, and prediction problems.

Existing approaches, however, only partially realize this goal and the emerging landscape of GFMs remains fragmented, as summarized in Table 1: some generalize node prediction across attributed homogeneous graphs with arbitrary feature and label spaces (Zhao et al., 2025; Xia and Huang, 2026; Finkelshtein et al., 2025; Hayler et al., 2025; Choi et al., 2026; Eremeev et al., 2026), some others generalize link prediction across knowl-

Table 1 Existing GFMs generalize across different subsets of graph modalities and prediction tasks. WANDER uses a single model across both node- and edge-level tasks on homogeneous and multi-relational graphs.

Graph Foundation Model FamiliesInput GraphsPrediction Task
node featuresedge typesnode propertylink
ULTRA (2024), FLOCK (2025)✕✓✕✓
OPENGRAPH, ANYGRAPH (2024)✓✕✓✓
TS-NET (2026), GRAPHPFN (2025)✓✕✓✕
UNILP (2024), TFMLINKER (2026)✕✕✕✓
Wander (ours)✓✓✓✓

edge graphs with arbitrary relational vocabularies (Galkin et al., 2024; Zhang et al., 2024; Huang et al., 2025; Kim et al., 2026), and some focus on link prediction on homogeneous graphs (Dong et al., 2024; Liao et al., 2026). What is still missing is a unified formulation that spans these different graph-learning settings. This leaves two closely related questions: what predictive function should such a general graph foundation model learn? How can a single architecture realize this function across previously unseen graphs, feature spaces, relations, and tasks?

This work makes three contributions toward answering these questions:

(1) A task-general predictive objective. We answer the first question through a probabilistic view of graph learning. Following the prior-predictive perspective of TABPFN (Hollmann et al., 2023), we view an observed graph as a partially specified realization of an underlying complete graph drawn from a graph distribution. Node- and edge-level prediction problems can then be expressed as completion tasks on this partially observed graph: completing node labels corresponds to node classification, while completing edges corresponds to link prediction. More generally, each task defines a query about an unobserved component of the graph, with the Bayes-optimal prediction given by the posterior expectation of the query-dependent target conditioned on the observation. This gives one predictive function across graph-learning tasks.

(2) A common computational architecture. Realizing this task-general predictor requires a common interface that can operate across varying graph structures, feature spaces, relations, and label spaces. We propose WANDER, which uses random walks as this interface. Random walks have a long history in graph learning (Perozzi et al., 2014; Grover and Leskovec, 2016; Tönshoff et al., 2021; Tan et al., 2023; Kim et al., 2025), and have recently re-emerged as a computational primitive in knowledge graph foundation models (Kim et al., 2026). WANDER extends this interface across graph settings and prediction tasks by representing features, labels, and structure through separate channels and processing their information along sampled walks, enabling a single architecture to operate on homogeneous and multi-relational graphs, accommodate varying feature and label spaces, and answer both node- and edge-level queries. It has three properties particularly useful for a foundation model.

• Unlike message-passing GFMs (Finkelshtein et al., 2025; Eremeev et al., 2026), whose structural context is fixed by network depth, WANDER can flexibly adjust its structural context at inference time by varying its random-walk sampling strategy, without modifying its learned parameters.

• Random-walks can capture structural properties beyond standard message passing architectures. We formalize this by showing that, under suitable capacity assumptions, WANDER is a universal approximator of the Bayes-optimal graph predictor on bounded connected graphs (Theorem 3).

• WANDER is permutation equivariant in distribution, allowing stochastic symmetry breaking while respecting graph symmetries at the distributional level to facilitate generalization (Proposition 4).

(3) A generalist model with compositional and adaptable capabilities. Empirically, we evaluate a single pretrained WANDER checkpoint across node classification, homogeneous link prediction, and knowledge-graph link prediction, obtaining state-of-the-art or highly competitive results across all three settings. Beyond this breadth, joint pretraining yields positive transfer across graph-learning settings. Further to this, WANDER can combine separately learned capabilities to solve new task settings. Finally, its random-walk interface supports adaptation without parameter updates: expanding or targeting the sampled context improves long-range reasoning on synthetic and real-world graphs. Together, these findings show benefits of unification beyond task coverage alone.