Title: Parts of Speech–Grounded Subspaces in Vision-Language Models
Venue: NeurIPS 2023
Accepted: yes
Keywords: generative models

text-to-image

vision-language models

interpretability
Abstract: Latent image representations arising from vision-language models have proved immensely useful for a variety of downstream tasks. However, their utility is limited by their entanglement with respect to different visual attributes. For instance, recent work has shown that CLIP image representations are often biased toward specific visual properties (such as objects or actions) in an unpredictable manner. In this paper, we propose to separate representations of the different visual modalities in CLIP’s joint vision-language space by leveraging the association between parts of speech and specific visual modes of variation (e.g. nouns relate to objects, adjectives describe appearance). This is achieved by formulating an appropriate component analysis model that learns subspaces capturing variability corresponding to a specific part of speech, while jointly minimising variability to the rest. Such a subspace yields disentangled representations of the different visual properties of an image or text in closed form while respecting the underlying geometry of the manifold on which the representations lie. What’s more, we show the proposed model additionally facilitates learning subspaces corresponding to specific visual appearances (e.g. artists’ painting styles), which enables the selective removal of entire visual themes from CLIP-based text-to-image synthesis. We validate the model both qualitatively, by visualising the subspace projections with a text-to-image model and by preventing the imitation of artists’ styles, and quantitatively, through class invariance metrics and improvements to baseline zero-shot classification.

Parts of Speech-Grounded Subspaces in Vision-Language Models

Abstract

Latent image representations arising from vision-language models have proved immensely useful for a variety of downstream tasks. However, their utility is limited by their entanglement with respect to different visual attributes. For instance, recent work has shown that CLIP image representations are often biased towards specific visual properties (such as objects or actions ) in an unpredictable manner. In this paper, we propose to separate representations of the different visual modalities in CLIP's joint vision-language space by leveraging the association between parts of speech and specific visual modes of variation (e.g. nouns relate to objects, adjectives describe appearance). This is achieved by formulating an appropriate component analysis model that learns subspaces capturing variability corresponding to a specific part of speech, while jointly minimising variability to the rest. Such a subspace yields disentangled representations of the different visual properties of an image or text in closed form while respecting the underlying geometry of the manifold on which the representations lie. What's more, we show the proposed model additionally facilitates learning subspaces corresponding to specific visual appearances (e.g. artists' painting styles), which enables the selective removal of entire visual themes from CLIP-based text-to-image synthesis. We validate the model both qualitatively, by visualising the subspace projections with a text-to-image model and by preventing the imitation of artists' styles, and quantitatively, through class invariance metrics and improvements to baseline zero-shot classification.

1 Introduction

Many recent advances in machine learning have been driven by vision-language (VL) models' ability to learn powerful, generalisable image representations from natural language supervision [1, 2, 3]. The image features from VL models well-capture representations of many visual attributes as evidenced by the broad applicability they have found for use in downstream tasks. The image or text encoders of CLIP in particular [1] have been used for controllable image synthesis [4, 5, 6], image captioning [7, 8], and multiple other discriminative tasks [9, 10, 11]. However, modelling the many different visual modalities in a single vector representation is not without its drawbacks-recent work shows that CLIP's visual representations are often entangled . For example, Goh et al. [12] find that specific neurons fire in response to both images containing a visual concept and images of text relating to the same concept. This leaves CLIP open to vulnerabilities in the form of 'Typographic attacks'-writing another class name as text on the image can often cause CLIP to predict this class with a higher probability than that of the original image's true category. Other recent works show that CLIP's visual representations encode task-specific attributes (such as of the object or action depicted in an image) in

(a) Image-word similarity with both CLIP's embedding

and after projecting it onto the PoS subspaces.

(b) Text-to-image visualisation of the subspace disen-

tanglement of phrases with multiple visual associations.

Prompt:

original

image

an unpredictable manner, and often the embedding is biased in the prominence with which it encodes different modalities [13]. We show in Figure 1a a motivating example of this problem identified by Menon et al. [13]-the 'goldfish' noun embedding dominates the image's representation despite there being multiple additional labels which accurately describe important information about the image's contents. As a visual example, we find that CLIP encodings of text prompts containing 'visually polysemous' [14] phrases of artists' names lead CLIP-based text-to-image models [15] to synthesize an unpredictable combination of both images of the artists and of artworks in their signature styles (as shown in Figure 1b). Multiple visual associations of the text prompt, including both the appearance of the artist themselves and the style of their artwork, are entangled in the same CLIP embedding. For VL representations to make for useful image features, it's vital that the particular modalities of interest are indeed well-represented in the embedding. One popular means to this end is fine-tuning the representations for specific downstream tasks [9]. However, this not only requires additional computation but makes the restrictive assumption of the existence of labelled data for each task.

In this paper, we address the problem of better disentangling the modes of visual variation in CLIP's shared vision-language space. In particular, we ask the question: do there exist subspaces in CLIP's joint VL space that capture the representations of the 'content' of an image or text, that are invariant to its 'appearance'? To take the first steps towards achieving this we leverage the association between parts of speech in natural language and specific modes of visual variation: our learnt noun subspace isolates representations of the 'object' of an image or text prompt (e.g. an animal in an image, or the noun described in a sentence), and the adjective space its appearance (e.g. whether an object is shiny, or a scene is snowy). This image-text semantic similarity is instilled in the representations through CLIP's contrastive learning training objective, through which it is encouraged to learn image encodings that have large cosine similarity in the shared vision-language space with text encodings of captions describing its visual content. We show how by using example words in the parts of speech categories in the WordNet [16] database, one can extract representations of both image and text embeddings that better isolate the individual modes of visual variation. This is in contrast to the method of VL model 'prompting' [17, 18, 13], which often steers the embeddings of either only the text or image modality. We take inspiration from the related line of work that finds so-called 'interpretable directions' in latent space [19, 20, 21, 22, 23] that capture high-level semantic attributeshowever, we learn subspaces that capture variation uniquely present amongst representations of words of particular parts of speech. We achieve this by formulating an appropriate objective function which we show can be manipulated into a well-known trace maximisation problem with a fast solution given in closed form. Since the CLIP representations live on the hypersphere [24], we further propose a manifold generalisation of the subspaces [25, 26] (illustrated in Figure 2) that share the property of capturing the variance of only the desired visual attributes, yet better respect the manifold on which the data lie. Concretely, we compute the proposed component analysis in the tangent space to the sphere's intrinsic mean, which can be seen as a local approximation of the manifold [27].

The method's ability to disentangle visual modes of variation is measured both qualitatively and quantitatively. Using a popular CLIP-based text-to-image model we demonstrate visually how the learnt PoS subspaces can better separate the content from the style associated with a text prompt. We show, for example, how simply projecting onto the orthogonal complements of the noun and adjective subspaces respectively can more reliably produce images of either the artists' work, or of the artists themselves, as shown in rows 2 and 3 of Figure 1b. We find removing a CLIP representations' adjective space component to be remarkably effective for preventing the visual imitation of artists' styles in this new class of CLIP-based text-to-image models [15], addressing societal concerns of the technology. Further, we show our objective additionally facilitates learning subspaces corresponding to more specific visual appearances (e.g. 'gory'). Projections onto the orthogonal complements of such subspaces consequently remove entire visual themes from text-to-image models, whilst preserving existing concepts through the PoS guidance.

Finally, we validate the subspaces' ability to isolate visual modes of variation quantitatively through a measure of class invariance (comparing to two existing baselines), and by showing how the baseline zero-shot classification protocol in the learnt subspaces leads to higher accuracies on the ViT-B-32 CLIP model on 14 / 15 datasets considered. Our contributions can be summarised as follows:

We present a method for learning geometry-aware subspaces in CLIP's shared visionlanguage space that disentangle representations of the content in an image or text prompt from the way it looks, using parts of speech as supervision. To the best of our knowledge, we are the first to use the semantic relationship between parts of speech and specific visual modes of variation to disentangle CLIP's shared vision-language space.

We formulate and solve an appropriate trace maximisation problem that admits a fast closed-form solution respecting the manifold on which the data lie.

We validate our method's success at disentangling the visual modes of variation both quantitatively and qualitatively: by visually separating a text prompt's 'content' from its 'appearance' with text-to-image models for the former and through improved zero-shot classification in the submanifolds for the latter.

We show the model's ability to further learn subspaces of more specific appearance-based variation (e.g. artists' styles), providing a way of erasing entire visual themes from CLIPbased text-to-image models.

2 Method

