Implicit Neural Representations for Variational Problems on Graphons

Taeyoung Kim, Jineon Baek, Joonkyung Lee, Hongseok YangNeurIPS 2026

TL;DR

What does an infinitely large graph look like if you pack it with edges while trying to avoid triangles—or when a random graph experiences a rare statistical fluke? Mathematicians turn these discrete puzzles into continuous calculus problems over graphons, and this paper trains neural networks to "paint" the optimal graphons directly. Without human hand-holding, the framework rediscovers famous theorems, beats long-standing mathematical constructions, and unearths bizarre new geometric graph structures that have already inspired new mathematical proofs.

What Problem Does This Paper Address?

Imagine trying to build a massive social network with a strict budget of friendships (say, 60% of all possible connections) while minimizing three-way mutual friendships (triangles). In extremal graph theory, finding these optimal configurations for finite graphs is notoriously hard. Instead, mathematicians zoom out to infinity, letting the number of vertices $n \to \infty$.

At this limit, a dense sequence of graphs blurs into a continuous 2D object called a graphon: a symmetric function $W: [0,1]^2 \to [0,1]$, where $W(x, y)$ represents the probability of an edge between two points $x$ and $y$ on a line segment. Think of it as a continuous, probabilistic adjacency matrix—a 2D heatmap of network connectivity.

Graphons allow us to reframe discrete combinatorics and large deviation theory (which asks: what does a random Erdős–Rényi graph look like when it accidentally produces way too many triangles?) as constrained optimization problems over functions. Yet, solving these variational problems analytically takes heroic human effort, and many basic instances—like minimizing 5-cycles ($C_5$) or 7-cycles ($C_7$)—remain wide open. Standard neural networks fail here too: optimal graphons usually look like sharp, blocky step functions, whereas vanilla MLPs love smooth, blurry transitions and struggle with strict equality constraints.

Methods

The authors treat graphon optimization like 3D scene reconstruction, parameterizing $W(x,y)$ with an Implicit Neural Representation (INR)—a neural network $f_\theta(x_1, x_2)$ that takes 2D coordinates and outputs an edge probability—and optimizing it via gradient descent. To make this work, they introduce three clever ingredients:

  1. Multi-scale Sinusoidal Residual Architecture: To overcome neural networks' bias toward smooth functions, every layer injects sinusoidal encodings of the input coordinates, with frequencies doubling at each layer ($2^{\ell-1}$). Early layers lock in coarse blocks, while deeper layers carve razor-sharp step boundaries. Symmetry is guaranteed by feeding $(\min(x_1, x_2), \max(x_1, x_2))$ into the network.
  2. Embedded Newton Solver with Implicit Differentiation: Penalty terms do a poor job of enforcing strict constraints (like fixing overall edge density to $p$). Instead, the network leaves its final scalar bias $c$ unlearned. During every forward pass, a clipped Newton's method solves for the exact $c$ that satisfies the constraint on the current batch. During the backward pass, rather than unrolling the solver in memory, they compute exact gradients via implicit differentiation (similar to Deep Equilibrium Models).
  3. Symmetry-Aware Monte Carlo: Graphon subgraph densities (homomorphism densities) are intractable high-dimensional integrals. The authors estimate them via Monte Carlo sampling, reusing vertex tuples across permutations and caching network evaluations to slash variance and compute costs.

Datasets

Because this is pure mathematical optimization from scratch, there are no external training datasets. Every training step generates fresh i.i.d. uniform coordinate samples on $[0, 1]$ to evaluate the continuous integrals.

Instead of datasets, the authors evaluate on mathematical problem suites:

  • Classical clique-minimization benchmarks ($K_3$ through $K_6$) and open odd-cycle problems ($C_5, C_7$).
  • A newly conducted exhaustive sweep of 117 non-bipartite small graphs (up to 6 vertices) across 6 target edge densities (702 total problem instances).
  • Large-deviation variational problems (both upper- and lower-tail regimes) for $K_3, C_4, C_5$, and the 3-star $K_{1,3}$.

