SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.05568 · ICML · 2025

Griffin: Towards a Graph-Centric Relational Database Foundation Model

David Wipf, Muhan Zhang, Quan Gan, Yanbo Wang, Xiyuan Wang, Minjie Wang, Qibin Yang

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 3 failures of our instrument; 3 no recorded run), measured 2026-11-24; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2505.05568.json · badge: /api/ran/2505.05568.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
yanxwb/griffin canonical (classifier label)
classifier basis: classifier_2025
5 ran · 3 no recorded run
FunctionStatusWhere it lives
RMPNN Ran
ran on a synthesized input
yanxwb/griffin/hmodel.py
code served (permissive licence) · get_code("7915517bfa8f8dd3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch import Tensor
from torch_geometric.nn.aggr import MeanAggregation, MaxAggregation

class RMPNN(nn.Module):

    def __init__(self, hiddim) -> None:
        super().__init__()
        self.rellin = nn.Sequential(nn.Linear(hiddim, hiddim))
        self.aggr1 = MeanAggregation()
        self.aggr2 = MaxAggregation()

    def reset_parameters(self) -> None:
        return self.rellin[0].reset_parameters()

    def forward(self, x: Tensor, edge_index: Tensor, edge_attr_type: Tensor, edge_attr: Tensor) -> Tensor:
        if edge_index is None or edge_index.shape[1] == 0:
            return 0 * self.rellin(x[0])
        edge_attr = self.rellin(edge_attr)
        center, inv = torch.unique(torch.stack((edge_index[0], edge_attr_type), dim=0), dim=1, return_inverse=True)
        out1 = self.aggr1(x[edge_index[1]], inv, dim_size=center.shape[1])
        out2 = self.aggr2(out1 * edge_attr[center[1]], center[0], dim_size=x.shape[0])
        return out2


INIT_ARGS = {
    'hiddim': 4
}

ARGS = {
    'x': torch.randn(3, 4),
    'edge_index': torch.tensor([[0, 1, 2], [1, 2, 0]], dtype=torch.long),
    'edge_attr_type': torch.tensor([0, 1, 0], dtype=torch.long),
    'edge_attr': torch.randn(3, 4)
}

if __name__ == '__main__':
    model = RMPNN(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch, torch_geometric — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (3, 4) — shape (3, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SelfAttentionAggregator Ran
ran on a synthesized input
yanxwb/griffin/hmodel.py
code served (permissive licence) · get_code("11386c5bd45cc746")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# INIT_ARGS for SelfAttentionAggregator.__init__
INIT_ARGS = {
    'hiddim': 8,
    'num_heads': 2,
    'num_layer': 1,
    'dim_feedforward': 16,
    'dropout': 0.1
}

# ARGS for SelfAttentionAggregator.forward
# forward signature: forward(self, tar: Union[Tensor, None], column_name_emb: Tensor, x, mask=None)
# Looking at the forward method:
# - column_name_emb is unsqueezed to add batch dim, then expanded to match x.shape[0]
# - x has shape (batch, seq_len, hiddim)
# - tar (q) is used as query in crossattention
# - mask is key_padding_mask for attention

batch_size = 2
seq_len = 5
num_columns = 3
hiddim = INIT_ARGS['hiddim']

ARGS = {
    'tar': torch.randn(batch_size, 1, hiddim),  # query tensor
    'column_name_emb': torch.randn(num_columns, hiddim),  # column embeddings (no batch dim initially)
    'x': torch.randn(batch_size, num_columns, hiddim),  # value tensor
    'mask': None  # optional mask
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
_attention_merge_feat_with_relation Ran
ran; our contract draft was wrong, not the code
yanxwb/griffin/hmodel.py
code served (permissive licence) · get_code("52e11df8e2d86ba6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch import Tensor
from typing import Union

torch.manual_seed(0)

# Build the SelfAttentionAggregator model
class SelfAttentionAggregator(nn.Module):
    def __init__(self, hiddim: int, num_heads=8, num_layer=1, dim_feedforward: int=None, dropout=0.1):
        super().__init__()
        if dim_feedforward is None:
            dim_feedforward = hiddim
        self.linq = nn.Linear(hiddim, hiddim, bias=False)
        self.crossattention = nn.MultiheadAttention(hiddim, num_heads, dropout, bias=False, batch_first=True)

    def forward(self, tar: Union[Tensor, None], column_name_emb: Tensor, x, mask=None):
        column_name_emb = column_name_emb.unsqueeze(0)
        q = tar
        ret = self.crossattention(q, column_name_emb.expand(x.shape[0], -1, -1), x, key_padding_mask=mask, need_weights=False)[0]
        return ret * self.linq(tar)

# Create a small SelfAttentionAggregator instance
hiddim = 4
num_heads = 2
attention_model = SelfAttentionAggregator(hiddim=hiddim, num_heads=num_heads, num_layer=1, dim_feedforward=8, dropout=0.1)

# Create tensors with distinct dimensions
batch_size = 2
num_columns = 3
hiddim = 4

# feat: (batch_size, num_columns, hiddim)
feat = torch.randn(batch_size, num_columns, hiddim)

# colfeat: (num_columns, hiddim) - column feature embeddings
colfeat = torch.randn(num_columns, hiddim)

# taskfeat: (batch_size, hiddim) - task feature, will be unsqueezed to (batch_size, 1, hiddim)
taskfeat = torch.randn(batch_size, hiddim)

# mask: optional key padding mask of shape (batch_size, num_columns)
mask = torch.zeros(batch_size, num_columns, dtype=torch.bool)

ARGS = {
    "attention_model": attention_model,
    "feat": feat,
    "colfeat": colfeat,
    "taskfeat": taskfeat,
    "mask": mask
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
checktaskfeat Ran
ran; our contract draft was wrong, not the code
yanxwb/griffin/hmodel.py
code served (permissive licence) · get_code("9ced55dcca7738bb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned list. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn

torch.manual_seed(0)

# Define a simple nn.Module
class SimpleModel(nn.Module):
    def __init__(self):
        super(SimpleModel, self).__init__()
        self.linear = nn.Linear(4, 4)

# Create some dummy tensors
taskfeat = [None, torch.randn(4)]
node = [(torch.randn(2, 4), torch.tensor([0, 1])), (torch.randn(3, 4), torch.tensor([0, 1, 2]))]

ARGS = {
    'taskfeat': taskfeat,
    'node': node
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_output Ran
ran; our contract draft was wrong, not the code
yanxwb/griffin/hmaintask_combine.py
code served (permissive licence) · get_code("3f4cad3bccd66e1b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Build a small model that returns a dict with a key for indexing
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        # Return a dict so we can index with mapping
        return {'output': self.linear(x)}

# Build a decoder that takes a tensor and returns a tensor
class SimpleDecoder(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(3, 2)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()
dec = SimpleDecoder()

# Create data tuple: (input_tensor, ..., label, y, mapping)
# The function expects data[-3:] to be (label, y, mapping)
# and data[:-3] to be unpacked as *data into model()

input_tensor = torch.randn(2, 4)  # batch size 2, feature dim 4
label = torch.tensor([0, 1])  # batch size 2 labels
y = torch.randn(5, 3)  # shape for matrix multiplication with model output (2, 3)
mapping = 'output'  # key to index into model's output dict

data = (input_tensor, label, y, mapping)

ARGS = {
    'model': model,
    'dec': dec,
    'data': data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
GriffinMod Not yet run
unverified (harvested, no recorded run)
yanxwb/griffin/hmodel.py
code served (permissive licence) · get_code("2284b2cf3b9cb01d")
How it ran

no invocation recorded.

SelfAverageAggregator Not yet run
unverified (harvested, no recorded run)
yanxwb/griffin/hmodel.py
code served (permissive licence) · get_code("60bdfff1f041522d")
How it ran

no invocation recorded.

_attention_merge_feat_self_attention Not yet run
unverified (harvested, no recorded run)
yanxwb/griffin/hmodel.py
code served (permissive licence) · get_code("21a1cdf79f2acf85")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We introduce Griffin, the first foundation model attemptation designed specifically for Relational Databases (RDBs). Unlike previous smaller models focused on single RDB tasks, Griffin unifies the data encoder and task decoder to handle diverse tasks. Additionally, we enhance the architecture by incorporating a cross-attention module and a novel aggregator. Griffin utilizes pretraining on both single-table and RDB datasets, employing advanced encoders for categorical, numerical, and metadata features, along with innovative components such as cross-attention modules and enhanced message-passing neural networks (MPNNs) to capture the complexities of relational data. Evaluated on large-scale, heterogeneous, and temporal graphs extracted from RDBs across various domains (spanning over 150 million nodes), Griffin demonstrates superior or comparable performance to individually trained models, excels in low-data scenarios, and shows strong transferability with similarity and diversity in pretraining across new datasets and tasks, highlighting its potential as a universally applicable foundation model for RDBs. Code available at github.com/yanxwb/Griffin.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2505.05568")
get_code_for_paper("2505.05568")
have("2505.05568")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2505.05568.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2505.05568.svg)](https://syntology.ai/paper/2505.05568)

Connect an agent — have() is free.