Paper: ReFACT: Updating Text-to-Image Models by Editing the Text Encoder (ICLR-2024)

Reviewer comment (Experiments):
In my opinion, the number of negative samples $N$ is very large in contrastive loss. Could the authors provide ablation experiments on this hyperparameter?

Author response:
We thank you for your comments and for striving to improve our work.

2. Regarding the amount of negative examples (now referred to as “contrastive examples” to distinguish from negative prompts in the test set) - using zero negative samples reduces to the direct optimization approach, which we discuss in Appendix A. As we mentioned, this variation was much less effective than the contrastive approach, i.e. an approach that does utilize negative examples. We ablated over the amount of negative examples and found 20 to be a reasonable number, far less than typically used in contrastive learning approaches [1, 2, 3]. We note that the negative prompts are not method specific as they are taken from the MS-COCO dataset. Moreover, the negative prompts are not specific to each of the editing cases, meaning that the same prompts are used throughout all of the editing cases we present in the paper.

Thank you for your feedback!

For Response 2: We tested 5 different values for the number of negative samples  - 0, 15, 20, 30, 50 (in practice, each experiment includes N+1 negative samples, as the source prompt is added [e.g., “Donald Trump”]). We provide the full results below:

| N  | Efficacy | Generalization | Specificity | F1 (Gen, Spec) |
|----|----------|----------------|-------------|----------|
|  0 |   99.5   |       71       |     90.3    |   79.50  |
| 15 |    100   |      80.4      |     86.8    |   83.48  |
| 20 |    97    |      81.5      |     86.7    |   84.02  |
| 30 |    100   |      80.9      |      87     |   83.84  |
| 50 |    100   |      80.8      |     87.1    |   83.83  |

Reviewer comment (Evaluation):
The proposed method may not be very effective in real-world scenarios, since each mistaken concept requires feedback from human and additional fine-tuning. Furthermore, it cannot handle with unseen visual concepts, either.

Author response:
We thank you for your comments and for striving to improve our work.

3. We would like to clarify that ReFACT  does not perform fine-tuning. Given k* and v*, ReFACT uses a closed-form solution to edit the specific layer weights. 

4. We argue that currently - the alternative to editing for correcting outdated associations is to re-train the entire model, which requires far more resources. Our method is aimed for model providers and developers. As such, model providers that are aware of something that changed in the world (e.g., a new president is elected in the US), can use ReFACT to keep their model up-to-date, and avoid costly retraining and data curation. For example, without our editing approach, one would need to remove all photos of Donald Trump with descriptions of “the president of the US”, or similar, from the training data, and perform full training from scratch. With editing, only a description of the fact to edit is required in the form of an editing prompt (e.g., “The President of the United States”), a source prompt (e.g., “Donald Trump”) and a target prompt (e.g., “Joe Biden”).

5. As for unseen visual concepts - we discuss in section 7 the combination of personalization methods with ReFACT to achieve editing with novel entities and demonstrate a proof-of-concept in appendix I.

Reviewer comment (Experiments):
The method carefully selects the positive and negative prompts to update the representation layer to change the knowledge. The main problem is the selection process. The objective may overfit the prompt and may not perform well in other cases. For instance, the second rows in figure 1 show good results of the positive prompt in figure 3, but it is unclear what would happen to other unshown prompts. For example, can we generate "prince of wales is drinking coffee" if the sentence is not seen by the model? This result is necessary for the approach; otherwise, we might just choose to add an oracle description "William" to generate images rather than fine-tuning the model.

Author response:
Thank you for your review and for taking the time to improve our work.

1. As for the positive and negative prompts - during editing, only three prompts are used: the editing prompt (e.g., “The Prince of Wales”), the source prompt (e.g., “Prince Charles”) and the target prompt (e.g., “Prince William”). To edit the model weights, we embed the given editing prompt into different prompt templates (e.g., “A photo of the President of Wales”) and get k*. To calculate v*, we use negative examples (prompts) from the MS-COCO dataset. During evaluation, we use a completely different set of negative prompts. Thus, a prompt like “The Prince of Wales drinking coffee” is completely unseen. Given this prompt, the model edited by our method generates correct images, containing Prince William. Further examples are shown in Figure 17, which we added to the paper.  Additionally, we have updated the paper and clarified  the terminology by now referring to the negative examples used for editing as “contrastive examples” and distinguishing them from the “negative prompts” which are a part of the dataset,  to avoid confusion. 

2. The main results in the paper refer to the case of a single edit. In this case, a new “clean” pre-trained stable-diffusion instance is edited, and used to generate the images for evaluation. Using ReFACT to perform multiple edits, i.e. editing several associations on the same instance of the model is possible and discussed in section 5.4 and appendix H. 

3. The FID and CLIP scores are indeed calculated on the MS-COCO dataset as is standard practice [1, 2, 3, 4] and as described in the last paragraph in section 4.3. 

We hope our response addressed your concerns and would be happy to provide any further clarifications. If our response is satisfactory, would you consider increasing your score?

[1] Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Bjorn Ommer. High-resolution image synthesis with latent diffusion models. 

[2] Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Raphael Gontijo-Lopes, Burcu Karagol Ayan, Tim Salimans, Jonathan Ho, David J. Fleet, and Mohammad Norouzi. Photorealistic text-to-image diffusion models with deep language understanding.

[3] Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. 

