Title: Im-Promptu: In-Context Composition from Image Prompts
Venue: NeurIPS 2023
Accepted: yes
Keywords: in-context learning

compositionality

generative models
Abstract: Large language models are few-shot learners that can solve diverse tasks from a handful of demonstrations. This implicit understanding of tasks suggests that the attention mechanisms over word tokens may play a role in analogical reasoning. In this work, we investigate whether analogical reasoning can enable in-context composition over composable elements of visual stimuli. First, we introduce a suite of three benchmarks to test the generalization properties of a visual in-context learner. We formalize the notion of an analogy-based in-context learner and use it to design a meta-learning framework called Im-Promptu. Whereas the requisite token granularity for language is well established, the appropriate compositional granularity for enabling in-context generalization in visual stimuli is usually unspecified. To this end, we use Im-Promptu to train multiple agents with different levels of compositionality, including vector representations, patch representations, and object slots. Our experiments reveal tradeoffs between extrapolation abilities and the degree of compositionality, with non-compositional representations extending learned composition rules to unseen domains but performing poorly on combinatorial tasks. Patch-based representations require patches to contain entire objects for robust extrapolation. At the same time, object-centric tokenizers coupled with a cross-attention module generate consistent and high-fidelity solutions, with these inductive biases being particularly crucial for compositional generalization. Lastly, we demonstrate a use case of Im-Promptu as an intuitive programming interface for image generation.

Im-Promptu: In-Context Composition from Image Prompts

Abstract

Large language models are few-shot learners that can solve diverse tasks from a handful of demonstrations. This implicit understanding of tasks suggests that the attention mechanisms over word tokens may play a role in analogical reasoning. In this work, we investigate whether analogical reasoning can enable in-context composition over composable elements of visual stimuli. First, we introduce a suite of three benchmarks to test the generalization properties of a visual in-context learner. We formalize the notion of an analogy-based in-context learner and use it to design a meta-learning framework called Im-Promptu . Whereas the requisite token granularity for language is well established, the appropriate compositional granularity for enabling in-context generalization in visual stimuli is usually unspecified. To this end, we use Im-Promptu to train multiple agents with different levels of compositionality, including vector representations, patch representations, and object slots. Our experiments reveal tradeoffs between extrapolation abilities and the degree of compositionality, with non-compositional representations extending learned composition rules to unseen domains but performing poorly on combinatorial tasks. Patch-based representations require patches to contain entire objects for robust extrapolation. At the same time, object-centric tokenizers coupled with a cross-attention module generate consistent and high-fidelity solutions, with these inductive biases being particularly crucial for compositional generalization. Lastly, we demonstrate a use case of Im-Promptu as an intuitive programming interface for image generation.

1 Introduction

No thought can be formed that isn't informed by the past; or, more precisely, we think only thanks to analogies that link our present to our past.

D. Hofstadter and E. Sander, Surfaces and Essences [1]

Humans represent complex concepts by combining and organizing simpler concepts [2, 3]. This endows us with an uncanny skill for constructing an unlimited number of concepts by composing a relatively small set of previously learned basic building blocks, an ability more formally called compositional generalization . For example, we can generate sentences by combining a dictionary of words in different ways and solve a wide range of mathematical problems using a small set of basic arithmetic operations and variables. In the case of the visual world, objects form naturally

composable entities and object-centric primitives can be flexibly combined using abstract syntactic rules to yield novel and counterfactual scenes.

The growing body of work in object-centric learning methods [4, 5, 6] enable the extraction of latent object representations from perceptual scenes. However, slot composition methods have been limited to ad-hoc composition rules based on hard-coding slots into concept libraries [7, 8]. A central challenge in learning a generative model that explicitly models the compositional grammar of the visual world is that the seemingly unlimited number of composition rules that undergird real-life visual entities prevents the explicit specification of each rule. For example, a warm spring day consists of blooming flowers and freshly verdant expanses, but come autumn, the same scene stipulates the presence of golden meadows carpeted with fallen leaves. State-of-the-art text-to-image models [9, 10, 11, 12] circumvent this bottleneck by grounding images in natural language. This aligns the representations of entities in an image to the compositional structure of language. While the visual quality of these models is stunning, they often require engineering complex language prompts to elicit the desired output. They also suffer from limited understanding of object relations [13]. Moreover, studies [14] have shown that infants as young as six months old can extract compositional structure from sequences of visual events, even before they acquire language. Such compositional abstraction independent of language faculty exhibited by humans remains elusive for contemporary models.

Translate English to French

Modify blue object to green object

cheese => {le fromage}

=>

=>

Model

peppermint => menthe poivrée

plush girafe => girafe peluche

=>

Support

Prompts

Visual

In-Context

Query

Large language models (LLMs) [15, 16, 17, 18, 19, 20], on the other hand, demonstrate implicit composition skills. Pre-trained on large text corpora, these models have impressive emergent few-shot learning capabilities. They can solve novel tasks on the fly without gradient updates by following examples shown in the instruction prompts, a process known as in-context learning . Under the hood, in-context learning uses the inherently compositional nature of the input text to implicitly infer the task structure and how to apply the task structure to a query [21]. In the most simple form, the prompt-based few-shot learning paradigm can be formalized as analogy solving of the type A : B :: C : D , where A represents an example task, B represents the example solution, and C denotes the query. The generated solution is the analogy completion D . Analogies over compositional elements, therefore, provide a direct isomorphism between in- context learning for language and learning implicit composition rules for visual objects, as depicted in Fig. 1. While LLMs use pre-specified tokenizers [22, 23, 24], the compositional granularity for implicit visual understanding is unspecified. On the other hand, slot methods induce object-level representations but fail to learn composition rules. In this work, we then ask:

Can analogy-solving enable in-context generalization over object-centric compositional elements of visual entities?

While many linguistic corpora have been extracted from the Internet for text-based tasks, to the best of our knowledge, no datasets exist for measuring in-context composition capability from visual prompts. To this end, we introduce a suite of three diverse benchmarks in Section 3 built on top of rich combinatorial spaces to systematically test image-based in-context learning abilities: (a) 3D Shapes [25], (b) BitMoji Faces, and (c) CLEVr Objects [26]. If the attention over word tokens enables analogical understanding in LLMs, can we transfer this mechanism to visual analogies? We formulate a unifying framework in Section 4.1 to formalize this notion. We present a visual analogy-based meta-learning algorithm called Im-Promptu in Section 4.2 and use it to train agents with a cross-attention module. How does one tokenize visual inputs? To answer this, we model several generative agents in Section 5, encompassing a continuum ranging from strong compositional learners using object-centric abstractions to non-compositional monolithic representation learners. Extensive experiments presented in Section 6 show the dependence of robust in-context learning for visual stimuli on object-centric slots as visual tokenizers and cross-attention. We demonstrate the use

