Explore the research collection
4 entries · Follow this search
- Paper
Learning to Compute Is Not Learning to Retain or Reuse in Looped Transformers
Separates three independently-learnable skills: computing an answer, retaining it across extra loops, keeping the hidden state reusable by later computation. Setting: in-context execution of Mealy machines (state-tracking), simulator giving exact intermediate targets and counterfactual continuations; 2-layer shared block (width 128, 4 heads, MLP 512, no positional/loop embeddings), trained to exit at loop 32. Key results: final-only supervision is 100% at the trained exit but keeps 22.3% of answers at loop 64; supervising every position → 94.3%; supervising one uniformly-random position per example (same single-label density as final-only) → 99.8% retention; randomized exit budget raises loop-64 accuracy 30.0% → 85.6%; progressive training works in only 1/3 seeds vs 3/3 for the random-exit control (97.9% retention). Computation is exact — swapping a loop-k hidden vector for one from another input redirects every later position to that input's exact continuation (237/237 pairs across ten models) — but answers fade within a few loops. Retention ≠ reuse: freezing each position at the loop its answer first becomes readable crashes endpoint accuracy 100% → 4.1% (sampled-prefix) / 6.3% (matched random exit); waiting four more loops is harmless. External check: Bansal et al. (2022)'s released recurrent maze network solves 0 of 32 mazes when pixels are frozen at answer arrival, 4/4... all 32 when frozen four iterations later. Caveats (§7): one synthetic task family + one principal architecture; interventions don't identify a microscopic cause or general repair; six paired seeds for original comparisons, three for controls; sampled supervision still needs intermediate labels; finite-window retention ≠ hidden-state convergence or uniform length extrapolation.
- Paper
OperLoop: Looped Transformers as Optimizers
Reframes looped Transformers' recurrent transition as an optimizer update on the hidden state treated as a fast weight. Any loop transition derives from (1) an input-map projection, (2) a local objective whose gradient the shared blocks' output predicts, (3) an optimizer update rule. Diagnosis: existing transitions (Ouro, Huginn, Parcae, HyperLoop) have input-map mismatches between transitions and projections (Parcae omits Āᵀ; HyperLoop splits H^pre/H^post) — aligning maps cuts loss, +0.15pp Parcae / +0.54pp HyperLoop commonsense (aligned HyperLoop: 59.47 vs 58.93). Their design, OperLoop: delta objective ½‖o_l − t_l‖², explicit learned weight decay Λ_l, state-dependent causally-monotonic step size η_l (inspired by Delta Linear Attention, but target implicit rather than projected values). At matched training FLOPs (~50% params): best looped variant at both scales — EM avg 25.58 vs non-looped 5B baseline 23.89 (+1.69pp), 10B +1.04pp; Loop6 at 1.67× FLOPs: EM 31.90 (+8.01), 8-shot CoT GSM8K 17.13→31.08. Ablations: removing delta objective 25.58→24.84; causal step-size beats fixed η=1 (+1.18pp EM) and non-causal (+1.56pp). Caveats: all looped models have worse PPL and log-likelihood accuracy than the non-looped baseline (Wikitext 13.90 vs 13.08 at 5B) — the advantage shows only in generative EM eval (authors' own point: evaluate beyond PPL); gains vary by task (ARCcn at 5B: 37.63 vs baseline 40.96); small models (5B/10B, 300–500B tokens, 4k seq) — no frontier-scale evidence.
- Paper
Native Hybrid Attention for Efficient Sequence Modeling
Native Hybrid Attention (NHA) unifies linear and full attention into a single softmax operation within one uniform layer design. Long-term history is compressed into fixed-size key-value memory slots updated by a linear RNN; short-term context comes from exact sliding-window tokens; one softmax over all keys and values learns per-token, per-head balancing dynamically with no extra fusion parameters. A single hyperparameter — the sliding window size — shifts each layer smoothly between pure linear attention (w=0), intra-layer hybrid, and full attention (w=N), with no structural changes; all layers share the same architecture. NHA beats Transformers and other hybrid baselines on recall-intensive and commonsense reasoning tasks, and pretrained LLMs (Llama-3, Qwen) can be structurally hybridized with NHA via lightweight finetuning (e.g., NHA-Qwen2.5-7B / NHA-Llama-3-8B trained on 10B tokens, NHA-Qwen3-30BA3B) to match accuracy with drastically lower GPU memory and inference latency.
- Paper
SageAttention: Accurate 8-Bit Attention for Plug-and-play Inference Acceleration
PTQ attention: subtract the token-mean of K to smooth channel outliers so QK can be INT8, and keep PV in FP16 with an FP16 accumulator (INT8 PV is too noisy on some layers). Triton kernels on RTX4090/3090; peak ~341 TOPS at headdim 64/128 vs FlashAttention2 ~165. ~2.1× FA2 and ~2.7× xformers. Plug-and-play: Llama2-7B WikiText 5.824 vs FP 5.823, MMLU 0.46=FP; CogVideoX/Unidiffuser/UltraPixel/TIMM/Llava1.6 near-parity. ICLR 2025. Code https://github.com/thu-ml/SageAttention.