Manuscript Offprint

arXiv:2610.06844

Learning to Read the Contextual Tokens in Diffusion Transformers

Omer Dahary, Etai Sella, Hadar Averbuch-Elor, Daniel Cohen-Or, Or Patashnik

Omer Dahary 1∗^{1*} Etai Sella 1∗^{1*} Hadar Averbuch-Elor 2^{2} Daniel Cohen-Or 1^{1} Or Patashnik 1^{1}

1^{1}Tel Aviv University 2^{2}Cornell University

Figure

cooking

playing tennis

skateboarding

dancing

playing guitar

riding a horse

Figure 1: Our Contextual Reader answers the question “What is this person doing?” directly from the contextual tokens. We show six generations conditioned on different prompts at an early denoising stage, where the visual predictions remain ambiguous. The text below each image is decoded from the contextual tokens when the MM-DiT is provided with an empty prompt. Despite this, our reader correctly identifies the activity, demonstrating that contextual tokens encode rich semantic information about the emerging image early in generation.

ABSTRACT

Multimodal Diffusion Transformers (MM-DiTs) jointly process visual and textual representations throughout generation. These models repeatedly update the text tokens through multimodal attention, forming dynamic contextual tokens whose function is not well understood. In this work, we introduce a framework for reading this contextual space through natural-language interrogation. We train a lightweight bottleneck network that maps intermediate contextual tokens into the input space of a frozen Large Language Model (LLM), allowing the LLM to answer questions about the emerging image directly from these hidden representations. Our reader reveals that contextual tokens encode a rich, global representation of the emerging scene: generation-specific semantics, including attributes left underspecified by the prompt, are accessible surprisingly early in denoising, while increasingly fine-grained details become readable over time. Remarkably, this information remains decodable even when the MM-DiT receives an empty prompt, showing that contextual tokens accumulate substantial image-specific information from the evolving visual representation itself. We further find that generations with more readable contextual representations tend to receive higher human-preference scores. Building on these observations, we introduce Contextual Alignment, a training technique that explicitly reinforces the visual-semantic information encoded in the contextual tokens, improving generation quality and distributional coverage. Together, our results establish contextual tokens as both an interpretable view into the internal dynamics of MM-DiTs and an effective target for improving generative models.

1 INTRODUCTION

In recent years, diffusion models have fundamentally transformed visual content creation by enabling high-fidelity generation directly from text prompts (Rombach et al., 2022; Saharia et al., 2022; Ramesh et al., 2022). Building on this foundation, Multimodal Diffusion Transformers (MM-DiTs) have emerged as a dominant paradigm for state-of-the-art image and video synthesis (Esser et al., 2024; Kong et al., 2024; Chefer et al., 2026). Central to these models are multimodal attention

∗^{*}Equal contribution.

layers, which enable bidirectional interaction between textual and visual representations throughout generation.

Within this shared multimodal space, visual tokens form a spatial representation of the evolving image and are explicitly supervised by the denoising objective. Their intermediate features can therefore be directly visualized as images (Patashnik et al., 2023; Tumanyan et al., 2023), making them especially accessible to analysis and intervention. This has enabled methods that guide visual features for controlled generation (Ho & Salimans, 2022; Zhang et al., 2023; Chefer et al., 2023), manipulate them for image editing (Meng et al., 2021; Avrahami et al., 2022; Hertz et al., 2022), and align them with pretrained representations to improve generation (Yu et al., 2024; Leng et al., 2025; Jiang et al., 2025).

The text stream, however, is considerably less understood. In modern MM-DiTs, text tokens do not remain fixed conditioning vectors. Instead, they are repeatedly updated through multimodal attention, absorbing information from the emerging visual representation and evolving into what prior work termed contextual tokens (Dahary et al., 2026). Although this cross-modal exchange has proven effective for generation (Esser et al., 2024), the function of the resulting contextual representations remains unclear. Unlike visual tokens, contextual tokens have no explicit spatial correspondence and receive no dedicated supervision, making them inherently difficult to interpret. Consequently, it remains unknown what visual information they encode and how their dynamics ultimately steer the generation process.

In this work, we propose a framework to directly read and interpret the contextual space of MM-DiTs by enabling natural language interrogation of their hidden representations. Rather than inspecting raw attention maps or feature vectors, our approach enables asking plain-text questions about visual elements in the emerging image and receiving direct answers decoded straight from the contextual tokens. To achieve this, we train a lightweight bottleneck network that projects intermediate contextual tokens into the input space of a Large Language Model (LLM). Because the LLM relies exclusively on the projected contextual tokens to answer visual questions, the bottleneck learns to extract the model's internal visual semantics directly from the text-side representation. In doing so, we can read the model's evolving generative intent in plain text, revealing how it internally resolves underspecified prompt attributes over the course of generation.

Through our reading mechanism, we find that contextual tokens encode generation-specific semantics surprisingly early in denoising. Remarkably, this remains true even when no prompt is fed into the model, showing that the tokens can acquire substantial information from the evolving visual representation alone. Figure 1 demonstrates this setting: despite the MM-DiT receiving an empty prompt, the reader can identify the person's activity at an early denoising stage, before it can be readily inferred from the visual prediction. Moreover, we find that readability continues to increase over the course of denoising, with the reader recovering progressively finer details about the emerging image. Importantly, this readability can also vary across different generations from the same prompt. Generations with clearer contextual representations tend to achieve higher human-preference scores, making contextual readability a meaningful signal of generation quality.