We first recall the basics of CLIP. We then motivate and introduce our objective function for learning parts of speech-specific linear subspaces in Section 2.1, and detail its closed-form solution in Section 2.1.1. Finally, in Section 2.2 we show how to learn subspaces of the tangent space to the CLIP VL hypersphere's intrinsic mean, which better respects the geometry of the manifold on which the CLIP representations lie.

CLIP preliminaries Pre-trained image and text encoders map images and text respectively to latent representations z I , z T ∈ R d in a shared 'vision-language' (VL) space [1]. For test-time zero-shot classification, candidate text prompts are first encoded with the text encoder. Then, the cosine similarity between an encoded image representation of interest and the text candidates is computed with S ( z T , z I ) = z T ⊤ z I / ( || z T || · || z I || ) , after which the softmax function is applied to determine the most likely text label for the image. We now address the task of extracting representations of solely the target modes of variation in the section that follows.

2.1 Objective

We seek a lower-dimensional subspace on which to project either a text or image CLIP representation z ∈ R d to predictably isolate the desired visual mode of variation. We achieve this through natural language supervision in the form of words from the different parts of speech. Let the elements of a set C index into the relevant word class of interest (i.e. C = { N,A,V,R } for nouns, adjectives, verbs, and adverbs respectively), and X i ∈ R d × n , ∀ i ∈ C contain in their columns the CLIP encodings of n words belonging to word class i [16]. Then, for a word class i ∈ C of interest, we seek a k -dimensional subspace of R d spanned by the columns of a learnt W i ∈ R d × k in which the CLIP

representations of the words in the class of interest i have a large norm and the remaining categories' representations in C \ { i } are close to the zero vector. Intuitively, a hyperplane with this property models factors of variation that are uniquely present in representations of text that belong to a particular part of speech. We quantify this by formulating the following objective function:

where λ ∈ [0 , 1] is a hyperparameter that controls the importance of killing the variation in the non-target categories relative to preserving the variation in the target class.

2.1.1 Closed-form solution

Imposing column orthonormality on W i not only ensures its columns span a full k -dimensional subspace, but also allows Equation (1) to be solved in closed form. Concretely, we first manipulate the objective as follows

where C i = ( (1 -λ ) X i X ⊤ i -∑ j ∈C\{ i } λ X j X ⊤ j ) . Having now reformulated our original objective in Equation (1) as a (constrained) trace maximisation problem, its solution W i is given in closed form 2 as the leading k eigenvectors of C i .

For ease of presentation, we have assumed the number of data points in each class to be equal. One can account for class imbalance straightforwardly whilst retaining a solution in closed form however: multiplying each Frobenius norm term in the original objective of Equation (1) by 1 n p (where n p is the number of columns of X p , ∀ p ∈ C ) leads to C i = ( 1 -λ n i X i X ⊤ i -∑ j ∈C\{ i } λ n j X j X ⊤ j ) in Equation (4).

Special cases To contrast the proposed objective with related decompositions, it's instructive to consider the resulting subspaces for extreme values of λ (for zero-mean data). In the limit case of λ := 0 for example, W i is given by the top principal components of the data points for one particular class i . Conversely, a value of λ := 1 gives the bottom principal components of datapoints in all other classes j ∈ C \ { i } . Thus, λ can be seen as providing a trade-off between hyperplanes well-capturing the variance of the attributes in the target class and lying near-orthogonal to the points of the remaining classes. Finally, one recovers regular PCA when C i := ∑ j ∈C 1 n j X j X ⊤ j .

2.2 From subspaces to submanifolds

Through CLIP's choice of the cosine similarity as an objective function during training, the unit-norm VL representations live on the hypersphere z I , z T ∈ S d -1 ⊂ R d [24]. However, subspace learning in the ambient Euclidean space R d does not respect the underlying geometry of the manifold on which the data lie. An orthogonal projection of a vector onto the learnt Euclidean subspaces is not guaranteed to result in a vector that remains on the sphere, even if all the input data do. Motivated by this, we extend the component analysis for linear subspaces developed in Equation (1) to geodesic submanifolds [25]. As demonstrated in Fletcher et al. [25] for PCA, an analogous approximate projection onto the geodesic submanifolds capturing the desired variances can be made by applying the exact same component analysis of Equation (1) in the tangent space T µ S d -1 ⊂ R d to the VL sphere data's intrinsic mean µ ∈ S d -1 instead. To this end, we use the so-called Logarithmic Map Log p : S d -1 →T p S d -1 , which maps points on the sphere to the tangent space at a reference point p ∈ S d -1 and its inverse, the Exponential Map Exp p : T p S d -1 → S d -1 to map points back onto the hypersphere (whose well-known definitions are provided in the supplementary material).

We can then compute the subspace of the tangent space to the intrinsic mean spanned by the columns of a ˆ W i ∈ R d × k for word class i as the leading k eigenvectors of ˆ C i = ∑ n (1 -λ ) Log µ ( x in ) Log µ ( x in ) ⊤ -∑ j ∈C\{ i } λ Log µ ( x jn ) Log µ ( x jn ) ⊤ . We have again assumed an equal number of class data points purely for ease of presentation. This whole process is visualised in Figure 2.

By projecting onto the learnt subspaces of T µ S d -1 , one can better isolate or remove the visual attributes associated with part of speech i . To isolate or kill the attributes we compute the projection onto the column space (i) or orthogonal complements (ii) respectively with

Projection onto the Euclidean subspaces can be computed using the projection matrices P i = W i W ⊤ i and P ⊥ i = I d -P i . The way in which one can extract representations relating to the visual modes of variation for the parts of speech is explored in detail in Section 3.

3 Experiments

Here we present both qualitative (Section 3.1) and quantitative (Section 3.2) experiments to validate the model's ability to disentangle the object in a CLIP text or image representation from its appearance. We henceforth use 'subspace' to refer throughout to the manifold generalisation from Section 2.2.

Implementation details For all experiments, we use the following 4 parts of speech: nouns , adjectives , verbs , and adverbs . Our labelled data points (with which we compute the closed-form solution of Equation (4)) for these parts of speech are given by the WordNet [16] database. There are a total of 112219 , 18021 , 7295 , and 3910 text-string data points from each of the categories respectively, after filtering out any word that appears in two or more parts of speech. We set λ := 1 / 2 for all experiments. For all quantitative results, we use the base CLIP ViT-B-32 model. Please see the supplementary material for ablation studies on λ and experiments on additional CLIP architectures.

3.1 Qualitative results

3.1.1 Visual disentanglement

Recent CLIP-based text-to-image models (TTIMs) learn a mapping from the CLIP embeddings to synthetic images depicting visually a text prompt [15, 29, 30]-a process that Menon et al. [13]

of

asnowy

NYC"

multicoloured penguin"

original

show is prone to also inheriting task bias. We begin in this section by following the experimental protocol of Materzynska et al. [31], using a recent popular CLIP-based TTIM [15] from LAION to demonstrate visually how our PoS subspaces can succeed in predictably isolating visual variation in the CLIP representations pertaining to either the object described in a text prompt or its appearance.

As one motivating example, we first study a curious instance of 'visually polysemous' [14] natural language phrases-terms that have multiple visual associations. In particular, we find that when prompted with artists' names, TTIMs produce both artworks in their style and images of the person themselves (e.g. the top row of Figure 3). That is to say, CLIP entangles in its representation these two dual meanings of the artists-their works' style and their physical appearance. We find that the PoS subspaces offer an intuitive way of reliably separating factors of visual variation in the representations for not just visually polysemous phrases, but also for natural language prompts more generally.

Concretely, projecting onto the orthogonal complement of the noun subspace Π ⊥ N ( z T ) successfully removes from the embedding visual information about the object/content described implicitly in a text prompt T . For example, as visualised in row 2 of Figure 3 by reliably synthesising just artwork in an artist's style, or by leaving just the snowy or multicoloured appearance-based textures. On the other hand, projecting onto the adjective subspace's orthogonal complement Π ⊥ A ( z T ) removes the visual appearances and styles associated with a text description (row 3 of Figure 3). For the visually polysemous artists' names, this isolates the representations of the artists themselves as humans-removing representations of their artwork styles. For the more complex prompts, this produces images of just the basic object described in the text prompt instead, such as the penguin or New York City. Many more examples of this visual disentanglement, details on the experimental setup, and ablation studies can be found in the supplementary material.

3.1.2 Style-blocking subspace projections

