arXiv:2610.30823cs.LGOct 2026

Manuscript Offprint

arXiv:2610.30823

Neural Spectral Capacity with Residual Context for Heterogeneous Resource Allocation within Transformers

Chenyu Zhu, Ruoyu Zhao, Zhichao Lu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Chenyu Zhu, Ruoyu Zhao and Zhichao Lu

Department of Computer Science, City University of Hong Kong

Predicting relative trained performance from architectural specifications can guide design when training costs limit experimentation. Neural Spectral Capacity (NSC) provides such a heuristic, but scores projections independently and assigns identical scores to compatible reorderings of the same layer configurations. We introduce Residual-Aware Neural Spectral Capacity (ResNSC) for Transformers, using a specification-derived statistical reference for accumulated residual updates to determine the input and residual-state statistics in each projection's capacity calculation, while retaining additive evaluation without data or instantiated weights. When residual widths vary, earlier choices affect later scores, so we augment NSC's allocator (NSC-DP) with residual history beyond its layer-and-budget state. ResNSC-DP jointly allocates residual and feed-forward widths under a resource budget, with certified bounds on the best numerically evaluated ResNSC score within a specified finite candidate set. At the 121M and 374M pretraining scales, selected architectures achieve lower mean perplexity than uniform, variable-width, and tapered allocations on FineWeb-Edu, WikiText-2, and LAMBADA at comparable parameter budgets. In inherited-weight LLaMA-7B pruning using the LoNAS supernet, ResNSC-DP improves eight-task average accuracy over NSC by 3.28–5.46 percentage points across eight matched parameter budgets. Paired reversals preserve the projection shapes and NSC scores yet worsen performance in both settings, exposing performance differences hidden by position-independent scoring. The code for this work is available at https://github.com/Optima-CityU/neural-spectral-capacity.

1. Introduction

Predicting a neural network’s performance before training can guide architecture development, especially when foundation-model training costs limit experimentation. Empirical scaling laws, calibrated on training runs, forecast loss from model and data scale and guide compute allocation (Hoffmann et al., 2022; Kaplan et al., 2020). However, these aggregate quantities leave structural differences at a given scale unresolved: equally sized networks can differ in depth, projection dimensions, and arrangement. Neural Spectral Capacity (NSC; Zhu et al., 2026) provides a heuristic for predicting relative trained performance: it analytically computes and sums projection-level scores from matrix dimensions and prescribed initialization statistics, without data or instantiated weights. Because NSC evaluates each projection independently of its position, it assigns identical scores to compatible reorderings of the same layer configurations. Recent studies show that distributing capacity differently across depth can change language-model performance at matched parameter budgets (Bayat et al., 2026; Wu et al., 2026). These observations motivate incorporating architectural context into specification-only scoring.

The residual stream provides a concrete basis for modeling this context: in a pre-normalized Transformer, attention and feed-forward network (FFN) branches read a normalized view of the shared state and add their outputs back to it (Elhage et al., 2021; Xiong et al., 2020). Earlier branches therefore shape both the features supplied to later projections and the existing state receiving branch outputs, so identically shaped projections can operate under different conditions. In the variable-width

Correspondence to: Zhichao Lu (zhichao.lu@cityu.edu.hk)

Figure

Figure 1 | From NSC to ResNSC. Left: schematic ResNSC-DP allocation (A) and reversal (B), with mean 374M FineWeb-Edu perplexities. Reversal preserves projection shapes and NSC scores but changes residual context. Right: additive scoring views of block ℓ\ell. ResNSC's specification-derived covariances use residual history and, for output projections, within-branch propagation. For b=2ℓ−2b = 2\ell - 2, pbp_b, pb+1p_{b+1}, pb+2p_{b+2} are the pre-attention, post-attention, and post-FFN reference variances. Blue/orange: attention/FFN; normalization omitted.

setting considered here, branches operate on a width-dependent subset of the shared residual state, so preceding width choices determine which coordinates have been updated and how often. This raises the question: how can NSC account for this residual context while remaining computable from architecture specifications alone?

We introduce Residual-Aware Neural Spectral Capacity (ResNSC), which uses a specification-derived statistical reference for accumulated residual updates to determine the input and residual-state statistics in each projection's capacity calculation. For output projections, this input model includes earlier within-branch transformations (Figure 1, right). ResNSC can therefore assign different scores to reorderings of the same projections, while retaining NSC's additive aggregation and deterministic evaluation without data or instantiated weights. When residual widths vary, ResNSC's layer scores depend on preceding choices, so the original layer-and-budget state of NSC's allocator (NSC-DP) no longer suffices. ResNSC-DP augments that state with residual history to jointly allocate residual and FFN widths under a resource budget.

At the 121M and 374M pretraining scales, architectures selected by ResNSC-DP achieve lower mean perplexity than uniform, variable-width (VWT) (Wu et al., 2026), and tapered (TLM) (Bayat et al., 2026) allocations at comparable parameter budgets. Relative to the strongest of these baselines for each dataset and scale, the reductions are 0.3–0.4% on FineWeb-Edu, 2.3–2.5% on WikiText-2, and 19.6–24.9% on LAMBADA. In LLaMA-7B pruning using the LoNAS supernet (Munoz et al., 2024), ResNSC-DP improves average accuracy over eight tasks by 3.28–5.46 percentage points relative to NSC across eight matched parameter budgets. In paired controls, reversing the selected width allocations preserves the collection of projection shapes and the NSC score, yet worsens performance in both settings (Figure 1, left, illustrates the 374M case).

Our contributions are:

• Residual context in capacity evaluation. A specification-derived residual reference for evaluating Transformer projections in their architectural context.

• Sufficient history for joint allocation. Under our reference, counts of preceding layers at each residual width suffice for future score evaluation, enabling ResNSC-DP with bounds on the best ResNSC score within a specified finite candidate set.

• Controlled evidence on layer order. Paired reversals reveal performance differences between allocations with identical NSC scores, in both pretraining and inherited-weight pruning.

References (97)