Table of Contents
Fetching ...

CLIP is All You Need for Human-like Semantic Representations in Stable Diffusion

Cameron Braunstein, Mariya Toneva, Eddy Ilg

TL;DR

The paper probes whether Stable Diffusion’s internal representations align with human semantic judgments by applying ridge-regression probes to intermediate features derived from CLIP and the diffusion process. It demonstrates that semantic information is predominantly carried by CLIP’s text encoder, while the diffusion steps function mainly as a visual decoder, with the final CLIP representation showing the strongest human-aligned semantics. The study also analyzes attribute disentanglement, finding CLIP often disentangles concepts that humans entangle, whereas diffusion-based features exhibit more entanglement as information progresses toward pixel-space. This work highlights CLIP’s central role in human-like semantic representations within text-conditioned diffusion models and suggests future directions for evaluating and designing generative systems with more human-aligned semantics.

Abstract

Latent diffusion models such as Stable Diffusion achieve state-of-the-art results on text-to-image generation tasks. However, the extent to which these models have a semantic understanding of the images they generate is not well understood. In this work, we investigate whether the internal representations used by these models during text-to-image generation contain semantic information that is meaningful to humans. To do so, we perform probing on Stable Diffusion with simple regression layers that predict semantic attributes for objects and evaluate these predictions against human annotations. Surprisingly, we find that this success can actually be attributed to the text encoding occurring in CLIP rather than the reverse diffusion process. We demonstrate that groups of specific semantic attributes have markedly different decoding accuracy than the average, and are thus represented to different degrees. Finally, we show that attributes become more difficult to disambiguate from one another during the inverse diffusion process, further demonstrating the strongest semantic representation of object attributes in CLIP. We conclude that the separately trained CLIP vision-language model is what determines the human-like semantic representation, and that the diffusion process instead takes the role of a visual decoder.

CLIP is All You Need for Human-like Semantic Representations in Stable Diffusion

TL;DR

The paper probes whether Stable Diffusion’s internal representations align with human semantic judgments by applying ridge-regression probes to intermediate features derived from CLIP and the diffusion process. It demonstrates that semantic information is predominantly carried by CLIP’s text encoder, while the diffusion steps function mainly as a visual decoder, with the final CLIP representation showing the strongest human-aligned semantics. The study also analyzes attribute disentanglement, finding CLIP often disentangles concepts that humans entangle, whereas diffusion-based features exhibit more entanglement as information progresses toward pixel-space. This work highlights CLIP’s central role in human-like semantic representations within text-conditioned diffusion models and suggests future directions for evaluating and designing generative systems with more human-aligned semantics.

Abstract

Latent diffusion models such as Stable Diffusion achieve state-of-the-art results on text-to-image generation tasks. However, the extent to which these models have a semantic understanding of the images they generate is not well understood. In this work, we investigate whether the internal representations used by these models during text-to-image generation contain semantic information that is meaningful to humans. To do so, we perform probing on Stable Diffusion with simple regression layers that predict semantic attributes for objects and evaluate these predictions against human annotations. Surprisingly, we find that this success can actually be attributed to the text encoding occurring in CLIP rather than the reverse diffusion process. We demonstrate that groups of specific semantic attributes have markedly different decoding accuracy than the average, and are thus represented to different degrees. Finally, we show that attributes become more difficult to disambiguate from one another during the inverse diffusion process, further demonstrating the strongest semantic representation of object attributes in CLIP. We conclude that the separately trained CLIP vision-language model is what determines the human-like semantic representation, and that the diffusion process instead takes the role of a visual decoder.

Paper Structure

This paper contains 24 sections, 12 equations, 8 figures, 1 table.

Figures (8)

  • Figure 1: An overview of our probing method, focused on iteration $k$ of the latent generation. The stimulus text prompt $\textbf{T}_1$ (in this case, "Bear") is passed to Stable Diffusion. The intermediate object representation $\text{CLIP}(\textbf{T}_1)$, $\text{Diff-Bot}_k(\text{CLIP}(\textbf{T}_1))$, and $\text{Diff-Out}_k(\text{CLIP}(\textbf{T}_1))$ are being extracted from the model during the generation process of the image of a bear. For every attribute $j$, we would like to decode, each intermediate representation is passed to a unique ridge regression model that is trained to predict this attribute value. These predictions $\hat{y}_{i,j}$ are compared against the human annotator responses $y_{i,j}$, which are judgments about the attribute intensities for the object "Bear". Note that each ridge regression produces a unique set of predictions $\{\hat{y}_{i,j}\}$. In the diagram, the predictions for ridge regressions on $\text{CLIP}(\textbf{T}_1)$ are shown on the front-most red boxes. Not all extracted intermediate representations have been shown: each $\text{CLIP}_l (\textbf{T}_i)$, $\text{Diff-Bot}_k(\text{CLIP}(\textbf{T}_i))$, and $\text{Diff-Out}_k(\text{CLIP}(\textbf{T}_i))$ for all $l$ and $k$ are extracted, and have their own ridge regressions. The model is tested on stimuli $\textbf{T}_i$ that have been withheld during training.
  • Figure 2: The percentage of significant predicted attributes with $p<0.05$ across all folds. On the left, we visualize the percentages of $\text{CLIP}_l$ probes. On the right, we visualize the percentages, both for probes of $\text{Diff-Out}_k$ and $\text{Diff-Bot}_k$. We observe that most P-values are significant for probes across Stable Diffusion, with only a few non-significant ones across the hundreds of attributes that we probe. We provide a further analysis of the non-significant ones in the supplemental material.
  • Figure 3: The average RMSE of the probes visualized with the standard error. Left, we show the RMSE of $\text{CLIP}_l$ probes as a baseline. Right, we visualize the RMSE for probes of $\text{Diff-Out}_k$ and $\text{Diff-Bot}_k$. Observations 1), 2), and 3) are elaborated on in the main text.
  • Figure 4: We visualize the average RMSE and standard error of all spatial (red) and non-spatial (green) attributes. Spatial attributes have a higher average RMSE across all $\text{CLIP}_l$, $\text{Diff-Out}_k$, and $\text{Diff-Bot}_k$.
  • Figure 5: We visualize the grid search for the ridge regression hyperparameters for probes of CLIP for a single fold. The average RMSE has a saddle point near $120$ principal components, with $a_j = 150$. Therefore, we use these hyperparameters for the probes that are evaluated in our work.
  • ...and 3 more figures