← 返回论文库
CVPR 2026   Finalist

ViT^3: Unlocking Test-Time Training in Vision

Dongchen Han ⋅ Yining Li ⋅ Tianyu Li ⋅ Zixuan Cao ⋅ Ziming Wang ⋅ Jun Song ⋅ Cheng Yu ⋅ Bo Zheng ⋅ Gao Huang

摘要 Abstract

Test-Time Training (TTT) has recently emerged as a promising direction for efficient sequence modeling. TTT reformulates attention operation as an online learning problem, constructing a compact inner model from key–value pairs at test time. This reformulation opens a rich and flexible design space while achieving linear computational complexity. However, crafting a powerful visual TTT design remains challenging: fundamental choices for the inner module and inner training lack comprehensive understanding and practical guidelines. To bridge this critical gap, in this paper, we present a systematic empirical study of TTT designs for visual sequence modeling. From a series of experiments and analyses, we distill six practical insights that establish design principles for effective visual TTT and illuminate paths for future improvement. These findings culminate in the Vision Test-Time Training (ViT$^3$) model, a pure TTT architecture that achieves linear complexity and parallelizable computation. We evaluate ViT$^3$ across diverse visual tasks, including image classification, image generation, object detection, and semantic segmentation. Results show that ViT$^3$ consistently matches or outperforms advanced linear-complexity models (e.g., Mamba and linear attention variants) and effectively narrows the gap to highly optimized vision Transformers. We hope this study and the ViT$^3$ baseline can facilitate future work on visual TTT models. Code will be released.

📝 精读笔记

