L2-Certified DAG Attention Ordering
Implementation & benchmark of arXiv:2607.20996 — The optimal constant for minimum weight feedback arc sets in oriented graphs
Source paper: The optimal constant for minimum weight feedback arc sets in oriented graphs arXiv:2607.20996 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Add a learned scalar ordering to a directed graph attention layer and retain only forward edges, producing a DAG attention mask without requiring a supplied topological order. Train the ordering with a differentiable surrogate for weighted surplus, and regularize it toward the paper's explicit half-weight-minus-l2 certificate. This supplies a principled alternative to random masking or unconstrained bidirectional graph attention when causal or hierarchical information flow is desirable.
Formulas
Mathematical statement
For an oriented graph D with nonnegative arc weights w(e), total weight w(D)=sum_{e in E} w(e), and an ordering sigma, the paper defines forward and backward arc weights and the surplus S(sigma)=w(fwd(sigma))-w(back(sigma)). Its exact identity is fas_w(D)=min_sigma w(back(sigma))=[w(D)-max_sigma S(sigma)]/2, where fas_w(D) is the minimum weight of arcs whose deletion makes D acyclic. For each vertex v, let w_2(v)=(sum_{e incident to v} w(e)^2)^(1/2), with the sum over all incident directed arcs, and let Delta be the maximum undirected degree. The main bound is fas_w(D)<=1/2 w(D)-sqrt(2)/12 sum_v w_2(v), so some ordering satisfies S(sigma)>=sqrt(2)/6 sum_v w_2(v). The degree-only consequence is fas_w(D)<=(1/2-sqrt(2)/(6 sqrt(Delta)))w(D). The proof's local random-order term is the sharp functional inf_{||a||_2=1} integral_0^1 E|sum_j a_j B_j(q)|dq=sqrt(2)/6, with independent B_j(q) distributed as Bernoulli(q); this explains why an incident-weight l2 norm, rather than only an incident sum, is the relevant local certificate.
Implementation notes
1. Integration point: use a directed graph attention layer. For node features h_v, compute nonnegative edge weights w_uv=softplus((W_q h_u)^T(W_k h_v)/sqrt(d)) for every directed edge u->v. If both directions occur, retain only the larger direction or subtract the smaller weight so the working graph is oriented. Add an ordering head s_v=MLP(h_v).
2. During training, replace the hard condition s_u<s_v with p_uv=sigmoid((s_v-s_u)/tau). Compute forward_weight=sum_{u->v} w_uv p_uv and backward_weight=sum_{u->v} w_uv(1-p_uv). Use attention logits l_uv+log(p_uv+epsilon), and add the differentiable surplus loss -(forward_weight-backward_weight)/(sum_e w_e+epsilon). Compute w2_sum=sum_v sqrt(sum_{e incident to v} w_e^2), and add the hinge certificate loss [1/2-sqrt(2)w2_sum/(12(sum_e w_e+epsilon))]_+ with coefficient lambda. Anneal tau from 1.0 to 0.05; at inference, sort nodes by s_v and retain exactly edges whose source precedes their target.
3. Computed from the paper: the surplus identity, the coefficient sqrt(2)/12, and the incident l2 certificate. Estimated empirically: ordering scores, attention weights, and realized backward fraction. Normalize edge weights by total graph weight, clip logits before the sigmoid, and handle self-loops separately because they cannot be classified as forward or backward.
4. First experiment: train a four-layer graph transformer on Cora and ogbn-arxiv, comparing ordinary bidirectional attention, a random ordering mask, and the learned DAG mask at matched parameter count and FLOPs. Measure validation accuracy, realized backward weight, retained-edge count, gradient variance, and inference memory. A successful result is lower backward mass than random ordering, equal-or-better accuracy with fewer retained edges, and stable optimization while temperature is annealed.
Verification
This idea has not been verified yet.
Verification happens in two stages: Stage 1 — a mechanism check on a toy system confirms the claimed mathematical phenomenon reproduces; Stage 2 — a benchmark implements the idea on a real (small) neural network task and compares it against a tuned baseline over 8 paired seeds with a permutation test.
Artifacts
Artifacts unavailable.