{
 "artifacts": [
  {
   "name": "experiment.py",
   "url": "https://synthcore.org/code/1054/experiment.py"
  },
  {
   "name": "report.md",
   "url": "https://synthcore.org/code/1054/report.md"
  },
  {
   "name": "results.json",
   "url": "https://synthcore.org/code/1054/results.json"
  }
 ],
 "category": "architecture",
 "description": "Replace ordinary topology-sensitive message passing with scalar-gated aggregation followed by an explicit correction that aligns local node states with a graph-wide consensus component. The correction should make node embeddings less sensitive to line or edge removals while preserving local information needed for prediction. This is suitable for graph neural networks and graph-based world models exposed to changing graph sizes or sparsity patterns.",
 "download_zip": "https://synthcore.org/download/1054",
 "formulas_latex": [
  "$$m_i^{(\\ell)}=\\operatorname{Agg}_{j\\in\\mathcal{N}(i)}\\phi_\\ell(h_i^{(\\ell)},h_j^{(\\ell)},x_{ij}),\\qquad g_i^{(\\ell)}=\\sigma\\!\\left(a_\\ell(h_i^{(\\ell)},m_i^{(\\ell)})\\right)$$",
  "$$h_i^{(\\ell+1)}=\\rho_\\ell\\!\\left(h_i^{(\\ell)}+g_i^{(\\ell)}W_{m,\\ell}m_i^{(\\ell)}+\\alpha_\\ell W_{c,\\ell}(\\bar h^{(\\ell)}-h_i^{(\\ell)})\\right),\\qquad \\bar h^{(\\ell)}=\\frac{1}{|\\mathcal{V}|}\\sum_{i\\in\\mathcal{V}}h_i^{(\\ell)}$$",
  "$$D^{(\\ell+1)}\\lesssim\\left(1-\\alpha_\\ell\\lambda_2(L)\\right)^2D^{(\\ell)},\\qquad 0\u003c\\alpha_\\ell\\lambda_{\\max}(L)\u003c2$$"
 ],
 "id": 2740,
 "implementation": "1. Integration point: insert this block into every message-passing layer in a PyTorch Geometric or DGL model. Use the active graph for each sample, including node and edge masks; removed edges must not be treated as ordinary edges. Compute the graph mean with a segment reduction, preserving linear complexity in the number of active nodes. 2. Pseudocode: compute edge messages and aggregate them into $m$; compute $g=\\operatorname{sigmoid}(a([h,m]))$; compute $\\bar h$ over active nodes; update $h\\leftarrow\\operatorname{LayerNorm}(h+g\\odot W_m m+\\alpha W_c(\\bar h-h))$; apply the task head. Initialize $\\alpha=0.05$ and parameterize it with softplus, while clipping it to $0.9/\\widehat{\\lambda}_{\\max}(L)$. 3. Quantities computed directly are the active adjacency, graph mean, and Laplacian estimate. Estimate $\\widehat{\\lambda}_{\\max}(L)$ with five power iterations per batch or cache it from topology statistics. The consensus mechanism comes from the paper; the contraction inequality is the stability monitor. Estimate the local message Jacobian with one additional power iteration if necessary. 4. First cheap experiment: train a six-layer GNN on 14-bus or 118-bus power-flow regression with random edge outages, comparing a standard GNN, residual GNN, and consensus-corrected GNN. Record representation disagreement $D^{(\\ell)}$, prediction error, and outage degradation. The predicted signature is geometric disagreement decay with slope approximately $(1-\\alpha\\lambda_2(L))^2$ when local-message gain is small. Sweep $\\alpha$ at $0.5$, $0.9$, $1.1$, and $1.5$ times $2/\\widehat{\\lambda}_{\\max}(L)$; embedding instability should begin near the predicted boundary within 20 percent.",
 "math_summary": "Let $h_i^{(\\ell)}\\in\\mathbb{R}^d$ be node $i$'s representation at layer $\\ell$, $\\mathcal{N}(i)$ its active neighbors, and $x_{ij}$ an edge feature. Compute $m_i^{(\\ell)}=\\operatorname{Agg}_{j\\in\\mathcal{N}(i)}\\phi_\\ell(h_i^{(\\ell)},h_j^{(\\ell)},x_{ij})$. A scalar gate $g_i^{(\\ell)}=\\sigma(a_\\ell(h_i^{(\\ell)},m_i^{(\\ell)}))\\in(0,1)$ controls local aggregation. Define the active-graph mean $\\bar h^{(\\ell)}=|\\mathcal{V}|^{-1}\\sum_{i\\in\\mathcal{V}}h_i^{(\\ell)}$ and consensus correction $c_i^{(\\ell)}=W_{c,\\ell}(\\bar h^{(\\ell)}-h_i^{(\\ell)})$. The update is $h_i^{(\\ell+1)}=\\rho_\\ell(h_i^{(\\ell)}+g_i^{(\\ell)}W_{m,\\ell}m_i^{(\\ell)}+\\alpha_\\ell c_i^{(\\ell)})$. The correction is a discrete consensus system; for a connected graph and weak local-message Jacobian, disagreement contracts when $0\u003c\\alpha_\\ell\\lambda_{\\max}(L)\u003c2$, where $L$ is the graph Laplacian.",
 "math_tags": [
  "dynamical-systems",
  "control-theory",
  "graph-theory",
  "spectral-theory",
  "linear-algebra"
 ],
 "ml_areas": [
  "graph-nn",
  "transformer",
  "world-model"
 ],
 "paper": {
  "arxiv_id": "2608.25784",
  "arxiv_url": "https://arxiv.org/abs/2608.25784",
  "summary_what_math_gives_to_ml": "UNION contains transferable mechanisms beyond ordinary graph prediction: scalar-gated message aggregation with an explicit consensus correction, and a sparse differentiable implicit layer that enforces nonlinear AC power-flow equations. These mechanisms suggest neural architectures whose representations remain coherent when graph topology changes and whose outputs are projected onto a physics-defined equilibrium manifold rather than merely penalized for violating it. The strongest transfer is to topology-varying graph models and constrained predictors, where the paper makes falsifiable predictions about constraint residuals, zero-shot topology generalization, and restoration success. A practical implementation can combine a consensus-corrected GNN with a differentiable nonlinear-equilibrium solver.",
  "title": "UNION: A Unified AC-OPF Framework for Topology-Varying Real-Time Grid Operation",
  "year": "2026"
 },
 "ratings": {
  "difficulty": 5,
  "novelty": 7,
  "usefulness": 8
 },
 "solves": [
  "stability",
  "generalization",
  "scalability"
 ],
 "title": "Consensus-Corrected Topology-Invariant GNN",
 "url": "https://synthcore.org/idea/2740/consensus-corrected-topology-invariant-gnn",
 "verification": {
  "peer_reviewed": false,
  "stage1_mechanism_check": {
   "worked": false,
   "confidence": 9,
   "verdict": "Built and numerically verified the consensus correction and the separate Laplacian diffusion stability condition. The mechanism checks passed: mean-consensus disagreement matched (1-alpha)^2, Fiedler-mode decay matched (1-alpha*lambda2)^2, and the Laplacian instability boundary matched 2/lambda_max. However, the learned consensus model reduced representation disagreement while worsening prediction MSE at every tested outage level, and the stated Laplacian bound does not directly apply to the proposed global-mean correction.",
   "metrics": {
    "baseline": "MSE at edge retention [0.75, 0.55, 0.35, 0.20]: [0.000133, 0.000270, 0.000883, 0.003274]; representation disagreement: [0.2093, 0.2183, 0.2386, 0.2780]",
    "idea": "MSE at edge retention [0.75, 0.55, 0.35, 0.20]: [0.001707, 0.002694, 0.006369, 0.015859]; representation disagreement: [0.1411, 0.1431, 0.1470, 0.1572]"
   },
   "how_to_run": "python3 experiment.py",
   "files": [
    "experiment.py",
    "results.json",
    "REPORT.md"
   ],
   "limitations": "Only a tiny synthetic node-regression task was tested, not the proposed 14-bus or 118-bus power-flow benchmark. No multi-seed statistics, learned-alpha sweep, FLOP/runtime comparison, or larger-graph evaluation was performed."
  },
  "status": "mechanism_failed",
  "status_label": "Mechanism failed",
  "updated_at": "2026-09-01T23:15:46",
  "verdict_source": "deterministic test code (paired-seed permutation statistics)"
 }
}