[4] Yogesh Balaji, Seungjun Nah, Xun Huang, Arash Vahdat, Jiaming Song, Karsten Kreis, Miika Aittala, Timo Aila, Samuli Laine, Bryan Catanzaro, et al. eDiff-I: Text-to-image diffusion models with an ensemble of expert denoisers

Reviewer comment (Reproducibility):
When performing evaluation on ROADS or TIME datasets, it is unclear whether the text-encoder is updated every time a new image is presented to the model, or whether the original model is copied and fine-tuned for each concept. In addition, although the authors show that the FID and CLIP scores are almost identical to the baseline model on the new datasets, it is necessary to include the FID and CLIP results on some benchmark text-to-image datasets to show that the model is able to generate other images after the tuning.

Author response:
Thank you for your review and for taking the time to improve our work.

1. As for the positive and negative prompts - during editing, only three prompts are used: the editing prompt (e.g., “The Prince of Wales”), the source prompt (e.g., “Prince Charles”) and the target prompt (e.g., “Prince William”). To edit the model weights, we embed the given editing prompt into different prompt templates (e.g., “A photo of the President of Wales”) and get k*. To calculate v*, we use negative examples (prompts) from the MS-COCO dataset. During evaluation, we use a completely different set of negative prompts. Thus, a prompt like “The Prince of Wales drinking coffee” is completely unseen. Given this prompt, the model edited by our method generates correct images, containing Prince William. Further examples are shown in Figure 17, which we added to the paper.  Additionally, we have updated the paper and clarified  the terminology by now referring to the negative examples used for editing as “contrastive examples” and distinguishing them from the “negative prompts” which are a part of the dataset,  to avoid confusion. 

2. The main results in the paper refer to the case of a single edit. In this case, a new “clean” pre-trained stable-diffusion instance is edited, and used to generate the images for evaluation. Using ReFACT to perform multiple edits, i.e. editing several associations on the same instance of the model is possible and discussed in section 5.4 and appendix H. 

3. The FID and CLIP scores are indeed calculated on the MS-COCO dataset as is standard practice [1, 2, 3, 4] and as described in the last paragraph in section 4.3. 

We hope our response addressed your concerns and would be happy to provide any further clarifications. If our response is satisfactory, would you consider increasing your score?

[1] Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Bjorn Ommer. High-resolution image synthesis with latent diffusion models. 

[2] Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Raphael Gontijo-Lopes, Burcu Karagol Ayan, Tim Salimans, Jonathan Ho, David J. Fleet, and Mohammad Norouzi. Photorealistic text-to-image diffusion models with deep language understanding.

[3] Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. 

[4] Yogesh Balaji, Seungjun Nah, Xun Huang, Arash Vahdat, Jiaming Song, Karsten Kreis, Miika Aittala, Timo Aila, Samuli Laine, Bryan Catanzaro, et al. eDiff-I: Text-to-image diffusion models with an ensemble of expert denoisers

Reviewer comment (Experiments):
The evaluation dataset is relatively small, and it would be beneficial to include a wider variety of prompts to evaluate ReFACT. For instance, additional prompts could involve questions about the current President of the United States or synonyms of the target prompts. This expanded evaluation would provide a more comprehensive assessment of ReFACT's performance and its ability to handle a diverse range of factual associations.

Author response:
As for the dataset size - indeed our evaluation data, consisting of our newly collected dataset ROAD and the prior dataset TIME, contains around 200 samples. Nonetheless, we argue that this test size is sufficient for showing improvement over the previous method and general effectiveness of our method. Furthermore, each test sample is composed of 11 different prompts: an editing prompt, five positive prompts and five negative prompts. Each prompt in the test sample is used for image generation with 25 different seeds, thus achieving stable results over each test sample. Overall, we generated more than 50k images for evaluation.

Variety of prompts: ROAD captures both roles and appearances, which add variety to TIME dataset’s implicit assumptions. In ROAD there are a variety of roles including politicians, musicians and tv characters, and appearances for objects such as recognized brands, plant varieties, and car models,  as discussed in section 4.1. We also find that our method is robust to synonyms and different phrasings of the editing prompt, such as prime minister/PM, cat/kitten, apple/granny smith and The tower of Pisa/Pisa tower. See Figure 5. We added an additional discussion on this point in section 5.1

Reviewer comment (Novelty):
The proposed method, ReFACT, appears to be straightforward in its approach to updating factual information in text-to-image models. However, the authors should clearly establish the differences between ReFACT and existing methods, such as "textual inversion." It is essential to provide a detailed comparison to highlight how ReFACT distinguishes itself.

Author response:
As we discussed in section 2, personalization methods -- including Textual Inversion -- target a different task with different goals compared to editing. The main difference is that personalization methods add a special token (e.g., [v]) to distinguish the specific entity (“A [v] dog”) from the general class (“A dog”). Editing, however, should persistently alter the representation of the entity (e.g., “The President of the United States”) without requiring a specific token, and without preserving the original association (“Donald Trump”). Thus the two tasks are fundamentally different.
Nonetheless, for comparison, we adapted Dreambooth, a personalization method which achieved superior performance on personalization datasets compared to Textual Inversion, to perform a variation of personalization that is related to editing (though not achieving the same goal).  As we discussed in Section 6 and Appendix I, we found that it leads to inferior performance compared to ReFACT, results in images that are less diverse and demonstrates catastrophic forgetting.