Key Insights and Ideas

  • Breaking the Blocky Mold: For decades, classical extremal graphons at special density breakpoints ($p = 1 - 1/k$) were expected to be neat, checkerboard-like $k$-partite blocks. While the network cleanly recovers these blocks for cliques, it reveals wild diagonal banded structures for odd cycles ($C_5, C_7$) at intermediate densities. Even more surprisingly, during the 117-graph sweep, a 6-vertex graph ($H_6$) broke the $k$-partite rule entirely—yielding a previously unknown geometric graphon where edge probabilities depend on circular distance.
Graphons found for C5 density minimisation
  • Beating Human Reference Constructions: In large deviation theory for triangles ($K_3$), a celebrated tripartite construction by Lubetzky and Zhao (2015) served as the reference upper-tail candidate. The neural network ignored the tripartite setup and converged on simpler two-block structures that achieve strictly better (lower) KL divergence.
  • From Neural Heatmaps to Rigorous Proofs: Unlike black-box ML, visualizable graphons act as crystal balls for mathematicians. Inspecting the network's output directly led the authors to formulate new conjectures for $C_7$ and prove new mathematical theorems—characterizing optimal graphons for odd cycles, certain chordal graphs, and regular graphs in large-deviation regimes.

Key Results

  • Rediscovering Classics: On $K_3$ minimization, the network finds graphons within 0.01% to 0.05% of the exact theoretical optima, cleanly recovering both balanced $k$-partite structures and subtler multi-block optima at intermediate densities (see below), as well as scaling up to $K_6$.
Figure 1: Graphons found by our method for K3 density minimisation under t(K2, W) = p.
  • Exhaustive Sweep: Across 702 instances of small graphs, the network's upper bounds land within 1% of rigorous flag-algebra lower bounds 72.6% of the time.
  • Improving Large Deviation Bounds: For upper-tail $K_3$ large deviations at $(q=0.05, r=0.4)$, the learnt graphon drops the relative entropy from Lubetzky and Zhao's 0.556057 down to 0.464208—hovering just above the theoretical lower bound of 0.460284.
  • Beating Discrete Baselines: In ablations, the continuous INR outperforms 256-block Stochastic Block Models (SBMs) and tree-based baselines tailored specifically for step functions.

Limitations and Future Work

First, neural optimization provides candidate upper bounds, not formal proofs—though as the authors show, it pairs naturally with lower-bound machinery like flag algebras to sandwich true optima and inspire human proofs. Second, as pattern graphs grow larger, Monte Carlo estimator variance increases, requiring careful permutation caching. Finally, while each run typically solves a single density constraint, the authors prototype a promising FiLM-conditioned multi-task network that learns a continuous family of optimal graphons across a range of edge densities $p \in [1/2, 2/3]$ simultaneously—pointing toward amortized mathematical discovery engines.

Summary updated

Abstract

We propose a neural exploratory framework for *variational problems over graphons*, i.e., symmetric measurable functions $[0,1]^2 \to [0,1]$, that arise as limits of dense graph sequences. Such problems are central to two parts of the mathematical literature: extremal graph theory, which studies graph parameter optimisation under given restrictions, often for those graphs with a large number of vertices, and the large deviation theory of dense random graphs, which characterises the structure of rare events through constrained graphon optimisation. We represent graphons by implicit neural networks and optimise graphon objectives by gradient descent. Our design combines three ingredients: a multi-scale sinusoidal residual architecture biased toward sharp, step-like graphons; an embedded solver that enforces a single empirical density constraint and is differentiated by implicit differentiation; and symmetry-aware Monte Carlo estimators. On generalised Turán problems that previously required substantial human effort, our framework rediscovers known optimal graphons without human intervention. Applied to open instances, it produces candidate optima, including a previously unreported family of extremal structures. Applied to the variational problems from the large deviation theory of Erdős–Rényi random graphs, the framework produces new candidate optimal graphons across both upper- and lower-tail regimes for multiple pattern graphs; for the case of the triangle graph and the upper-tail regime, these candidates improve upon the best-known reference construction of Lubetzky and Zhao. The structures found by our framework have also led to new theorems on the optimal graphons for both families of problems.
BibTeX
@inproceedings{kim2026implicit,
  author = {Taeyoung Kim and Jineon Baek and Joonkyung Lee and Hongseok Yang},
  title = {{Implicit Neural Representations for Variational Problems on Graphons}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=KAUv6pGFCz},
}
Figure