Papers
Topics
Authors
Recent
Search
2000 character limit reached

Subjective Timescale Transformers (STT)

Updated 3 December 2025
  • Subjective Timescale Transformers (STT) are decoder-only models that apply conditional, token-based computation along the temporal axis to optimize efficiency.
  • They integrate a lightweight Transition Network to predict residual updates and employ Bayesian surprise signals to decide block execution dynamically.
  • Empirical results show that STT achieves up to 37.5% savings in self-attention FLOPs and 25% KV-cache reduction while balancing computational efficiency and accuracy.

Subjective Timescale Transformers (STT) are a class of decoder-only Transformer architectures designed to enhance computational efficiency by introducing conditional computation along the temporal axis. Unlike standard Transformers, which execute a uniform, dense computation at each block for all tokens, STT selectively skips blocks for specific tokens based on learned Bayesian surprise signals. This mechanism enables the model to determine both "where and when to compute," reducing both self-attention computations and KV-cache requirements, with explicit routing governed by predicted and observed token-wise state transitions (Wieser et al., 26 Nov 2025).

1. Architectural Framework and Temporal Conditional Computation

An STT is a modification to the conventional decoder-only Transformer stack, where every other standard block is replaced by an STT layer. Each STT layer consists of two principal components:

  • A lightweight Transition Network (TPN) that generates a temporal prior by predicting the next-token residual update based on the previous token's processed state.
  • A full Transformer block (self-attention and feedforward) whose execution is dynamically gated by surprise signals computed from model predictions and observed outcomes.

At each timestep tt and layer \ell, the TPN computes a prior residual prediction Δx^t()\widehat{\Delta x}_t^{(\ell)} from xt1()x_{t-1}^{(\ell)}. The true residual Δxt()\Delta x_t^{(\ell)} is produced by running the full block on xt(1)x_t^{(\ell-1)}. Both quantities are compared using surprise metrics. A router then determines, per token, whether to execute or skip the full block. This approach extends conditional computation—historically applied only across model depth—into the temporal domain, allowing the network to economize computation on a token-by-token basis (Wieser et al., 26 Nov 2025).

2. Transition Network and Temporal Change Hypothesis

Each STT layer \ell contains a TPN defined as: Δx^t()=TPN()(xt1())=ft(xt1();ϕ())\widehat{\Delta x}_t^{(\ell)} = \mathrm{TPN}^{(\ell)}\bigl(x_{t-1}^{(\ell)}\bigr) = f_t\bigl(x_{t-1}^{(\ell)};\,\phi^{(\ell)}\bigr) where ϕ()\phi^{(\ell)} are the TPN parameters. The full block computes: xt()=xt(1)+f()(xt(1)),Δxt()=xt()xt(1)x_t^{(\ell)} = x_t^{(\ell-1)} + f^{(\ell)}\left(x_t^{(\ell-1)}\right), \quad \Delta x_t^{(\ell)} = x_t^{(\ell)} - x_t^{(\ell-1)} The pair \ell0 forms the "temporal change hypothesis," quantifying expected state evolution and providing the basis for gating decisions. The TPN in all experiments is a 2-layer MLP with hidden size equal to model dimension \ell1, trained with MSE loss weighted by \ell2.

3. Surprise Signal Computation

STT computes two core surprise metrics per token and layer: \ell3

  • Expected Change (CE):

\ell4

CE quantifies whether the predicted residual (change hypothesis) accounts for the update more accurately than the static prior.

  • Unexpected Change (CU):

\ell5

where \ell6 is a moving average over the sequence and \ell7 are offsets. CU captures if the token's static change magnitude is unusually large relative to prior tokens.

The gating score for each token is then given by: \ell8 with \ell9 denoting the sigmoid and Δx^t()\widehat{\Delta x}_t^{(\ell)}0 as learnable inverse temperatures annealed during training, ensuring the gating sharpens over time.

4. Routing and Execution Mechanism

Routing is implemented as a fixed-capacity Top-K selection over the continuous gating score. For a chosen capacity Δx^t()\widehat{\Delta x}_t^{(\ell)}1 and sequence length Δx^t()\widehat{\Delta x}_t^{(\ell)}2, the Δx^t()\widehat{\Delta x}_t^{(\ell)}3 tokens with the highest Δx^t()\widehat{\Delta x}_t^{(\ell)}4 per sequence are selected for full-block execution, while the rest are assigned identity residual updates (skipped blocks). During inference, a causal router (small MLP) trained to imitate non-causal Top-K behavior facilitates autoregressive operation by consuming only current and previous token representations: Δx^t()\widehat{\Delta x}_t^{(\ell)}5.

