Manuscript Offprint

arXiv:2609.30894

Training Graph Foundation Models on The Web Graph

Ryoma Sato

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

Abstract

We introduce Acacia, a graph foundation model, trained on the web graph. Acacia (i) supports arbitrary feature dimensionalities and semantics without additional training, (ii) supports a wide range of tasks, including node classification, link prediction, node clustering, and graph generation, without additional training, (iii) has in-context learning capabilities, and (iv) does not rely on pretrained LLMs. In particular, existing graph foundation models often require training additional classification heads or feature projectors to accommodate new graphs or new labels, whereas Acacia does not. Moreover, existing graph foundation models often gain their capabilities by being stitched together with pretrained LLMs, whereas Acacia is trained from scratch using only the Common Crawl web graph. This is also an important result because it provides evidence that graph models can acquire emergent capabilities from scratch like LLMs.

1 Introduction

Graph structures appear in many forms, including social networks, citation networks, transportation networks, chemical compounds, text (one-dimensional sequences), and images (two-dimensional grids). Conventional approaches have built separate models for each graph domain or task. Models such as graph neural networks can use a single architecture for all kinds of graphs, but a particular set of model weights can only be used with a fixed feature dimensionality, fixed feature semantics, and a fixed task.

Many graph foundation models that can be applied to various tasks have been proposed in recent years. However, many of them depend on the representational power of LLMs or often require additional classification heads or feature projectors to accommodate new graphs or new labels [19, 40]. One For All [23] addresses the mismatch between feature representations across domains by expressing node features as text, feeding them into an LLM, and using the resulting representations as node embeddings. However, much of its capability depends on the LLM, and it is difficult to apply to features that are hard to express as text. AnyGraph [38] is based on a mixture of experts represented by GCNs and residual MLPs, and improves its capabilities through task-dependent routing, but does not achieve complete alignment for new graphs or new labels.

We propose Acacia 1^{1}, the first graph foundation model that (i) supports arbitrary feature dimensionalities and semantics without additional training, (ii) supports a wide range of tasks, including node classification, link prediction, node clustering, and graph generation, without additional training, (iii) has in-context learning capabilities, and (iv) does not rely on pretrained LLMs.

One distinguishing feature of Acacia is that it is trained exclusively on the Common Crawl web graph. Modern LLMs have developed through training on web data. Extending this idea to graph foundation models is a natural step. In particular, the web itself has a graph structure, and one could even argue that it is better suited to graph models than to text models. The web's link structure contains diverse topologies that are connected in a “natural” way. Learning this structure is expected to enable graph foundation models to handle a variety of graph structures.

Acacia is a decoder-only autoregressive Transformer model, like GPT. Acacia has three types of token, i.e., nodes, edges, and labels, which it generates sequentially. This approach enables a variety of tasks.

1^{1}Acacia is a tree. A tree is a graph. Therefore, Acacia is a graph.

Figure

Figure 1: Token types. Acacia has four types of tokens: headers, nodes, edges, and node labels.

Generating everything from the beginning yields a graph generation model. Given a graph, filling in its nodes and edges as input to Acacia and generating labels as a continuation enables node classification or node clustering. If the labels of some nodes are known, filling in those labels as well enables transductive classification. Retrieving examples from other labeled graphs and prepending them as separate connected components enables in-context learning. Thus, a single model can perform various tasks by using a decoder-only autoregressive Transformer, as in LLMs, and choosing how to arrange the input tokens.

We trained Acacia-315m, a model with 315M parameters, on 11 billion tokens, obtaining model weights that achieve nontrivial node clustering accuracy in a fully unsupervised setting and possess in-context learning capabilities. These model weights are publicly available on Hugging Face 2^{2}. Obtaining a graph foundation model with such general capabilities entirely from scratch, without relying on pretrained LLMs, is an important result in itself.

References (44)