DAGFormer Predicts the Global Topology of Cross-Layer Connections in Transformers

Research 0 views

DAGFormer predicts a token-level global topology for cross-layer connections before running a Transformer backbone. Its small topology predictor assigns signed weights to earlier layers for each attention head’s query, key, value, and residual input. On matched OLMo-2 backbones from 75 million to 1 billion parameters, it lowers WikiText-2 perplexity by 17 to 25 percent versus vanilla and beats mHC at every size, with stronger instruction-tuning win rates. The method also makes routing auditable, but prefill costs 1.5 to 1.9 times vanilla.

Key Takeaways

  • DAGFormer plans each token’s global cross-layer routing graph before the Transformer backbone runs, instead of letting each layer choose routing locally.
  • The predictor outputs signed weights for earlier layers on each attention head’s query, key, value, and residual inputs, making routing auditable, intervenable, and easier to coordinate across heads.
  • On matched OLMo-2 experiments from 75M to 1B parameters, DAGFormer reduces WikiText-2 perplexity by 17–25% versus vanilla and outperforms mHC across sizes and multiple tasks.
  • The gains come with higher prefill cost, taking 1.5–1.9 times vanilla, so the method is currently a benchmarked but cost-sensitive proposal.

Meta description: DAGFormer plans a Transformer token's global routing graph before the backbone runs, improving OLMo-2 perplexity while prefill costs 1.5 to 1.9 times vanilla.

Tags: DAGFormer, Transformer routing, OLMo-2, model efficiency, language models

![Abstract technology style with directed acyclic graph over transformer layers, no real people, company logos, or text](data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20640%20360'%3E%3Crect%20width='640'%20height='360'%20fill='%23071422'/%3E%3Cg%20stroke='%2322d3ee'%20stroke-width='2'%3E%3Cpath%20d='M80%20300%20L180%20220'/%3E%3Cpath%20d='M180%20220%20L280%20140'/%3E%3Cpath%20d='M80%20300%20L280%20140'/%3E%3Cpath%20d='M280%20140%20L380%20220'/%3E%3Cpath%20d='M180%20220%20L380%20220'/%3E%3Cpath%20d='M380%20220%20L480%20140'/%3E%3Cpath%20d='M280%20140%20L480%20140'/%3E%3C/g%3E%3Cg%20fill='%23fbbf24'%3E%3Ccircle%20cx='80'%20cy='300'%20r='10'/%3E%3Ccircle%20cx='180'%20cy='220'%20r='10'/%3E%3Ccircle%20cx='280'%20cy='140'%20r='10'/%3E%3Ccircle%20cx='380'%20cy='220'%20r='10'/%3E%3Ccircle%20cx='480'%20cy='140'%20r='10'/%3E%3C/g%3E%3C/svg%3E)

DAGFormer changes the sequence in which a Transformer decides its cross-layer routing, the choice of connections across different layers. Instead of letting each layer choose connections as it runs, a small topology predictor reads the input tokens, plans a global graph for each token, and outputs a signed weight for every earlier layer on each attention head's query, key, value, and residual input before the backbone begins. The reported OLMo-2 experiments show lower WikiText-2 perplexity, a measure of how well a model predicts text, from 75 million to 1 billion parameters, while prefill takes 1.5 to 1.9 times vanilla.

Local Routing Set the Baseline

Earlier routing methods place the decision inside the layer. DenseFormer, hyper-connections, mHC, and MUDDFormer each choose routing one layer at a time. That design keeps the routing decision local to the layer, so the final connection pattern is distributed across many sequential choices rather than treated as one planned object.

DAGFormer Moves Planning Ahead of the Backbone

DAGFormer moves routing from the layer to the input. For each input, the topology predictor produces one global topology object and assigns a cross-layer plan to each token. The plan includes signed weights on earlier layers for each head's query, key, value, and residual input, the carry-forward signal that passes information across layers. Because the topology is produced before execution, it can be audited and intervened on. The same global view also allows explicit coordination between cross-layer attention heads.

Matched OLMo-2 Results Highlight the Range

The comparisons use matched OLMo-2 backbones with the same data, tokens, and seed, so the routing design is the main variable. Across model sizes from 75 million to 1 billion parameters, DAGFormer reduces WikiText-2 perplexity by 17 to 25 percent relative to vanilla. A 1-billion-parameter DAGFormer trained on 5 billion tokens outperforms a vanilla 1-billion-parameter model trained on 10 billion tokens.

Compared with mHC, DAGFormer reports 10 to 18 percent lower perplexity at every size and an average accuracy gain of 0.7 to 0.8 points on 13 tasks. It also records the lowest perplexity among all four routing baselines at 75 million, 300 million, and 1 billion parameters. After instruction tuning, a fine-tuning stage aimed at following user directions, DAGFormer shows a 63 to 70 percent AlpacaEval win rate against vanilla, while mHC reports 55 to 62 percent.

Cost and Auditability Define the Current Stage

The gain is not free. Prefill, the prompt-processing stage before token-by-token generation, takes 1.5 to 1.9 times vanilla, placing DAGFormer in the same cost range as mHC. The linked interactive page lets a reader click any token or layer to inspect the graph DAGFormer plans: https://interpretability.web.illinois.edu/wp-content/uploads/2026/10/DAGFormer.html

The current stage is a benchmarked, auditable proposal: global topology planning is now measurable against local routing baselines on OLMo-2 models from 75 million to 1 billion parameters. What to watch next is whether the 17 to 25 percent perplexity reduction and the result that a 1-billion-parameter DAGFormer trained on 5 billion tokens outperforms a vanilla model trained on 10 billion tokens remain stable beyond the reported matched runs and at the 1.5 to 1.9 times prefill cost.

Tags: language modelsDAGFormerTransformer routingOLMo-2model efficiency

Comments

No comments yet. Be the first to comment.

Leave a comment