[Paper Review] Semi-Parametric Neural Image Synthesis
This paper proposes a semi-parametric approach to neural image synthesis that combines small diffusion or autoregressive generative models with an external image database and retrieval mechanism. By conditioning on nearest neighbors from the database during training and inference, the model achieves state-of-the-art FID scores with significantly fewer parameters, enabling zero-shot domain transfer, text-to-image synthesis, and stylization without retraining.
Novel architectures have recently improved generative image synthesis leading to excellent visual quality in various tasks. Much of this success is due to the scalability of these architectures and hence caused by a dramatic increase in model complexity and in the computational resources invested in training these models. Our work questions the underlying paradigm of compressing large training data into ever growing parametric representations. We rather present an orthogonal, semi-parametric approach. We complement comparably small diffusion or autoregressive models with a separate image database and a retrieval strategy. During training we retrieve a set of nearest neighbors from this external database for each training instance and condition the generative model on these informative samples. While the retrieval approach is providing the (local) content, the model is focusing on learning the composition of scenes based on this content. As demonstrated by our experiments, simply swapping the database for one with different contents transfers a trained model post-hoc to a novel domain. The evaluation shows competitive performance on tasks which the generative model has not been trained on, such as class-conditional synthesis, zero-shot stylization or text-to-image synthesis without requiring paired text-image data. With negligible memory and computational overhead for the external database and retrieval we can significantly reduce the parameter count of the generative model and still outperform the state-of-the-art.
Motivation & Objective
- To challenge the prevailing paradigm of scaling up parametric models for image generation, which demands excessive computational resources and limits accessibility.
- To address the inefficiency of compressing shared visual concepts into ever-larger parameterized representations by leveraging external, non-parametric memory.
- To enable post-hoc adaptation of a trained model to new domains—such as zero-shot stylization—by simply swapping the retrieval database without retraining.
- To achieve competitive generative performance with substantially reduced parameter counts and minimal computational overhead from retrieval.
Proposed method
- Train a small diffusion or autoregressive generative model conditioned on the nearest neighbors retrieved from an external image database using CLIP's shared text-image embedding space.
- Use scalable approximate nearest neighbor (ANN) search via scaNN to efficiently retrieve up to 20 nearest neighbors in the CLIP latent space in under 1 ms per inference.
- Condition the generative model via cross-attention on the flattened, raster-scanned latent representations of the retrieved nearest neighbors (e.g., 4 neighbors of size 8×8×256 → 64×1024 input).
- Decouple the generative model from the need to memorize content by focusing it on composition and editing based on retrieved exemplars.
- Enable zero-shot generalization by replacing the training database with a new one (e.g., WikiArt) at inference time, allowing the same model to generate stylized or text-conditioned images.
- Integrate model-specific sampling techniques (e.g., classifier-free guidance for diffusion, top-k sampling for autoregressive models) with retrieval-based conditioning.
Experimental results
Research questions
- RQ1Can a small parametric generative model achieve state-of-the-art image synthesis performance when augmented with a large, external image database and retrieval mechanism?
- RQ2To what extent can a model trained on one dataset (e.g., ImageNet) generalize to novel domains (e.g., artistic styles) without retraining by swapping the retrieval database?
- RQ3Does retrieval-augmented generation reduce the need for massive parameter counts while maintaining or improving sample quality and diversity?
- RQ4How does conditioning on both CLIP text embeddings and retrieved image neighbors affect generalization to unseen or fictional text prompts?
- RQ5Can the proposed method support multiple conditional generation tasks—such as text-to-image, class-conditional, and zero-shot stylization—using a single, fixed parametric generator?
Key findings
- The retrieval-augmented diffusion model (RDM) achieves a Fréchet Inception Distance (FID) of 5.69 on ImageNet, outperforming the unconditional SOTA ADM model (FID 6.25) while using significantly fewer parameters.
- The RDM model surpasses the class-conditional ADM model in FID (5.69 vs. 6.25) despite being trained only on images and not using class labels during training.
- By replacing the training database with the WikiArt dataset, the same RDM model achieves zero-shot stylization, generating diverse and high-fidelity images from text prompts without fine-tuning.
- The model generalizes effectively to unseen and fictional text prompts (e.g., 'a zebra-skinned panda') when conditioning on CLIP text embeddings and their nearest neighbors, but fails when relying solely on text embeddings.
- The retrieval mechanism adds only 0.95 ms inference latency and 2GB per 1M images in storage, demonstrating negligible overhead despite high performance.
- The autoregressive retrieval model (RARM) also achieves strong results, generating diverse and high-fidelity samples with minimal parameter count, and supports top-k sampling for controlled generation.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.