JJava Stack Lab
论文雷达 · arXiv AI

拓扑枢纽最优传输(THOT):以 Flash 速度消除长上下文稀释

摘要

论文提出 Topology Hub Optimal Transport(THOT),用线性规模的 hub-and-spoke 最优传输图替代密集 L×L 矩阵,并结合 simplex sparsemax 或免排序的 token-local thresholded ReLU 容量门控、三 sweep Sinkhorn 调度、Triton kernel 和分块因果变体来抑制长上下文中的干扰项质量。实验显示,在 NVIDIA L4 上以 L=128 训练后,sparsemax THOT 在 L=262,144 的零样本固定绑定召回达到 97.40%(α=0)和 98.83%(α=0.05),而 softmax-gated hub OT 降至 3.52%。kernel 在 H=8、D=64、L=262K 时 forward+VJP 为 100.1 ms,WikiText-103 多针检索在 L=65K 达到 100.00%(128/128),对比短训练 RoPE FlashAttention 的 0.78%。

查看原始标题和摘要

Topology Hub Optimal Transport: Eliminating Long Context Dilution at Flash Speed

Long-context models use sparse or structured attention to avoid quadratic cost, yet retrieving a small set of relevant facts embedded among hundreds of thousands of distractors degrades as normalization mass disperses with length. Hub-and-spoke optimal transport (OT) replaces the dense $L \times L$ matrix with a linear-size graph over local windows and $K$ shared hubs balanced by Sinkhorn scaling. Building on block-wise tail refinement and fixed-support transport topology (arXiv:2605.08123, arXiv:2609.07954), we introduce Topology Hub Optimal Transport (THOT): (1) bounded-support capacity gating via simplex sparsemax ($O(L\log L)$) or sorting-free token-local thresholded ReLU ($O(L)$), driving excess distractor mass to zero; (2) a three-sweep $1+2$ annealed row-closed Sinkhorn schedule that damps bipartite residuals; (3) an exact rank-$(D+2R+1)$ One-Reference-Tile adjoint in batched split-factor Triton kernels (BF16 Tensor Cores, FP32 potentials); and (4) a chunked exclusive-prefix causal variant with verified zero future leakage. On NVIDIA L4, sparsemax THOT trained at $L=128$ reaches 97.40% zero-shot recall of fixed bindings at $L=262{,}144$ under pure task loss ($α=0$) and 98.83

核心要点

  • THOT 用线性规模 hub-and-spoke 最优传输替代密集 L×L 注意力矩阵,目标是缓解长上下文归一化质量分散导致的检索退化。
  • 容量门控采用 simplex sparsemax(O(L log L))或免排序的 token-local thresholded ReLU(O(L)),将多余干扰项质量压到零。
  • 引入三 sweep 1+2 退火 row-closed Sinkhorn 调度,并用 batched split-factor Triton kernel 实现 rank-(D+2R+1) 的 One-Reference-Tile adjoint,使用 BF16 Tensor Cores 与 FP32 potentials。
  • 在 NVIDIA L4 上,L=128 训练的 sparsemax THOT 在 L=262,144 零样本召回为 97.40%(α=0)和 98.83%(α=0.05),softmax-gated hub OT 为 3.52%。
  • kernel 在 H=8、D=64、L=262K 时 forward+VJP 为 100.1 ms;在 L=4,096 时为 1.34 ms,对比 cuDNN FlashAttention 的 4.37 ms;WikiText-103 多针检索在 L=65K 达 100.00%。

为什么值得后端工程师关注

对后端工程师的参考主要在长上下文推理与检索系统的延迟、内存和容量评估:THOT 用线性规模 OT 图、稀疏容量门控和 Triton kernel 降低 L×L 注意力成本,但实现依赖 GPU kernel,Java 服务侧更多是模型集成、批处理配置与性能验证。