NeurIPS 2026Coming to NeurIPS in Sydney?Explore papers, orals & directions

Structure-Semantic Co-optimized Latent Diffusion Model for Fast Visual Anagram Synthesis

Xiang Gao, Yunpeng JiaNeurIPS 2026

TL;DR

Imagine painting a portrait of a young girl that, the moment you flip it upside down, transforms into an unmistakable portrait of an elderly man. Creating these "visual anagrams" with AI usually requires slow, pixel-level diffusion models that produce blurry, low-resolution compromises. By cleverly untangling structural layout from fine details inside a lightning-fast latent diffusion model, S2CO-Anagram generates crisp, 512×512 optical illusions in just 2.6 seconds.

Figure 1: Our method enables fast synthesis of high-quality visual anagram images that conceptually conform to different text prompts after undergoing a transformation such as flipping and rotation, offering artists and designers an efficient tool to create optical illusion visual arts.

What Problem Does This Paper Address?

Visual anagrams are optical illusions that change their meaning under geometric transformations like rotations or flips. Recently, researchers discovered how to generate them using text-to-image diffusion models via multi-view parallel denoising: at each step of turning random noise into an image, you predict the noise for View A (say, "a rabbit"), flip the canvas to predict the noise for View B ("a bird"), and average the two predictions together.

Until now, this mostly worked only in heavy, slow, pixel-space diffusion models capped at low resolutions (256×256). If you try this naive noise-averaging trick inside modern, fast Latent Diffusion Models (LDMs)—which operate in a compressed feature space and take very few steps—the illusion falls apart due to two tug-of-war problems:

  1. Structural Divergence: A horse and a penguin have fundamentally different shapes. Averaging their latent trajectories forces a rigid, awkward middle ground full of visual artifacts.
  2. Semantic Dilution: Simply averaging two different noise directions washes out the distinct details of both concepts, leaving you with an ambiguous, blurry mess.

Methods

To get high resolution and blazing speed, the authors build upon a standard few-step LDM backbone (SDXL-Turbo, using just 4 denoising steps). What is new is their Structure-Semantic Co-optimization (S2CO) framework—a tiny, 5-step optimization loop tucked inside each denoising step to referee the tug-of-war before fusing the views.

Figure 2: Method overview. Our method synchronously denoises two latent views linked by a specified transformation followed by fusing their noise estimations at each denoising step. Grounding on this process, a novel optimization framework comprising null-text structure alignment, semantic enhancement, and attention-guided noise fusion is proposed to enhance the generated results.

S2CO introduces three clever mechanisms:

  • Null-Text Structure Alignment (NTSA): Instead of altering the text prompts, the authors optimize the unconditional ("null-text") embedding used in Classifier-Free Guidance. Using Tweedie’s formula to peek at the predicted clean latents for both views, they apply a Discrete Cosine Transform (DCT) to extract the lowest 5% of spatial frequencies (which govern global layout). Minimizing the difference between these low frequencies forces both views to agree on a shared macro-structure without compromising their prompt semantics.
  • Cross-Modal Semantic Enhancement (SE): To fight semantic dilution, the model slightly nudges the noisy latent at each step to maximize activation in the vision-text cross-attention maps for the prompt's keywords (e.g., girl and elderly man). Crucially, it only boosts pixels above the 60th activation percentile so concepts don't bleed everywhere.
  • Attention-Guided Noise Fusion: Instead of a blind 50/50 average of the two noise predictions, the model uses those same cross-attention maps as spatial weights. Regions crucial to "rabbit" get more of the rabbit noise, while regions crucial to "bird" get more of the bird noise.

Finally, because an LDM's image decoder isn't perfectly symmetric under flips or rotations, the decoded images from both views are averaged in pixel space at the very end to ensure exact geometric consistency.

Datasets

Because S2CO-Anagram is a zero-shot, inference-time optimization method built on a pretrained T2I model, no training datasets are used. For quantitative evaluation, the authors use the existing CIFAR10 2-views benchmark, which pairs text prompts derived from the 10 object classes of CIFAR-10. No new datasets are introduced.