灵魂一句
一篇系统性 empirical study:把 Test-Time Training(TTT,把 attention 重写成"测试时在 KV 上在线训练一个小内层模型"的 O(N) 范式)在视觉里彻底摸一遍设计空间,蒸出 6 条实用 insight(内层 loss / lr / batch / epoch / 内层模型架构与深度),据此拼出 ViT³——一个纯 TTT、线性复杂度、可并行的视觉 backbone。在分类/生成/检测/分割上稳定追平或超过 Mamba 与各种 linear attention,并显著缩小与"重度调优 Softmax ViT"的差距。定位是给视觉 TTT 立一个强 baseline + 设计准则。
问题 & 动机
Softmax attention 是 O(N²),长视觉序列代价爆炸。线性方案 linear attention 把 K,V 压成 d×d 线性权重 W=KᵀV 得 O(N),但状态容量有限、naive 压缩丢信息、表达力弱。TTT[56] 提供新路:把整个 attention 看成在线学习——把 KV 当 mini-dataset,测试时对内层模型 F_W 做几步自监督训练得到 W*,再用 query 取输出 O=F_{W*}(Q);内层用线性复杂度模块即得 O(N) 但有"学出来的非线性状态"。但 TTT 太灵活→设计空间巨大且没人系统研究(内层 loss/lr/batch/epoch、内层架构/大小怎么选都没准则)→无法做出强的视觉 TTT。本文中心问题:能为高效又有表达力的 TTT 立什么设计准则、怎么指明未来改进方向?
核心:六条 insight + ViT³ 设计(关键公式)
TTT 内层训练(式5):V̂_B=F_W(K_B),W←W−η·∂L(V̂_B,V_B)/∂W;初始 W0 是外层可学习参数,内层更新被 unroll、与外层端到端联合训练。六条 insight:① 混合二阶导 ∂²L/∂V̂∂V 为 0 的内层 loss 不适合 TTT(外层对 W_V 的梯度要穿过它,式6)——L1/MAE 最差;② 视觉用单 epoch 全批量(B=N)内层训练最好(mini-batch 引入因果偏置,适合语言不适合非因果视觉);③ 较大内层 lr=1.0 有效;④ 增大内层宽度容量持续涨点(r1→r4:78.9→79.6);⑤ 当前设定下加深内层反而变差(3 层 77.5<2 层 78.9,优化瓶颈);⑥ 卷积做内层模型特别适合视觉(把全局 K,V 压进局部 conv kernel→输出同时含全局+局部)。ViT³ 内层=两模块:F1=FC(x)⊙SiLU(FC(x))(简化 GLU,倍增容量又好优化)+ F2=DWConv(x)(局部全局融合);每个 TTT block 里 1 个 head 用 F2、其余用 F1,drop-in 替换 attention。两族:ViT³(非层级 DeiT 式)/ H-ViT³(4-stage 层级);生成用 DiT³(替 DiT 的 attention)。
关键结果
分类(ImageNet-1K):非层级 ViT³-S 81.6(DeiT-S 79.8 / Vim-S 80.3 / Agent-DeiT-S 80.5);层级 H-ViT³-B 84.9(MESA 训 85.5),全面超 VMamba/SOFT++/VVT/MILA,且 H-ViT³-S 用约一半参数/FLOPs 就超更大的 SOFT-L++、VMamba-B。检测(COCO/Mask R-CNN) H-ViT³-T 1× APᵇ 47.3/APᵐ 42.8 超 VMamba-T、MILA-T。分割(ADE20K/UPerNet) H-ViT³-T mIoU 48.0(>VMamba-T 47.9)。生成 DiT³-S/8 FID 153.60→143.49。普遍规律:序列越长(检测/分割 N≫d),TTT 的"非线性内层 + 在线学习"相对固定状态的 linear/Mamba 优势越明显。
亮点
① 把 TTT 的设计空间讲清楚:6 条 insight 既是准则也是未来方向(如 insight 5 直指"深内层优化难"是开放问题),对一个新范式比单点 SOTA 更有价值。② 统一视角(Fig 1):Softmax attention = 宽度 N、Softmax 激活的 2 层 MLP;linear attention = d×d 线性层;TTT = 任意内层模型——把三者放进同一框架,解释力强。③ conv 做内层的洞察优雅:全局信息编进局部 kernel 权重,天然融合全局+局部,是视觉特化。
疑问 / 待查
① ViT³/H-ViT³/DiT³ 的逐层超参(stage 配置、head 数、F1/F2 head 划分比例)原文说"in the Appendix"——正文未给全,需查附录。② insight 5 的"深内层难优化"只给了假设+部分证据(残差/初始化缓解有限),根因未定论,是留给后人的坑。③ 分割上 H-ViT³ 仍逊于 TransNeXt(重度调优 ViT),差距未完全抹平。④ href arXiv id 2512.01643(2025.12);各表 ‡ 表示用了 MESA 抗过拟合训练策略,比较时需对齐。

📖 逐段精读 · 笔记