of our visual analogy framework in task extrapolation (Section 6.2), combinatorial generalization (Section 6.3), and generating counterfactual images (Section 6.5).

2 Related Work

In this section, we discuss prior works and draw connections to relevant research areas.

2.1 Object-Centric Learning: This growing body of work targets unsupervised decomposition of scenes into a set of object-centric vectors from raw perception data. A common approach involves modeling an autoencoder consisting of a latent factorization of object slots that are independently decoded to reconstruct the scene [4, 5, 6, 27, 28, 29]. These methods effectively segment scenes into representations of underlying objects but do not learn the flexible combination of object representations. On the other hand, the authors in [7] replace the independent slot decoding bias with an Image-GPT [30] and demonstrate novel slot composition. While this work largely answers how to compose a given set of visual entities, their slot selection is performed manually through organization of slots into clustered libraries. In our work, we use a meta-learning approach to help the learner implicitly understand the composition task. Recently, the authors of [31] recast the iterative slot refinement problem as finding of fixed points through implicit differentiation to improve the stability and computational cost of the slot-attention (SA) technique. The authors of [32] use specific inductive biases to disentangle object contents from spatial information that enables relational reasoning. Our work produces a more generalized composition beyond spatial relations.

2.2 Analogical Reasoning: The ability to make analogies has been shown to have important implications in various domains, such as problem-solving, creativity, learning, and counterfactual thinking [1, 33, 34, 35, 36]. Various models have been proposed to explain the underlying mechanisms of analogy-making. Popular symbolic approaches include ARGUS [37], Transfer Frames [38], and Structural Mapping Engine [39], connectionist models include LISA [40] and Star-1 [41], and models that occupy a middle ground like Copycat [42]. Contemporary deep-learning models [43, 44, 45] attempt to solve Raven's Progressive Matrices and Bongard Problems, types of visual analogies present in IQ tests. The authors of [46] propose a generative deep visual analogy-making model based on a parallelogram regularizer on the latent space to disentangle variation factors and traverse transformation manifolds. Most similar to us, a recent work [47] reformulates the analogy-making task as Inpainting in an image grid and proposes an auto-encoder pre-training task to that end.

2.3 Compositional Generative Models: Prior works [48, 49] use energy-based models to represent composable factors of variation of a scene. However, these methods use concept labels or are grounded in text and are limited to a few concept composition operations. A follow-up work [50] describes unsupervised energy-based concepts; however, the re-composition is performed via manually-picked concepts. Recent works in text-to-image models use language grounding to induce compositionality. DALL-E [9] uses language modeling over the joint space of the text and image tokens to facilitate image generation. The latest text-to-image models [10, 11, 12] use diffusion modeling to guide the image generated from the text. A growing body of work [51, 52, 53] explores text-grounded controllable image editing via prompt engineering, where most parts of the image are preserved, but specific objects are re-composed.

2.4 Modular Representations and Attention: A swath of recent works proposes neural methods that combine modular primitives with recurrent mechanisms and cross-attention. The authors of [54] propose the Recurrent Independent Mechanisms (RIMs) to learn weakly coupled dynamical systems with independent compositional neural modules that communicate via a sparse attention bottleneck. Another work [55] uses object-centric abstractions as 'files' to store factorized declarative knowledge and the dynamics of the environment. A follow-up work [56] introduces neural abstractions of the classical Production Systems framework to learn rule-based templates, thereby facilitating compositional dynamics of the environment that can quickly adapt to novel stimuli. Most recently, the authors in [57] propose an attention-based architecture to learn in-context causal relationships between entities.

3 Benchmarks

Humans can contextualize past visual stimuli in the face of everyday experiences and even use them for imagining counterfactuals. Having seen an oak table, we can, with little difficulty, look at a metal armchair and understand the concept of an oak armchair. How do we then systematically test such

Support Prompt

Query

Solution

:

Task: [ Modify blue object to green object ]

::

:

:

Task: [ Modify facial hair style ]

Task: [Add grey metal sphere to the scene]

:

:

::

Input prompt

Primitive Tasks

Composite Tasks

Support Prompt

Query

Solution

:

::

:

Input prompt

Task: [ Modify cyan object to orange object

<and> Modify pink floor to blue floor ]

:

Task: [ Modify facial hair style

<and> eyewear ]

:

::

Task: [Add red rubber cylinder <and>

Delete grey metal cube <and>

Delete blue rubber cube]

:

:

::

3D Shapes

BitMoji Faces

CLEVr Objects

:

::

abilities of a visual in-context learner? In this work, we posit that an answer to this question lies in combinatorial visual spaces with controllable factors of variation, which provide a semantically rich, simple, scalable, and composable avenue for setting up such tasks. We create a suite of three benchmarks (Fig. 2) from compositional image creators that include (a) 3D Shapes [25], (b) BitMoji Faces, and (c) CLEVr Objects [26]. Each benchmark has a split of primitive training tasks and out-of-distribution test tasks. The primitive tasks (Fig. 2, left) constitute an analogy where a single composable element of the visual stimulus is modified in isolation. The description of each benchmark with its primitive set of tasks is given next:

3.1 3D Shapes Image Prompts: This dataset consists of static scenes of various objects lying on a colored floor in front of a colored wall viewed from different orientations. To set up primitive tasks, we consider the four properties P = { object color , wall color , floor color , scene orientation }, where each property can take multiple values within a domain. For each such task, the latent relation r ( . ) for the analogy prompt takes a property p ∈ P and modifies it from a source domain value to a target value. This benchmark comprises 80000 such tasks with a maximum of four supporting image pairs for each instance and with a roughly equal split across properties.

3.2 BitMoji Faces Image Prompts: BitMoji is an avatar creator service for social media users that allows them to create intricate cartoon faces. We queried the BitMoji API [58] to collect faces with four underlying dynamic elements P = { skin tone , facial hair style , hair style , eyewear }. Much like the previous case, primitive tasks are generated by intervening on a source value of a property and modifying it to a target value. We populate the training set with 80000 tasks, with four demonstrations available per task.

3.3 CLEVr Objects Image Prompts: CLEVr is a popular visual question-answering dataset with the visual component consisting of multiple objects lying in a scene. We use the CLEVr rendering engine to set up primitive tasks that include adding and deleting the same object across various scenes. In this fashion, we generate 60000 tasks with three examples per task.

A composable image space allows the concurrent modification of individual visual elements. One can construct composite tasks (Fig. 2, right) out of a combination of primitives shown in the training set. A k -composite task is denoted as R k ( . ) = r 1 ◦ r 2 ◦ · · · ◦ r k where r 1 , · · · , r k ∈ R . We provide details of the k -compositeness test of each of our agents in Section 6.3. Finer details about each

benchmark, along with visual examples from every task, are detailed in Appendix A. We will release the complete dataset of primitive and composite tasks upon the publication of this article.