Key Insights and Ideas

  • Frequency-domain truce: Forcing two concepts to share low-frequency DCT components automatically pushes their distinguishing traits (like dog ears vs. cat whiskers) into the high-frequency details. That is why the illusion works so seamlessly—our brains read global harmony and fine semantic cues simultaneously.
  • Hijacking the null-text embedding for geometry: Optimizing the empty prompt ("") to align structure leaves the actual text embeddings untouched, cleanly separating where things go from what things are.
  • Few-step LDMs can do illusions: Conventional wisdom suggested compressed latent spaces and 4-step distilled models were too brittle for multi-view synchronization. With the right test-time guidance, they actually outperform pixel models.

Key Results

Even with the inner optimization loops, SDXL-Turbo's 4-step schedule makes S2CO-Anagram remarkably fast and sharp:

  • Speed & Resolution: Generates 512×512 anagrams in 2.6 seconds on an RTX PRO 6000 GPU. Compare that to pixel-based methods (256×256 in 4.0s to 1027.3s) or the latent-based LookingGlass (512×512 in 74.8s—nearly 29× slower).
  • Quantitative Metrics: Achieves state-of-the-art text-image alignment on CIFAR10 2-views (Worst CLIP Alignment: 0.2726, Concealment: 0.6918) and tops the LAION Aesthetic Score at 6.14 (vs. 5.65 for Anagram-MTL and 4.96 for LookingGlass).
  • Ablations & User Study: Removing NTSA causes the sharpest drop in quality (Aesthetic Score plunges from 6.14 to 5.29), confirming structure alignment is the linchpin. Over 40 human evaluators rated S2CO-Anagram highest by a wide margin in visual harmony, conceptual fidelity, and semantic saliency.
Figure 4: Qualitative method comparison. Results are presented at their actual resolution: thumbnails correspond to 256×256 outputs, and larger panels correspond to 512×512 results.

Limitations and Future Work

The authors note two clear boundaries where the magic currently fades:

  1. Photorealism: While the model excels at painterly, watercolor, and sketched illusions (where brushstrokes naturally forgive dual interpretations), it struggles to synthesize convincing photorealistic visual anagrams.
  2. Complex Transformations: S2CO-Anagram handles flips and rotations gracefully, but fails on intricate spatial scrambles like jigsaw rearrangements, likely because scrambling patches shatters the continuous low-frequency DCT structure that NTSA relies on. Solving both is slated for future work.

Summary updated

Abstract

Visual anagram is an intriguing form of art creation wherein a single image presents different conceptual interpretations under transformations such as flipping or rotation. Recent work has achieved visual anagram synthesis by leveraging pretrained text-to-image (T2I) diffusion models, yet still suffers from several key limitations including computational inefficiency, suboptimal aesthetic quality, and weak semantic fidelity and expressiveness. This work focuses on generating visual anagrams with substantially improved visual quality at minimal computational cost, thereby advancing intelligent creation of illusionary digital art. To increase image resolution while reducing time overhead, we adapt the cutting-edge parallel denoising algorithm from pixel-based T2I model to the adversarially distilled latent-based one, and accordingly propose a structure-semantic co-optimization (S2CO) framework to counteract the consequent visual degradation. As the core of our approach, S2CO framework comprises three key innovations: (\romannumeral1) null-text structure alignment optimization; (\romannumeral2) semantic enhancement optimization; (\romannumeral3) attention-guided noise fusion. Building upon these components, our method dubbed \textbf{S2CO-Anagram} is able to generate higher-resolution anagram images with noticeably superior visual harmony, aesthetic quality, and semantic faithfulness to the text prompt than related SOTA approaches, all while achieving substantially faster inference speed.
BibTeX
@inproceedings{gao2026structure,
  author = {Xiang Gao and Yunpeng Jia},
  title = {{Structure-Semantic Co-optimized Latent Diffusion Model for Fast Visual Anagram Synthesis}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=vWSKzHnaou},
}
Figure