Same Graph, Different Likelihoods: Calibration of Autoregressive Graph Generators via Permutation-Equivalent Encodings

Laurits Fredsgaard, Aaron Thomas, Michael Riis Andersen, Mikkel N. Schmidt, Mahito SugiyamaarXiv 2026

TL;DR

Autoregressive graph generators rely on turning graphs into sequences, but models trained on specific, biased orderings learn the sequence structure rather than the actual graph topology. By introducing Linearization Uncertainty (LU)—a metric measuring likelihood consistency across different permutations of the same graph—this paper reveals that standard likelihoods can be confidently wrong, and shows that LU can act as a powerful filter to detect unstable generated molecules.

What Problem Does This Paper Address?

Graphs and molecules are inherently permutation-invariant—there is no natural "first" node or edge. However, autoregressive models must linearize them into sequences to apply the chain rule of probability. While previous work focused on which ordering yields the best generation metrics, this paper asks a more fundamental question: Are the model's likelihoods actually trustworthy?

Ideally, a consistent model should assign the exact same likelihood to a graph regardless of how it is linearized. If it doesn't, its distribution over graphs is poorly defined. The authors investigate how different linearization strategies affect model calibration and robustness, exposing a critical vulnerability in models trained on fixed, structured orderings.

Methods

  • SENT Encoding: The authors build on Segmented Eulerian Neighborhood Trails (SENT), a recent framework that maps graphs to token sequences. Crucially, multiple distinct SENT sequences can decode back to the exact same graph topology, making it possible to cleanly isolate the effect of ordering.
  • Linearization Strategies: They evaluate four traversal strategies to generate sequences: Random Order, Min-Degree First (starting with leaves), Max-Degree First (starting with hubs), and Anchor Expansion (expanding outward from hubs).
  • Linearization Uncertainty (LU): To quantify how much a model violates graph-consistency, the authors introduce LU. It computes the coefficient of variation (standard deviation divided by the mean) of the negative log-likelihood (NLL) across $K$ equivalent permutations of the same graph.
  • Expected Calibration Error (ECE): This standard metric is used to evaluate whether the model's predicted token probabilities actually match empirical frequencies.

Datasets

  • Planar ($N=128$): A small, synthetic dataset of planar graphs used to analyze model behavior in data-scarce regimes.
  • QM9 ($N\approx98\text{k}$): A standard molecular graph benchmark containing small organic molecules, used to evaluate the models in a data-rich regime.

Key Insights and Ideas

  • Learning the Sequence, Not the Graph: Models trained on structured, biased orderings (like Anchor Expansion) act as excellent density estimators only on their native orderings. When evaluated on random permutations, their calibration collapses. They exploit topological sorting cues rather than truly understanding the underlying graph structure.
  • The "Confidently Wrong" Paradox: For generated molecules, standard Generation NLL is negatively correlated with chemical stability. Unstable molecules often happen to align perfectly with the training linearization, leading to a falsely low NLL (high confidence).
  • LU as a Quality Signal: Re-linearizing a generated graph under different permutations exposes this false confidence. If a molecule is unstable, its NLL will spike under unfamiliar orderings, causing high Linearization Uncertainty. Thus, LU acts as an effective unsupervised filter for molecule quality.

Key Results

  • Brittleness of Biased Models: On the full QM9 dataset, the Anchor Expansion strategy achieves a low native NLL/token of 0.222, but this skyrockets to 2.246 under random evaluation. Its ECE degrades by two orders of magnitude, jumping from 0.001 to 0.245 (see Table 1 in Table 1).
  • Stability Prediction: Generation NLL fails to predict molecular stability on QM9, yielding an AUC of just 0.43 (worse than random guessing). In contrast, LU achieves an impressive AUC of 0.85. Remarkably, even at $K=2$ permutations, the LU signal far exceeds the baseline with an AUC of 0.65 (see Figure 1).
  • Data-Scarce Overfitting: On the small Planar dataset, biased strategies quickly memorize training sequences, causing validation NLL to rise after just ~5k steps. Only Random Order training acts as an inherent data augmentation that prevents overfitting and sustains generative novelty (see Figure 2).
Table 1: Test-set robustness on QM9 (K=32 permutations, full test set, 3 seeds). Native = model’s own training strategy; Random = evaluated under the Random Order strategy.
Figure 1: LU AUC vs. number of permutations K (QM9). ROC-AUC for predicting molecular sta- bility from LU, per linearization strategy (mean ± std across 3 seeds). Even at K=2 the signal far exceeds the Generation NLL baseline (AUC = 0.43).
Figure 2: Overfitting vs. Generative Quality in Data-Scarce Regimes. Dual-axis plot showing validation NLL/token (solid, left axis) and VUN (dashed, right axis) for Planar (N=128, seed 0). For all biased strategies, NLL rises after ∼5k steps (memorization) while VUN continues to climb, driven by Validity alone. Only Random Order achieves sustained improvement in both axes. See Appendix D.2 for the decomposition of VUN into Validity, Uniqueness, and Novelty.

Limitations and Future Work

  • Dataset Constraints: The stability predictor results are limited to QM9, which consists of small, highly constrained molecules. Testing on larger, more diverse datasets like MOSES or GuacaMol is necessary to see if the LU signal generalizes.
  • Framework Dependency: The analysis is strictly limited to the SENT framework; how LU behaves or scales with other graph linearization methods remains an open question.
  • K-Sensitivity Scaling: While LU converges quickly ($K=8$ to $16$) for biased strategies on small graphs, larger and more complex graphs might require significantly more permutations to yield a stable LU estimate.

Summary updated

BibTeX
@misc{fredsgaard2026same,
  author = {Laurits Fredsgaard and Aaron Thomas and Michael Riis Andersen and Mikkel N. Schmidt and Mahito Sugiyama},
  title = {{Same Graph, Different Likelihoods: Calibration of Autoregressive Graph Generators via Permutation-Equivalent Encodings}},
  year = {2026},
  eprint = {2604.05613},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.05613},
}
Figure