4 Methods

To learn compositional structure over visual stimuli, we begin by formulating a unified mechanistic interpretation of an in-context compositional learner using insights from design elements of LLMs.

4.1 In-Context Learning as Analogy Completion: A general compositional in-context learner M ϕ,α,θ ( . ) can be formalized via the following three key components:

An encoder E ϕ ( . ) that maps the input space X to the compositional space C ≜ E ϕ ( . ) : X ↦- → C

An executor T α ( . , . , . ) that maps compositional entities from example tasks, example solutions, and a query task to the query solution ≜ T α ( ., ., . ) : C × C × C ↦- → C

A decoder D θ ( . ) that maps the compositional space back to the input space ≜ D θ ( . ) : C ↦- → X

Coupling the above functions together yields the learner:

The inclusion of E ϕ ( . ) and D θ ( . ) is crucial for compositional abstraction since the input space may not be a priori composable as in the case of images. Beyond this, we do not place any strong parametric constraints on the model. Let R denote a task set. For any task r ∈ R , define the task analogy ζ over input pairs x 1 , x 2 as x 1 : r ( x 1 ) :: x 2 : r ( x 2 ) ≜ A : B :: C : D . An effective in-context learner over R then satisfies the following property [59]:

Here, P denotes the distribution of the analogies resulting from the input space X and task r ( . ) , L ( . ) denotes a loss metric, and ϵ is an error bound. The above property simply states that a good in-context learner solves analogies defined over a task set within some finite error bound. In Appendix B, we describe LLMs as an instantiation of this framework.

4.2 Im-Promptu Learning: Pre-training LLMs on large-scale text data leads to the emergence of highly transferable internal representations that allow them to adjust to novel tasks by simple priming on a few demonstrations. However, it is still unclear whether the underlying structure of the training data, architecture, or inductive biases instilled by choice of pre-training learning algorithms cause these intriguing properties to emerge. How can we encourage the emergence of such a general-purpose representation for visual data? In this work, we take an explicit approach based on the formalism presented in the previous section. Having established the desideratum (Eq. 2), we set up a learning procedure called Im-Promptu that trains the model to generate analogy completions from image prompts. To this end, given a task set R , in each minibatch, we sample an analogy A : B :: C : D that follows a latent primitive r ( . ) ∈ R . Given a loss criterion, L , we make the following stochastic gradient updates of the model parameters:

where the step size α is a hyperparameter. The full Im-Promptu algorithm is laid out in Algorithm 1.

5 Learning Agents

In this section, we explore various modeling choices for a visual in-context learner ranging from simple pixel-space rules to object-centric learners (OCLs).

5.1 Pixel Baseline: This non-parametric baseline manipulates the pixel space using a simple addition rule. We denote the support prompt as A : B , the query as C , and the solution as ˆ D . Then the Pixel baseline predicts ˆ D as the outcome of a linear transformation, ˆ D = C +( B -A ) .

5.2 Monolithic Learner: Our first learning agent, inspired by [46], is entirely non-compositional and uses latent monolithic vectors to execute the image prompts as follows:

Algorithm 1 Im-Promptu Learning Algorithm

The encoder e ϕ ( . ) and decoder d θ ( . ) are convolutional and deconvolutional networks, respectively. The inference network f α ( . ) and executor network h β ( . ) are modeled as multi-layered perceptrons. Here, [ ] denotes the concatenation operator. This architecture is detailed in Appendix D.1.

5.3 Inpainting Model: Inspired by recent work on inpainting for In-Context learning [47], this agent (Inpaint., visualized in Appendix D.2) is modeled via an autoencoder architecture that fills in missing patches of an image. The architecture is composed of a discrete variational autoencoder (dV AE) that discretizes the input patches and a Vision Transformer [60] auto-encoder to impute missing values. While the monolithic agent separately encodes the components of the visual analogy, this model jointly represents them as a 2 × 2 image grid. The model is pre-trained using the masked autoencoder reconstruction task [61]. Subsequently, at inference time, the analogy solution is represented as a missing image in the grid. Details have been given in Appendix D.2.

5.4 Object-Centric Learner (OCL): This agent, as depicted in Fig. 3, is a strongly compositional learner that uses object-centric inductive biases. The encoder and decoder of the framework in Section 4.1 are parametrized using Slot Attention Transformer (SLATE) [7] (see Appendix C.2) as follows:

A Context Encoder Transformer (CET) ≜ T α (. ,. ,.) (.) with interleaved layers of: ( a ) cross-attention on the context slots and ( b ) self-attention, induces sparse modifications on the query slots to complete the analogy.

The latent sequence ˆ Z D predicted by Image-GPT is mapped by the dVAE back to the pixel space ˆ D .

The CET forward pass is shown in Appendix D.3.

5.5 Sequential Prompter: This (Seq., visualized in Appendix D.4) is an ablation over the OCL that replaces CET with an LLM-like sequence prompt obtained from a simple concatenation of slots of images A , B , and C , injected with position embeddings p i .

While the OCL explicitly encodes the entire context into a fixed-length slot sequence via the CET, the ablated agent models a longer concatenated sequence.

5.6 Patch Learner: This agent straddles the compositionality extremes of Monolithic Learners and OCLs, and uses image patch abstractions. The SA module from OCL is ablated to get a discrete sequence of 4 × 4 patch latents as the degree of compositional granularity E ϕ ( . ) ≜ f dVAE ϕ ( . ) . A larger image implies longer sequences for this modeling choice.

6 Experiments

In this section, we set up experiments to answer (1) whether analogical reasoning enables incontext generalization, (2) does such a generalization require key mechanisms from LLMs, namely compositionality and attention, (3) if compositionality is a key ingredient, what is the correct granularity for visual tokens, and (4) what are the limits to the generalization.

SLATE

encoder

:

::

A

B

C

Context Encoder

Transformer

Cross

Attention

1

2

SLATE

decoder

Input prompt

3

Solution

Image-GPT

prompt

D

Ep(.)

Ta(...,.)

De()

SAN

S:N

S1:N

6.1 Training Setup: We trained each agent on the primitive set of tasks across the three benchmarks using Im-Promptu (Section 4.2). The SA-based object-centric encoders used in the OCL and Sequential Prompter were pre-trained as a SLATE autoencoder, as described by the authors in [7]. On the other hand, the Patch Learner was trained completely from scratch. The loss metric L used to train the agents was cross-entropy (CE) loss between the true latent sequence Z D and the predicted solution ˆ Z D obtained from Image-GPT, i.e., L impromptu = CE ( Z D , ˆ Z D ) .

In addition to the above loss, the dV AE was trained using the mean-squared error (MSE) loss over the raw pixel space to yield the full loss function L = L impromptu + MSE ( D, ˆ D ) . For inference, answers of the transformer-based agents were sampled from the Image-GPT decoder using topk nucleus sampling [62]. Hyperparameters for training and inference have been laid out in Appendix E.

