Tree-Aligned Neuron Orderings for Tensor-Train Compression Across Architectures

A tensor train (a way of storing a large weight matrix as a short chain of small three-way arrays, also called a matrix product state) compresses well only when the matrix has a particular nested structure. To build one, each row index and each column index is written as a string of digits: a first digit choosing a coarse block, a second choosing a sub-block, and so on. Compression succeeds when rows that share leading digits behave alike. That digit assignment is set by the order in which neurons happen to be stored, and in a trained network that order is arbitrary. Hidden units, channels, attention heads and residual-stream coordinates can be permuted, with matching permutations in adjacent layers, without changing what the network computes. TT methods are nonetheless sensitive to this order, and every current one uses whatever order training produced. This holds for compressing pretrained layers, for TT adapters such as TT-LoRA and MetaTT, and for FacT on vision transformers.

We propose to find a hierarchy among the neurons of each permutable index set and relabel the neurons so that the TT's implicit digit tree matches it. Hyperbolic embedding is the tool for this. It is a way of placing points in a negatively curved space where trees fit with low distortion in very few dimensions. Because the relabeling is an exact symmetry, the network is unchanged before compression. It applies in the same way to convolutional networks, ViTs, encoder transformers and decoder LLMs, which is what makes it a candidate for a compression step that generalizes across architectures. A second output is equally important: how tree-like each layer's neurons are, measured by how well a 2–8 dimensional hyperbolic embedding fits them. We test whether that score predicts where TT compression will work and at what rank, in place of the per-family heuristics the quantization literature relies on.

Core Claim

Suppose a weight matrix $W \in \mathbb{R}^{M\times N}$ is folded into a tensor whose row index $i$ is split into digits $(i_1,\dots,i_k)$. Then the TT rank at bond $j$ is set by the rank of the unfolding that separates the first $j$ digits of the row and column indices from the rest. Write $W_{\le j}$ for that unfolding. For permutation matrices $P_{\text{out}}, P_{\text{in}}$ that the network's symmetries allow, the matrix that actually gets tensorized is

