InCoDe:
Interpretable Compressed Descriptions For Image Generation

Armand Comas1, Aditya Chattopadhyay2*, Feliu Formosa1, Changyu Liu1, Octavia Camps1, René Vidal3
1Northeastern University 2Johns Hopkins University 3University of Pennsylvania
*Work done prior to joining Amazon.
ICLR 2025

TL;DR: InCoDe describes an image with a short sequence of user-defined questions and their answers, chosen in order of information gain, and generates images from that description, so users control generation by editing answers.

InCoDe controllable image generation and editing on LSUN Bedroom: a reference image, four re-generations, and edits obtained by changing the answers to queries about red bedsheets, bunk beds, and windows.
Figure 1: InCoDe controllable image generation and editing. A user can provide a sample image (a) and request to generate new images that are semantically “similar” to the given one (b). In addition, the user can also encode their preferences in the generated images by specifying certain attributes, like the color of the bedsheets (c).

Abstract

Generative models have been successfully applied in diverse domains, from natural language processing to image synthesis. However, despite this success, a key challenge that remains is the ability to control the semantic content of the scene being generated. We argue that adequate control of the generation process requires a data representation that allows users to access and efficiently manipulate the semantic factors shaping the data distribution. This work advocates for the adoption of succinct, informative, and interpretable representations, quantified using information-theoretic principles. Through extensive experiments, we demonstrate the efficacy of our proposed framework both qualitatively and quantitatively. Our work contributes to the ongoing quest to enhance both controllability and interpretability in the generation process. Code available at github.com/ArmandCom/InCoDe.

Motivation: Text Is a Hard Interface for Control

Plain textual scene descriptions seem like an intuitive interface for controlling image generation, but the semantic content of an image can be described by many different captions. A bedroom could be described by the objects it contains, its furniture style, its colors, or the relationships among objects: there is no canonical semantic representation. Moreover, constraining a generated image to a rich description that combines numerous concepts remains a challenge for text-to-image models, which struggle with composition in the presence of negations and large conjunctions.

InCoDe instead represents the semantic content of images by sets of predefined, user-oriented and task-specific questions and their answers. Such representations are interpretable, easy for the user to modify, and specialize the generative model to the sub-distribution of interest (e.g. bedroom furniture). This may limit the generality of the model, but it prioritizes combining multiple concepts accurately.

Comparison of Stable Diffusion v1-4, Stable Diffusion XL, Dall-E 3 and InCoDe on a list of nine bedroom attributes; the baselines violate several attributes.
Figure 2: Text-to-image models fail when composing multiple concepts. For a given subset of attributes: (a) samples from Stable Diffusion v1-4 (≈ ×0.95 params w.r.t. InCoDe), (b) Stable Diffusion XL (≈ ×10 params), (c) Dall-E 3 (≈ ×15 params), and (d) InCoDe (trained on top of Stable Diffusion v1-4). Red superscripts in the attributes indicate the models that fail to capture them in the presented samples.

Method

Interpretable compressed descriptions. Given a set of user-defined queries Q (e.g. “Is there a window?”), InCoDe describes an image X by a sequence of query-answer pairs D(X) = [q1(X), …, qL(X)], sorted in decreasing order of the information they provide about the answers to all queries, Q(X). The description is built greedily with Information Pursuit (IP): each new query is the one whose answer has maximum mutual information with Q(X), given the history of query-answers observed so far.

q1 = arg maxq ∈ Q I(q(X); Q(X)),   qk+1 = arg maxq ∈ Q I(q(X); Q(X) | q1:k(xobs))

The length L controls the compactness of the representation. Ordering queries by information gain also yields a natural information-theoretic notion of semantic similarity: two images are k-similar if they agree on the first k most informative query-answers.

Three modules. Following Variational IP, InCoDe learns IP directly from data instead of computing mutual information explicitly:

  • Encoder (Querier). Given a history of query-answer pairs S, it outputs the most informative next query, which is answered on the reference image by an off-the-shelf VQA model (or the dataset ground truth).
  • Decoder (QuerySet Answerer). Maps a partial set of query-answers to a distribution over the answers of the complete query set. Querier and QuerySet Answerer are fully-connected networks trained jointly with the VIP objective, first on randomly sampled histories and later on histories produced by the Querier itself.
  • Generator. A diffusion model that predicts the noise added to the corrupted image Xt, conditioned on the query-answer representation.