6.2 Primitive Task Extrapolation: In the first out-of-distribution paradigm, we tested the ability of agents to apply learned rules to different domain pairs. In order to do this, we held out 20% of source-target pairs (see Section 3 for the definition of source and target) from the training primitives and tested the ability of agents to generalize from learned rules to unseen source-target pairs. For example, the object color property in the 3D Shapes benchmark can take 10 unique values and 10 × 9 = 90 source-target combinations. Thus, an agent was trained on only 90 × 0 . 8 = 72 pairs for object-hue primitives. We made sure that each value in the domain set was shown at least once as either the target or the source.

Fig. 4(a) plots scores of different agents across benchmarks against two key metrics: (1) MSE (lower is better) that quantitatively compares the construction against the ground truth and (2) Fréchet inception distance (FID, lower is better) score to measure the perceptual quality of the composition. We make several interesting observations:

(R1.1) Simple pixel manipulation produces implausible outputs. The pixel baseline has poor MSE scores ( ∼ 138 for 3D Shapes, ∼ 895 for BitMoji) with clearly apparent artifacts in the output. While linear pixel transformations are sufficient when an object is independent of the remaining entities, it is unable to model complex dependencies (see Fig. 4(b),(d) under 'Pixel').

(R1.2) Inpainting model struggles to generalize beyond i.i.d. inputs. We observed that the Inpainting model is able to cogently complete analogies on the i.i.d. validation set (see Appendix F.1 for outputs). However, when tested on extrapolated primitives, it only fills in the high-level structure (see Fig. 4 (b), (c)) and, in the case of more complex inputs, produces entirely incoherent outputs (Fig. 4 (d)). We posit that a top-down method like inpainting pre-ordains larger datasets for improved generalization and, as such, suffers from sample inefficiency.

(R1.3) Monolithic Learners are reasonably effective at generalizing from learned rules on structured stimuli. These agents have the lowest MSE scores on 3D Shapes and BitMoji Faces, both spatially consistent datasets. However, the output deteriorated over CLEVr Objects where the

(a)

(b)

(c)

(d)

Support Prompt

Query

Ground Truth

Monolithic

Patch

Seq.

Prompter

OCL

Inpainting

Query

Support Prompt

Ground

Truth

Missing

shadows

Fused

objects

Monolithic

Patch

OCL

Seq.

Prompter

Inpainting

Monolithic

Patch 2 shot

1Seq. 1 shot

Seq. 3 shot

OCL 2 shot

Patch 1 shot

Patch 3 shot

Seq. 2 shot

OCL 1 shot

OCL 3 shot

Pixel | MSE: 138, FID: 33.79

Pixel | MSE: 895.37, FID: 11.68

Pixel | MSE: 77.81, FID: 40.42

Inpaint. | MSE: 142.77, FID: 31.20 Inpaint. | MSE: 260.94, FID: 104.84

Inpaint.|MSE:200.64,FID:186.34

160

140

80

120

MSE（↓）

100

80

60

40

40

20

20

0

3DShapes

BitMojiFaces

CLEVrObjects

0

latent scene configuration is diverse. The edges of the generated shapes and lighting details were significantly blurred, and occluded objects were often fused together (FID ∼ 92, worse than Pixel baseline, Fig. 4(d) under 'Monolithic').

(R1.4) Patch Learner and Sequential Prompter benefit from additional examples. For these agents, the addition of context examples was markedly apparent from the significant MSE drops for > 1 shot (see Fig. 4(a)). We posit that since these models learn from longer contexts, additional examples are particularly effective in regularizing the output sequence manifold of Image-GPT.

6.3 Composite Task Extrapolation: In this generalization paradigm, we probed the compositional generalization capabilities of the agents. A k -composite task ( k ≥ 2 , see Section 3) is an unordered composite function of k primitives. The value of k is varied across each benchmark, where higher values of k yield visually complex contexts. To solve such a task, the agent must identify the underlying primitive relations and combinatorially modify the query.

In Fig. 5(a), we note (R1.1) and (R1.3) from the previous setup in this extrapolation paradigm as well, but we make additional key observations next:

(R2.1) The effect of object-centric biases is strong. This is indicated by the widening MSE gap between the OCL and monolithic agent for increasing values of k across all three benchmarks (see Fig. 5(a)-(c)). Moreover, the OCL and the Sequential Prompter generate outputs with consistent perceptual quality (lower FID scores).

(R2.2) Monolithic and Patch Learners apply shortcuts. The monolithic agent tends to produce a Frankenstein-like image, as if a superposition of context images (see Fig. 5(d)-(f) under 'Monolithic'). In the case of the CLEVr Objects dataset, both the Monolithic and Patch Learners often simply filled in 'blobs' agnostic to the color and shape of objects (Fig. 5(f), Appendix F.4), with missing shadows leading to lower MSE scores but poor visual quality.

6.4 Analysis: Next, we discuss key elements required for in-context composition.

(A1) In-context generalization critically hinges on compositional granularity. As evident from (R1.2), monolithic representations suffice for reliably learning primitive composition rules over simple contexts. However, they suffer from fidelity issues when the visual space becomes more complex. Beyond primitive generalization, patch abstractions are effective when the underlying space

10

2

(b)

(e)

(f)

BitMoji Faces

CLEVr Objects

Patch

Seq. Prompter

OCL

Support Prompt

Query

(a)

(d)

3D Shapes

Ground Truth

Monolithic

Inpainting

Query

e

Support Prompt

Ground Truth

Inpainting

Query

Monolithic

Patch

Seq. Prompter

OCL

Support Prompt

Patch

Seq. Prompter

OCL

Ground Truth

Monolithic

Inpainting

(c)

Monolithic

Patch 2 shot

Seq. 1 shot

Seq. 3 shot

OCL 2 shot

Patch 1 shot

Patch 3 shot

Seq. 2 shot

OCL 1 shot

OCL 3 shot

Pixel | MSE: 270.43, FID: 33.79

Pixel I MSE: 333.64, FID: 38.46

Pixel | MSE: 342.01, FID: 35.53

200

Inpaint. I MSE: 194.6, FID: 31.82

Inpaint. | MSE: 268.6, FID: 41.84

Inpaint. I MSE: 292.84, FID: 51.34

60

175

50

150

MSE(↓)

125

40

100

75

50

20

25

4

10

k

Pixel |MSE: 1129.13, FID: 18.36

Pixel| MSE: 1009.50, FID: 13.17

Inpaint. I MSE: 284.9, FID: 103.74

Inpaint. | MSE: 311.10, FID: 108.92

22

20

250

18

MSE（↓）

200

16

14

150

FID

100

50

9

K

