Neural Spectral Capacity: Measuring and Designing Architectures from Network Specification Alone
Organizations: Department of Computer Science, City University of Hong Kong
Abstract
Modern Transformer design and compression both reduce to allocating capacity under a budget. The standard scalars for these decisions, #Params and #FLOPs, capture size and compute but not architectural structure: two architectures with identical parameter budgets but different depth-width, head, or FFN allocations receive identical scores yet behave differently. We propose Neural Spectral Capacity (NSC), a closed-form scalar grounded in the singular-value spectrum of each weight matrix. Under standard random initialization, the Marchenko-Pastur law renders NSC computable from the architectural specification alone, with no model instantiation, data, or gradients. Its layer-wise additive structure admits NSC-DP, an exact dynamic-programming solver returning the architecture globally maximizing NSC under resource constraints in seconds on a CPU -- a guarantee that black-box search over existing training-free proxies cannot provide. Empirically, NSC outperforms #Params, #FLOPs, and representative training-free proxies in ranking across seven Transformer and CNN families (on FlexiBERT, on pairs differing in #Params by less than 10%, where #Params collapses to 0.082); NSC-DP discovers a Transformer-XL architecture on WikiText-103 that beats the human-designed baseline in 2 seconds; and prunes LLaMA-7B to the best 5.7B model across eight commonsense reasoning tasks without any calibration data, about 5900x faster than the strongest training-free proxy baseline.
Figures & tables
| Aggregation | FlexiBERT | GPT-2 | AutoFormer-T |
|---|---|---|---|
| 0.884 (297) | 0.968 (200) | 0.810 (208) | |
| 0.178 (22) | 0.813 (195) | (3) | |
| 0.917 (362) | 0.712 (200) | 0.816 (458) |
| Architecture | Decision Dimensions | #Archs. | |
| Transformers | BERT ( Serianni and Kalita, 2023 ) | Hidden dim, depth, per-layer FFN dim & attn. type | |
| GPT-2 ( Javaheripi et al., 2022 ) | Embed dim, depth, per-layer FFN dim & heads | ||
| Transformer-XL ( Javaheripi et al., 2022 ) | Embed dim, depth & per-layer FFN dim | ||
| ViT (AutoFormer) ( Chen et al., 2021a ) | Embed dim, depth, per-layer heads & MLP ratio | ||
| LLaMA (LoNAS) ( Munoz et al., 2024 ) | Per-layer FFN dim & LoRA rank (32 layers) | ||
| CNNs | CNN (NATS-Bench) ( Dong et al., 2022 ) | Per-layer channels (5 layers) | 32,768 |
| Method | 10%-PW | Time | |
| NSC (ours) | 0.695 | 0.505 | 2 ms |
| #Params | 0.485 | 0.082 | — |
| #FLOPs | 0.552 | 0.329 | 2 ms |
| W-PCA | 0.635 | 0.417 | 88 s |
| ZeroLM | 0.527 | 0.355 | 63 s |
| SNIP | 0.289 | 0.237 | 73 s |
| Method | #P (M) | Test PPL ( ) | Cost |
|---|---|---|---|
| TXL Base | 38 | 23.279 | — |
| Synaptic Div. | 37 | 23.135 | s |
| Softmax Conf. | 39 | 23.532 | s |
| W-PCA | 40 | 23.669 | s |
| NSC-DP (ours) | 40 | 23.087 | s |
| Method | Params | BoolQ | PIQA | SIQA | HSwag | WGrnd | ARC-e | ARC-c | OBQA | Avg 8 | Cost |
|---|---|---|---|---|---|---|---|---|---|---|---|
| LoNAS-SuperNet | 6.7 B | 66.02 | 77.58 | 72.93 | 57.49 | 66.85 | 78.41 | 62.29 | 76.20 | 69.72 | — |
| SNIP | 5.4 B | 61.93 | 69.21 | 64.99 | 41.26 | 62.04 | 66.50 | 52.47 | 67.40 | 60.73 | 22 min |
| SynFlow | 5.2 B | 61.13 | 70.24 | 63.25 | 45.94 | 59.98 | 66.84 | 51.88 | 66.20 | 60.68 | 23 min |
| GradNorm | 5.5 B | 61.31 | 70.78 | 67.35 | 46.33 | 62.59 | 69.02 | 55.03 | 67.20 | 62.45 | 22 min |
| W-PCA | 5.7 B | 63.82 | 70.95 | 67.91 | 49.24 | 62.75 | 69.57 | 56.40 | 70.00 | 63.83 | 45 min |
| NSC-DP (ours) | 5.7 B | 64.01 | 72.85 | 68.94 | 51.30 | 64.72 | 72.43 | 58.70 | 70.80 | 65.47 | s |
Appendix figures & tables18 assets
Supplementary material from the paper’s appendix.
Appendix
| When it applies | Needs beyond the architecture | How it uses the MP law | What it produces | |
|---|---|---|---|---|
| NSC (ours) | before any network exists | nothing—matrix shapes and initialization variances suffice | as the quantity itself: the MP spectrum is the capacity being counted | closed-form score + exact argmax ( NSC-DP ) |
| Pennington and Worah (2017) | at initialization | nonlinearity + input distribution | the linear baseline their nonlinear theory extends | limiting spectral density of activations |
| Berlyand et al. (2023) | during training | the partially trained weights | noise criterion: MP-bulk singular values are pruned | a pruned network |
| Martin and Mahoney (2021) | after training | the trained checkpoint | the null model that training departs from | a training-quality diagnostic |
| at | at | all 2nd diff. ? | |
|---|---|---|---|
| 128 | 0.041 | 0.020 | ✓ |
| 256 | 0.081 | 0.040 | ✓ |
| 384 | 0.120 | 0.060 | ✓ |
| 512 | 0.158 | 0.080 | ✓ |
| 640 | 0.195 | 0.100 | ✓ |
| 768 | 0.231 | 0.120 | ✓ |
| Subnet | TFLOPs | BoolQ | PIQA | SIQA | HSwag | WGrnd | ARC-e | ARC-c | OBQA | Avg 8 | Search |
|---|---|---|---|---|---|---|---|---|---|---|---|
| LoNAS-SuperNet | 1.71 | 66.02 | 77.58 | 72.93 | 57.49 | 66.85 | 78.41 | 62.29 | 76.20 | 69.72 | — |
| NSC-DP -A | 1.41 | 64.01 | 72.42 | 68.17 | 51.26 | 64.09 | 72.52 | 58.53 | 70.60 | 65.20 | 0.46 s (shared, single DP) |
| NSC-DP -B | 1.40 | 63.73 | 72.42 | 68.27 | 51.05 | 63.46 | 72.18 | 58.79 | 71.20 | 65.14 | |
| NSC-DP -C | 1.39 | 63.61 | 72.25 | 67.50 | 50.69 | 63.38 | 72.18 | 58.87 | 72.00 | 65.06 | |
| NSC-DP -D | 1.38 | 63.73 | 72.03 | 66.73 | 49.95 | 63.85 | 71.34 | 58.19 | 70.80 | 64.58 | |
| NSC-DP -E | 1.37 | 63.15 | 71.49 | 67.71 | 49.73 | 63.69 | 71.30 | 57.08 | 71.00 | 64.39 |
| Serianni (original) | Spec-faithful (ours) | |||
| Method | ||||
| NSC (ours) | 0.544 | 0.776 | 0.695 | 0.884 |
| #Params | 0.454 | 0.652 | 0.485 | 0.676 |
| W-PCA ( Wang, 2025 ) | 0.522 | 0.757 | 0.638 | 0.850 |
| ZeroLM ( Chen et al., 2025 ) | 0.543 | 0.775 | 0.527 | 0.730 |
| SNIP ( Lee et al., 2019 ) | 0.096 | 0.146 | 0.275 | 0.411 |
| Windowed ( ) | Kendall partial (Conover–Iman) | |||||
| Method | P | F | P | F | P, F | |
| NSC (ours) | 0.695 | 0.505 | 0.298 | 0.584 | 0.477 | 0.477 |
| #Params | 0.485 | 0.082 | 0.273 | — | 0.237 | 0.013 |
| #FLOPs | 0.552 | 0.335 | 0.412 | — | 0.053 | |
| W-PCA | 0.635 | 0.417 | 0.341 | 0.508 | 0.474 | 0.444 |
| ZeroLM | 0.527 | 0.356 | 0.052 | 0.412 | 0.220 | 0.217 |
| Windowed ( ) | Kendall partial (Conover–Iman) | |||||
| Method | P | F | P | F | P, F | |
| NSC (ours) | 0.849 | 0.536 | 0.436 | 0.329 | 0.329 | 0.329 |
| #Params | 0.854 | 0.530 | 0.395 | — | — | 0.214 |
| #FLOPs | 0.854 | 0.530 | 0.395 | — | — | 0.214 |
| W-PCA | 0.878 | 0.531 | 0.428 | 0.382 | 0.382 | 0.382 |
| ZeroLM | 0.841 | 0.536 | 0.431 | 0.377 | 0.377 | 0.377 |
| Windowed ( ) | Kendall partial (Conover–Iman) | |||||
| Method | P | F | P | F | P, F | |
| NSC (ours) | 0.610 | 0.503 | 0.494 | 0.324 | 0.317 | 0.439 |
| #Params | 0.466 | 0.322 | 0.296 | — | 0.033 | |
| #FLOPs | 0.512 | 0.385 | 0.359 | 0.187 | — | |
| W-PCA | 0.500 | 0.365 | 0.342 | 0.205 | 0.132 | 0.114 |
| ZeroLM | 0.506 | 0.428 | 0.424 | 0.251 | 0.133 | 0.242 |
| Windowed ( ) | Kendall partial (Conover–Iman) | |||||
| Method | P | F | P | F | P, F | |
| NSC (ours) | 0.803 | 0.423 | 0.419 | 0.205 | 0.249 | 0.253 |
| #Params | 0.789 | 0.366 | 0.364 | — | 0.053 | 0.086 |
| #FLOPs | 0.787 | 0.361 | 0.359 | — | ||
| W-PCA | 0.785 | 0.353 | 0.352 | 0.064 | 0.083 | 0.062 |
| ZeroLM | 0.797 | 0.406 | 0.397 | 0.171 | 0.190 | 0.159 |
| Windowed ( ) | Kendall partial (Conover–Iman) | |||||
| Method | P | F | P | F | P, F | |
| NSC (ours) | 0.706 | 0.372 | 0.767 | 0.377 | 0.765 | 0.470 |
| #Params | 0.653 | 0.116 | 0.698 | — | 0.683 | 0.028 |
| #FLOPs | 0.250 | 0.024 | — | 0.030 | ||
| W-PCA | 0.674 | 0.254 | 0.721 | 0.255 | 0.715 | 0.305 |
| SNIP | 0.496 | 0.002 | 0.486 | 0.493 | 0.206 | |
| Windowed ( ) | Kendall partial (Conover–Iman) | |||||
|---|---|---|---|---|---|---|
| Method | P | F | P | F | P, F | |
| NSC (ours) | 0.812 | 0.535 | 0.665 | 0.439 | 0.668 | 0.278 |
| #Params | 0.780 | 0.414 | 0.668 | — | 0.680 | 0.025 |
| #FLOPs | 0.610 | 0.379 | 0.187 | 0.392 | — | 0.011 |
| W-PCA | 0.630 | 0.292 | 0.400 | 0.234 | 0.408 | 0.137 |
| SNIP | 0.687 | 0.436 | 0.392 | 0.434 | 0.397 | 0.211 |
| Setting | Method | #Params (M) | Acc@1 | Acc@5 | Search |
|---|---|---|---|---|---|
| Small | AutoFormer ( Chen et al., 2021a ) | 22.9 | 81.650 | 95.712 | d |
| TF-TAS ( Zhou et al., 2022 ) | 22.8 | 81.344 | 95.698 | d | |
| AZ-NAS ( Lee and Ham, 2024 ) | 23.0 | 81.182 | 95.636 | s | |
| W-PCA ( Wang, 2025 ) | 22.8 | 81.296 | 95.628 | s | |
| NSC-DP (ours) | 23.0 | 81.392 | 95.644 | s | |
| Base | AutoFormer ( Chen et al., 2021a ) | 54.0 | 82.384 | 95.746 | d |
| CIFAR-10 | CIFAR-100 | ImageNet16-120 | ||||
| Method | Acc. % | Time (s) | Acc. % | Time (s) | Acc. % | Time (s) |
| Oracle | 93.65 | — | 71.34 | — | 47.40 | — |
| TAS ( Dong and Yang, 2019 ) | 93.40 0.00 | 1946 | 70.72 0.00 | 3863 | 47.17 0.00 | 7776 |
| ZiCo ( Li et al., 2023a ) | 90.03 0.26 | 69.9 | 69.36 0.60 | 69.8 | 44.90 0.79 | 1327 |
| SNIP ( Lee et al., 2019 ) | 90.31 0.11 | 621 | 69.27 0.79 | 640 | 45.25 0.32 | 828 |
| SynFlow ( Tanaka et al., 2020 ) | 86.96 1.35 | 37.3 | 51.24 3.83 | 37.2 | 28.85 3.43 | 127 |
| overall | ||||
|---|---|---|---|---|
| 32 | 6.1e-03 | 3.5e-03 | 3.1e-03 | 4.2e-03 |
| 64 | 3.0e-03 | 2.2e-03 | 6.2e-04 | 1.9e-03 |
| 128 | 2.0e-03 | 1.6e-03 | 3.7e-04 | 1.3e-03 |
| 256 | 8.0e-04 | 5.9e-04 | 1.4e-04 | 5.1e-04 |
| 512 | 1.8e-04 | 3.6e-04 | 1.9e-04 | 2.4e-04 |
| 1024 | 9.3e-05 | 1.4e-04 | 3.6e-05 | 9.0e-05 |
| Metric | Value | Significance |
|---|---|---|
| Pareto Kendall | ||
| Pareto Spearman | ||
| LoRA rank, per-position match | ( ) | — |
| LoRA rank, histogram match | ( ) | — |
| SVD-oracle regret, mean | — | |
| SVD-oracle regret, max | — |
| Benchmark | Init convention | vs. Xavier | vs. Kaiming | ||
|---|---|---|---|---|---|
| FlexiBERT (Serianni) | Xavier | 0.544 | 0.776 | — | 0.995 |
| Kaiming | 0.546 | 0.777 | 0.995 | — | |
| TruncNorm-0.02 | 0.517 | 0.751 | 0.880 | 0.901 | |
| FlexiBERT (Spec-faithful) | Xavier | 0.695 | 0.884 | — | 0.997 |
| Kaiming | 0.704 | 0.892 | 0.997 | — | |
| TruncNorm-0.02 | 0.575 | 0.788 | 0.888 | 0.894 |