InCoDe pipeline: a Querier (encoder) selects the next query from the history S, a VQA module answers it on image X, a QuerySetAnswerer (decoder) predicts all answers, and a diffusion Generator is conditioned on the selected query-answers.
Figure 3: Overview of the InCoDe pipeline. An Encoder maps a history of query-answer pairs S to the next query q, which is answered by providing q and the reference image X to an off-the-shelf VQA module. A Decoder maps query-based representations to the complete query-answer set, and a diffusion-based Generator predicts the noise ϵt added to the corrupted image Xt, conditioned on the representations.

Conditioning a Pre-trained Diffusion Model on Query-Answers

Query-answer conditioning is not typical in the literature, so no large pre-trained diffusion model can be used out of the box. InCoDe fine-tunes a frozen text-to-image model (Stable Diffusion v1-4) with two components: (i) LoRA with rank 32, and (ii) a query embedder, a feature embedding followed by an MLP with a zero-initialized final projection. Each query-answer pair is embedded individually into the dimensionality of a single text token, masked according to whether it is present in the history S, summed to a null-text token, and fed to the UNet through its cross-attention layers.

At the beginning of training the UNet only sees null-text tokens and performs unconditional denoising; as training advances, it learns to use the conditional information in S, which is sampled uniformly at random. At inference, the Querier builds a description of length L, either from a reference image (answers from a VQA model) or by asking the user, and images are sampled with classifier-free guidance.

Fine-tuning scheme: query-answers pass through a trainable embedder and zero-initialized MLP, are added to null-text embeddings, multiplied by a sampled mask, and fed to a frozen pre-trained diffusion model with LoRA.
Figure 4: Adapting pre-trained diffusion models to query-based conditions. Proposed scheme to fine-tune text-to-image diffusion models with LoRA. A small neural network (embedder plus an MLP with zero-init for the last layer) maps queries into null-text token features. A mask is then used to train the model with a subset of queries.

Datasets and Query Sets

InCoDe is evaluated on four datasets of increasing complexity. For LSUN Bedroom and LSUN Churches, no existing dataset met the requirements of the task, so the authors built new ones: a large language model assisted in creating the query sets and a VQA model (BLIP) generated the answers. Both datasets are publicly available: attribute-based Bedrooms and attribute-based Churches.

Dataset (image size)Query set Q|Q|
CLEVR Colors (3 × 64 × 64)Indicator of presence of N or more objects of a particular color45
CelebA (3 × 64 × 64)Facial attributes40
LSUN Bedroom (3 × 512 × 512)Room descriptor attributes58
LSUN Churches (3 × 512 × 512)Church and surroundings descriptor attributes44
Table 1: Image size and query set for the different datasets.

Qualitative Results

Semantic Auto-Encoding and Concept Manipulation

InCoDe regenerates a reference image by first representing it in the query-answer space, and then edits it by changing the answers to specific queries. On LSUN Bedroom (Figure 1), re-generations use the complete description of L = 58 query-answer pairs, and edits change one or two attributes. In Figure 2, InCoDe generates samples from a sequence of query-answers alone, where text-to-image models fail. Figure 5 shows the same behavior on LSUN Churches.

LSUN Churches: reference image, regeneration, and edits setting Asphalt to Yes, People to Yes, and Mountains to No.
Figure 5: InCoDe offers users intuitive tools to adjust the semantic elements of generated images. InCoDe describes an image in the query-answer space and generates a new, semantically aligned image. By changing the answer to specific queries, we can modify semantic attributes of the new images.

Querier Trajectory

On CLEVR Colors it is easy to check whether the Querier's choices make sense. It first asks whether there are 4 or more objects (no), then asks about colors one by one, finding gray and green objects, so there are at least 2 objects. At iteration 10 it asks whether there are 3 or more objects and receives a negative answer, which completely captures the semantics of the reference image as defined by the query set. The Generator then synthesizes an image that matches the reference in semantic content.

CLEVR Colors: reference image X, samples generated with the learned Querier and with a random strategy at description lengths 5 to 44, and the first ten queries asked by the Querier with their answers.
Figure 6: InCoDe on the CLEVR Colors dataset. Samples generated with the learned Querier (top row) and with the random baseline (bottom row) for increasing description length L. InCoDe generates a sequence of sensible queries, and the Generator produces an image that is semantically equivalent (as defined by the query set) to the reference image after asking only a few queries.

Corner Cases

Concepts that are underrepresented in the training set are still captured through the proposed fine-tuning. When faced with seemingly contradictory answers to different queries, InCoDe synthesizes a creative but implausible solution.

