# SNACK: A Sequential Notation Framework for Probabilistic Graph Generation

*Hohyun Kim, Hyesung Kim, Min-hwan Oh, Seunggeun Lee*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/153507) · [Open on the map](../papers.html#p153507)

Category: [AI for Molecules, Materials & Genomics](../pcat/8.md) › [Probabilistic Graph and Structure Generation](../pgroup/609.md) · Type: new method · Keywords: probabilistic graph generation, string representation, GFlowNet, graph neural networks, molecular design, sequence models

Areas: [Graph Learning](../areas/graph-learning.md) › Multidimensional Graph Learning › Graph generation

## Summary
SNACK introduces a string representation for probabilistic graph generation that linearizes graphs via lower-triangular adjacency matrix encoding, enabling sequence models to generate graphs while improving GFlowNet training throughput.

## Explained to a 5-year-old
We made a new way to draw graphs using a string of letters, like a recipe. The recipe makes sure the drawings follow rules, like how many connections each dot can have. This helps computers learn to draw graphs faster and better. It also helps them understand the shape of the whole picture even when they only see the recipe. So now we can create graphs that look realistic and follow the rules.

## Explained to a 5-year-old, longer
Imagine you have lots of dots that you want to connect to make a picture. Usually drawing those pictures is hard for computers because they need to know many rules. The paper comes up with a clever trick: they turn the picture into a long string of symbols, like a sentence. This string acts like a recipe that tells the computer exactly how to place each connection. By using this recipe, the computer can make sure each dot follows the right rules, such as not having too many or too few lines. The recipe also handles special cases, like when a dot represents an atom that can only bond a certain number of times. Because the recipe is a simple string, it can be processed by models that normally work with text, making training faster. The method also takes care of the fact that the order of dots can change without changing the graph, so it avoids counting the same graph many times. When the computer learns from many examples of these recipes, it starts to understand both small details and the overall shape of the graph. This allows the computer to generate new graphs that look realistic and obey all the constraints. The approach works well on many tasks, from simple graph generation to more complex molecular designs. As a result, researchers and developers now have a practical tool to create graphs using familiar text-based models.

## For a technical reader
SNACK is a string-based notation that encodes the lower-triangular part of a graph’s adjacency matrix, turning graph generation into a sequence-model problem. By mapping each valid string to a unique ordered adjacency matrix, it allows models to generate graphs while naturally enforcing structural constraints such as chemical valence through invalid-logit masking. The design also explicitly handles node-ordering symmetries, which makes GFlowNet training more stable and significantly faster than traditional graph-centric approaches. Empirically, SNACK reaches state-of-the-art sample quality on standard graph-generation and molecular-distribution benchmarks while cutting training time. In practice, developers can now treat graph generation as a text-generation task, simplifying integration with existing sequence models and pipelines.

## Problem
Generating graph-structured data with deep sequence models is challenging due to the need to enforce structural constraints and handle node-ordering symmetries.

## Method
The approach linearizes graphs by encoding nonzero entries of the lower-triangular adjacency matrix into a string, establishing a bijection between sequences and ordered adjacency matrices. It uses invalid logit masking to enforce structural constraints such as chemical valence and ordering, and incorporates node-ordering symmetry considerations for GFlowNet training.

## Results
The approach attains competitive or state-of-the-art sample quality and significantly improves training throughput compared to graph-based generation.

## Contributions
It provides a string-based representation that enables sequence models to generate graphs with built-in constraint enforcement and accounts for node-ordering symmetries, leading to faster GFlowNet training and better scalability.

## Practical relevance
SNACK offers a practical framework for generating graph-structured data using sequence models, facilitating applications such as molecular design and other domains requiring constrained graph generation.

## Research questions this paper is counted under

- [How can we generate graphs that preserve global structural relationships while scaling to larger sizes and respecting constraints?](../q/145.md)

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/153507)