One societal concern with free-form TTIMs is their ability to produce imitation artworks copying the style of artists. Here, we show how the learnt adjective subspace can be used as is as a step towards mitigating this. To achieve this, one simply modifies the TTIM forward pass to first project the CLIP text representations onto the orthogonal complement of the adjective subspace with Π ⊥ A ( z T ) before feeding it into the image generator. We see from the results in Figure 4 that this modification indeed prevents the imitation of the visual styles of a range of artists (even with multiple forms of sentence structure in the prompt), whilst still enabling a diverse set of images to be generated nonetheless.

Visual theme subspaces Whilst successfully preventing the visual imitation of many famous artists, applying the adjective subspace projection to every text prompt's CLIP representation can restrict the ability to use adjectives to specify visual appearance. We find a further effective strategy is to build additional subspaces for more specific visual appearances (e.g. artists' painting styles). Concretely,

thestyleof

Van

Gogh

Prompt:

"A

painting

gof

Einstein"

original

Promnt:

"A

f

The

Fiffel

Promnt:

"A

m

1omam

Towerinthestyleof

thestyle"of

Lichtenstein

original

Jaita

ofahouse'

r

thestyleof

Van

Gogh

original

we embed 830 artists' names and surnames in a new matrix X i ′ and solve Equation (1) using all PoS classes in the negative summation to prevent the destruction of existing concepts. In contrast to the adjective space, projection onto the orthogonal complement of this 'artist subspace' preserves adjective-based visual descriptions whilst also successfully preventing style imitation (Figure 5a). Crucially, we highlight that for the example shown in Figure 5a, the artist's name Qi Baishi is not present in the 'training' list of example artists , suggesting the subspace has learnt a more general notion of an artist rather than simply the variation for only those artists whose names are provided as supervision.

We suggest more generally that subspaces learnt from a collection of words describing specific themes (whilst retaining variation in the PoS data through the main objective) could be useful for erasing entire visual concepts (such as NSFW imagery) from the CLIP representations. An additional example of another such custom subspace is shown in Figure 5b for removing only gory/bloody visual appearances. Not only does this offer a way to erase specific appearances in CLIP-based text-to-image models, but might also offer application in discriminative tasks, such as being able to block CLIP-based retrieval of images of sensitive nature. Please see the supplementary material for additional details, results, and visualisation of failure cases.

3.2 Quantitative results

Here we show quantitatively how the PoS-grounded subspaces can isolate the variation in the CLIP representation of either an image or text prompt. We validate this in two ways: through a class invariance metric in Section 3.2.1 and through zero-shot classification in Section 3.2.2.

Prowpt:

A

pnoto

a

hpoo29

rabbit

carcass

original

[graphic images

6 censored

D

00

the styleof Qi

Baishi

original

(a) A custom subspace for 'artistic style'.

(b) A custom subspace for gory/bloody visual themes.

(a) [25] PGA for PoS of interest.

(b)

Ours

(

λ

:= 0

.

5

).

(c) [25] PGA

⊥

for nuisance PoS.

nalised)

0.6

0.5

0.4

0.3

0.2

0.1

alised)

0.7

0.6

0.5

0.4

0.3

0.2

0.1

nalised)

0.40

0.35

0.30

0.25

0.20

0.15

3.2.1 Class invariance

We first aim to quantify the extent to which our method results in subspaces that capture variation solely in the desired part of speech. We quantify this by a class invariance metric to measure how much each class' data points are retained in the subspaces. Concretely, we compute the Frobenius norm 1 n j || ˆ W ⊤ i Y j || 2 F where each column y jn = Log µ ( x jn ) contains the CLIP embeddings in the columns of X j mapped to the tangent space, and n j is the number of data points in class j .

