Process-Graph-FM β€” graph foundation model for event logs

A graph foundation model for predictive process monitoring: instead of flattening a case prefix into a sequence, it treats the prefix as a graph of events with typed directly-follows edges, and learns next-activity / next-resource prediction with a GPS-style graph transformer.

Models

EventGraphFM (model.py): GINEConv local message passing + GPSConv global attention, edge features (2), 7 numeric node features.

checkpoint params d_model / layers / heads pretraining val next-activity acc BPIC 2015-1 zero-shot FT test acc FT top3 FT macro-F1
gfm-sc27/ 27.28M 512 / 8 / 8 v4, 6 epochs (~0.13B positions) 0.6048 0.3102 0.4527 0.6135 0.1936
gfm-sc80/ 88.14M 768 / 12 / 8 v4, 18 epochs (~0.38B positions) 0.6017 0.3226 0.4354 0.6018 0.1945

Zero-shot here is the plain global-head evaluation (no unseen-to-UNK mapping). With unseen-to-UNK: gfm-sc80 0.2975; sequence sc80 0.3810. Each folder has model.pt (state dict), config.json, vocab.json (global ids) and metrics.json.

Results (BPIC 2015-1, held out)

gfm-sc80 vs sequence sc80 β€” equal corpus and budget

metric graph gfm-sc80 sequence sc80 delta
pretraining val next-activity acc 0.6017 0.6563 βˆ’5.5pp
zero-shot test acc (plain) 0.3226 0.3600 βˆ’3.7pp
zero-shot test acc (unseen-to-UNK) 0.2975 0.3810 βˆ’8.4pp
fine-tuned test acc 0.4354 0.4336 +0.0018
fine-tuned top3 0.6018 0.6280 -0.0262
fine-tuned macro-F1 0.1945 0.1861 +0.0084

Honest reading (gfm-sc80): at equal corpus and budget the 80M graph model does not beat the sequence model on zero-shot transfer, and its fine-tuned accuracy is higher than sc80 (+0.0018). Its pretraining validation is also lower. The fine-tuning required a lower learning rate (1e-4 instead of 3e-4) because the 80M graph diverged at the recipe used for sc27/sc80; this is documented rather than hidden. One seed, under-budget: the result is evidence, not a graph-vs-sequence law.

gfm-sc27 vs sequence sc27 β€” equal corpus and budget

metric graph gfm-sc27 sequence sc27 delta
pretraining val next-activity acc 0.6048 0.6451 βˆ’4.0pp
zero-shot test acc 0.3102 0.3068 +0.34pp
fine-tuned test acc 0.4527 0.4296 +2.3pp
fine-tuned top3 0.6135 0.5865 +2.7pp
fine-tuned macro-F1 0.1936 0.1877 +0.6pp

Late fusion graph + sequence (validation-selected)

seq=0.4336 graph=0.4354 best_single=0.4354 mix_sc80_gfm80.json: weights=seq=0.60 graph=0.40 val={'accuracy': 0.4945067391550572, 'top3': 0.6815041341035225, 'macro_f1': 0.25174367057122143} test={'accuracy': 0.46706586826347307, 'top3': 0.6551183347590533, 'macro_f1': 0.21542101104609862} beat_best_single_by=+0.0317 gate=PASS mix_sc80_gfm80_v6.json: weights=seq=0.40 graph=0.35 v6=0.25 val={'accuracy': 0.507305470608223, 'top3': 0.691924340242383, 'macro_f1': 0.271597143329999} test={'accuracy': 0.46706586826347307, 'top3': 0.6515540347875677, 'macro_f1': 0.2305893787932908} beat_best_single_by=+0.0317 gate=PASS

The fusion script combines the fine-tuned probability matrices of sc80 and gfm-sc80 with convex weights selected on the validation split, then reports the untouched test split. Full grid and both validation criteria are in out/mix_sc80_gfm80.json of the study repository; a 3-way variant including fm-v6 is in out/mix_sc80_gfm80_v6.json.

Usage

import json
import torch
from model import EventGraphFM

cfg = json.load(open("gfm-sc80/config.json"))
state = torch.load("gfm-sc80/model.pt", map_location="cpu", weights_only=True)
model = EventGraphFM(
    n_act=cfg["n_act"], n_res=cfg["n_res"], n_logs=cfg["n_logs"],
    d_model=cfg["d_model"], n_layers=cfg["n_layers"], n_heads=cfg["n_heads"],
    dropout=cfg["dropout"], edge_dim=cfg["edge_dim"], num_dim=cfg["num_dim"],
)
model.load_state_dict(state)
model.eval()

# forward(gact, gres, num, log_id, edge_index, edge_attr, batch_vec, mask_flag)
# gact/gres: global ids (activities 4..776, resources 2..2739, UNK=1)
# edge_index/edge_attr: typed directly-follows graph; build it with the project code

The graph construction (DFG edges, edge types, numeric node features, masking) follows the ProcessGraph-FM project code. The global activity/resource ids are in gfm-sc80/vocab.json; log ids are conditioning inputs.

Data & licensing

Weights and code are released under MIT. Raw event logs are not redistributed and keep their original licenses (mostly 4TU General Terms of Use; BPIC 2018 is CC0). The synthetic half of the corpus is available at Polifemus/event-log-mixer under MIT.

Related repositories

Citation

@misc{process-graph-fm,
  title  = {Process-Graph-FM: A GPS Graph Foundation Model for Event Logs},
  author = {Polidori, Filippo},
  year   = {2026},
  howpublished = {\url{https://huggingface.co/Polifemus/process-graph-fm}}
}
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train Polifemus/process-graph-fm