Introduction
Diffusion models have revolutionized image synthesis, but they typically rely on a point-based reconstruction objective. Whether working in pixel space or latent space, the model is usually tasked with predicting a single point (pixel or feature) from a noisy version. This "point-wise" approach is short-sighted because it neglects the local context—the semantic and structural relationships between a point and its surrounding neighborhood. Without explicitly modeling these connections, generated images can suffer from poor local continuity and reduced fidelity.
To address this, ConPreDiff introduces a "context prediction" task to the diffusion training process. By forcing models to look beyond individual pixels and understand how they relate to their neighbors, ConPreDiff achieves a new state-of-the-art zero-shot FID of 6.21 on MS-COCO without any additional sampling overhead.
Methodology: Neighborhood Context Prediction
The core innovation of ConPreDiff is augmenting the standard diffusion objective with a neighborhood context prediction task.
- Context Prediction Head: A small "context decoder" (typically a few Feed-Forward Neural Network layers) is attached to the end of the standard denoising blocks (like a U-Net or Transformer).
- Multi-Stride Neighbors: Instead of just looking at the immediate neighbors, the model is trained to predict "multi-stride" neighbors at varying distances. This allows the model to capture both fine-grained local details and broader structural patterns.
- Distributional Matching via Optimal Transport: Predicting the exact values of an entire neighborhood is computationally expensive. Instead, the authors treat the neighborhood as a probability distribution. They use the 2-Wasserstein distance (an optimal transport metric) to measure the similarity between the predicted neighborhood distribution and the ground truth. This provides a "permutation-invariant" loss focusing on structural similarity rather than exact pixel matching.
- Training vs. Inference: Crucially, the context decoder is only used during training. It acts as scaffolding that forces the main denoising network to learn better internal representations. Once training is done, the decoder is removed, meaning the improved image quality comes with zero extra parameters or latency during sampling.
Key Insights and Results
By forcing a point to "know" its neighbors, the model learns to preserve semantic connections. This is particularly visible in complex textures and edges where point-wise models often struggle with blurriness or jitter.
The authors evaluated ConPreDiff across unconditional image generation, text-to-image generation, and image inpainting tasks:
- New SOTA: ConPreDiff achieved a zero-shot FID score of 6.21 on MS-COCO (256x256), outperforming heavyweights like Imagen (7.27), eDiff-I (6.95), and the original LDM (12.63).
- Inpainting Excellence: In image inpainting, ConPreDiff consistently outperformed specialized models like RePaint and LaMa across almost all mask categories, showing significantly lower LPIPS (perceptual loss) scores.
- Human Preference: In side-by-side evaluations, human users preferred ConPreDiff over Imagen and VQ-Diffusion, especially regarding "Context Coherence" (preferred 84% of the time against VQ-Diffusion).
- Versatility: The method proved effective for both discrete (token-based) and continuous (Gaussian) diffusion backbones.
Limitations and Future Work
While inference is "free," the training stage is more complex. Calculating the Wasserstein distance and running the extra decoder layers increases the computational footprint during the learning phase. Furthermore, because ConPreDiff is a wrapper for existing diffusion backbones, it inherits their inherent limitation of slow, iterative sampling compared to GANs or VAEs.
Future directions suggest extending this context-aware paradigm to more complex domains, such as text-to-3D and text-to-video generation, where temporal and spatial context are even more critical.
Summary updated