$$W' = P_{\text{out}}\, W\, P_{\text{in}}^{\top}, \qquad r_j(W') = \operatorname{rank}\big(W'_{\le j}\big),$$

and $r_j(W')$ changes with the permutations while the network's function does not.

Our claim has two parts. First, at equal parameter count, permutations chosen so that neurons sharing leading digits sit close in a hyperbolic embedding of neuron similarity reduce TT approximation error and improve TT-adapter accuracy over the stored order. This should hold consistently across CNN, ViT, encoder and decoder families. Second, a layer's low-dimensional hyperbolic embedding distortion predicts the size of that gain and the TT rank the layer needs. This gives one geometric rule for allocating TT ranks across architectures.

The construction of the digit tree reuses Hyperbolic Residual Quantization almost directly. HRQ quantizes a point in the Poincaré ball in successive stages, subtracting each stage's codeword with hyperbolic (Möbius) arithmetic. If those stages have codebook sizes $d_1,\dots,d_k$ equal to the TT mode sizes, and assignment is constrained to be balanced, the stage codes of each neuron are exactly its mixed-radix TT index. HRQ was designed for tokenizing hierarchical data and was shown to stay accurate at 4–8 dimensions where Euclidean residual quantization degrades. We use it to discover the index tree of a weight tensor, which it was never applied to.

Relation to Prior Work

The TT papers supply the representation and the baselines. TT-LoRA folds each weight update into a high-order tensor and searches TT ranks with Ray Tune and HyperBand. MetaTT stacks layer index, matrix type and input and output dimensions into one global train with a DMRG-style rank sweep. FacT stacks all ViT increments into a $12L\times d\times d$ tensor. MPOP and the TT language models of Grachev et al. tensorize the base weights themselves. All of them treat the storage order of neurons as given. Two of them also report the problems that ordering might ease: rank selection is expensive, and badly conditioned high-order trains train unstably. Our proposal changes none of these representations. It changes which tensor they factorize.

Compact Neural Architecture Designs by Tensor Representations motivates the work: it shows that folding matrices into higher-order tensors exposes low-rank structure that is invisible in the flat matrix. If folding exposes structure, the order of folding should decide how much is exposed.

On the geometry side, Knowledge Graph Completion with Mixed Geometry Tensor Factorization (MIG-TF) is the only work in the file that joins hyperbolic geometry with tensor factorization. It adds a hyperbolic correction term to a Euclidean Tucker model of knowledge-graph triples, using a squared Lorentz distance for numerical stability. We differ in what is factorized: network weights rather than relational data. We also differ in where geometry enters. It shapes the index structure of a TT and leaves the arithmetic Euclidean, so inference uses ordinary matrix multiplies.

MIG-TF also constrains the design. It reports that purely hyperbolic models underperform on non-hierarchical data. We therefore treat tree-likeness as something to measure per layer, and fall back to the stored order where it is low, rather than assuming every layer is tree-like. HyperVQ offers indirect evidence that hyperbolic partitions avoid the crowding that collapses Euclidean codebooks: 220.22 versus 58.09 codebook perplexity on CIFAR-100. That is relevant because our balanced digit assignment is a crowding-sensitive partitioning problem.

The cross-architecture motivation comes from the quantization literature, which repeatedly finds that transformations tuned on one family break on another. Adaptive Layer-Wise Transformations chooses rotation versus affine transforms per layer by kurtosis, validated only on LLaMA. ATQ warns that activation transforms overfit standard feed-forward blocks. Modality-Aware Block Rotation documents rotation failures in vision-language-action models. QuaRot exploits an exact symmetry, orthogonal rotations of the residual stream, to make activations easier to quantize. We exploit a cheaper exact symmetry, permutation, to make weights easier to tensorize.

Permutation also has a structural advantage. RMSNorm and LayerNorm commute with it directly, by permuting their scale vector, so nothing like the gamma-folding step that Outlier Suppression needs is required. That makes it a natural candidate for a step that carries over between architectures unchanged.

Research Program

For each architecture we first list its permutable index sets and the coupling constraints that keep the function exact. These are output channels of a convolution together with the next convolution's input channels and the BatchNorm parameters, MLP hidden units, the residual-stream coordinates shared by all blocks, and attention heads as whole units. Within-head dimensions are left fixed in RoPE models because the rotary encoding ties each dimension pair to a frequency. Each neuron gets a calibration-free feature vector made of its incoming and outgoing weight rows across every matrix that the permutation touches. A second variant adds activation correlations from a few hundred calibration samples.

These features are embedded in the Lorentz model of hyperbolic space at dimension 2–8 so that hyperbolic distance tracks feature dissimilarity. We use the Lorentz model because it avoids the numerical blow-up near the boundary of the Poincaré ball. Balanced HRQ then assigns each neuron its digit string, and the TT is fitted, by sequential SVDs for post-training compression or by gradient training for adapters, in the permuted basis.

For global trains such as MetaTT and FacT, the same procedure orders the non-neuron modes as well, including layer index and matrix type. We expect less from this because those modes are short.

The diagnostic part records, for every permutable set, the ratio of hyperbolic to Euclidean embedding distortion at matched low dimension, which we call the tree-likeness score. We then test whether it predicts two quantities: the ordering gain in TT reconstruction error at fixed rank, and the smallest rank that meets a fixed error target. If it does, rank allocation becomes a cheap per-layer computation on the weights. That replaces the HyperBand or DMRG searches used by TT-LoRA and MetaTT. It is also a single rule we can check on held-out architecture families, which is the sense of "generalizes across architectures" that the quantization literature has lacked.

Baselines

The naive reference point is the stored order, which is what every existing TT method uses. A random permutation is also run, to show how much variance the stored order itself carries. For both, TT shapes and ranks are chosen by the same search we give our method.

The strongest existing method for adapters is TT-LoRA. On LLaMA-2-7B it reports 80.19% average SuperGLUE accuracy, against 74.04% for LoRA and 75.03% for full fine-tuning (TT-LoRA). It is the strongest competitor because it already captures most of what TT offers over flat low rank. We rerun it ourselves on the same data, seeds, parameter budget and HyperBand trial budget, and apply the reordering as the only change.

For global adapters we compare against MetaTT-4D, reported at 72.0% commonsense accuracy on Llama-2-13B with 0.83M parameters versus 72.5% for LoRA with 26.2M (MetaTT), with its DMRG rank sweep left on.

For ViTs we compare against FacT-TT on VTAB-1K. The file says only that FacT-TT with 8K parameters outperforms full fine-tuning, VPT and BitFit, and that FacT-TK matches NOAH with 5x fewer parameters. No reported per-task average for FacT-TT was found on Lacuna, so we reproduce it.

For post-training compression of a CNN, the strongest architecture-agnostic reference is AQCompress, reported at 7.2x compression of ResNet-50 on ImageNet with no accuracy loss and 15.3x at 76.1% to 74.79% top-1 (AQCompress).

Beating a baseline means one of two things, both averaged over three seeds and with confidence intervals reported. Either higher task accuracy at an identical TT parameter count, or the same accuracy at a parameter count at least 1.5x smaller.

The ablation that isolates the key ingredient compares orderings that are all fed into the same balanced digit assignment. The candidates are the hyperbolic embedding, a Euclidean embedding of identical dimension, and recursive spectral bisection, a Euclidean method that needs no embedding at all. A second ablation applies a random Hadamard rotation instead of a permutation. We expect that to destroy the digit structure, which would show that the gain comes from alignment and not from the change of basis alone.

Why not just…?

Why not just order neurons by Euclidean hierarchical clustering or recursive spectral bisection? This is the real threat. Splitting a weight-similarity graph into balanced pieces can produce a mixed-radix tree without any curved geometry, and it may work as well. The evidence that hyperbolic partitions help is indirect. HRQ stays accurate at 4–8 dimensions where Euclidean residual quantization degrades (HRQ), and HyperVQ avoids codebook crowding (HyperVQ). Neither involves network weights. The ablation in the Baselines section decides the question directly. If spectral bisection matches the hyperbolic ordering, we report that, and the hyperbolic contribution narrows to the tree-likeness diagnostic and rank predictor. That part does not depend on which method builds the tree.

Why not just tune TT shapes and ranks harder on the stored order? Rank search only chooses among ranks the stored order can reach. Reordering changes the unfolding ranks themselves. We give both conditions the same HyperBand budget used by TT-LoRA. If extra search on the stored order closes the gap, the ordering claim fails.

Why not just use ordinary LoRA, which does not care about neuron order? Flat low-rank adapters are unaffected by permutation, so they are a fixed reference rather than a competitor that reordering could help. TT-LoRA already reports 80.19% versus 74.04% on LLaMA-2-7B SuperGLUE at far fewer parameters, and MetaTT reports near-parity with roughly 30x fewer parameters. LoRA stays in our tables so that any reordering gain can be read against the gap between TT and flat low rank.

Why not just predict where TT works from layer statistics like kurtosis? Kurtosis describes the distribution of a layer's activation values, not the similarity structure among its neurons. Its use for choosing transforms was validated only on LLaMA (Adaptive Layer-Wise Transformations). We test both predictors on the same held-out families and compare their rank correlation with the measured gains.

Proposed Experiments

The first experiment is post-training TT compression with no fine-tuning, across four families. These are ResNet-50 on ImageNet, compared with AQCompress; a ViT; BERT or RoBERTa on GLUE; and LLaMA-2-7B on WikiText-2 perplexity and the zero-shot suite of PIQA, ARC, HellaSwag and WinoGrande. For each we plot reconstruction error and task metric against compression ratio, comparing the stored order, a random order and the three tree-built orders.

The second experiment is adapters: FacT-TT on VTAB-1K, TT-LoRA on DeBERTa GLUE and LLaMA-2-7B SuperGLUE, and MetaTT-4D on Llama-2-13B commonsense, each with and without reordering at matched parameters.

The decisive checks come in three steps. We first confirm that reordering leaves outputs identical to floating-point precision before compression. We then require that the reordering gain has the same sign in all four families. Finally, we fit the link from tree-likeness score to gain and to required rank on two families and test it on the other two. A rank correlation that holds on the held-out families is the cross-architecture result. A per-family-only correlation would mean the diagnostic does not generalize.

A short secondary check reuses the same permutations with block-scaled 4-bit formats. The layer- and block-wise sensitivity analysis of NVFP4 and MXFP4 in Diagnosing FP4 Inference indicates that these formats are sensitive at the block level, and our orderings change which channels share a block. If tree-aligned ordering also lowers block-wise quantization error, one exact relabeling would serve both compressions. If it does not, the main claim is unaffected.