Building on these observations, we transition from passively reading the contextual tokens to actively supervising them during model training. To this end, we introduce Contextual Alignment, a regularization objective that explicitly reinforces the visual-semantic information encoded in the contextual space. We evaluate our supervised training framework through quantitative and qualitative experiments spanning both full model training and fine-tuning. Our experiments show that contextual supervision complements existing alignment methods, improving generation quality and distributional coverage. Furthermore, while existing alignment methods provide only limited additional gains in the fine-tuning regime, contextual supervision remains highly effective when adapting an already extensively trained model to a specific dataset.

Overall, our work establishes the contextual space as a semantically rich representation that can both expose the internal dynamics of multimodal generation and provide an effective target for improving generative models beyond the standard diffusion objective.

2 RELATED WORK

Multimodal Diffusion Transformers. Diffusion models have traditionally relied on convolutional U-Net architectures as their denoising backbone (Saharia et al., 2022; Ramesh et al., 2022; Rombach et al., 2022; Podell et al., 2023). Transformer-based denoisers later offered a more scalable alternative (Bao et al., 2023; Peebles & Xie, 2023), leading to increasingly large transformer-based text-to-image models (Chen et al., 2024b;a). Stable Diffusion 3 (Esser et al., 2024) took this development further by introducing the Multimodal Diffusion Transformer (MM-DiT), in which textual and visual representations jointly participate in attention and continuously update one another. This bidirectional interaction has since become a prominent design in large-scale image generation and editing models, including FLUX (Labs, 2024; Labs et al., 2025), Qwen-Image (Wu et al., 2025; Zhao et al., 2026), and others (Zhuo et al., 2024; Cai et al., 2025; Xiao et al., 2025).

The same paradigm has become important in video generation, where CogVideoX (Yang et al., 2025) and HunyuanVideo (Kong et al., 2024) jointly process textual and spatiotemporal representations. Other models extend joint attention to appearance and motion (Chefer et al., 2025) or audio and video (Wang et al., 2026b; 2025; Shan et al., 2025). Together, these developments establish joint multimodal attention as a general mechanism for evolving representations across modalities.

Understanding Latent Representations in Diffusion Models A growing body of work has investigated the internal representations learned by diffusion models. Studies of visual features have shown that intermediate representations encode the semantics of individual patches and the correspondence between them, enabling a range of downstream applications (Tumanyan et al., 2023; Tang et al., 2023; Patashnik et al., 2023; Cao et al., 2023; Alaluf et al., 2024; Dahary et al., 2024; 2025; Sella et al., 2025; Luo et al., 2024). Other studies examine textual representations in text-to-image models, studying how semantic information is encoded and distributed across textual tokens (Rassin et al., 2022; Toker et al., 2024; Kaplan et al., 2026; Zhuang et al., 2024).

With the emergence of MM-DiTs, recent work has also begun to examine the evolving text-side representations formed through multimodal attention. ConceptAttention (Helbling et al., 2025) uses these representations to localize concepts in the generated image, while Contextual Repulsion (Dahary et al., 2026) demonstrates their utility as an intervention space for increasing generation diversity. Several works use causal interventions to reveal functional roles of contextual tokens under specific conditioning settings. Padding Tone (Toker et al., 2025) shows that, under textual conditioning, contextualized padding tokens can contribute additional visual information to the generated image; Vision-Language Binding (Ge et al., 2026) shows that contextual tokens can acquire semantic information from a reference image in FLUX.2 editing; Li et al. (Li et al., 2026) show that LLM-encoded template tokens in Qwen-Image can act as implicit registers for maintaining object identity. Altogether, these interventions demonstrate that contextual tokens can carry information relevant to generation. However, they do not directly reveal the semantic content of the contextual space or how it evolves over denoising. We instead decode this space into natural language, revealing a surprisingly broad range of image-specific semantics encoded within it. Remarkably, this information can be decoded in the absence of textual conditioning and even before it becomes readily apparent in the visual prediction itself.

Representation Alignment for Generation. Recent work has shown that explicitly encouraging diffusion models to learn stronger internal representations can substantially improve both training efficiency and generation quality. REPA (Yu et al., 2024) introduced this direction by aligning intermediate visual features with representations from a pretrained vision encoder. Subsequent works extend alignment to attention features (Wang et al., 2026c), the latent space (Leng et al., 2025; Zheng et al., 2026), representations derived from the diffusion model itself (Jiang et al., 2025; Chefer et al., 2026), and text–image contrastive objectives (Lee et al., 2026). Recent analyses have also examined the role of local and global information in representation alignment. iREPA (Singh et al., 2025) shows that, for spatial visual features, alignment benefits primarily from preserving and enhancing spatial structure rather than global semantics. REG (Wu et al., 2026) instead shows that global semantic information can benefit class-conditional generation when represented separately through a high-level semantic token alongside the image latents.

Figure

Figure 2: Training the Contextual Reader. At a selected denoising timestep, contextual tokens from multiple frozen MM-DiT layers are aggregated by a trainable Bottleneck Network into a compact Contextual Descriptor. A frozen LLM receives this descriptor together with a visual question and predicts an answer about the emerging image. We train only the Bottleneck Network using cross-entropy against the ground-truth answer.

We extend these insights to text-conditioned generation and find that global visual semantics are implicitly encoded in the contextual tokens. We therefore align them with a global semantic representation, complementing the local, spatial representations reinforced by existing alignment methods.

References (100)

Couldn't load all references. Reload the page to try again.