Pixel|MSE:88.18,FID: 53.89

Pixel|MSE: 98.09,FID: 53.67

Inpaint. | MSE: 235.66, FID: 191.72

Inpaint. | MSE: 285.76, FID: 183.94

175

110

150

125

100

↑）

100

90

FID (↓)

MSE

75

80

50

70

25

has object-patch equivalence, as evident from the CLEVr Objects dataset (Fig. 5(c)). However, even with object-patch equivalence, the Patch Learner omits the inter-object dependencies (e.g., object occlusions and shadows). It further fails to learn complex and diverse objects spanning multiple patches reliably (does poorly on the BitMoji Faces dataset with diverse facial components). Slotbased compositionality with the CET not only enables the generalization of the learned primitives but also enables combinatorial generalization to composite tasks that require abstracting out the composition rule over each entity in isolation as well as composing the resultant interplay between them to generate a globally consistent output.

(A2) Encoding the context via cross-attention leads to sample efficiency. Longer slot sequences in the Sequential Prompter require multi-shot contexts across all benchmarks. The sample inefficiency was particularly observed on the CLEVr Objects dataset that uses six slots and, hence, much longer sequences. Cross-attention via CET is essential for implicit inference, enabling the learner to encode specific objects from the context.

6.5 'Counterfactual Prompt Engineering' with Im-Promptu: LLMs have spurred interest in several priming techniques [63, 64] that can 'engineer' the model into following user instructions. While this natural-language-based programming language provides an intuitive interface for tasks that have a fundamental degree of language abstraction (writing code, summarization, symbolic

OCL

OCL

OCL

OCL

Prompt: "add a metal blue

cylinder behind the red sphere"

Prompt:[add rubber purple

cube]

Prompt:[add rubber red

cyclinder]

Prompt:[add rubber silver

cube]

Prompt:[add metal blue

cylinder]

DALL-E

Prompt: "add a rubber purple cube

in front of the metallic cylinder

and to the left of the red sphere"

DALL-E

Prompt: "add a rubber red cylinder

slightly to the front and right of

the red sphere"

DALL-E

(a)

(b)

manipulation, etc.), it is not a priori obvious that textual descriptions should also scaffold image generators. Coming up with natural-language prompts for complex visual entities is often tedious and unintuitive. Instead, explaining an image is naturally easier from its entities and composition over them 1 . To this end, Im-Promptu provides an avenue for generating counterfactuals via image prompts. In Fig. 6(a), we demonstrate the creation of a scene from its object components via the OCL. As a point of comparison, in Fig. 6(b), using image-inpainting and natural language prompts with DALL-E [9] yields an unreliable output with distorted objects. More practically, the OCL reduces human effort significantly in rendering images with desired properties by using existing visual assets. The procedure to generate scenes from OCL can be found in Appendix G.

7 Conclusion

This work investigated whether analogy-solving can enable in-context compositional generalization over visual entities. We first designed a new test suite. We probed if attention and compositionality, key ingredients in LLMs, also play a crucial role in the visual domain. We transported these ingredients from language to model several agents. Our experiments showed that non-compositional agents do not generalize well beyond primitive task extrapolation. Even with compositionality baked in, the performance of patch-based learners depends on idiosyncrasies of the visual structure. However, we found that object-centric biases consistently facilitate an implicit understanding of composition rules and generate outputs with global semantic consistency. Our ablation of the CET suggested that cross-attention plays a crucial role, just like language models, which posits the importance of analogy and attention in understanding the underpinnings of in-context learning. Future research challenges include collecting real-world primitives from photo-realistic graphic engines or human labels, improving object-centric inductive biases for real-life entities, and designing better prompting techniques. We hope that our work will spur further research on visual in-context learning.

Acknowledgments and Disclosure of Funding

We would like to thank Sreejan Kumar for helpful discussions and insights throughout the course of this work. The experiments reported in this article were performed on the computational resources managed and supported by Princeton Research Computing at Princeton University. This project was funded by NSF Grant No. CCF-2203399 and ONR Grant No. N00014-18-1-2873. JS gratefully acknowledges financial support from the Schmidt DataX Fund at Princeton University made possible through a major gift from the Schmidt Futures Foundation.

References

Douglas R. Hofstadter and Emmanuel Sander. Surfaces and Essences: Analogy as the Fuel and Fire of Thinking . Basic Books, 2013.

Brenden M. Lake, Ruslan Salakhutdinov, Jason Gross, and Joshua B. Tenenbaum. One Shot Learning of Simple Visual Concepts. Cognitive Science , 33, 2011.

Brenden M. Lake, Tal Linzen, and Marco Baroni. Human Few-Shot Learning of Compositional Instructions. CoRR , abs/1901.04587, 2019.

Christopher P. Burgess, Loic Matthey, Nicholas Watters, Rishabh Kabra, Irina Higgins, Matt Botvinick, and Alexander Lerchner. MONet: Unsupervised Scene Decomposition and Representation. CoRR , abs/2303.08774, 2019.

Klaus Greff, Raphaël Lopez Kaufman, Rishabh Kabra, Nick Watters, Chris Burgess, Daniel Zoran, Loic Matthey, Matthew Botvinick, and Alexander Lerchner. Multi-Object Representation Learning with Iterative Variational Inference. CoRR , abs/1903.00450, 2019.

Francesco Locatello, Dirk Weissenborn, Thomas Unterthiner, Aravindh Mahendran, Georg Heigold, Jakob Uszkoreit, Alexey Dosovitskiy, and Thomas Kipf. Object-Centric Learning with Slot Attention. CoRR , abs/2006.15055, 2020.

Gautam Singh, Fei Deng, and Sungjin Ahn. Illiterate DALL-E Learns to Compose. CoRR , abs/2110.11405, 2021.

Jindong Jiang, Fei Deng, Gautam Singh, and Sungjin Ahn. Object-Centric Slot Diffusion. CoRR , abs/2303.10834, 2023.

Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-Shot Text-to-Image Generation. CoRR , abs/2102.12092, 2021.

Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical Text-Conditional Image Generation with CLIP Latents. CoRR , abs/2204.06125, 2022.

Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S. Sara Mahdavi, Rapha Gontijo Lopes, Tim Salimans, Jonathan Ho, David J. Fleet, and Mohammad Norouzi. Photorealistic Text-to-Image Diffusion Models with Deep Language Understanding. CoRR , abs/2205/11487, 2022.

Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-Resolution Image Synthesis with Latent Diffusion Models. CoRR , abs/2112.10752, 2021.

Gary Marcus, Ernest Davis, and Scott Aaronson. A Very Preliminary Analysis of DALL-E 2. CoRR , abs/2202.13807, 2022.

Fei Xu, Elizabeth S. Spelke, and Sydney Goddard. Number Sense in Human Infants. Developmental Science , 8(1):88-101, 2005.

