SlowGuess/NeurIPS_2023_OCR huggingface dataset:
2We can view this as first editing the centered representation  $\bar{s}$  ..  $\bar{s}_{\mathrm{edit}}(y)\gets (\mathbb{I} - \mathrm{proj}_Z(y))\bar{s}[x_0](y)+$ $\operatorname {proj}_Z(y)\bar{s} [\tilde{x} ](y)$  . Then add the same baseline on both sides.
(a) dog vs. cat
(b) beach vs. forest
(c) formal clothes vs. casual clothes
(d) boy vs. old man
(e) smiling vs. gloomy
Figure 2: Binary concepts (e.g. dog-vs-cat, smiling-vs-gloomy) correspond to subspaces, and can be easily manipulated with concept algebra.
(f) sunny vs. rainy
Following this result, we might take the spanning prompts for style to be  $x_0 =$  "a mathematician in Art Deco style",  $x_1 =$  "a mathematician in Impressionist style", etc. Each of these prompts elicit a fixed distribution  $Q_W$  over the content, but varies the distribution  $Q_Z$  over style. If style is composed of finer-grained attributes, a relatively small set of such of prompts will suffice.
We have formalized what it means for concepts to correspond to subspaces of the representation space, and derived a procedure for identifying and editing the subspaces corresponding to particular concepts in the score representation. We now work through some examples testing if this subspace structure does indeed exist, and whether it enables manipulation of concepts.
Many concepts are represented as subspaces First, we check whether the subspace structure does indeed exist. To this end, we generate randomly selected prompts—e.g., "a black dog sitting on the beach"—and attempt to change binary concepts expressed in the prompt. For example, we change the subject to be a cat by manipulating the concept dog—vs—cat with concept algebra. This, and other examples, are shown in fig. 2. It is clear that we are able to manipulate the target concept—providing evidence that these concepts are represented as subspaces.
Concept Algebra can disentangle hard-to-separate concepts We stress-test concept algebra by using it to sample images expressing combinations of concepts that occur rarely in the training data. Specifically, we look at unlikely subject/style combinations—e.g., "A nuclear power plant in Baroque painting". We accomplish this by taking a base prompt that generates a high-quality image, but with the wrong style (e.g., "A nuclear power plant"). Then we use concept algebra to edit the style. We compare this with directly prompting the model, and with concept composition [e.g., Du+21; Liu+21]. The later is a method that adds on a score representation of the style to the base prompt (without projecting on to a target subspace).
We used each of the three methods to sample images expressing to 49 anti-correlated content/style pairs. Human raters were then presented with the outcomes alongside reference images, and asked to rank them based on adherence to the desired style and content. This evaluation was replicated across 10 different raters. Refer to fig. 3 for illustrative examples. Raters consistently favored images produced by concept algebra, as highlighted in table 1. This aligns with our theory, suggesting concept algebra's adeptness in retaining content while altering style. See appendix C for further details.
Figure 3: Concept algebra is considered more faithful than other methods. Raters are shown rows of images and rank method outputs by how well they produce target style while preserving content. Each row has style-reference (leftmost), a content-reference (2nd from left), and left-to-right (here, but randomly permuted in the survey) images generated from concept-algebra, composition and direct prompting. Quantative results are in table 1.
Direct Prompting	Concept Composition	Concept Algebra	All Bad
Average Proportion	0.162	0.164	0.476	0.198
Standard Error	0.017	0.017	0.023	0.018
Table 1: Raters find concept algebra is more faithful to content and style than direct prompting or concept composition
Mixture concept distributions Next, our theory predicts that we can use concept algebra to sample from mixture (non-degenerate) distributions over concept values. Consider sex. Figure 1a shows that  $x =$  "a portrait of a mathematician" almost always generates pictures of men. In fig. 1b we sample from the distribution induced by
$$
s _ {\mathrm {e d i t}} \leftarrow (\mathbb {I} - \operatorname {p r o j} _ {\mathrm {s e x}}) s [ \mathrm {x} ] + \operatorname {p r o j} _ {\mathrm {s e x}} s [ \text {" p e r s o n "} ], \tag {15}
$$
and observe that we indeed get a mixture distribution (induced by "person") over sex.
Non-prompted edits to the subspace edit the concept Concept algebra uses reference prompts (e.g., "woman" or "person") to set the target concept distribution. It's natural to ask what happens if we make an edit to a concept subspace that does not correspond to a reference prompt. In fig. 4, we sample from
$$
s _ {\mathrm {e d i t}} \leftarrow (\mathbb {I} - \operatorname {p r o j} _ {\mathrm {s e x}}) s [ \mathrm {x} ] + \operatorname {p r o j} _ {\mathrm {s e x}} \left(\frac {1}{2} s [ " a \text {m a l e n u r s e}" ] + \frac {1}{2} s [ " a \text {f e m a l e n u r s e}" ]\right). \tag {16}
$$
The representation vector  $\frac{1}{2} s["a male nurse"] + \frac{1}{2} s["a female nurse"]$  need not correspond to any English prompt. We observe that modifications on the subspace still affect just the sex concept though—the samples are androgynous figures!
Mask as a Concept Finally, we consider a more abstract kind of concept motivated by the following problem. Suppose we have several photographs of a particular toy, and we want to generate an image of this toy in front of the Eiffel Tower. In principle, we can do this by fine-tuning the model (e.g., with dreambooth) to associate a new token (e.g., "sks toy") with the toy. Then, we can generate the image by conditioning on the prompt "a sks toy in front of the Eiffel Tower". In practice, however, this can be difficult because the fine-tuning ends up conflating the toy with the background in the demonstration images. E.g., the prompt "a sks toy in front of the Eiffel Tower" tends to generate images featuring carpet; see fig. 5b.
Intuitively, we might hope to fix this problem by finding a concept subspace that excludes background information. Given such a "subject subspace", we could mask the subject out of the image, generate the background, and then edit the subject back in. In appendix C.1 we explain how to construct such a subspace using the prompts  $x_0 =$  "a toy" and  $x_1 =$  "a soccer ball". Figure 5 shows the sampled output.
(a)  $s[$  "a portrait of a nurse]
(b)  $(\mathbb{I} - \mathrm{proj}_{\mathrm{sex}}) s[\text{"a portrait of a nurse"}]$  +projsex(  $\frac{1}{2} s[a$  female nurse  $] + \frac{1}{2} s[a$  male nurse"]
Figure 4: Elements of the  $\mathcal{R}_Z$  may not correspond to any prompt.
7 Discussion and Related Work
We introduced a framework illustrating that concepts align with subspaces of a representation space. Through this, we validated the structure of the score representation and derived a method to identify the subspace for a concept. We then demonstrated concept manipulation in a diffusion model's score representation.
Concepts as Subspaces There has been significant interest in whether and how neural representations encode high-level concepts. A substantial body of work suggests that concepts correspond to subspaces of a representation space [e.g., Mik+13; MYZ13; PSM14; GL14; Aro+15; GAM17; AH19]. Often, this work focuses on a specific representation learning approach and is either empirical or offers domain-tied theoretical analysis. For instance, in word embeddings, theories explaining observed structures depend on the unique nature of language [e.g., Aro+15; AH19]. In contrast, our paper's mathematical development is broad—we merely stipulate that the data have two views separated by a semantically meaningful space. We argue that the concepts-assubspaces structure stems from the structure of probability theory, independent of any specific architecture or algorithm.
Our work also relates to studies that assume training data arises from a specific latent variable model and demonstrate that learned representations (partially) uncover these latent variables [e.g., HM16; HM17; HST19; Khe+20; VK+21; Eas+22; Hig+18; Zim+21]. This literature often aims for "disentangled" representations where each latent space dimension matches a single latent factor. Unlike these, we don't presuppose a finite set of latent factors driving the data.
Instead, our representations define probability distributions over latent concepts, not merely recovering them. This non-determinism, as observed, is generally necessary.
Controlling Diffusion Models To demonstrate the concept-as-subspace structure, we developed a method for identifying the subspace corresponding to a given concept and showed how to manipulate concepts in the score representation of a diffusion model. We emphasize that our contribution here is not the manipulation procedure itself, but rather the mathematical framework that makes this procedure possible. In particular, the requirement to manipulate entire score functions is somewhat burdensome computationally. However, the ability to precisely manipulate individual concepts is clearly a useful tool, and it is an intriguing direction for future work to develop more efficient procedures for doing so. We conclude by surveying connections to existing work on controlling diffusion models.
One idea has been to take the bottleneck layer of UNet as a representation space and control the model by manipulating this space [KJU22; Haa+23; Par+23]. This work does not consider text controlled models. It would be intriguing to understand the connection to the score-representation view, as moving from manipulation of the score to manipulation of the bottleneck layer would be a large computational saving.
(a)  $s[[a$  toy in front of the Eiffel Tower]
(b)  $s_{\mathrm{dreambooth}}$  [a sks toy in front of the Eiffel Tower]
(c)  $(\mathbb{I} - \mathrm{proj}_{\mathrm{subject}}) s[\text{"a toy in front of the Eiffel Tower}]$
+projsubject  $s_{\mathrm{dreambooth}}$  [a sks toy in front of the Eiffel Tower]
Figure 5: We can manipulate abstract concepts such as 'subject' of the image
Concept algebra can be seen as providing a unifying mathematical view on several methods that manipulate the score function [e.g., Du+21; Liu+21; NBP22; Ano23]. Du et al. [DLM20] and Liu et al. [Liu+22] manipulate concepts via adding and subtracting scores. Negative prompting is a widely-used engineering trick that 'subtracts off' a prompt expressing unwanted concepts. In section 6 and appendix D we compared against these heuristics and show that concept algebra is more effective at manipulating concepts in isolation. Couairon et al. [Cou+22] use score differences to identify objects' locations in images; this inspired our approach in section 6 and appendix C.1. In each case, we have seen that this kind of manipulation may be viewed as editing the subspace corresponding to some concept.
This work is supported by ONR grant N00014-23-1-2591 and Open Philanthropy.
A Concept Algebra Algorithms in Diffusion Model
Text-to-image Diffusion Models use score representations in their generation. More specifically, suppose the target is to sample  $Y = Y_0 \sim P^*$ , with the corresponding score function denoted as  $s_0$ . The key ingredients for generation are the score function for  $Y_t$  (denoted as  $s_t$ ), which is  $Y$  noised at different levels, (e.g.  $Y_t = (1 - \alpha_t)Y + \alpha_t\epsilon_t$  for standard independent Gaussian noise  $\epsilon$ ), for  $t = 0, \dots, T$ . See [Luo22] for more details. To apply our results, we require causal separability with respect to  $\mathcal{X}, \mathcal{W}$  holds for all  $Y_t, t = 0, \dots, T$ . Then our theoretical results follow through.
Algorithm 1 is an implementation of Concept Manipulation through Projection based on DDPM [HJA20] (we can also implement different variants). It requires FindSubspaceMethod, for which we can use FindSubspaceBasis(algorithm 2) and FindSubspaceMask(algorithm 3) based on the properties of  $\mathcal{Z}$  as discussed in the main text. More specifically,
FindSubspaceBasis We calculate the projection matrix (denoted as  $\Pi_Z$ ) for the  $Z$ -subspace, from a span of  $K$  prompts (after subtracting off the baseline) (algorithm 2). In practical computations, we evaluate the  $m \times K$  matrix  $\triangle E$ :
$$
\Delta E := \left[ \epsilon_ {\theta} \left(y _ {t}, t \mid x _ {1}\right) - \epsilon_ {\theta} \left(y _ {t}, t \mid x _ {0}\right), \dots , \epsilon_ {\theta} \left(y _ {t}, t \mid x _ {K}\right) - \epsilon_ {\theta} \left(y _ {t}, t \mid x _ {0}\right) \right]
$$
Then, the top  $K_{\mathrm{thres}}$  left singular vectors are selected as  $Q$ . Here,  $K_{\mathrm{thres}}$  denotes the least number of factors required to surpass a certain proportion of variance explained, denoted as thres. Consequently, we have  $\Pi_z \gets QQ^T$ .
FindSubspaceMask In this context,  $\Pi_Z$  signifies a mask. This mask can be calculated from the score difference  $\triangle \epsilon$  (refer to algorithm 3). As a practical measure, we may implement noise reduction techniques to fine-tune  $\triangle \epsilon$ . One approach is the application of a Gaussian blur to smooth out neighboring pixels.
Algorithm 1 Concept Manipulation through Projection
1: Require Diffusion model  $\epsilon_{\theta}(y_t,t|x)$  , guidance scale  $w$  , covariance matrix  $\sigma_t^2 I$  empty prompt", prompts:  $x_{\mathrm{orig}},x_{\mathrm{new}}$  prompts to build the Z subspace:  $\{x_i\}$  the function for finding the Z subspace: FindSubspaceMethod(,)   
2: Initialize sample  $y_{T}\sim \mathcal{N}(\mathbf{0},I)$    
3: for  $t = T,\ldots ,1$  do   
4:  $\epsilon_{\mathrm{empty}}\gets \epsilon_{\theta}(y_t,t|\text{"})$  # unconditional score   
5:  $\epsilon_{\mathrm{orig}},\epsilon_{\mathrm{new}}\gets \epsilon_{\theta}(y_t,t|x_{\mathrm{orig}}),\epsilon_{\theta}(y_t,t|x_{\mathrm{new}})\#$  conditional scores   
6:  $\Pi_Z\gets$  FindSubspaceMethod(yt,{xi}) # find the projection matrix   
7:  $\epsilon_{\mathrm{cond}}\gets (\mathbb{I} - \Pi_Z)\epsilon_{\mathrm{orig}} + \Pi_Z\epsilon_{\mathrm{new}}$  # concept projection   
8:  $\epsilon \gets \epsilon_0 + w(\epsilon_{\mathrm{cond}} - \epsilon_0)$  # apply classifier-free guidance   
9:  $y_{t - 1}\sim \mathcal{N}\bigl (y_t - \epsilon ,\sigma_t^2 I\bigr)$    
10: end for
Algorithm 2 FindSubspaceBasis
Require:  $y_{t}\in \mathbb{R}^{m}$  , prompts  $\{x_{k}\}_{k = 0}^{K}$    
1:  $\hat{\mathcal{R}}_Z(y)\gets \mathrm{span}(\{\epsilon_\theta (y_t,t\mid x_k) - \epsilon_\theta (y_t,t\mid x_0)\}_{k = 1}^K)$    
2: Determine  $\Pi_Z$  as the projection matrix onto  $\hat{\mathcal{R}}_Z(y)$    
3: return  $\Pi_Z$
Note there here we use residual  $\epsilon_{\theta}(y_t,t\mid x)$  instead of the score  $s_{\theta}(y_t,t\mid x)$  for generation, they are equivalent up to a time-varying constant.
Algorithm 3 FindSubspaceMask
Require:  $y_{t}\in \mathbb{R}^{m}$  , a pair of prompts  $(x_{1},x_{2})$  1:  $\triangle \epsilon \gets \epsilon_{\theta}(y_t,t\mid x_1) - \epsilon_{\theta}(y_t,t\mid x_2)$  2: for  $i = 1$  to m do 3:  $m_{i}\leftarrow \triangle \epsilon_{i}\neq 0?1:0$  4: end for 5:  $\Pi_Z\gets \mathrm{diag}(m_1,m_2,\dots,m_m)$  6: return  $\Pi_Z$
Proof. By assumption in Theorem 3.2, we have
$$
\begin{array}{l} p (y \mid z, w) = p \left(y _ {\mathscr {Z}}, y _ {\mathscr {W}}, \xi (y) \mid z, w\right) \left| \det  \left(\frac {\partial g}{\partial y}\right) \right| \\ = p \left(y _ {\mathcal {Z}} \mid z\right) p \left(y _ {\mathcal {W}} \mid w\right) p (\xi (y)) \left| \det  \left(\frac {\partial g}{\partial y}\right) \right| \\ \end{array}
$$
$$
\begin{array}{l} p [ Q ] (y) = p \left[ Q _ {Z} \times Q _ {W} \right] (y) \\ = p _ {Z} [ Q _ {Z} ] (y) p [ Q _ {W} ] (y) p (\xi (y)) \left| \det (\frac {\partial g}{\partial y}) \right|, \\ \end{array}
$$
where  $p_Z[Q_Z](y) = \int p(y_{\mathcal{Z}}|z)Q_Z(z)\mathrm{d}z$  and  $p_W[Q_W](y) = \int p(y_{\mathcal{W}}|z)Q_W(w)\mathrm{d}w$ .
Then, taking the log-derivative with respect to  $y$ , we get its score function as follows:
$$
s \left[ Q _ {Z} \times Q _ {W} \right] (y) = s _ {Z} \left[ Q _ {Z} \right] (y) + s _ {W} \left[ Q _ {W} \right] (y) + s _ {0} (y) \tag {17}
$$
where  $s_Z(y)$  and  $s_W(y)$  are  $p_Z[Q_Z](y)'s$  and  $p_W[Q_W](y)'s$  score functions, and  $s_0(y) := \nabla_y \log \left( p(\xi(y)) \left| \det \left( \frac{\partial g}{\partial y} \right) \right| \right)$ . So the centered-score is
$$
\bar {s} \left[ Q _ {Z} \times Q _ {W} \right] (y) = \left(s _ {Z} \left[ Q _ {Z} \right] (y) - s _ {Z} \left[ Q _ {Z} ^ {0} \right] (y)\right) + \left(s _ {W} \left[ Q _ {W} \right] (y) - s _ {W} \left[ Q _ {W} ^ {0} \right] (y)\right) \tag {18}
$$
where  $Q_{Z}^{0}$  and  $Q_{W}^{0}$  are the marginal distributions of  $Z$  and  $W$  of the baseline  $Q_{0}$ . Then, we can use the fact that
$$
\begin{array}{l} \mathcal {R} _ {Z} = \operatorname {s p a n} \left(\left\{\bar {s} _ {Z} \left[ Q _ {Z} \right] - \bar {s} _ {Z} \left[ Q _ {Z} ^ {0} \right]: Q _ {Z} \text {a c o n c e p t d i s t r i b u t i o n} \right\}\right) \\ = \operatorname {s p a n} \left(\left\{s _ {Z} \left[ Q _ {Z} \right] - s _ {Z} \left[ Q _ {Z} ^ {0} \right]: Q _ {Z} \text {a c o n c e p t d i s t r i b u t i o n} \right\}\right) \\ \end{array}
$$
$$
\begin{array}{l} \mathcal {R} _ {W} = \operatorname {s p a n} (\{\bar {s} _ {W} [ Q _ {W} ] - \bar {s} _ {W} [ Q _ {W} ^ {0} ]: Q _ {W} \text {a c o n c e p t d i s t r i b u t i o n} \}) \\ = \operatorname {s p a n} \left(\left\{s _ {W} \left[ Q _ {W} \right] - s _ {W} \left[ Q _ {W} ^ {0} \right]: Q _ {W} \text {a c o n c e p t d i s t r i b u t i o n} \right\}\right) \\ \end{array}
$$
Consequently, the claim follows.
Proof. By causal separability we can easily get the  $\mathcal{R}_Z(y)$  in proposition 4.1 is the same as:
$$
\mathcal {R} _ {Z} (y) = \operatorname {s p a n} \left(\left\{s _ {Z} \left[ Q _ {Z} \right] (y) - s _ {Z} \left[ Q _ {Z} ^ {0} \right] (y) \right\}: Q _ {Z} \text {a c o n c e p t d i s t r i b u t i o n}\right)
$$
The only thing left to show is that \(\mathcal{R}_Z(y)\) remains the same for whatever choice of baseline \(Q_Z^0\). But this is immediate: \(\operatorname{span}(\{s_Z[Q_Z](y) - s_Z[Q_Z^0](y): Q_Z\) a concept distribution\}) = \(\operatorname{span}(\{s_Z[Q_Z](y) - s_Z[Q_Z^1](y): Q_Z\) a concept distribution\})\) for any two baselines \(Q_Z^0\) and \(Q_Z^1\).
Proof. We denote the possible values that  $\mathcal{Z}$  can take as  $\{z_0,z_1,\ldots ,z_{L - 1}\}$ . Let  $\delta_{z_i} \coloneqq \delta_{z_i}(z)$  represent the delta function in the  $\mathcal{Z}$ -subspace, which is infinite at  $z_{i}$  and zero at all other points. For any distribution  $Q_{Z}$  over  $Z$  and any  $y\in \mathbb{R}^m$ , we can express  $s_Z[Q_Z](y)$  as a linear combination of  $s_z[\delta_{z_i}]$  in the following form:
$$
s _ {Z} \left[ Q _ {Z} \right] (y) = \sum_ {l = 0} ^ {L - 1} \pi_ {l} (y) s _ {Z} \left[ \delta_ {z _ {l}} \right] (y)
$$
Here,  $\sum_{l=0}^{L-1}\pi_l(y) = 1$ . Consider a baseline concept distribution  $Q_Z^0$  and its corresponding  $Z$ -related score  $s_Z[Q_Z^0](y) = \sum_{l=0}^{L-1}c_l(y)s_Z[\delta_{z_l}](y)$ . We can then express the difference  $s_Z[Q_Z](y) - s_Z[Q_Z^0](y)$  as:
$$
s _ {Z} [ Q _ {Z} ] (y) - s _ {Z} [ Q _ {Z} ^ {0} ] (y) = \sum_ {l = 1} ^ {L - 1} \omega_ {l} (y) (s _ {z} [ \delta_ {z _ {l}} ] (y) - s _ {z} [ \delta_ {z _ {0}} ] (y)),
$$
where  $\omega_{l}(y) = \pi_{l}(y) - c_{l}(y)$  for  $l = 1,\dots ,L - 1$ . Consequently, we can observe that  $\mathcal{R}_Z(y)\subset$ $\mathrm{span}(\{s_z[\delta_{z_l}](y) - s_z[\delta_{z_0}](y)\}_{l = 1}^{L - 1})$ , which implies that  $\dim (\mathcal{R}_Z(y))\leq L - 1$ .
Proposition 5.2. Suppose  $\mathcal{Z}$  is composed of categorical concepts  $\{\mathcal{Z}_k\}_{k=1}^K$  each with the number of categories  $L_k$ , in the sense that  $\mathcal{Z} = \mathcal{Z}_1 \times \ldots \times \mathcal{Z}_k$ . Assume  $Y$  satisfies causal separability with respect to  $\mathcal{Z}, \mathcal{W}$ , with  $Y_{\mathcal{Z}}$  the corresponding Y-measurable variable for  $\mathcal{Z}$ . Further assume that there exists  $Y_{\mathcal{Z}}$ -measurable variables  $Y_{\mathcal{Z}_k}$  such that  $p(y_{\mathcal{Z}} \mid z) = \Pi_{k=1}^K p(y_{\mathcal{Z}_k} \mid z_k)$ . Then
Proof. By assuming that  $p(y_{\mathcal{X}} \mid z) = \prod_{k=1}^{K} p(y_{\mathcal{X}_k} \mid z_k)$ , we can easily derive the following result for any concept distribution  $Q_Z$  over  $Z$ :
$$
s _ {Z} [ Q _ {Z} ] (y) = \sum_ {k = 1} ^ {K} s _ {Z _ {k}} [ Q _ {Z _ {k}} ] (y),
$$
where  $Q_{Z_k}$  represents the concept distribution of  $\mathcal{Z}_k$  for each  $k$ , and  $s_{Z_k}[Q_{Z_k}](y) = \nabla_y\log \left(\int p(y_{\mathcal{Z}_k}\mid z_k)Q_{Z_k}(z_k)\mathrm{d}z_k\right)$ . Recall that
$$
\mathcal {R} _ {Z} (y) = \operatorname {s p a n} \left(\left\{s _ {Z} \left[ Q _ {Z} \right] (y) - s _ {Z} \left[ Q _ {Z} ^ {0} \right] (y) \right\}: Q _ {Z} \text {i s a c o n c e p t d i s t r i b u t i o n}\right),
$$
where  $Q_Z^0$  is a baseline. Importantly, it should be noted that  $\mathcal{R}_Z(y)$  is unique regardless of the choice of  $Q_Z^0$  as per proposition 4.1.
Let  $Q_{Z_k}^0$  denote the  $\mathcal{Z}_k$ -related part of  $Q_Z^0$  for  $k = 1, \ldots, K$ . We define  $\mathcal{R}_{Z_k}(y) := \operatorname{span}(\{s_{Z_k}[Q_{Z_k}](y) - s_{Z_k}[Q_{Z_k}^0](y)\})$ . Then, we can state that:
$$
\mathcal {R} _ {Z} (y) \subset \sum_ {k = 1} ^ {K} \mathcal {R} _ {Z _ {k}} (y).
$$
Based on proposition 5.1, it follows that  $\dim (\mathcal{R}_{Z_k}(y))\leq L_k - 1$  for each  $k$ . Hence, we can conclude that:
$$
\dim (\mathcal {R} _ {Z} (y)) \leq \sum_ {k = 1} ^ {K} (L _ {k} - 1).
$$
C Experiment Details and More Figures
C.1 Concept projection for Dreambooth (Figure 5)
First, we fine-tune the diffusion model using Dreambooth, applying a learning rate of  $5e^{-6}$  and setting the number of steps to 800. While there are configurations that could yield a less overfitted model, we intentionally opt for these parameters to generate an overfitted model. Our aim is to verify if it's possible to disentangle the overfitted model by using concept manipulation via projection.
To generate images depicting a sks toy in front of the Eiffel Tower, we utilize our Dreambooth fine-tuned diffusion model together with the original pretrained Stable Diffusion model. Only for the new prompt,  $x_{\mathrm{new}} =$  a sks toy", we use the score function from the Dreambooth fine-tuned model. All other prompts are plugged into the score functions from the original pretrained Stable Diffusion model. To create the desired images, we construct a projector using a pair of prompts:  $(x_1,x_2) =$  ("a toy", "a soccer ball"). The mask, computed using algorithm 3 with the threshold  $= 0.1$ , helps identify specific areas corresponding to the location of the subject. Then, we use the Dreambooth score function  $s_{\mathrm{dreambooth}}$  (a sks toy") to guide the generation process within the masked region (areas with value 1), while using  $s$  (a toy in front of the Eiffel Tower) to guide the generation outside the mask (areas with value 0).
To ensure image fidelity, we exclusively employ the score function  $s_{\text{dreambooth}}$  ("a sks toy") for guiding the denoising process for the last 6% of the denoising steps.
It is important to note that due to severe overfitting issues with the fine-tuned model, there is no significant difference between using either the prompt "a sks toy" or "a sks toy in front of the Eiffel Tower" for the fine-tuned model. Also, due to the same reason, we apply the original pretrained diffusion model for all score functions except for the sks toy related one.
C.2 The mathematician example (Figure 1)
Our starting point is an original prompt  $x_{\mathrm{orig}} =$  "a portrait of a mathematician". Our objective is to modify the sex and style using concept projection:
To adjust sex, we formulate a corresponding direction using a pair of prompts  $(x_{1}, x_{2}) =$  ("a man", "a woman"). Subsequently, we set  $x_{\mathrm{new}} =$  "a person".