We compare the proposed method to two other component analyses performed in the tangent spaces. In Figure 6a we project onto a subspace learnt from only the data of the specific PoS of interest (e.g. the first row's subspace learnt through principal geodesic analysis [26]-maximising the variance for just the noun PoS data points), whilst in Figure 6c the subspace is learnt by simply minimizing the variance in the projections for the nuisance PoS classes (e.g. the first row's subspace minimizing the variance for the remaining adjective, verb, and adverbs' data points). We show the results of the proposed method with λ = 0 . 5 in Figure 6b for all combinations of parts of speech.

̸

This quantity should be as close as possible to 0 in each of Figure 6's subfigures' off-diagonals i = j and as close as possible to 1 along the figures' diagonals i = j (if the subspaces capture visual variation that is unique to a particular word class). The learnt subspaces in Figure 6b evidently exhibit this pattern of disentanglement better than the baselines; the vectors have a large norm in their labelled class and a much smaller norm in the subspaces of the other categories.

3.2.2 Zero-shot subspace classification

In this subsection, our goal is to further validate quantitatively how well our noun subspace can isolate the representations relating to the content in an image by studying the task of zero-shot image

96.3

StanfordCars

Caltech101

Food101

cifar10

cifar100

OxfordPets

Flowers102

Caltech256

stl10

MNIST

FER2013

MIT-states

ut-zap

ImageNET

DomainNET

0

50

100

Top-1 ZS Accuracy

48.7

75.7

67.4

81.2

42.8

66.2

31.6

73.7

92.3

38.5

37.5

30.8

84.9

39.4

43.6

58.6

81.9

76.3

87.9

61.4

75.2

61

81.5

29.8

44.7

45.5

87.7

57.8

50.8

classification 3 , given this is a very common application of CLIP in practice [1]. Importantly, these experiments serve as an additional way of measuring the subspaces' ability to isolate task-relevant modes of variation in the CLIP representations. With this in mind, we consider the baseline zero-shot setting [1] which computes the cosine similarity between all images in the training sets' and names of the class labels' CLIP representations. In our case, rather than computing the cosine similarity of the CLIP representations with S ( z I , z T ) we measure instead the similarity in the noun subspace with S ( Π N ( z I ) , z T ) . We hypothesise that if the noun subspace indeed better isolates the object of an image-invariant to the particular style of the image-we should expect to see improvement to the baseline image classification.

We show the Top-1 accuracies for a large variety of datasets in Table 1. We find the noun submanifold projection to lead to improved zero-shot classification on 14 / 15 of the datasets considered with CLIP ViT-B-32 , and include a comparison to the Euclidean subspaces in Figure 7 to further illustrate the benefit of the geometry-aware variant. This is without needing any prompt engineering or domain knowledge about each dataset separately, confirming that the subspaces serve the intended role of being able to isolate the visual modalities of interest automatically. For all results in this subsection, we project onto a relatively large k := 500 dimensional subspace for PCA, PGA, and the proposed method. Please see the supplementary material for results on 2 more alternative CLIP architectures.

4 Related work

Vision-language representations There has been much interest in studying the properties of the VL representations in large-scale models such as CLIP. In particular, Goh et al. [12] show that there exist neurons that fire in response to both visual representations of a concept as well as to text relating to the concept. Viewing this as a form of entanglement , Materzynska et al. [31] address this by learning a linear subspace in which written text is disentangled from its visual component. Whilst we also wish to disentangle visual concepts, we do not focus on disentangling written words from visual representations, but rather visual modalities more generally. Further, our solution is instead given in closed form and has far fewer hyperparameters to tune. In addition to disentangling written/visual concepts, a number of works explore other forms of disentanglement in multimodal models. For example, to better perform image captioning [35, 36], generation [37, 38, 39, 40, 41], or discovering compositional representations or structure [37, 38, 39, 42].

Another popular approach to learning more useful VL representations is fine-tuning; Ilharco et al. [43] use fine-tuning in combination with weight interpolation to improve results on specific tasks without affecting existing performance, whilst many other works fine-tune CLIP for specific domains such as action recognition [11], video recognition [10], image captioning [7], and more [9]. Despite the success of fine-tuning, this comes with the restrictive requirement of task-specific labels. The method of 'prompting' [44, 17, 18, 13] is one alternative approach. At a high level, this technique learns a set of parameters (either in the form of 'words' in a prompt [17, 44] or as pixels appended to an input image [18, 13]) to steer the input to produce more useful representations for specific downstream tasks. In contrast, our method disentangles the modes of variation directly in the joint

vision-language representation space-this facilitates the ability to separate semantic information in both image and text representations. Consequently, the proposed method has direct application for both discriminative tasks and CLIP text-driven generative tasks.

Component analysis Let the matrices X 1 , X 2 ∈ R d × n contain n data points of two classes in their columns. The Principal Component Analysis (PCA) [32, 45] computes the low-dimensional subspace of maximum variance as the leading eigenvectors of the empirical covariance matrix of all data points. One pertinent drawback of PCA is its unsupervised nature in disregarding the labels of the data points. Whilst one can learn class-specific subspaces via PCA on the relevant subset of data (i.e. the eigenvectors of zero-mean 1 n X 1 X ⊤ 1 ), there is nothing to prevent the remaining 'nuisance' class(es) from also having large variance in this learnt subspace. One method that provides a way to jointly maximise the variance in one class' projected embeddings whilst minimizing that of another class is the Fukunaga-Koontz transform [46, 47] (FKT). FKT learns a class 1 -specific subspace spanned by the columns of W 1 ∈ R d × k as the leading eigenvectors of ( UD -1 2 ) ⊤ X 1 X ⊤ 1 ( UD -1 2 ) , where U , D are the eigenvectors (stacked column-wise) and eigenvalues (along the diagonal) respectively of the matrix ( X 1 X ⊤ 1 + X 2 X ⊤ 2 ) . Whilst FKT also learns a subspace in which solely the target class' points have a large coefficient, the FKT operates on just two classes of interest and is more computationally expensive than the proposed method in requiring two eigendecompositions (rather than one). Another related supervised decomposition is the Fisher Discriminant Analysis (FDA) [48] which learns a subspace in which classes can be easily discriminated. Despite FDA's objective involving a similar trace maximisation form to Equation (4), the goals of FDA and the proposed objective are very different. FDA aims to minimise intra-class variation, whilst the proposed objective maximises the norm of vectors of the target class in the learnt subspaces, whilst minimising those of the remaining classes. Additionally, the proposed objective does not suffer from the same restrictively small upper bound on the dimensionality of the learnt subspace as FDA does through the low-rank of the between-scatter matrix. A comparison to the subspaces learnt with FDA, FKT, and the proposed objective is shown in the supplementary material to illustrate the differences visually.

5 Conclusion

In this paper, we have proposed a method for learning geometry-aware subspaces in CLIP's visionlanguage space that disentangle the modes of visual variation in representations of both images and text. To achieve this, we used the semantic relationship between parts of speech in natural language and specific visual modes of variation. We demonstrated the disentanglement qualitatively with a text-to-image model, showcasing the model's ability to remove visual imitation of artists' styles from synthetic images. Class invariance metrics and zero-shot classification results further validated the disentanglement quantitatively.

Limitations A common drawback of subspace learning approaches is choosing a good number of dimensions k . Our method inherits this limitation, and one must choose the appropriate value for the specific task. Despite this, the closed-form eigensolution means only a single fast computation is needed, and any desired number of eigenvectors can be used at test-time. Although the recovered subspaces show wide applicability in downstream tasks, they are not able to perfectly separate the modes of variation for every possible image and text prompt. Additionally, the PoS supervision can not help address polysemy within a particular part of speech (such as disambiguating between the bird/machine meanings of the word 'crane'). This further alludes to the promise of the custom subspaces in being able to target more specific visual concepts. Finally, often even minor changes to text-to-image models' text input or its representation produces very different output images [49]. As can be seen from our results, the subspace projection of the entire text representation similarly does not guarantee the preservation of the structure of the images generated from the 'original' prompts.

References

Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In Int. Conf. Mach. Learn. , 2021.

Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc Le, YunHsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In International Conference on Machine Learning , pages 4904-4916. PMLR, 2021.

Lu Yuan, Dongdong Chen, Yi-Ling Chen, Noel C. F. Codella, Xiyang Dai, Jianfeng Gao, Houdong Hu, Xuedong Huang, Boxin Li, Chunyuan Li, Ce Liu, Mengchen Liu, Zicheng Liu, Yumao Lu, Yu Shi, Lijuan Wang, Jianfeng Wang, Bin Xiao, Zhen Xiao, Jianwei Yang, Michael Zeng, Luowei Zhou, and Pengchuan Zhang. Florence: A new foundation model for computer vision. ArXiv , abs/2111.11432, 2021.

Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Bjorn Ommer. High-resolution image synthesis with latent diffusion models. CVPR , Jun 2022.

Katherine Crowson, Stella Biderman, Daniel Kornis, Dashiell Stander, Eric Hallahan, Louis Castricato, and Edward Raff. VQGAN-clip: Open domain image generation and editing with natural language guidance. In ECCV , pages 88-105, 2022.

Or Patashnik, Zongze Wu, Eli Shechtman, Daniel Cohen-Or, and Dani Lischinski. StyleCLIP: Text-driven manipulation of StyleGAN imagery. In ICCV , pages 2085-2094, 2021.

Ron Mokady, Amir Hertz, and Amit H Bermano. ClipCap: Clip prefix for image captioning. arXiv preprint arXiv:2111.09734 , 2021.

Yixuan Su, Tian Lan, Yahui Liu, Fangyu Liu, Dani Yogatama, Yan Wang, Lingpeng Kong, and Nigel Collier. Language models can see: Plugging visual controls in text generation. ArXiv , abs/2205.02655, 2022.

Sheng Shen, Liunian Harold Li, Hao Tan, Mohit Bansal, Anna Rohrbach, Kai-Wei Chang, Zhewei Yao, and Kurt Keutzer. How much can CLIP benefit vision-and-language tasks? In ICLR , 2022.

Bolin Ni, Houwen Peng, Minghao Chen, Songyang Zhang, Gaofeng Meng, Jianlong Fu, Shiming Xiang, and Haibin Ling. Expanding language-image pretrained models for general video recognition. In ECCV , pages 1-18. Springer, 2022.

Mengmeng Wang, Jiazheng Xing, and Yong Liu. ActionCLIP: A new paradigm for video action recognition. ArXiv , abs/2109.08472, 2021.

Gabriel Goh, Nick Cammarata †, Chelsea Voss †, Shan Carter, Michael Petrov, Ludwig Schubert, Alec Radford, and Chris Olah. Multimodal neurons in artificial neural networks. Distill , 2021. doi: 10.23915/distill.00030. https://distill.pub/2021/multimodal-neurons.

Sachit Menon, Ishaan Preetam Chandratreya, and Carl Vondrick. Task bias in vision-language models. ArXiv , abs/2212.04412, 2022.

Yazhou Yao, Jian Zhang, Fumin Shen, Wankou Yang, Pu Huang, and Zhenmin Tang. Discovering and distinguishing multiple visual senses for polysemous words. In Proceedings of the AAAI Conference on Artificial Intelligence , volume 32, 2018.

Dominic Rampas, Pablo Pernias, Elea Zhong, and Marc Aubreville. Fast text-conditional discrete denoising on vector-quantized latent spaces, 2022.

George A. Miller. WordNet: A lexical database for english. Commun. ACM , 38(11):39-41, nov 1995. ISSN 0001-0782.

Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Conditional prompt learning for vision-language models. In CVPR , pages 16816-16825, 2022.

Hyojin Bahng, Ali Jahanian, Swami Sankaranarayanan, and Phillip Isola. Exploring visual prompts for adapting large-scale models. arXiv preprint arXiv:2203.17274 , 2022.

Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. ICLR , 2016.

Erik Härkönen, Aaron Hertzmann, Jaakko Lehtinen, and Sylvain Paris. GANSpace: Discovering interpretable GAN controls. NeurIPS , 33:9841-9850, 2020.

Yujun Shen and Bolei Zhou. Closed-form factorization of latent semantics in GANs. In CVPR , 2020.

Christos Tzelepis, Georgios Tzimiropoulos, and Ioannis Patras. WarpedGANSpace: Finding non-linear RBF paths in GAN latent space. In ICCV , 2021.

Yue Song, Jichao Zhang, Nicu Sebe, and Wei Wang. Householder projector for unsupervised latent semantics discovery. In ICCV , 2023.

Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere. In Int. Conf. Mach. Learn. JMLR.org, 2020.

P.T. Fletcher, Conglin Lu, S.M. Pizer, and Sarang Joshi. Principal geodesic analysis for the study of nonlinear statistics of shape. IEEE Trans. Med. Imag. , 23(8):995-1005, 2004.

P Thomas Fletcher, Conglin Lu, and Sarang Joshi. Statistics of shape via principal geodesic analysis on lie groups. In CVPR , volume 1, pages I-I, 2003.

Stefan Sommer, François Lauze, Søren Hauberg, and Mads Nielsen. Manifold valued statistics, exact principal geodesic analysis and the effect of linear approximations. In ECCV , pages 43-56. Springer, 2010.

Roger A Horn and Charles R Johnson. Matrix analysis, 2nd Ed. Cambridge university press, 2012.

Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with CLIP latents. ArXiv , abs/2204.06125, 2022.

Zihao Wang, Wei Liu, Qian He, Xin ru Wu, and Zili Yi. CLIP-GEN: Language-free training of a text-to-image generator with CLIP. ArXiv , abs/2203.00386, 2022.

Joanna Materzynska, Antonio Torralba, and David Bau. Disentangling visual and written concepts in CLIP. CVPR , pages 16389-16398, 2022.

Harold Hotelling. Analysis of a complex of statistical variables into principal components. Journal of educational psychology , 24(6):417, 1933.

Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893 , 2019.

Andrea Vedaldi. Invariant representations and learning for computer vision . PhD thesis, University of California, 2008.

Aditya Deshpande, Jyoti Aneja, Liwei Wang, Alexander G. Schwing, and David Alexander Forsyth. Fast, diverse and accurate image captioning guided by part-of-speech. CVPR , pages 10687-10696, 2018.

Shweta Mahajan and Stefan Roth. Diverse image captioning with context-object split latent spaces. NeurIPS , abs/2011.00966, 2020.

Hila Chefer, Oran Lang, Mor Geva, Volodymyr Polosukhin, Assaf Shocher, Michal Irani, Inbar Mosseri, and Lior Wolf. The hidden language of diffusion models, 2023.

Zihao Wang, Lin Gui, Jeffrey Negrea, and Victor Veitch. Concept algebra for score-based conditional model. In ICML 2023 Workshop on Structured Probabilistic Inference & Generative Modeling , 2023.

Matthew Trager, Pramuditha Perera, Luca Zancato, Alessandro Achille, Parminder Bhatia, and Stefano Soatto. Linear spaces of meanings: Compositional structures in vision-language models, 2023.

Jan Zuiderveld. Style-content disentanglement in language-image pretraining representations for zero-shot sketch-to-image synthesis, 2022.

Ian Huang, Panos Achlioptas, Tianyi Zhang, Sergei Tulyakov, Minhyuk Sung, and Leonidas Guibas. LADIS: Language disentanglement for 3D shape editing. In Findings of the Association for Computational Linguistics: EMNLP 2022 , pages 5519-5532, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022. findings-emnlp.404.

Tian Yun, Usha Bhalla, Ellie Pavlick, and Chen Sun. Do vision-language pretrained models learn composable primitive concepts? Transactions on Machine Learning Research , 2023. ISSN 2835-8856.

Gabriel Ilharco, Mitchell Wortsman, Samir Yitzhak Gadre, Shuran Song, Hannaneh Hajishirzi, Simon Kornblith, Ali Farhadi, and Ludwig Schmidt. Patching open-vocabulary models by interpolating weights. NeurIPS , 2022.

Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. IJCV , 130(9):2337-2348, 2022.

Karl Pearson. Liii. on lines and planes of closest fit to systems of points in space. The London, Edinburgh, and Dublin philosophical magazine and journal of science , 2(11):559-572, 1901.

Keinosuke Fukunaga. Introduction to statistical pattern recognition . Elsevier, 2013.

Sheng Zhang and Terence Sim. Discriminant subspace analysis: A fukunaga-koontz approach. IEEE Transactions on Pattern Analysis and Machine Intelligence , 29, 2007.

R. A. Fisher. The use of multiple measurements in taxonomic problems. Annals of Eugenics , 7 (2):179-188, 1936.

Amir Hertz, Ron Mokady, Jay Tenenbaum, Kfir Aberman, Yael Pritch, and Daniel Cohen-Or. Prompt-to-prompt image editing with cross attention control, 2022.

Mehdi Cherti, Romain Beaumont, Ross Wightman, Mitchell Wortsman, Gabriel Ilharco, Cade Gordon, Christoph Schuhmann, Ludwig Schmidt, and Jenia Jitsev. Reproducible scaling laws for contrastive language-image learning, 2022.

Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. NeurIPS , 35:27730-27744, 2022.

Rohit Gandikota, Joanna Materzynska, Jaden Fiotto-Kaufman, and David Bau. Erasing concepts from diffusion models. arXiv preprint arXiv:2303.07345 , 2023.

Nupur Kumari, Bingliang Zhang, Sheng-Yu Wang, Eli Shechtman, Richard Zhang, and Jun-Yan Zhu. Ablating concepts in text-to-image diffusion models. arXiv preprint arXiv:2303.13516 , 2023.

A Definitions and derivations

A.1 Closed-form solution

Detailed steps for the expansion of the original objective into the trace maximisation form of the main objective are given as follows:

where C i = ( (1 -λ ) X i X ⊤ i -∑ j ∈C\{ i } λ X j X ⊤ j ) . Here we have used || X || 2 F = tr ( X ⊤ X ) and the linearity and cyclic properties of the trace.

A.2 The Logarithmic and Exponential Maps

For mapping to the hypersphere's tangent space at a reference point in the main paper, we use well-known explicit formulas. Concretely, the Logarithmic Map Log p : S d -1 → T p S d -1 , which maps points on the sphere to the tangent space at a reference point p ∈ S d -1 is defined as

Its inverse, the Exponential Map Exp p : T p S d -1 → S d -1 mapping points back onto the sphere is given by

B Additional results

B.1 Qualitative results

Visual disentanglement Firstly, we include many more examples of the visual disentanglement with the 'adjective' and 'noun' PoS subspaces and TTIM of Rampas et al. [15] in Figures 8 and 9.

original

k=32

original

3

k=768

Prompt:

"Jackson Pollock"

k=768

Prompt:

original

Y

k=768

original

k=768

original

768

k=768

Prompt:"Aphotoof

asunny

city"

original

8

6

k=768

Prompt: "A photo of a pink croissant"

original

Visual theme removal As shown in the main paper, the adjective subspace works remarkably well for preventing the imitation of artists' styles in the CLIP-based text-to-image model Paella. However, as stated in the main paper, the adjective subspace orthogonal projection for the task of 'style blocking' is overly restrictive in also preventing the description of visual appearance with adjectives. We provide in Figure 10 some examples of this-for example, the 'stormy' and 'red' visual appearances are removed in Figure 10 after projection. On the other hand, the custom visual theme subspaces can target specific visual appearances more precisely-two examples are shown in Figure 11 (following the experimental setup outlined in Appendix D).

outszde

einstormy

weather

zn

the

forest

withred

walls

original

Prompt:

'A

photo_of

a

man

Prompt:

A

photoof

a

gruesome

covered in blood"

death

album

cover"

original

[graphic images

censored

Q0

Shok

T

+h

D

styleofVan

Gogh"

man

int

the style of Picasso

original

al

to:

5

ace

al

to:

2

e's

5

nal

二

ent

k

Polysemy within a single part-of-speech As described in the limitations, the PoS subspaces cannot disambiguate between polysemous phrases within one particular PoS. We show in Figure 12 a proof-of-concept result suggesting that the custom visual subspaces can be a means of addressing this. In particular, we learn a custom 'animal' subspace following the same protocol in Sect. 3.1.2 of the main paper. When projecting CLIP representations of 'a photo of a crane' onto this subspace, we produce photos of the bird, rather than of machinery. Conversely, projecting the CLIP representation of 'A photo of a bass' onto this subspace's orthogonal complement removes the representation of 'bass' as a fish, synthesizing instead just images of bass guitars.

B.2 Quantitative results

Visual theme subspace invariance Here we show quantitative results for the visual theme-specific subspaces. We have evaluated this visually via text-to-image models in Figure 11, however here we wish to demonstrate that large variation in the CLIP representations directly is captured for only the themes of interest. Concretely, in Figure 13 we compute the same class invariance metric for 200 random WordNET words and random theme-specific words in the learnt custom theme subspaces through 1 200 || ( ˆ W ⊤ i Y ) || 2 F . Here, Y ∈ R d × 200 contains in its columns the CLIP word embedding mapped to the tangent space, and i denotes the specific custom visual theme of interest for a particular subfigure. As can be seen from the high magnitude in the orange bars and low magnitude of the blue bars in Figure 13, these subspaces map the 200 random other words much closer to the zero vector than the theme-specific words. This indicates the variance in just the words of interest has indeed been captured.

Random words

Theme words

0.0

0.2

0.4

0.6

0.8

1

200

||(

W

i

Y

)||

2

F

Artists' style subspace,

k

=64,

=0.5

Random words

Theme words

0.0

0.1

0.2

0.3

0.4

0.5

0.6

1

200

||(

W

i

Y

)||

2

F

Nude subspace,

k

=64,

=0.5

Random words

Theme words

0.0

0.1

0.2

0.3

0.4

1

200

||(

W

i

Y

)||

2

F

Gory subspace,

k

=64,

=0.5

Additional zero-shot classifcation We show in both Table 2 and Table 3 additional results for the baseline zero-shot classification protocol (following the exact same setup in the main paper) with the similarity metric S (Π N ( z I ) , z T ) after the noun subspace projection. As can be seen, the proposed subspace leads to improved zero-shot classification on a wide range of datasets, for multiple CLIP architectures.

C Ablation studies

C.1 Relationship to alternative component analyses

We first compare 1D subspaces learnt with our method, FDA [48], and FKT [46] shown in Figure 14 on toy data chosen to illustrate the qualitative differences in the properties of the subspaces. Given the very different goals of FDA in minimising intra-class variation, the resulting FDA subspace is near-orthogonal to that of FKT and the proposed method. Whilst the FKT-given subspace is very close to ours, for this particular illustrative toy data our subspace better kills the variance in the red data (as illustrated in Figure 14 b.iii). This figure also provides a visualisation of the learnt subspace's proximity to the principal component of the target class and the bottom principal component of the red class' datapoints-the proximity to the two extremes being controlled by λ .

0.04

0.02

0.00

0.02

0.04

0.02

0.01

0.00

0.01

0.02

0.03

0.04

0.05

(a) Learnt subspace (with

: =0.5)

z

B

z

A

PCA

A

PCA

B

FDA

FKA

Ours

4

3

2

1

0

1

2

1e

2

(b.i)  FDA

4

3

2

1

0

1

2

1e

2

(b.ii)  FKT

4

3

2

1

0

1

2

1e

2

(b.iii) Ours

C.2 Role of k

We show the impact of various choices of k (dimensionality of the subspaces) as visualised with text-to-image models in Figure 15 with the projections onto the orthogonal complements to kill the undesired variation. As can be seen, increasing k removes more and more visual information relevant to the particular visual mode. For example, we see the image feature increasingly less snow on the right, whilst increasing less of London on the left.

original

(ZT)

IA (ZT)(remove adj component)

(remove noun component)

256

ablations

768

cup

of

cranberry

juice

original

[graphic images

censored

60

>:=

0

e

入:= 0.5

C.3 Role of λ

We next provide an ablation study on the value of λ . We provide both a visual qualitative ablation and a quantitative one.

Qualitative Concretely, in each subfigure (row) of Figure 17, we take the first 5000 WordNET text strings from each part of speech and compute their CLIP text embeddings z T ∈ R d . We then calculate ˆ W ⊤ i Log µ ( z T ) , plotting the first coordinate along the x -axis and the second along the y -axis of each subfigure in Figure 17. Ideally, the data points in the target class should be the only ones with a large norm if this hyperplane captures visual variation that is unique to a particular word class. We see that λ := 0 preserves the most variance in the target class' embeddings but the different categories' projections are clearly entangled-the other classes' datapoints also have large norm. Conversely, λ := 1 . 0 maps all points effectively to the zero vector-killing the variance in all categories. As can be seen in Figure 17c, λ := 0 . 5 offers a reasonable balance of both properties in this 4-class setting. The exact same experiments are run on the larger version of CLIP, shown in Figure 18, where similar conclusions can be drawn about the practical impact of λ .

Quantitative For quantifying this in more dimensions, we compute the class invariance metric (used in the main paper) in Figure 19 and Figure 20 for various values of λ , where we observe that λ := 0 . 5 is a sensible choice for multiple CLIP architectures.

Visual subspaces Finally, we demonstrate the importance of using PoS as 'negative examples' in the summation in the main objective when learning visual theme-specific subspaces. Intuitively, whilst we want to maximise the variation for phrases of a particular theme (such as 'gory'), we also want to preserve the ability to generate other concepts with the TIIM, which is what the objective provides through the hyperparameter λ .

In particular, we show in the second row of Figure 16 the visual results when projecting onto the orthogonal complement of a 'gory' subspace learnt when we do not use the PoS as 'negative guidance' (i.e. when λ := 0 ). As can be seen in comparison to the third row of Figure 16, using the PoS is critical in this instance for retaining the ability to synthesise existing related concepts (here ensuring e.g. 'cranberry juice' can still be synthesised even though visually 'gory' appearances are removed).

0.50

0.25

0.00

0.25

0.50

w

N

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

N

T

2

Log

(

z

)

Noun-specific space,

=0.0

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

A

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

A

T

2

Log

(

z

)

Adjective-specific space,

=0.0

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

V

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

V

T

2

Log

(

z

)

Verb-specific space,

=0.0

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

R

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

R

T

2

Log

(

z

)

Adverb-specific space,

=0.0

N

A

V

AV

(a)

λ

:= 0

0.50

0.25

0.00

0.25

0.50

w

N

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

N

T

2

Log

(

z

)

Noun-specific space,

=0.25

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

A

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

A

T

2

Log

(

z

)

Adjective-specific space,

=0.25

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

V

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

V

T

2

Log

(

z

)

Verb-specific space,

=0.25

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

R

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

R

T

2

Log

(

z

)

Adverb-specific space,

=0.25

N

A

V

AV

(b)

λ

:= 0

.

25

0.50

0.25

0.00

0.25

0.50

w

N

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

N

T

2

Log

(

z

)

Noun-specific space,

=0.5

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

A

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

A

T

2

Log

(

z

)

Adjective-specific space,

=0.5

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

V

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

V

T

2

Log

(

z

)

Verb-specific space,

=0.5

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

R

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

R

T

2

Log

(

z

)

Adverb-specific space,

=0.5

N

A

V

AV

(c)

λ

:= 0

.

5

0.50

0.25

0.00

0.25

0.50

w

N

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

N

T

2

Log

(

z

)

Noun-specific space,

=0.75

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

A

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

A

T

2

Log

(

z

)

Adjective-specific space,

=0.75

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

V

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

V

T

2

Log

(

z

)

Verb-specific space,

=0.75

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

R

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

R

T

2

Log

(

z

)

Adverb-specific space,

=0.75

N

A

V

AV

(d)

λ

:= 0

.

75

0.50

0.25

0.00

0.25

0.50

w

N

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

N

T

2

Log

(

z

)

Noun-specific space,

=1.0

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

A

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

A

T

2

Log

(

z

)

Adjective-specific space,

=1.0

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

V

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

V

T

2

Log

(

z

)

Verb-specific space,

=1.0

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

R

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

R

T

2

Log

(

z

)

Adverb-specific space,

=1.0

N

A

V

AV

(e)

λ

:= 1

.

0

0.50

0.25

0.00

0.25

0.50

w

N

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

N

T

2

Log

(

z

)

Noun-specific space,

=0.0

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

A

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

A

T

2

Log

(

z

)

Adjective-specific space,

=0.0

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

V

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

V

T

2

Log

(

z

)

Verb-specific space,

=0.0

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

R

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

R

T

2

Log

(

z

)

Adverb-specific space,

=0.0

N

A

V

AV

(a)

λ

:= 0

0.50

0.25

0.00

0.25

0.50

w

N

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

N

T

2

Log

(

z

)

Noun-specific space,

=0.25

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

A

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

A

T

2

Log

(

z

)

Adjective-specific space,

=0.25

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

V

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

V

T

2

Log

(

z

)

Verb-specific space,

=0.25

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

R

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

R

T

2

Log

(

z

)

Adverb-specific space,

=0.25

N

A

V

AV

(b)

λ

:= 0

.

25

0.50

0.25

0.00

0.25

0.50

w

N

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

N

T

2

Log

(

z

)

Noun-specific space,

=0.5

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

A

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

A

T

2

Log

(

z

)

Adjective-specific space,

=0.5

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

V

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

V

T

2

Log

(

z

)

Verb-specific space,

=0.5

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

R

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

R

T

2

Log

(

z

)

Adverb-specific space,

=0.5

N

A

V

AV

(c)

λ

:= 0

.

5

0.50

0.25

0.00

0.25

0.50

w

N

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

N

T

2

Log

(

z

)

Noun-specific space,

=0.75

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

A

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

A

T

2

Log

(

z

)

Adjective-specific space,

=0.75

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

V

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

V

T

2

Log

(

z

)

Verb-specific space,

=0.75

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

R

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

R

T

2

Log

(

z

)

Adverb-specific space,

=0.75

N

A

V

AV

(d)

λ

:= 0

.

75

0.50

0.25

0.00

0.25

0.50

w

N

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

N

T

2

Log

(

z

)

Noun-specific space,

=1.0

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

A

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

A

T

2

Log

(

z

)

Adjective-specific space,

=1.0

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

V

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

V

T

2

Log

(

z

)

Verb-specific space,

=1.0

N

A

V

AV

0.50

0.25

0.00

0.25

0.50

w

R

T

1

Log

(

z

)

0.4

0.2

0.0

0.2

0.4

w

R

T

2

Log

(

z

)

Adverb-specific space,

=1.0

N

A

V

AV

(e)

λ

:= 1

.

0

Noun

Adjective

Verb

Adverb

CLIP embeddings

Y

j

in the tangent space

d

1

Noun

Adjective

Verb

Adverb

Learnt subspace

W

i

for category

i

0.41

0.23

0.21

0.15

0.31

0.28

0.24

0.18

0.29

0.25

0.28

0.17

0.28

0.26

0.25

0.21

1

nj

||(

W

i

Y

j

)||

2

F

, for

k

: =64,

: =0.0 (row normalised)

0.15

0.20

0.25

0.30

0.35

0.40

(a)

λ

:= 0

Noun

Adjective

Verb

Adverb

CLIP embeddings

Y

j

in the tangent space

d

1

Noun

Adjective

Verb

Adverb

Learnt subspace

W

i

for category

i

0.47

0.22

0.2

0.11

0.29

0.3

0.24

0.17

0.28

0.25

0.32

0.15

0.25

0.26

0.24

0.26

1

nj

||(

W

i

Y

j

)||

2

F

, for

k

: =64,

: =0.1 (row normalised)

0.15

0.20

0.25

0.30

0.35

0.40

0.45

(b)

λ

:= 0

.

1

Noun

Adjective

Verb

Adverb

CLIP embeddings

Y

j

in the tangent space

d

1

Noun

Adjective

Verb

Adverb

Learnt subspace

W

i

for category

i

0.59

0.18

0.16

0.069

0.29

0.37

0.22

0.13

0.26

0.22

0.39

0.12

0.2

0.23

0.19

0.38

1

nj

||(

W

i

Y

j

)||

2

F

, for

k

: =64,

: =0.25 (row normalised)

0.1

0.2

0.3

0.4

0.5

(c)

λ

:= 0

.

25

Noun

Adjective

Verb

Adverb

CLIP embeddings

Y

j

in the tangent space

d

1

Noun

Adjective

Verb

Adverb

Learnt subspace

W

i

for category

i

0.74

0.13

0.1

0.036

0.24

0.52

0.15

0.091

0.2

0.16

0.56

0.081

0.14

0.18

0.12

0.56

1

nj

||(

W

i

Y

j

)||

2

F

, for

k

: =64,

: =0.5 (row normalised)

0.1

0.2

0.3

0.4

0.5

0.6

0.7

(d)

λ

:= 0

.

5

Noun

Adjective

Verb

Adverb

CLIP embeddings

Y

j

in the tangent space

d

1

Noun

Adjective

Verb

Adverb

Learnt subspace

W

i

for category

i

0.84

0.081

0.061

0.022

0.39

0.29

0.2

0.11

0.28

0.16

0.47

0.093

0.17

0.14

0.11

0.58

1

nj

||(

W

i

Y

j

)||

2

F

, for

k

: =64,

: =0.75 (row normalised)

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

(e)

λ

:= 0

.

75

Noun

Adjective

Verb

Adverb

CLIP embeddings

Y

j

in the tangent space

d

1

Noun

Adjective

Verb

Adverb

Learnt subspace

W

i

for category

i

0.65

0.15

0.13

0.065

0.42

0.24

0.22

0.12

0.42

0.22

0.25

0.12

0.41

0.22

0.21

0.15

1

nj

||(

W

i

Y

j

)||

2

F

, for

k

: =64,

: =1.0 (row normalised)

0.1

0.2

0.3

0.4

0.5

0.6

(f)

λ

:= 1

.

0

Noun

Adjective

Verb

Adverb

CLIP embeddings

Y

j

in the tangent space

d

1

Noun

Adjective

Verb

Adverb

Learnt subspace

W

i

for category

i

0.44

0.22

0.19

0.15

0.29

0.28

0.24

0.19

0.27

0.25

0.3

0.19

0.25

0.26

0.25

0.25

1

nj

||(

W

i

Y

j

)||

2

F

, for

k

: =64,

: =0.0 (row normalised)

0.15

0.20

0.25

0.30

0.35

0.40

(a)

λ

:= 0

Noun

Adjective

Verb

Adverb

CLIP embeddings

Y

j

in the tangent space

d

1

Noun

Adjective

Verb

Adverb

Learnt subspace

W

i

for category

i

0.51

0.2

0.18

0.11

0.28

0.31

0.23

0.18

0.26

0.24

0.35

0.15

0.22

0.25

0.23

0.3

1

nj

||(

W

i

Y

j

)||

2

F

, for

k

: =64,

: =0.1 (row normalised)

0.15

0.20

0.25

0.30

0.35

0.40

0.45

0.50

(b)

λ

:= 0

.

1

Noun

Adjective

Verb

Adverb

CLIP embeddings

Y

j

in the tangent space

d

1

Noun

Adjective

Verb

Adverb

Learnt subspace

W

i

for category

i

0.61

0.18

0.14

0.07

0.27

0.38

0.21

0.15

0.23

0.22

0.42

0.13

0.18

0.24

0.19

0.38

1

nj

||(

W

i

Y

j

)||

2

F

, for

k

: =64,

: =0.25 (row normalised)

0.1

0.2

0.3

0.4

0.5

0.6

(c)

λ

:= 0

.

25

Noun

Adjective

Verb

Adverb

CLIP embeddings

Y

j

in the tangent space

d

1

Noun

Adjective

Verb

Adverb

Learnt subspace

W

i

for category

i

0.73

0.13

0.097

0.042

0.18

0.6

0.13

0.092

0.14

0.13

0.65

0.083

0.1

0.17

0.094

0.64

1

nj

||(

W

i

Y

j

)||

2

F

, for

k

: =64,

: =0.5 (row normalised)

0.1

0.2

0.3

0.4

0.5

0.6

0.7

(d)

λ

:= 0

.

5

Noun

Adjective

Verb

Adverb

CLIP embeddings

Y

j

in the tangent space

d

1

Noun

Adjective

Verb

Adverb

Learnt subspace

W

i

for category

i

0.84

0.077

0.057

0.025

0.15

0.71

0.082

0.052

0.062

0.058

0.83

0.053

0.053

0.09

0.046

0.81

1

nj

||(

W

i

Y

j

)||

2

F

, for

k

: =64,

: =0.75 (row normalised)

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

(e)

λ

:= 0

.

75

Noun

Adjective

Verb

Adverb

CLIP embeddings

Y

j

in the tangent space

d

1

Noun

Adjective

Verb

Adverb

Learnt subspace

W

i

for category

i

0.49

0.2

0.19

0.11

0.37

0.26

0.23

0.14

0.37

0.23

0.26

0.13

0.37

0.24

0.22

0.17

1

nj

||(

W

i

Y

j

)||

2

F

, for

k

: =64,

: =1.0 (row normalised)

0.15

0.20

0.25

0.30

0.35

0.40

0.45

(f)

λ

:= 1

.

0

D Experimental details

For reference in this section, we first include the dimensionalities of the shared VL spaces and public links to implementations used of the three CLIP models in this paper in Table 4.

Visual disentanglement The Paella TTIM [15] used in the main paper adopts the 'OpenCLIP' [50] model with a larger d = 1024 -dimensional VL representation. For all 'visual disentanglement' results throughout both the paper and supplementary material, we use k = 768 dimensional 'adjective' and 'noun' subspaces for all text prompts (apart from when removing the 'content' representations in visually polysemous phrases, where we find only k = 32 components are necessary).

Visual theme subspaces For the custom visual subspaces, we produce a list of phrases related to the visual theme of interest by asking ChatGPT [51] questions of the format: Please give me a list of 250 words and phrases related to the concept of {x} , where x is the visual concept of interest (such as 'gore'). For the case of the artist subspace, we ask: Please give me a list of 250 of the most famous painters and visual artists of all time . In each scenario, we follow up twice more asking for additional responses (given the limited response length), specifying that it tries not to repeat any of the previous answers in the list. For the experiments in the 'gory' and 'artist' custom subspaces, ChatGPT gave us 371 and 830 unique phrases respectively (taking just the provided artists' surnames as additional examples for the latter), and use a k = 128 - and k = 512 -dimensional subspace respectively (given the limited number of phrases for the gore subspace provided by ChatGPT).

Concurrent work Recent preprints [52, 53] explicitly address the task of ablating particular concepts in diffusion models specifically. However, in contrast to the proposed method, these concurrent works fine-tune Stable Diffusion-specific [4] submodules, and do not focus on the final CLIP vector representations. Thus, there is no straightforward way to compare the proposed method working in CLIP's shared vision-language space directly nor the alternative Paella [15] TIIM. One methodological benefit to [52] over the proposed method however (purely in the context of text-toimage synthesis) is in the requirement of only a single text prompt describing a concept, relative to our necessary collection 4 . On the other hand, our subspaces are learnt in closed form-for example, the 'gory' subspace takes only 0.28 seconds to compute on a V100 GPU, given the CLIP embeddings. This is in contrast to [52]'s models which are stated to require 1000 gradient descent steps to compute, and [53] taking 5 minutes per concept.

Compute time and hardware To run the Paella model, we use a 32GB NVIDIA Tesla V100 GPU. Learning the subspaces is particularly fast given the closed-form solution, taking just 1.1 seconds to compute all 4 (noun, adjective, verb, and adverb) PoS subspaces. Encoding all WordNet PoS examples with CLIP takes 28.91 minutes, however, this is a fixed cost and only needs to be done once at the beginning (after which any number of additional subspaces can be computed very quickly).

Peer reviews:
{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe paper presents an innovative solution to address the problem of polysemy within CLIP's embedding space. The authors propose a novel approach that involves decomposing CLIP embeddings into distinct subspaces, with each subspace representing a specific part of speech. This decomposition technique enables the isolation of different parts of speech within a given sentence, thereby facilitating subsequent manipulation in downstream tasks. The experimental results presented in the paper demonstrate the efficacy of the proposed approach in effectively eliminating properties associated with particular parts of speech during CLIP's text-to-image generation process.\n\nSTRENGTHS:\nThe paper presents a novel approach to decompose the embedding space of CLIP. Theoretical analysis and experimental results provide compelling evidence that the proposed approach effectively disentangles properties related to different parts of speech within the embedding space. This work is of significant value to researchers, as comprehending and manipulating the embedding space learned by deep neural networks is both crucial and challenging. Understanding the features that embeddings can represent and learning how to manipulate them is essential to the improvement of DNNs. The paper is written clearly and is well-structured.\n\nWEAKNESSES:\nWhile the paper's exploration of subspace decomposition focuses on addressing the polysemy issues associated with part of speech in CLIP embeddings, it is important to note that there are instances of polysemy that cannot be disambiguated solely based on part of speech. For example, consider the word \"crane,\" which can refer to both a bird and a machine. These instances present case-by-case ambiguities, and it remains unclear whether the proposed method can be extended to tackle such scenarios successfully as there are no universal subspaces that can disentangle all of them.\n\nQUESTIONS:\nIn the context of addressing polysemy and disambiguation, would it be more straightforward to incorporate more detailed descriptions in the prompts? Could you please elaborate on the advantages of the proposed method over using prompts with additional details?\n\nLIMITATIONS:\nYes", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 5, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2023-07-01"}

comments: SUMMARY:
The paper gives a closed-form solution to project CLIP representation of image/text into a subspace with disentangled modes. The proposed method is demonstrated qualitatively in text-to-image generation, and quantitatively by zero-shot classification.

STRENGTHS:
- The subspace projection proposed by the paper with a closed-form solution can directly be applied to models based on CLIP, without further training. 
- Qualitative results demonstrate the effectiveness in some extent.

WEAKNESSES:
- The motivation of this work is CLIP's representation is biased and unpredictable. The paper proposes to learn sub-space representations for content and appearance. There are many diffusion-based works on guided generation for controlling contents and appearances. However, the paper (claims to have wide applications in generation tasks) fails to compare to any current work on this topic.
- Limited quantitative studies, except for zero-shot classification. 

In summary, the close-form projection proposed in this paper is simple/fast and (qualitatively) effective in the some examples shown. But the paper lacks comparisons to recent works on diffusion generation with controllable contents and appearances.

QUESTIONS:
N/A

LIMITATIONS:
The limitation is discussed, but only for the dimensionality of sub-space (a hyper-parameter k), which is superficial.
TITLE: Official Review
SOUNDNESS_CORRECTNESS: 2
DATE: 2023-07-02

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe following work proposes a geometry-aware approach to identifying subspace projections within the CLIP embedding space. The projections allow one to limit the CLIP embeddings to the subspaces corresponding to individual parts of speech (noun, adj... ). This allows for more fine-grained controllability when using CLIP embeddings for downstream tasks such as text to image synthesis. Notably, the authors take into account the non-euclidean nature of CLIP embeddings (located on the surface of a hypersphere) by mapping it a specific tangent space first. Experiments demonstrate additional controllability with regards to visual style when given access to a part-of-speech partitioning of the CLIP embedding space.\n\nSTRENGTHS:\n- Principled approach to handling the non-euclidean nature of the CLIP embedding space. Personally I think this is an important topic that is often overlooked in many applied works building on top of CLIP and the recent improved VQGAN architecture, both of which employ a normalized embedding space. While the geometry-aware formulation is perhaps not the most novel contribution of this work, I believe it may serve as an important blueprint for future works relying on normalized embeddings.\n- Overall, the closed-form linear formulation of the subspace solving objective provides a low complexity but effective solution to the problem statement.\n\nWEAKNESSES:\n- As much as the geometry aware formulation is mathematically justified, it would be nice to see some sort of experiment that demonstrates a significant loss in downstream task performance or even a simple plot based analysis as in the supplementary if one were to ignore it.\n- The visualization for lambda selection in supplementary figure 11 is unclear. The plotting software clearly overlays each point cloud on top of the others. As such, it is difficult to visually confirm the spread of all the point clouds except for the last one rendered, which I believe is the yellow adverb cloud. In order to properly visualize this, I think we would have to have juxtaposed separate plots for each cloud with the same axis scaling and offset.\n- While I am aware that there are many standards for placement of related works, I think it would be best for an earlier placement before methods given the proposed formulation's close relationship to fisher discriminant analysis.\n\nQUESTIONS:\nSee weaknesses.\n\nLIMITATIONS:\nAdequately addressed.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 4, "SOUNDNESS_CORRECTNESS": 4, "DATE": "2023-07-05"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis work proposes to learn subspaces for disentangling the visual representation in the CLIP space, based on the parts of speech of the prompt. A closed form solution is presented where the norm corresponding to the embedding of word of interest has a maximum norm while the norm of the rest is minimized. Qualitative results are shown on the  CLIP-based TTIM from LAION where visual results are presented by killing on of the subspaces (noun or adjective) and quantitative through performance on a class invariance metric and through zero-shot classification. The method performs better than the prior art.\n\nSTRENGTHS:\n+ The work is very well written, clearly motivated and well presented. \n+ This is the first work which attempts to disentangle the subspaces using POS in CLIP based embedding models. \n+ The method is easy to implement with the closed-form solution. \n+ Qualitative and quantitative evaluation are performed to show the utility of POS guided subspace projection.\n\nWEAKNESSES:\n- Effect of the prompts: From the quantitative results the role of the subspaces is not clear. For example, by removing noun from \"Van Gogh\" it generates the painting. Painting is also a noun. Therefore, the distinction is not clear.\n\n- In the qualitative examples (Figure 5), the images also change and the semantics on removing one POS subspace do not guarantee that the original image's style is preserved. \n\n- It would be good to show the results with multiple samples from the given prompt on the original dataset to show if the method actually works or just picks up on the partial prompts which would also work with the baseline model.  For example, \"A mutlicolored Penguin\" and \"A penguin\" are very general prompts and they can have similar results without the subspace projection.\n\n- \"Disentanglement\" in multimodal approaches has been presented in prior work [1,2]. \n1.  Fast, Diverse and Accurate Image Captioning Guided By Part-of-Speech. CVPR 2019. \n2. Diverse image captioning with context-object split latent spaces.\n\nQUESTIONS:\n1. How would different partial prompts in the original baseline model compare with the proposed approach as pointed to in weakness?\n2. Are there insights into persevering the underlying style of the image generated from the prompt? Example removing only snow from the already generated \"snowy\" images of NYC?\n\nLIMITATIONS:\nThere is no potential negative societal impact of their work.", "TITLE": "Official Review", "RECOMMENDATION": 7, "REVIEWER_CONFIDENCE": 5, "SOUNDNESS_CORRECTNESS": 3, "DATE": "2023-07-07"}