Tom B. Brown et al. Language Models are Few-Shot Learners. CoRR , abs/2005.14165, 2020.

Ben Wang and Aran Komatsuzaki. GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model. https://github.com/kingoflolz/mesh-transformer-jax , May 2021.

Aakanksha Chowdhery et al. PaLM: Scaling Language Modeling with Pathways. CoRR , abs/2204.02311, 2022.

Opher Lieber, Or Sharir, Barak Lenz, and Yoav Shoham. Jurassic-1: Technical Details and Evaluation. https://uploads-ssl.webflow.com/60fd4503684b466578c0d307/ 61138924626a6981ee09caf6_jurassic_tech_paper.pdf , 2022.

Teven Le Scao et al. BLOOM: A 176B-Parameter Open-Access Multilingual Language Model. CoRR , abs/2211.05100, 2022.

OpenAI. GPT-4 Technical Report. CoRR , abs/2303.08774, 2023.

Jerry Wei, Jason Wei, Yi Tay, Dustin Tran, Albert Webson, Yifeng Lu, Xinyun Chen, Hanxiao Liu, Da Huang, Denny Zhou, and Tengyu Ma. Larger Language Models do In-context Learning Differently. CoRR , abs/2303.03846, 2023.

Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural Machine Translation of Rare Words with Subword Units. CoRR , abs/1508.07909, 2016.

Mike Schuster and Kaisuke Nakajima. Japanese and Korean Voice Search. In IEEE International Conference on Acoustics, Speech and Signal Processing , pages 5149-5152, 2012.

Taku Kudo and John Richardson. SentencePiece: A Simple and Language Independent Subword Tokenizer and Detokenizer for Neural Text Processing. CoRR , abs/1808.06226, 2018.

Chris Burgess and Hyunjik Kim. 3D Shapes Dataset. https://github.com/deepmind/3dshapesdataset/, 2018.

Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Li Fei-Fei, C. Lawrence Zitnick, and Ross Girshick. CLEVR: A Diagnostic Dataset for Compositional Language and Elementary Visual Reasoning. CoRR , abs/1612.06890, 2016.

Klaus Greff, Sjoerd van Steenkiste, and Jürgen Schmidhuber. On the Binding Problem in Artificial Neural Networks. CoRR , abs/2012.05208, 2020.

Martin Engelcke, Adam R. Kosiorek, Oiwi Parker Jones, and Ingmar Posner. GENESIS: Generative Scene Inference and Sampling with Object-Centric Latent Representations. CoRR , abs/1907.13052, 2019.

Martin Engelcke, Oiwi Parker Jones, and Ingmar Posner. GENESIS-V2: Inferring Unordered Object Representations without Iterative Refinement. CoRR , abs/2104/09958, 2021.

Mark Chen, Alec Radford, Rewon Child, Jeffrey Wu, Heewoo Jun, David Luan, and Ilya Sutskever. Generative Pretraining From Pixels. In Hal Daumé III and Aarti Singh, editors, Proceedings of the 37th International Conference on Machine Learning , volume 119 of Proceedings of Machine Learning Research , pages 1691-1703. PMLR, 13-18 July 2020.

Michael Chang, Thomas L. Griffiths, and Sergey Levine. Object Representations as Fixed Points: Training Iterative Refinement Algorithms with Implicit Differentiation. CoRR , abs/2207.00787, 2022.

James C. R. Whittington, Rishabh Kabra, Loic Matthey, Christopher P. Burgess, and Alexander Lerchner. Constellation: Learning Relational Abstractions over Objects for Compositional Imagination. CoRR , abs/2107.11153, 2021.

J. P. Guilford. Creativity. American Psychologist , 5(9):444, 1950.

Dedre Gentner. Structure-Mapping: A Theoretical Framework for Analogy. Cognitive Science , 7(2):155-170, 1983.

Arthur B. Markman and Dedre Gentner. Structural Alignment in Analogy and Similarity. American Psychologist , 48(1):40, 1993.

Keith J. Holyoak and Paul Thagard. Mental Leaps: Analogy in Creative Thought . MIT Press, 1995.

W. R. Reitman. Cognition and Thought: An Information Processing Approach . John Wiley and Sons, 1965.

Patrick H. Winston. Learning by Creatifying Transfer Frames. Artificial Intelligence , 10(2):147172, 1978.

Brian Falkenhainer, Kenneth D. Forbus, and Dedre Gentner. The Structure-Mapping Engine: Algorithm and Examples. Artificial Intelligence , 41(1):1-63, 1989.

Jeffrey E. Hummel and Keith J. Holyoak. Distributed Representations of Structure: A Theory of Analogical Access and Mapping. Psychological Review , 104(3):427-466, 1997.

Graeme S. Halford, William H. Wilson, Jian Guo, Ross W. Gayler, Janet Wiles, and J. E. M. Stewart. Connectionist Implications for Processing Capacity Limitations in Analogies , pages 363-415. Ablex Publishing, 1994.

Douglas R. Hofstadter. Fluid Concepts and Creative Analogies: Computer Models of the Fundamental Mechanisms of Thought . Basic Books, 1995.

Stefan Depeweg, Constantin A. Rothkopf, and Frank Jäkel. Solving Bongard Problems with a Visual Language and Pragmatic Reasoning. CoRR , abs/1804.04452, 2018.

Chi Zhang, Feng Gao, Baoxiong Jia, Yixin Zhu, and Song-Chun Zhu. RAVEN: A Dataset for Relational and Analogical Visual rEasoNing. CoRR , abs/1903.02741, 2019.

Felix Hill, Adam Santoro, David G. T. Barrett, Ari S. Morcos, and Timothy Lillicrap. Learning to Make Analogies by Contrasting Abstract Relational Structure. CoRR , abs/1902.00120, 2019.

Scott E. Reed, Yi Zhang, Yuting Zhang, and Honglak Lee. Deep Visual Analogy-Making. In C. Cortes, N. Lawrence, D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems , volume 28. Curran Associates, Inc., 2015.

Amir Bar, Yossi Gandelsman, Trevor Darrell, Amir Globerson, and Alexei A. Efros. Visual Prompting via Image Inpainting. CoRR , abs/22098.00647, 2022.

Yilun Du, Shuang Li, and Igor Mordatch. Compositional Visual Generation with Energy Based Models. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems , volume 33, pages 6637-6647. Curran Associates, Inc., 2020.

Nan Liu, Shuang Li, Yilun Du, Antonio Torralba, and Joshua B. Tenenbaum. Compositional Visual Generation with Composable Diffusion Models. CoRR , abs/2206.01714, 2022.

Yilun Du, Shuang Li, Yash Sharma, Joshua B. Tenenbaum, and Igor Mordatch. Unsupervised Learning of Compositional Energy Concepts. CoRR , abs/2111.03042, 2021.

