Rank-Adaptive Tensor-Train MLP
Implementation & benchmark of arXiv:2607.08936 — A Tensor-Train Discontinuous Galerkin Method for the Vlasov-Maxwell System
Source paper: A Tensor-Train Discontinuous Galerkin Method for the Vlasov-Maxwell System arXiv:2607.08936 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace a large dense layer whose input and output dimensions factor into multiple modes by a TT-matrix whose parameters are stored as a chain of small cores. Periodically apply TT-SVD rounding to remove weak singular directions and keep the representation within a prescribed approximation error. This transfers the paper's central computational principle—perform tensor-product contractions directly in compressed form—to neural network layers.
Formulas
Mathematical statement
For an order-d tensor X with mode sizes n_1,...,n_d, the tensor-train representation is X(i_1,...,i_d)=G^(1)[i_1]...G^(d)[i_d], where G^(k)[i_k] is an r_(k-1) by r_k matrix and r_0=r_d=1. A TT-matrix mapping input modes j_1,...,j_d to output modes i_1,...,i_d uses cores W^(k)[i_k,j_k] of shape r_(k-1) by r_k, giving W(i,j)=W^(1)[i_1,j_1]...W^(d)[i_d,j_d]. If output mode sizes are m_k and input mode sizes are n_k, its parameter count is sum_k r_(k-1)m_kn_kr_k instead of the dense count (product_k m_k)(product_k n_k). TT-SVD factors successive tensor unfoldings and keeps the smallest rank r_k for which the discarded squared singular values satisfy sum_{q>r_k} sigma_(k,q)^2 <= epsilon_k^2. The resulting global Frobenius error obeys ||W-W_TT||_F^2 <= sum_k epsilon_k^2. Here sigma_(k,q) are singular values of the kth unfolding and epsilon_k are per-bond truncation tolerances. In a neural layer, the TT contraction replaces dense matrix multiplication; the activation is applied after contraction because nonlinearities generally increase TT rank.
Implementation notes
(1) Integration point: replace one or more large Linear layers in an MLP, coordinate neural field, or neural operator with a TTLinear module. Factor the input width as n_1...n_d and output width as m_1...m_d. Reshape each input vector into a d-way tensor, contract it successively with the TT cores, then reshape the result back to a vector. Apply the normal bias and GELU or ReLU after the full contraction.
(2) Pseudocode:
initialize W[k] with shape [r[k-1], m[k], n[k], r[k]]
for minibatch x:
X = reshape(x, [batch,n[1],...,n[d]])
Y = sequential_tt_contract(W, X)
y = reshape(Y, [batch,prod(m)]) + bias
loss = criterion(activation(y), target)
backprop(loss); optimizer.step()
if step % R == 0:
for k in 1,...,d-1:
form kth TT unfolding
compute singular values sigma[k,q]
choose smallest r[k] satisfying
sum(q > r[k]) sigma[k,q]^2 <= epsilon[k]^2
replace W by TT-SVD-rounded cores
Use both a relative tolerance and a maximum rank cap. If rounding changes the output too much, increase the tolerance or round less frequently. A dense bias can be retained initially so that only the weight compression is tested.
(3) Computed directly from the mathematics: TT contractions, unfolding SVDs, rank selection, TT parameter counts, and the Frobenius truncation budget. Estimated empirically: rank growth during training, output perturbation caused by rounding, backward cost, wall-clock time, peak memory, and validation error. Log every TT bond rank and compare the measured output error against the SVD tolerance.
(4) First cheap experiment: train a 6-layer MLP on CIFAR-10 with one 1024-by-1024 hidden layer replaced by TTLinear. Factor both dimensions into five modes of size 4, test TT ranks 4, 8, and 16, and round every 50 steps with relative tolerances 1e-4, 1e-3, and 1e-2. Compare against the dense model and a conventional low-rank matrix-factorized layer at matched parameter counts. Measure parameters, peak GPU memory, forward/backward time, validation accuracy, and loss at equal FLOPs. Success means at least 4x lower layer memory with less than 1 percentage-point accuracy loss and no severe slowdown; failure is rank saturation, rounding overhead exceeding contraction savings, or materially worse optimization.
Verification
Stage 1 · Toy mechanism gate: Failed ✗
Stage 2 · Mechanism transferred to benchmark: Not tested
Stage 2 · Practical benchmark result: Not run
Methodology: Toy-system gate first; the benchmark stage runs only after a pass. How verification works
Stage 1 — Mechanism check agent confidence 9/10
Built a TT-SVD implementation, TTLinear contraction, rank-cap/tolerance handling, rounding, and a reproducible CUDA mini-regression experiment. The uncapped TT-SVD satisfied the requested relative Frobenius bound (2.46e-15 error versus 0.08), and contraction matched dense reconstruction to 4.16e-6, while the capped rank-8 approximation compressed parameters from 4096 to 1280 but violated the tolerance with 0.775 relative error. In training, the compressed TT model used 448 parameters versus 4160 for dense, but reached MSE 0.0744 versus 2.72e-5 and was 1.9x slower, so the proposed practical win was not observed.
- Agent confidence
- 9/10
- Baseline
- Dense: 4160 parameters, final MSE 2.7150e-05, step-50 MSE 0.01797, 0.712 s
- Idea
- TT: 448 parameters, ranks [1,4,4,1], final MSE 0.07440, step-50 MSE 0.07721, 1.358 s; capped rank-8 SVD compression 1280 vs 4096 matrix parameters, relative error 0.7747; uncapped relative error 2.46e-15 and bound satisfied
Limitations: Only a small synthetic regression task and one 64x64 matrix factorization were tested; no CIFAR-10, matched-FLOP comparison, conventional low-rank baseline, peak-memory measurement, rank-growth study, or larger MLP evaluation was performed.
How to run: python3 tt_mlp_experiment.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Artifacts
- report.md 1.4 KB View
- tt_mlp_experiment.py 6.8 KB View Raw