批量精读初稿(基于本地 PDF 全文 61k 字符 / 13 页提取)。最后更新 2026-06-21。
① Abstract(摘要)— 逐句精讲
原文逐句 + 中文指路:
1) “TTT reformulates attention operation as an online learning problem, constructing a compact inner model from key-value pairs at test time.” → TTT 定义:把 attention 重写成在线学习,测试时从 KV 构紧凑内层模型。
2) “This reformulation opens a rich and flexible design space while achieving linear computational complexity.” → 好处=O(N) + 灵活设计空间。
3) “crafting a powerful visual TTT design remains challenging: fundamental choices for the inner module and inner training lack comprehensive understanding and practical guidelines.” → 痛点:内层模块/训练怎么选没准则。
4) “we distill six practical insights … culminate in the Vision Test-Time Training (ViT³) model, a pure TTT architecture that achieves linear complexity and parallelizable computation.” → 贡献=6 条 insight + ViT³。
5) “consistently matches or outperforms advanced linear-complexity models (e.g., Mamba and linear attention variants) and effectively narrows the gap to highly optimized vision Transformers.”
一句话抓 Abstract:TTT 在视觉潜力大但没人会调;本文系统实验出 6 条准则、据此造 ViT³(纯 TTT、O(N)、可并行),在分类/生成/检测/分割上超 Mamba/linear attention、逼近 Softmax ViT。代码 github.com/LeapLabTHU/ViTTT。
📚 背景知识①(外部):O(N²) Softmax vs O(N) linear attention
Softmax attention=主流 token mixer,但对序列长 \(N\) 是 \(O(N^2)\),长视觉序列代价爆炸。linear attention=用线性核换 Softmax,靠矩阵乘结合律把 \((QK^\top)V\) 重排成 \(Q(K^\top V)\) 得 \(O(N)\),但 “linear attention suffers from limited expressive power”——\(d\times d\) 线性状态容量有限、naive \(K^\top V\) 压缩丢信息。还有 Mamba(selective SSM,sequential scan)也是 \(O(N)\) 但固定状态。本文路线=用 TTT 范式做 \(O(N)\) 但更有表达力。
📚 背景知识②:统一视角(Fig.1,全文最关键 framing)
把三种 token mixer 都看成“给 \(Q\) 用的一个内层模型”:Softmax attention=\(O=\sigma(QK^\top)V\),即一个宽度=\(N\)、激活=Softmax 的 2 层 MLP(\(W_1=K^\top,W_2=V\))→评 \(O\) 时 \(O(N^2)\)。Linear attention=\(O=Q(K^\top V)\),即把 \(K,V\) 压成一个 \(d\times d\) 线性层 \(W=K^\top V\)→\(O(N)\) 但状态小、信息丢。TTT=内层 \(F_W(\cdot):\mathbb{R}^d\to\mathbb{R}^d\) 可以是任意模块,把 KV 当 mini-dataset 在线训出 \(W^*\)→\(O=F_{W^*}(Q)\);当 \(F_W\) 用线性复杂度模块(如 hidden 4d 的 2 层 MLP)即得 \(O(N)\) 且有非线性状态。
📚 背景知识③:内层/外层 loop + 算力代价(Remark 4)
内层(inner loop)=\(F_W\) + 式5 的几步在线更新(per-sequence,测试时也跑);外层(outer loop)=整网在真实数据上的常规训练。关键:内层更新“is differentiable and is optimized jointly with the outer network … the inner updates are unrolled and learned end-to-end”(meta-learning 式“梯度的梯度”),故带 TTT 层仍端到端可训。代价(Remark 4):内层要 (i) 对 \(K\) 前向 \(\hat V=F_W(K)\)、(ii) loss 反向、(iii) 对 \(Q\) 前向 \(O=F_W(Q)\);反向≈2× 前向,合计 ≈1+2+1=4× 同架构外层模块的 FLOPs——故“内层要轻量又有表达力”是核心矛盾。
② §1 Introduction — problem → solution → why
problem:ViT 的 Softmax attention \(O(N^2)\) 处理长序列贵;社区转 \(O(N)\),代表 linear attention 但 “suffers from limited expressive power, making it impractical for many applications”。TTT 给新路:“in each context a compact inner model is trained or constructed from the key–value pairs and then applied to every query.” 但 “the very flexibility of TTT introduces a critical bottleneck: a large and under-explored design space.”
solution + why:中心问题 “What design principles can be established for building efficient yet expressive Test-Time Training module, and how to enable future improvement?” 系统探索两方面——inner training(loss/lr/batch/epoch)+ inner model(架构/大小),蒸出 6 条 insight,据此造 ViT³。为什么做 empirical study 而非单一新模块:TTT 是新范式、设计空间大且无地图,作者把立准则 + 强 baseline + 揭示未来方向列为核心贡献,比抢单点 SOTA 对社区更有用。
②c §2 Related Work — TTT 的跨域版图
降 \(O(N^2)\) 的两条老路:① 减少参与 attention 的 token(locality / sparsity);② 重设计 attention 范式做 \(O(N)\) 全局建模(linear attention 族)。本文补的是第三条——TTT-based 线性复杂度。TTT 已在多域开花:“LaCT attains effective linear-time language modeling by applying large chunk test-time training”;“TTT layers allow pretrained diffusion Transformers that could only generate 3-second clips to produce coherent one-minute videos”(视频生成);“TTT3R views 3D reconstruction as a test-time training process, achieving a 2× improvement in global pose estimation”。TTT 还与 fast weight programmers、meta-learning、Test-Time Scaling、recurrent depth 密切相关。但作者点明:“the superiority of TTT methods remain locked by the under-explored design space”——正是本文要解的。
③ §3 Preliminaries — 式(1)-(4)
Softmax(式1-2):\(O_i=\sum_j \frac{\exp(Q_iK_j^\top)}{\sum_j\exp(Q_iK_j^\top)}V_j\),重写为 \[ O=\sigma(QK^\top)V\triangleq\sigma(QW_1)W_2=\mathrm{MLP}(Q),\quad W_1=K^\top,\ W_2=V \tag{2} \] Linear(式3-4):用线性核 \(\phi\) 替 Softmax、忽略归一化标量后 \[ O=Q(K^\top V)\triangleq QW=\mathrm{FC}(Q),\quad W=K^\top V\in\mathbb{R}^{d\times d} \tag{4} \] 维度:\(Q,K,V\in\mathbb{R}^{N\times d}\),投影 \(W_{Q/K/V}\in\mathbb{R}^{C\times d}\)。
③b §3.2 TTT Model — 式(5)
把 KV 当 dataset \(D=\{(K_i,V_i)\}_{i=1}^N\),用自监督在线学习压进 \(F_W:\mathbb{R}^d\to\mathbb{R}^d\) 的权重: \[ \hat V_B=F_W(K_B),\qquad W\leftarrow W-\eta\cdot\frac{\partial L(\hat V_B,V_B)}{\partial W} \tag{5} \] \(L\)=自监督重建目标(鼓励 \(F_W(K_i)\) 预测对应 \(V_i\));初始 \(W_0\) 是外层可学习参数;几步内层更新后用 \(W^*\) 产出 \(O=F_{W^*}(Q)\)。当 \(F_W\) 用线性复杂度架构(如 ratio 4.0 的 2 层 MLP),TTT 层继承 \(O(N)\) 时空复杂度且有“学出来的非线性状态”。
④ §4 设置 + Insight 1(loss)式(6) + Table 1
设置:DeiT-S 把 attention 换成 TTT 层做 baseline,ImageNet-1K 标准 300 epoch,逐项改动看影响;研究内层训练时内层先固定为 2 层 MLP(SiLU,ratio 1.0)。Insight 1:“loss functions L for which \(\partial^2 L/\partial\hat V\partial V\) vanishes are not suitable for TTT.” 机制(式6):外层对 value 投影 \(W_V\) 的梯度 \[ \frac{\partial G}{\partial W_V}=\frac{\partial\hat V_B}{\partial W}\cdot\frac{\partial^2 L(\hat V_B,V_B)}{\partial\hat V_B\partial V_B}\cdot\frac{\partial V_B}{\partial W_V} \tag{6} \] 若中间的混合二阶导≈0→外层梯度信号消失→学不动。Table 1:MAE/L1(导数是 sign、混合二阶导几乎处处 0)最差 76.5;Smooth L1(部分区域消失)78.1;Dot product 78.9 / MSE 79.2 / RMSE 78.8(无此病,~79.0)。Remark 1:Softmax attention 隐式满足“\(F(K_i)\approx V_i\)”这个 TTT 训练目标。
④b Insight 2(batch/epoch,Table 2)
Insight 2:“a single epoch of full-batch (batch gradient) inner training works well for vision.” Table 2:\(B=N\) 78.9 > N/2 78.6 > N/3 78.3 > N/4 78.1;多 epoch 略升(2ep 79.1、3ep 79.2)但掉吞吐+不稳,4ep 直接发散(57.0*)。why:sequential mini-batch 引入因果偏置(“updates from earlier mini-batches change the inner-module weights … updates from later mini-batches can overwrite those produced earlier”)——适合因果的语言、不适合非因果的视觉。Remark 2 还把现有方法分两类:parallel(全局非因果,≈单 epoch 全批量)vs sequential(Mamba 沿扫描路径,更富空间依赖);为视觉设计 mini-batch 内训算法是未来方向。
④c Insight 3(lr)式(7) + Table 3
Insight 3:较大内层 lr=1.0 有效。Table 3:0.1→77.5 / 0.2→78.1 / 0.5→78.7 / 1.0→78.9 / 2.0→78.9 / 5.0→76.7* / 10.0→76.9*(发散)/ token-wise Dynamic→78.7(视觉里反而更差)。Remark 3:lr 数学上可被 \(K,V\) 缩放吸收: \[ \eta\cdot\frac{\partial L}{\partial W}=\eta K^\top(KW-V)=\tilde K^\top(\tilde KW-\tilde V),\quad \tilde K=\sqrt\eta K,\ \tilde V=\sqrt\eta V \tag{7} \] 但实践上因初始化尺度/norm 层,\(\eta\) 仍是关键超参(类比 Softmax 的 \(1/\sqrt d\) 可吸收进 Q,K 却众所周知很关键)。
④d Insight 4(加宽有益)+ Insight 5(加深反直觉,Table 4/6)
Insight 4:增大内层宽度持续涨点。Table 4:2 层 MLP hidden \(d\to4d\),r1 78.9 / r2 79.2 / r3 79.5 / r4 79.6——这是 TTT 相对 linear attention(被限死 \(d\times d\))的核心优势。Insight 5(反直觉):“in current TTT settings, deep inner models suffer from optimization difficulties.” Table 4:FC(1 层)79.1 > 2 层 MLP 78.9 > 3 层 MLP 77.5;Fig.3 显示越深训练 loss 越高→欠拟合/优化瓶颈(非容量不足)。佐证:约束输出层为恒等的 SiLU(FC(x)) 78.9→79.4、去输出层的 SwiGLU 79.0→79.7。成因(Remark 5):外层——深内层初始化 \(W_0\) 难端到端优化;内层——深度致内层梯度爆炸/消失。Table 6:残差(+x 78.8)与朴素 init(79.0)缓解有限(均<79.4)。→“让深内层可训”是开放方向。
④e Insight 6(卷积内层,Table 4)
Insight 6:“convolutional architectures are particularly appropriate as inner models for visual tasks.” Table 4:Conv 79.9 / DWConv 80.1(全表最佳)。why:TTT 把全局 \(K,V\) 压进 \(F_W\) 参数,当 \(F_W\) 是 conv→“global information is effectively encoded into the local convolution kernel weights”,\(O=F_W(Q)\) 同时实现全局(更新的 kernel 权重)+ 局部(感受野)交互。Remark 6:此时 KV 数据集泛化为 \(\{(K^{loc}_i,V_i)\}\),3×3 conv 即 \(K^{3\times3}_i\)(\(K_i\) 的 9 邻域 key)。
⑤ §5 ViT³ 架构(落地 6 条 insight)
内层训练:单 epoch 全批量 GD + lr 1.0 + dot-product loss。内层模型=两模块:\(F_1=\mathrm{FC}(x)\odot\mathrm{SiLU}(\mathrm{FC}(x))\)(简化 GLU,“doubles the capacity of a naive \(d\times d\) linear state while remaining easy to optimize”)+ \(F_2=\mathrm{DWConv}(x)\)(局部全局融合);每个 TTT block 里 1 个 head 用 \(F_2\)、其余用 \(F_1\),drop-in 替换 attention。宏观结构同 Transformer(Norm→TTT Block→Norm→FFN)。两族:ViT³(非层级 DeiT 式,B(C,H)×12)/ H-ViT³(层级 4-stage);生成用 DiT³(替 DiT 的 attention)。位置编码用 conditional positional encodings。
⑤b §5.1 分类 ImageNet-1K(Table 5/7 真数字)
模型类型#ParamTop-1
DeiT-STransformer22M79.8
Vim-SMamba26M80.3
Agent-DeiT-SLinear23M80.5
ViT³-S(非层级)TTT24M81.6
VMamba-BMamba89M83.9
SOFT-L++Linear85M84.1
MILA-B‡Linear96M85.3
H-ViT³-T / S / BTTT29/54/94M83.5 / 84.4 / 84.9 (84.0/84.9/85.5‡)
读表:非层级 ViT³-S 81.6 超 DeiT-S 79.8 / Vim-S 80.3 / Agent-DeiT-S 80.5、ViT³-T 76.5 / ViT³-B 82.6;层级 H-ViT³ 全面超 VMamba/SOFT++/VVT。原文:“H-ViT³-S attains higher performance than the larger SOFT-L++ and VMamba-B, despite using roughly half of parameters and FLOPs.”(‡=MESA 抗过拟合训练。)非层级档位细节:ViT³-T 76.5(DeiT-T 72.2 / Vim-T 76.1 / Agent-DeiT-T 74.9)、ViT³-B 82.6(DeiT-B 81.8 / ConvNeXt-B-iso 82.0),三个 size 都稳超同量级 Transformer/Mamba/Linear 基线,说明 6 条 insight 拼出的内层设计在不同容量下都成立。
⑤c §5.2 检测 COCO(Table 8)+ §5.3 分割 ADE20K(Table 9)
检测(Mask R-CNN 1×, AP↑):H-ViT³-T APᵇ 47.3/APᵐ 42.8(VMamba-T 47.3/42.7、MILA-T 46.8/42.1);H-ViT³-S 49.1/44.1;H-ViT³-B 50.0/44.6(3× schedule 同样追平/超线性方案)。分割(UPerNet, mIoU↑):H-ViT³-T 48.0(VMamba-T 47.9 / SOFT-T++ 46.5 / VVT-S 46.8);H-ViT³-S 50.2;H-ViT³-B 51.7(仍<TransNeXt-B 53.0 等重度调优 ViT)。关键规律(原文):“token sequences in object detection are typically much longer … N ≫ d. Under these conditions, existing linear-complexity designs such as VMamba and SOFT++ tend to be constrained by limited state capacity and therefore frequently underperform”——序列越长,TTT 的“非线性内层 + 在线学习”相对固定状态优势越大。
⑤d §5.4 生成 DiT³(Table 10 全表)+ §5.5 效率
把 DiT 的 Softmax attention 换成 ViT³ block 得 DiT³,FID-50K @256²(无额外调参,全档位超 DiT):
ModelFLOPsFID↓IS↑
DiT-S/8 → DiT³-S/80.36→0.40G153.60 → 143.498.34
DiT-S/4 → DiT³-S/41.41→1.57G100.41 → 93.7714.42
DiT-S/2 → DiT³-S/26.06→6.23G68.40 → 62.6521.59
DiT-B/8 → DiT³-B/81.42→1.51G122.74 → 120.4110.94
DiT-B/4 → DiT³-B/45.56→5.88G68.38 → 65.2522.29
DiT-B/2 → DiT³-B/223.01→23.35G43.47 → 39.3136.99
效率(Fig.4):线性时空复杂度让 ViT³ 随分辨率 scale 更省——“At 1248² resolution (i.e., 6,084 tokens per image), ViT³-T attains a 4.6× speedup over DeiT-T and reduces GPU memory consumption by 90.3%.” 这正是 \(O(N)\) 相对 \(O(N^2)\) Softmax 的本质收益:序列越长、收益越大。注意生成任务里 DiT³ 仅替换 token mixer、其余训练配方照搬 DiT,FID 仍单调改善,侧证 TTT block 是真正的 drop-in 增益而非靠调参堆出来的。
Q&A · 追问 why
Q:TTT 凭什么比 linear attention / Mamba 强? linear attention 把 KV 压进固定 \(d\times d\) 线性状态(信息瓶颈死板);Mamba 是固定容量 selective SSM。TTT 内层是可学习非线性模块,且测试时还对当前序列在线“拟合”几步——相当于每条序列定制一个压缩器。序列越长(N≫d,检测/分割)固定小状态越吃亏,TTT 优势越大(§5.2 明确点出),代价是内层 ~4× FLOPs。
Q:为什么“加宽内层有用、加深反而有害”? 加宽=纯增容量、优化难度几乎不变;加深=TTT 内层既要在外层 unroll 下学初始化 \(W_0\)、又要在内层几步更新里稳定传梯度,深度同时恶化两处(Remark 5),训练 loss 反升、欠拟合。约束输出层为恒等能缓解,侧证是优化问题而非表达力问题。
Q:为什么视觉要全批量、语言要 mini-batch? sequential mini-batch 让“先处理的 token 改权重影响后处理的 token”,本质是因果/单向依赖——语言天生因果受益;视觉非因果(全局),强加因果偏置反而损性能。
⑥ 疑问 / 待查([推测] 已标注)
① ViT³/H-ViT³/DiT³ 逐层超参(stage 配置、head 数、F1/F2 head 划分比例)正文丢到附录——附录 Tab.11-13 给了 backbone 配置(如 ViT³-S=B(384,6)×12、H-ViT³ 四 stage),但 F1/F2 在多 head 里的精确比例(“1 head 用 F2、其余 F1”)对不同 H 的影响未单独消融。② insight 5 的“深内层难优化”只给假设+部分证据(残差/init 缓解有限),根因未定论,是留给后人的坑(理论上深网更强,能否在 TTT 框架内训起来=fundamental direction)。③ 分割上 H-ViT³-B 51.7 仍逊 TransNeXt-B 53.0,差距未抹平。④ 作者自承未覆盖的轴:inner optimizer、inner data augmentation、Transformer inner model(“this paper is not exhaustive”)。⑤ ‡=MESA 训练,跨表比较需对齐该标记。
📌 全文一页总结(≥3 takeaway)
problem:Softmax attention \(O(N^2)\) 贵;linear attention \(O(N)\) 但弱;TTT 范式有潜力但设计空间大且无准则,做不出强的视觉 TTT。
method:系统实验内层训练(loss/lr/batch/epoch)+内层模型(架构/大小),蒸出 6 条 insight(loss 需混合二阶导非零 / 单 epoch 全批量 / lr=1.0 / 加宽有益 / 加深有害 / 卷积内层最适视觉),据此造 ViT³(内层=简化 GLU \(F_1\)+DWConv \(F_2\) 混合 head,drop-in 替 attention,\(O(N)\) 可并行)。
experiment:分类 ViT³-S 81.6 / H-ViT³-B 84.9(85.5‡);检测 H-ViT³-T APᵇ 47.3;分割 H-ViT³-T mIoU 48.0;生成 DiT³-S/8 FID 153.6→143.5;1248² 下比 DeiT-T 快 4.6×、省显存 90.3%。
takeaways:① 统一视角(Softmax=N 宽 MLP / linear=d×d 线性 / TTT=任意内层)解释力强,是理解高效 attention 的好框架;② 视觉 TTT 的甜点=“单 epoch 全批量 + 大 lr + 宽而浅的非线性/卷积内层”,且 conv 内层把全局信息编进局部 kernel 很优雅;③ 最大开放问题是让深内层可优化——解决它有望让 TTT 真正比肩 SOTA Transformer。

🖼 论文原图(本地 PDF 截图,原文 caption 未改写)

Figure 1. Illustration of Softmax attention [59], linear atten- tion [32], and Test-Time Training (TTT) module [56]. (a) Softmax attention can be viewed as building a two-layer MLP that directly uses the uncompressed keys K and values V , where the hidden width equals the sequence length N and the nonlinearity is Soft- max. While effective, this N-width MLP leads to O(N 2) costs when applied to th
Figure 2. Illustration of the TTT model building block. TTT shares the same macro architecture as Transformer.
Figure 3. Results of TTT models with inner modules of 1, 2, 3 layers (FC, two-layer and three-layer MLP). Deeper inner models lead to higher training loss, and thus lower test accuracy.