Conjuring Semantic Similarity

Tian Yu Liu, Stefano Soatto

Introduction

How do you measure the semantic similarity between two sentences? Instead of comparing their words, this paper proposes measuring the similarity of the images they generate. By calculating the mathematical distance between the image generation processes (the diffusion SDEs) of two prompts, the authors provide a visually grounded, interpretable metric for semantic similarity that aligns surprisingly well with human judgment.

The Problem: Missing Visual Grounding

In Natural Language Processing (NLP), semantic similarity is usually measured by analyzing text—how often words co-occur, or how Large Language Models (LLMs) predict the next token. However, this ignores "visually grounded" meaning. For humans, the meaning of a word is often inextricably tied to the mental image it evokes.

While we have established ways to evaluate the semantic spaces of text models, evaluating how well image generation models (like Stable Diffusion) align with human semantic understanding is difficult. Existing metrics, such as FID or CLIP scores, evaluate image quality or text-image alignment, but they don't quantify the underlying semantic space of the diffusion model itself. The authors tackle this gap by asking: How can we mathematically compare the "mental images" two different prompts conjure in a trained diffusion model?

Methodology: Distance Between Image Distributions

The authors propose that the semantic similarity between two text prompts can be defined as the distance between the image distributions they induce.

To do this rigorously, they examine the mathematics underlying diffusion models. Diffusion models operate via reverse-time Stochastic Differential Equations (SDEs) that iteratively remove noise to form an image. The authors measure the Jeffreys divergence (a symmetrized version of the Kullback–Leibler divergence) between the SDEs conditioned on Prompt A and Prompt B.

Practically, they compute this using a straightforward Monte-Carlo sampling algorithm:

  1. Start with a random noisy image.
  2. Ask the model to denoise it using Prompt A, and then again using Prompt B.
  3. At various timesteps during the denoising process, calculate the squared Euclidean distance between the model's noise predictions for both prompts.
  4. Average these distances over a few random starting images and timesteps to get the final "Conjured Semantic Similarity" score.

Key Insights and Ideas

Visual Explanations for Semantics

Unlike opaque text embeddings, this method provides a visual "explanation" for semantic differences. By looking at the denoising steps, you can literally watch the model morph a "Snow Leopard" into a "Bengal Tiger" by swapping spots for stripes, showing exactly what visual features the model considers semantically distinct.

Denoising trajectories for "Snow Leopard" and "Bengal Tiger"

Taxonomy Emergence

The distance metric naturally clusters words by hypernyms. For example, dog breeds tightly cluster together in the model's semantic space, completely separate from marine animals. This demonstrates that the diffusion model has learned a structured, visually-based taxonomy of the world.

Semantic clustering of animal categories

The Noun vs. Verb Divide

Diffusion models are excellent at preserving the semantics of nouns (objects they can draw). However, the authors found that the models actually lose semantic information about verbs and adjectives compared to their base text encoders. Learning the diffusion process for image generation seems to come at the expense of abstract action and descriptor semantics.

High Efficiency

You don't need to run thousands of diffusion steps to get a good similarity score. The authors found that a uniform sampling of timesteps and just 1 to 5 Monte Carlo iterations is enough for the score to converge reliably.

Empirical Results

The authors evaluated their method's alignment with human judgment using standard NLP benchmarks (STS-B, STS-12 through STS-16, SICK-R, RG65, and SimLex-999).

  • Strong Human Alignment: The method achieved an average Spearman correlation of 65.4 with human annotators across the STS benchmarks.
  • Beating Text Encoders: This zero-shot, visually-grounded approach outperforms standard encoder-based language models like BERT (which scores ~48.9 - 58.0) and rivals massive autoregressive LLMs like LLaMA-13B (65.3) and Falcon-7B (65.7).
  • Beating Naive Baselines: The SDE-divergence approach significantly outperforms naive diffusion baselines, such as simply comparing the final generated images (which only achieved a 51.3 correlation) or only looking at the very first/last denoising steps.

Limitations and Future Work

While promising, the authors acknowledge several limitations. First, the method struggles with abstract concepts that lack clear visual representations (e.g., "imaginary numbers" or "conscience"), as imagery is not always sufficient to capture full linguistic meaning. Second, it doesn't resolve linguistic ambiguity; it merely reveals whichever visual interpretation the model defaults to. Finally, because it requires multiple inference passes through a diffusion model, it is computationally heavier than simple text embeddings.

For future work, the authors suggest exploring this visually-grounded semantic framework in other classes of image generative models beyond diffusion.

Summary updated

BibTeX
@inproceedings{liu2026conjuring,
  author = {Tian Yu Liu and Stefano Soatto},
  title = {{Conjuring Semantic Similarity}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=Wf0tGnQOIh},
}
Figure