PHYSICAL PDF PAGE 3 / 20

                        Outlier-Aware Post-Training Quantization for Discrete Graph Diffusion Models



2018), and program synthesis (Brockschmidt et al., 2018).              |X | and |E|, respectively. For a graph G = (X, E) with

Early on, there was considerable interest in graph generation          |V| nodes, X ∈ R|V|×|X | is the matrix of node categorical

using RNNs (You et al., 2018), VAEs (Simonovsky & Ko-                  attributes, and each row xi ∈ R|X | denote the one-hot en-

modakis, 2018), GANs (De Cao & Kipf, 2018) or normaliz-                coding of node i attributes. E ∈ R|V|×|V|×|E| represents

ing flows (Zang & Wang, 2020). Inspired by the tremendous              the one-hot encoding eij ∈ R|E| of each edge, treating the

success of diffusion models in the image domain, Niu et al.            absence of edge as a particular edge type. Here, we take

(2020) relied on Gaussian noise and generated adjacency ma-            the 2D graph generation problem as an example, while the

trices by thresholding continuous values to represent edges,           input for the other application of graph generation will be

while Jo et al. (2022) extended this approach to incorporate           discussed in detail in Appendix C.

both node and edge attributes. Given the discrete nature of

graph structures, Haefeli et al. (2022) were the first to de-          3.1. Discrete Graph Diffusion Models

sign a discrete diffusion model specifically for unattributed          Discrete graph diffusion models consist of two main com-

graphs, demonstrating that discrete diffusion can enhance              ponent: a noise process and a recursive denoising process.

graph generation. Furthermore, Vignac et al. (2023) intro-

duced the first Markovian noise model, Digress, tailored               Noise process. The noise process q progressively cor-

for attributed graphs, and Yi et al. (2023) extended Digress           rupts graph G and creates a sequence of increasingly

to inverse protein folding task where the node features are            noisy graphs (G 1 , ..., G T ), where G t = (Xt , Et ). It

represented as 3D coordinates. In our study, we focus on the           has a Markovian structure, where q(G 1 , ..., G T |G) =

                                                                                 QT

quantization of discrete graph diffusion models, as they in-           q(G 1 |G) t=2 q(G t |G t−1 ). In line with Vignac et al. (2023),

herently capture discrete structures and demonstrate greater           we add noises by sampling each node and edge type from a

efficacy in graph generation.                                          categorical distribution as

                                                                                   q(G t |G t−1 ) = (Xt−1 NtX , Et−1 NtE ),         (1)

2.2. Model Quantization                                                                                  t       t      t

                                                                       where the transition matrix NX = α I + β 1a mX , and    0

Model quantization aims to save memory costs and speed                 NtE = αt I + β t 1a m0E . m0X and m0E denote the true cat-

up computations by reducing the precision of weights and               egorical distributions of node and edge attributes as the

activations. It can be generally divided into two cate-                prior distributions, respectively. Since (1a m0X )2 = 1a m0X ,

gories. Quantization-aware training (QAT) (Jacob et al.,                                               t

                                                                       we have the closed-form NX = N1X N2X ...NtX = αt I +

2018; Zhuang et al., 2018) integrates quantization during                t                           t              t

                                                                       β 1a m0X , where αt = τ =1 ατ and β = 1 − αt , sat-

                                                                                                   Q

the training process, enabling high performance at lower                                              T

precision. However, it necessitates significant time and               isfying ∀i, limT →∞ NX 1i = m0X . Thus, it then follows

                                                                                                t

computational resources. In contrast, post-training quanti-            q(Xt |X0 ) = Cat(Xt ; XNX ) and    >                        t−1

zation (PTQ) (Wei et al., 2022a; Lin et al., 2022) does not                                                      Xt NtX    X0 NX

                                                                             q(Xt−1 |Xt , X0 ) = Cat(Xt−1 ;               t              ),   (2)

require fine-tuning and only requires a small amount of unla-                                                       X 0 N X X t>

beled data for calibration, offering a faster and less resource-

                                                                       where Cat denotes categorical distribution. The edge transi-

intensive alternative. Due to the huge computation costs of

                                                                       tion distribution is defined similarly and omitted for brevity.

diffusion models, recent quantization approaches (He et al.,

2024b;a; Li et al., 2024b) for diffusion models focused on             Recursive denoising  QT process. The denoising process

PTQ. These approaches have pushed the boundaries of PTQ                pθ (G 0:T ) = p(G T ) t=1 pθ (G t−1 |G t ) parameterized by θ

to 4-bit quantization by leveraging new rounding strate-               aims to recover the distribution p(G 0 ) (for brevity, G 0 := G).

gies (Nagel et al., 2020), layer-wise calibration (Wang et al.,        The reversed transition pθ (G t−1 |G t ) is a product of categor-

2020), second-order statistics (Li et al., 2021), and mixed-           ical distributions over nodes and edges, i.e., pθ (Xt−1 |G t )

precision schemes (He et al., 2024b). However, these meth-             and pθ (Et−1 |G t ). Aligned with the x0 -parameterization

ods primarily focus on continuous diffusion models, partic-            used in continuous diffusion models (Karras et al., 2022;

ularly in the image domain. To the best of our knowledge,              Ho et al., 2020), pθ (Xt−1 |G t ) is modeled as:

                                                                                                                                

there is a lack of methods addressing PTQ for DGDMs.

                                                                                              X

                                                                         pθ (Xt−1 |G t ) ,                          e 0 pθ X

                                                                                                      q Xt−1 | Xt , X      e 0 | Gt ,         (3)

                                                                                             e 0 ∈X

                                                                                             X

3. Preliminary                                                         where pθ (Xe 0 | G t ) is a neural network predicting posterior

In this section, we first revisit discrete graph diffusion mod-        probability of X0 given a noisy graph G t . The architec-

els and then introduce the quantization process. Follow-               tures of neural networks will be illustrated extensively in

ing Vignac et al. (2023), we focus on graphs with categorical          Appendix C. The reversed process for edges is similar to the

node and edge attributes, particularly well-suited for diverse         nodes and thus omitted. After training, the new graph sam-

structured data like chemical compounds (Wu et al., 2018)              ples can be generated by sampling GT from prior distribu-

and proteins (Ingraham et al., 2019). Let X and E denote               tions m0X and m0E and subsequently sampling pθ (G t−1 |G t ),

the categorical space of nodes and edges with cardinalities            resulting in a generation trajectory (G T , G T −1 , ..., G 0 ).



                                                                   3