Pseudocode for a single STT layer with fixed capacity is:

\ell7

5. Efficient KV-Cache Management

In standard Transformers, each layer appends the key-value pairs Δx^t()\widehat{\Delta x}_t^{(\ell)}6 for every token to the respective layer’s KV-cache. In STT, only tokens for which the block is executed contribute new Δx^t()\widehat{\Delta x}_t^{(\ell)}7 pairs, decreasing the memory requirements. For a fixed capacity Δx^t()\widehat{\Delta x}_t^{(\ell)}8, a Δx^t()\widehat{\Delta x}_t^{(\ell)}9 fraction of tokens per STT layer add to the cache. As STT layers are placed every other block, the relative KV-cache saving per layer is: xt1()x_{t-1}^{(\ell)}0 For example, with xt1()x_{t-1}^{(\ell)}1, the KV-cache size is reduced by xt1()x_{t-1}^{(\ell)}2 per layer.

6. Empirical Results: Compute-Accuracy Tradeoffs and Training Dynamics

Experiments utilize the Qwen2.5-0.5B backbone with alternating STT and standard blocks. Key outcomes include:

  • Compute savings: With fixed xt1()x_{t-1}^{(\ell)}3, self-attention cost per two-layer block pair is averaged to xt1()x_{t-1}^{(\ell)}4 (full block + STT block at xt1()x_{t-1}^{(\ell)}5), yielding xt1()x_{t-1}^{(\ell)}6 savings in self-attention FLOPs; KV-cache consumption is reduced by xt1()x_{t-1}^{(\ell)}7.
  • Dynamic-capacity variant: Allowing xt1()x_{t-1}^{(\ell)}8 learned during training results in xt1()x_{t-1}^{(\ell)}9 self-attention and Δxt()\Delta x_t^{(\ell)}0 KV-cache savings.
  • Accuracy trade-offs: For Δxt()\Delta x_t^{(\ell)}1B parameter models at Δxt()\Delta x_t^{(\ell)}2 capacity, there is a marked decrease in standard LM benchmarks compared to the dense model—for instance, MMLU: Δxt()\Delta x_t^{(\ell)}3, ARC-C: Δxt()\Delta x_t^{(\ell)}4, HellaSwag: Δxt()\Delta x_t^{(\ell)}5, TruthfulQA: Δxt()\Delta x_t^{(\ell)}6, WinoGrande: Δxt()\Delta x_t^{(\ell)}7.

Training dynamics reflect a shift in gating strategy: early on, Unexpected Change (novelty-driven signal, CU) dominates block execution; as TPNs improve predictive accuracy, Expected Change (CE) increasingly drives gating. Causal router temperatures Δxt()\Delta x_t^{(\ell)}8 are annealed from Δxt()\Delta x_t^{(\ell)}9 to xt(1)x_t^{(\ell-1)}0 to sharpen decisions. In dynamic capacity settings, deeper layers process fewer tokens, consistent with hierarchical predictive coding.

7. Implementation Details and Experimental Configuration

Key implementation parameters:

  • Backbone: Pre-trained Qwen2.5-0.5B; STT layers alternate with standard blocks.
  • Transition Network (TPN): 2-layer MLP, hidden size xt(1)x_t^{(\ell-1)}1; MSE loss (xt(1)x_t^{(\ell-1)}2).
  • Routing Losses: MSE (xt(1)x_t^{(\ell-1)}3), causal routing BCE (xt(1)x_t^{(\ell-1)}4), sparseness loss (xt(1)x_t^{(\ell-1)}5) for dynamic capacity.
  • Optimizer: AdamW (xt(1)x_t^{(\ell-1)}6, xt(1)x_t^{(\ell-1)}7, xt(1)x_t^{(\ell-1)}8, weight decay xt(1)x_t^{(\ell-1)}9).
  • Learning Rates: \ell0e–5 (backbone), \ell1e–3 (TPN), \ell2e–2 (router).
  • Batching/Hardware: 1024-token blocks, per-device batch \ell3, gradient accumulation \ell4 (effective \ell5); bfloat16, activation checkpointing.
  • Software Stack: PyTorch, HuggingFace Transformers, Hydra, Accelerate with FSDP. Code is seeded (\ell6), trained on mixed text corpora, evaluated via lm-eval harness.

Together, these components produce a model that adaptively controls when to compute using tokenwise prediction error, yielding significant compute and memory reductions with dynamic, surprise-driven gating behavior over training (Wieser et al., 26 Nov 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Subjective Timescale Transformers (STT).