Amir Hertz, Ron Mokady, Jay Tenenbaum, Kfir Aberman, Yael Pritch, and Daniel Cohen-Or. Prompt-to-Prompt Image Editing with Cross Attention Control. CoRR , abs/2208.01626, 2022.

Dani Valevski, Matan Kalman, Yossi Matias, and Yaniv Leviathan. UniTune: Text-Driven Image Editing by Fine Tuning an Image Generation Model on a Single Image. CoRR , abs/2210.09477, 2022.

Bahjat Kawar, Shiran Zada, Oran Lang, Omer Tov, Huiwen Chang, Tali Dekel, Inbar Mosseri, and Michal Irani. Imagic: Text-Based Real Image Editing with Diffusion Models. CoRR , abs/2210.09276, 2022.

Anirudh Goyal, Alex Lamb, Jordan Hoffmann, Shagun Sodhani, Sergey Levine, Yoshua Bengio, and Bernhard Schölkopf. Recurrent Independent Mechanisms. CoRR , abs/1909.10893, 2020.

Anirudh Goyal, Alex Lamb, Phanideep Gampa, Philippe Beaudoin, Sergey Levine, Charles Blundell, Yoshua Bengio, and Michael Mozer. Object Files and Schemata: Factorizing Declarative and Procedural Knowledge in Dynamical Systems. CoRR , abs/2006.16225, 2020.

Anirudh Goyal, Aniket Didolkar, Nan Rosemary Ke, Charles Blundell, Philippe Beaudoin, Nicolas Heess, Michael Mozer, and Yoshua Bengio. Neural Production Systems: Learning Rule-Governed Visual Dynamics. CoRR , abs/2103.01937, 2022.

Nan Rosemary Ke, Silvia Chiappa, Jane Wang, Anirudh Goyal, Jorg Bornschein, Melanie Rey, Theophane Weber, Matthew Botvinic, Michael Mozer, and Danilo Jimenez Rezende. Learning to Induce Causal Structure. CoRR , abs/2204.04875, 2022.

Snap Inc. Bitmoji. https://www.bitmoji.com/ , accessed 2023.

Shivam Garg, Dimitris Tsipras, Percy Liang, and Gregory Valiant. What Can Transformers Learn In-Context? A Case Study of Simple Function Classes. CoRR , abs/2208.01066, 2022.

Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. CoRR , abs/2010.11929, 2021.

Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dollár, and Ross Girshick. Masked Autoencoders Are Scalable Vision Learners. CoRR , abs/2111.06377, 2021.

Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. The Curious Case of Neural Text Degeneration. CoRR , abs/1904.09751, 2020.

Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processing. CoRR , abs/2107.13586, 2021.

Simon Willison. In Defense of Prompt Engineering. https://simonwillison.net/2023/ Feb/21/in-defense-of-prompt-engineering/ , February 2023.

Jason Tyler Rolfe. Discrete Variational Autoencoders. CoRR , abs/1609.02200, 2016.

Aaron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. Neural Discrete Representation Learning. CoRR , abs/1711.00937, 2017.

Peer reviews:
comments: SUMMARY:
This paper presents a comprehensive study of in-context learning of compositionality in images. It introduces a simple benchmark of compositional language-driven visual transformations and explores under what conditions a model can perform in-context analogies from image pairs.

STRENGTHS:
Very interesting study, with relevant conclusions that can be easily turned into hypotheses for examining how one can achieve in-context analogical reasoning in a more real-world, less synthetic context. The scope of the study is well delineated, and the hypotheses that are tested are very clear. This is a very important topic beyond the narrow setting of 'can we do visual analogies', because of the widespread believe that analogy making is a great proxy for broader understanding of the visual world.
This study further reinforces recent observations from a number of researchers that object or attribute-centric representations are very effective at enabling higher level visual reasoning and deserve more attention (pun intended), and confirms that cross-attention is a strong contender for enabling compositional learning beyond just a single modality.

WEAKNESSES:
One could argue that results obtained on synthetic data always come with the question of whether the findings will transfer to more real-world settings. In this case, the diversity of synthetic data sources partially addresses the concern.

Nits:
- Fig 1: girafe has two 'f' in English.
- Suggest shortening refs [17] and [19] if permitted byt the NeurIPS style guide. A whole printed page for a single reference is a bit over the top.

QUESTIONS:
None.

