TL;DR
This paper introduces Residualized Temporal Sparse Autoencoders (SAEs), a novel framework designed to interpret the internal activation trajectories of text-to-image diffusion models over denoising time. By using linear predictors to strip away highly redundant, step-to-step temporal drift, the method forces the SAE to focus on sparse, non-linear features across the entire generation process. This approach yields highly interpretable feature trajectories that can be used to precisely steer and edit image generation.
What Problem Does This Paper Address?
Text-to-image diffusion models don't create an image in a single forward pass; they generate it iteratively through a sequence of denoising timesteps. Consequently, the internal layers of these networks produce a trajectory of activations rather than a single static representation. Early steps typically sketch out coarse semantic layouts, while later steps refine fine textures and spatial details.
To understand and interpret these internal representations, researchers have turned to Sparse Autoencoders (SAEs), which decompose complex activations into a sparse set of human-interpretable features. However, existing approaches usually analyze activations at isolated timesteps or simply condition the SAE on time. A naive alternative—concatenating the activations across all timesteps—fails because adjacent steps are highly correlated. An ordinary SAE trained on raw concatenated trajectories wastes its capacity modeling this predictable, redundant step-to-step drift rather than discovering the underlying semantic features.
Methods
The authors propose a three-step pipeline to build Residualized Temporal SAEs:
- Activation Collection & Subsampling: They extract activations from a specific internal layer of the diffusion model (specifically, the residual contribution of the U-Net mid-block cross-attention layer) across a subsampled set of timesteps (e.g., every 10 steps).
- Linear Residualization: To eliminate temporal redundancy, they fit a ridge regression model between every pair of consecutive subsampled timesteps ($i-1 \to i$). The residual ($r$) represents the component of the activation that cannot be linearly predicted from the previous step.
- Temporal SAE Training: They concatenate the initial activation and the subsequent residuals into a single trajectory vector: $$z_q = [\bar{a}_{q,0}, r_{q,1}, \dots, r_{q,T-1}]$$ A BatchTopK SAE is then trained on this residualized representation, encouraging the model to find sparse latents that capture non-linear dynamics.
To interpret these features, the learned decoder directions can be mathematically mapped back through the linear dynamics into the original activation space, providing a full "feature trajectory" over denoising time.
Datasets
- Training & Validation: The authors generated 50,000 training images and 2,500 validation images at $512 \times 512$ resolution using Stable Diffusion 1.5 conditioned on text prompts from the
guangyil/laion-coco-aestheticdataset. - Evaluation (Feature Transfer): For source-to-target feature manipulation experiments, they utilized paired prompts from the RIEBench dataset.
Key Insights and Ideas
- High Temporal Redundancy: The authors verified that a simple linear predictor explains a massive fraction of the variance between adjacent timesteps—with an explained variance (EV) ranging from 0.37 to over 0.8. This strongly justifies the need for residualization.
- Temporal Specialization: Features naturally specialize into early, middle, or late stages of generation.
- Spatiotemporal Dynamics: Early features tend to have broad spatial support and remain stable (temporally persistent) across multiple steps. In contrast, later features are highly localized, spatially concentrated, and specific to narrow windows of time.
Key Results
1. Better Reconstruction with Fewer Latents
When evaluated on activation-space reconstruction under a strict trajectory-level sparsity budget (matching the total number of active latents), the residualized concatenated model (Resid+Concat) consistently outperformed its non-residualized counterpart (NoResid+Concat) and a Matryoshka SAE baseline in both Mean Squared Error (MSE) and Explained Variance (EV).
2. Precise Feature Steering
By scaling the activation-space decoder trajectories during the generation process, the authors successfully performed single-feature steering (both locally on specific tokens and globally across the entire image). For instance, activating a "middle-stage" feature successfully introduced jewelry-like structures into the image.
3. High-Efficiency Feature Transfer
Using the RIEBench dataset, they performed source-to-target feature transfer (e.g., turning a watercolor portrait into a realistic portrait). The Resid+Concat model achieved the highest edit efficiency ($\Delta$CLIP-T score per unit of LPIPS image distortion) compared to all other baselines, demonstrating that it alters target semantics while preserving the original image layout.
Limitations and Future Work
- Single Layer Focus: The evaluation was restricted to a single U-Net cross-attention block (
mid.0.1) in Stable Diffusion 1.5. Future work is required to validate this method across other U-Net blocks and modern Diffusion Transformer (DiT) architectures. - Qualitative Steering: The steering and editing experiments served primarily as a qualitative proof-of-concept for interpretability rather than a fully optimized, competitive image-editing framework. Further engineering could refine these feature trajectories for practical downstream editing tasks.
Summary updated