Left: bedrooms with red curtains (3.2% of training data) and collage images (2.5%). Right: images generated with contradictory answers about seeing a window and seeing plants through the window.
Figure 7: InCoDe behaves correctly in corner cases. Left: when generating concepts underrepresented in the training set, images still capture them. Right: for apparently contradictory answers to queries, the Generator tries to satisfy both at the same time, resulting in creative solutions.

Quantitative Results

Effectiveness of the Information Acquisition Strategy

Each query-selection strategy produces a description D, from which an attribute classifier predicts the answers to the complete query set Q(X); accuracy and F1 are measured on a 2k-sample test set. InCoDe is compared with random sampling, a decision tree with information gain by impurity criterion (DT-IC, the gold standard in principle), and TopK-IC, which picks the queries with highest answer entropy in the training set.

InCoDe consistently selects queries that yield a better information acquisition strategy than the baselines, especially in more complex scenarios such as the LSUN datasets. DT-IC fragments the data with every query-answer and eventually runs out of training points over which to compute entropy, so its curves flatten. TopK-IC does not suffer from fragmentation but ignores the history. CLEVR, being simple and highly redundant, favors entropy-based methods and explains the poor performance of the random strategy.

Accuracy and F1 versus number of queries on CLEVR Colors, CelebA, LSUN Bedroom and LSUN Churches for InCoDe, DT-IC, TopK-IC and Random.
Figure 8: Performance evaluation of InCoDe using attribute-based queries. Test accuracy and F1 score of an attribute classifier on the predicted representations, as a function of the number of queries. InCoDe outperforms the baselines in all cases, with increasing gains as the datasets become more complex. DT-IC shows similar performance initially, but it suffers from data fragmentation, as well as long computation time.

Composable Generation

To measure how well generated images respect a conjunction of attributes, BLIP answers the queries on the generated images, and accuracy and F1 are computed against the conditioning answers for the 10 queries with highest entropy. Text-based baselines receive the attribute list as a concatenated prompt (e.g. “Photo of a bedroom that does not have white walls, has a window, …”); only 10 attributes are used because of their 77-token limit. All generative models, including InCoDe, use SD v1-4 as the base model. InCoDe performs significantly better than SD v1-4, on which it is built, and also outperforms the larger SD XL. Structured Diffusion, which targets attribute binding, is hurt by the conjunction of numerous concepts.

LSUN BedroomLSUN Churches
Acc.F1Acc.F1
SD V10.610.620.570.55
SD XL0.580.640.590.61
Structured Diffusion0.520.540.510.50
InCoDe0.850.840.750.72
Table 2: InCoDe generates images that respect the attributes more often than baselines do. Accuracy and F1 score for the top 10 queries, ranked by their entropy computed on the respective training set.

Beyond Attribute-Based Queries

InCoDe is not restricted to binary queries. In the appendix, the paper studies location-based queries, where a query requests the pixel values of an image patch around a location. Asking all such queries amounts to observing the whole image, and the queries carry spatial structure, so a set of answered patches is parameterized as an image and the Querier uses convolutional blocks. On CLEVR, the Querier first selects a patch in the center of the image and then explores around it as more objects are glimpsed; on CelebA, it selects patches on the main facial features, the clothes and the contour of the head.

Location-based queries: sequences of patches selected by the Querier on CLEVR (a) and CelebA (b), with generated samples for description lengths 2, 5, 10 and 20 next to the reference image X.
Figure 9 (paper Fig. 10): InCoDe selects meaningful patches according to the data distribution. (a) A sequence of patch queries selected by the Querier on CLEVR, with the associated generated samples (same color border). The Querier initially selects a patch in the center of the image and then explores around it as more objects are glimpsed. (b) An example for CelebA, where the Querier selects patches in the main features of the face, the clothes and the contour of the head.

Limitations

InCoDe requires a query set. This is a strength, since the designer is free to select the semantic concepts that matter for the intended generation task, but building the set can be tedious. Large language models can alleviate this, as done for the LSUN Bedroom and Churches query sets, yet human supervision and prompting are still necessary. Designing a framework that lets users define the semantic domain of a query set without directly supervising the query set itself remains an open question.

BibTeX

@inproceedings{comas2025incode,
  title     = {InCoDe: Interpretable Compressed Descriptions For Image Generation},
  author    = {Comas, Armand and Chattopadhyay, Aditya and Formosa, Feliu and
               Liu, Changyu and Camps, Octavia and Vidal, Ren{\'e}},
  booktitle = {International Conference on Learning Representations},
  volume    = {2025},
  pages     = {80030--80061},
  year      = {2025},
  url       = {https://openreview.net/forum?id=aXwukBD6M6}
}