LIMITATIONS:
Limitations of the work are adequately spelled out.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 4
DATE: 2023-06-25

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper focuses on the problem of using composable elements of visual modality to perform in-context referring for analogical reasoning like LLMs do. Firstly, the authors constructed three benchmarks to evaluate the generalization capacities of visual in-context learner. Then, the authors unified the formula of in-context analogy learning, and designed a framework called Im-Promptu. Different levels of agents, ranging from simple pixel-space rules to object-centric learners are trained for exploring the granularity of composition in visual modality. Lastly, the paper pointed out the characteristics of different degrees of compositionality via experiments.\n\nSTRENGTHS:\n1.\tThe paper proposes an interesting topic of considering the in-context composition learning from visual prompts. Similar to the composition skills of LLMs, visual generative models’ compositionality is largely under explored. The motivation of this paper is meaningful and insightful.\n2.\tThis paper is of great novelty. First, it formulates the notion of analogy-based in-context learner and proposed a novel training framework called Im-Promptu based on that. What’s more, the paper provides a detailed and insightful analysis of different granularities’ influence on the compositionality and whether analogical reasoning enables in-context generalization. \n3.\tThe paper contributes three benchmarks for evaluating the generalization properties of visual in-context learners.\n\nWEAKNESSES:\n1.\tThere is no obvious weakness I have found in this paper.\n\nQUESTIONS:\n1.\tJust one question: The proposed three benchmarks are very different from actual scenes, are there any plans to introduce more real-scene images to the benchmark?\n\nLIMITATIONS:\nThe authors discussed limitations and there is no potential negative societal impact of their work from my perspective.", "TITLE": "Official Review", "RECOMMENDATION": 8, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2023-07-03"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis work proposes a framework for in-context image generation/composition from image prompts. The in-context learner resembles analogy completion and is simply optimized with a reconstruction objective. Several variants in terms of visual representations (pixels/latent vectors), the compositionality of the vectors (monolithic/object-centric), and the scheme of integrating prompts (cross-attention/simple concatenation) are explored to indicate the key ingredients of a successful visual in-context learning model. In addition, a benchmark consisting of three object/attribute-combinatorial datasets is created to evaluate visual in-context learning tasks.\n\nSTRENGTHS:\n+ The main idea of introducing in-context inference ability (which is text-free) into the object-centric learning framework is interesting.\n\n+ The proposed Object-Centric Learner (OCL) is technically sound and the experimental results demonstrate its validity for in-context composition from image prompts.\n\n+ Extensive evaluations regarding different levels of compositionality and different means of context aggregation are investigated.\n\nWEAKNESSES:\n- The main concern comes from the confusing contribution clarification of this paper. I do not see which specific/major contributions the authors want to emphasize. Text-free in-context generation compared to text-to-image generation models such as DALL-E? Endowing SLATE with the in-context composition capability by inserting a context encoder transformer?\n(a) If the answer is the first one, I would say it is over-claimed. Although Figure 6 to some extent showcases that DALL-E requires tedious prompt engineering and some external techniques like inpainting to achieve scene composition, the proposed text-free in-context generation method is not more appealing since 1) it can only be applied in the toy scenario (while DALL-E supports open-vocabulary generations with high fidelity), and 2) one needs to have each component in advance (e.g., an image of a rubber purple cube in the desired position), and this is not feasible in practical scenarios.\n(b) If the answer is the latter, I would say the claimed contribution is not well supported. The proposed OCL demonstrates its ability of in-context composition from image prompts, but SLATE also supports compositional generation using the concept library built from the training datasets. I think some comparisons and discussions with SLATE would help contextualize this paper.\n\n- Overall, the paper is not easy to follow because: 1) there are many long sentences with less specific descriptions, and 2) many technical details of the in-context learner are missing and Section 4 is redundant (e.g., Equations 2 and 3 could be moved to the appendix). In addition, the authors should consider adding some preliminaries of slot attention and SLATE, making the paper more self-contained.\n\n- The proposed method is only evaluated on toy synthetic datasets. Although previous related works (e.g., SLATE) generally struggle to generalize to real-world data with diverse scenes, I would like to see some experiments on natural images.\n\nQUESTIONS:\nIn terms of the experiments, I have two questions:\n(a) How to implement the multi-shot in-context generation?\n(b) In Figure 6, the objects in the generated image seem to be placed in the same position as they are in the image prompt. How is this position-preserving functionality realized by OCL? I would like to see some insights into this from the authors.\n\nLIMITATIONS:\nYes", "TITLE": "Official Review", "RECOMMENDATION": 4, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-04"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis work investigates whether analogical reasoning can enable in-context composition over composable elements of visual stimuli. First, they introduce a suite of three benchmarks to test the generalization properties of a visual in-context learner. They formalize the notion of an analogy-based in-context learner and use it to design a meta-learning framework called Im-Promptu. To this end, they use Im-Promptu to train multiple agents with different levels of compositionality, including vector representations, patch representations, and object slots. Lastly, they demonstrate a use case of Im-Promptu as an intuitive programming interface for image generation.\n\nSTRENGTHS:\nIn-context learning is a novel learning paradigm recently. While in-context learning is popular with large language models (LLM), it has not been discovered in computer vision fields. This paper provides three benchmarks for in-context learning for computer vision and introduces some algorithms for proposed benchmarks. Since in-context learning is open for computer vision, the attempt is valuable and makes further research possible.\n\nWEAKNESSES:\nIn-context learning is a general learning paradigm for diverse tasks. In the computer vision field, there are a lot of tasks (e.g., classification, object detection, segmentation). However, this paper only considers three tasks: 3D Shapes Image Prompts, BitMoji Faces Image Prompts, CLEVr Objects Image Prompts. Thus, this benchmark may be not sufficiently comprehensive from this perspective. On the other hand, the performance versus the number of in-context examples is one important aspect of in-context learning. This paper doesn't provide any insight from this view.\n\nQUESTIONS:\nI have the following questions:\n1. Since the number of in-context demonstrations is one important parameter in in-context learning fields, is there any ablation study for the number of demonstrations? \n2. The input and output of these three tasks are all images. One question is can the text be the output of the task (e.g., image classification)?\n3. In the proposed method, there are some components involved. What's the difference if we use models from scratch instead of pre-trained?\n\nLIMITATIONS:\nCompared with in-context learning in language models, this paper only considers three proposed computer vision tasks. Thus the setting of in-context learning may be limited.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-24"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper investigates whether analogical reasoning can enable in-context compositional generalization over visual entities. The authors construct three benchmarks to test the compositional generalization on visual analogy-making, including 3D shapes, BitMoji Faces, and CLEVR. The authors also present a visual analogy-making algorithm called Im-Promptu. The authors test the proposed method on the constructed benchmarks with various visual representations, including vector representations, patch representations, and object slots. The experiments demonstrate the tradeoffs between extrapolation abilities and the compositionality degree of the visual representations.\n\nSTRENGTHS:\n1. The paper constructs three benchmarks to test the compositional generalization on visual analogy-making, including 3D shapes, BitMoji Faces, and CLEVR.\n\n2. The paper conducts experiments using various visual representations, including vector representations, patch representations, and object slots, and provides insights into the impact of the compositionality degree of the visual representations on compositional generalization. The results demonstrate the effectiveness of the object-centric representation for the compositional visual analogy-making.\n\nWEAKNESSES:\n1. The technical novelty of the proposed framework (Im-Promptu) is limited. The formulation in Section 4 is similar to visual analogy-making [1,2]. It is inappropriate to rename it as in-context learning or Im-Promptu learning, if there is no fundamental difference. Section 5 lists several model variants for visual analogy-making by composing existing modules. It is unclear what is the paper's contribution to the methodology.\n\n2. The constructed benchmarks are all synthetic domains with little variance. This is a weakness considering that previous works [2,3] have already studied similar tasks using natural images.\n\n3. The experimental results are inadequate. The authors only evaluated the proposed framework on the self-constructed benchmarks, while previous works [1,2,3] have introduced several benchmarks for visual analogy-making. It is unclear whether the proposed framework generalizes to other realistic benchmarks.\n\n4. The paper lacks reference to important related works [2,3].\n\n[1] Reed, Scott E., et al. \"Deep visual analogy-making.\" Advances in neural information processing systems 28 (2015).\n\n[2] Sadeghi, Fereshteh, C. Lawrence Zitnick, and Ali Farhadi. \"Visalogy: Answering visual analogy questions.\" Advances in Neural Information Processing Systems 28 (2015).\n\n[3] Bar, Amir, et al. \"Visual prompting via image inpainting.\" Advances in Neural Information Processing Systems 35 (2022): 25005-25017.\n\nQUESTIONS:\n1. What is the fundamental difference between the proposed Im-Promptu learning in Section 4 and visual analogy-making?\n\n2. What is the main technical contribution of this paper?\n\n3. The method of this paper works better on spatially consistent datasets, so how to reflect the statement \"produces a more generalized composition beyond spatial relations\" in the paper?\n\n4. Why are there some results with lower MSE and higher FID?\n\nLIMITATIONS:\nThe authors do not discuss the limitations of the proposed method.", "TITLE": "Official Review", "RECOMMENDATION": 4, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 2, "DATE": "2023-07-26"}