CAS: A Probability-Based Approach for Universal Condition Alignment Score

Chunsan Hong, ByungHee Cha, Tae-Hyun Oh

Introduction

Recent conditional diffusion models have shown remarkable advancements, enabling fascinating real-world applications from text-to-image generation to audio synthesis. However, these models are not flawless; samples generated often fail to strictly comply with user-provided conditions (e.g., generating a blonde woman when prompted for green hair).

To address this, researchers have developed CAS (Condition Alignment Score), a "universal" metric that evaluates how well a generative model’s output matches the user's prompt or condition. Unlike previous methods that require training massive, separate "judge" models, CAS uses the diffusion model itself to calculate a score. This makes it applicable to almost any modality—from text-to-audio to edge-to-image—without needing any extra training data.

The Challenge of Measuring Alignment

Typically, researchers use "alignment scores" to filter out poor results in a process called cherry-picking or self-rejection. However, current scoring tools like CLIPScore suffer from two major flaws:

  1. Domain Lock-in: They are predominantly designed for the text-to-image domain. If you are generating audio from text or images from scribble maps, these scores are ineffective.
  2. Resource Intensity: They require training a separate, massive neural network on millions of human-annotated examples just to "learn" what a good match looks like.
Examples of high and low-ranked samples across various conditional generation tasks using CAS.

The authors of CAS sought a way to measure alignment that is both model-agnostic and training-free, leveraging the mathematical properties of the diffusion process itself.

Methodology: The Power of Self-Rejection

The core idea behind CAS is Self-Rejection. If a model is trained to generate an output $x$ given a condition $c$, it inherently "knows" the conditional probability $p(x|c)$.

The three-step process of CAS: sampling, inversion, and probability computation.

1. The Probability-Based Score

The authors define CAS as the difference between the conditional log-likelihood and the unconditional log-likelihood: $$S = \log p_\theta(x|c) - \log p_\theta(x)$$

By subtracting the unconditional probability, they "debias" the score. This prevents the model from assigning a high score simply because an image looks generally "realistic." Instead, it forces the score to reflect exactly how much the condition contributed to the final result.

2. Recursive DDIM Inversion

To calculate these probabilities accurately, the generation process must be "inverted"—taking the finished image and mathematically tracing it back to the original noise. Because standard DDIM inversion is too imprecise for exact probability math, the authors introduce Recursive Inversion. This technique iteratively refines the latent variables to ensure the mathematical path from noise to image is perfectly reversible.

3. Faster Computation

Calculating the "trace of the Jacobian" (required for exact probability in these models) is notoriously slow and memory-heavy. To solve this, the authors utilize the Skilling-Hutchinson trace estimator to approximate the value, reducing computation time to just 16% of the original requirement with negligible error.

Key Insights and Results

The authors rigorously tested CAS across a wide variety of tasks, including text-to-image (Van Gogh style, PickScore dataset), image editing (InstructPix2Pix), structural conditions (ControlNet with Canny edges/scribbles), and text-to-audio (AudioLDM).

  • The "Unseen Condition" Bias: The researchers discovered that raw conditional probability $p(x|c)$ is actually a poor metric on its own. Because specific prompts are often "out-of-distribution" for the model's training set, the model naturally assigns them a low probability. Subtracting the general image probability $p(x)$ cancels out this noise and reveals the true alignment.
  • Superiority in Specific Domains: On a fine-tuned Van Gogh dataset, CAS achieved 47% accuracy in matching human preference, significantly outperforming PickScore (33.8%) and CLIPScore (28.4%).
  • Zero-Shot Versatility: CAS achieved over 60% agreement with human preferences across diverse tasks like Scribble-to-Image and Text-to-Audio—areas where traditional text-to-image metrics cannot even be applied.
  • Fake Detection: CAS proved highly effective at identifying which model generated a specific image, achieving 92% accuracy in detecting "fake" images and outperforming specialized state-of-the-art detectors.

Limitations and Future Directions

While highly effective, CAS does have limitations. It requires an "inversion" step (running the model backwards), which introduces computational overhead compared to a single forward pass of a model like CLIP. Furthermore, CAS measures alignment based on the model's understanding of the condition; if the model fundamentally misunderstands a prompt, the score will reflect that internal bias.

Looking forward, the authors suggest that CAS could be utilized not just during inference, but also during the training phase to help models learn better alignment from the very beginning.

Summary updated

BibTeX
@inproceedings{hong2024cas,
  author = {Chunsan Hong and ByungHee Cha and Tae-Hyun Oh},
  title = {{CAS: A Probability-Based Approach for Universal Condition Alignment Score}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=E78OaH2s3f},
}
Figure