Pioneering Reliable Assessment in Text-to-Image Knowledge Editing: Leveraging a Fine-Grained Dataset and an Innovative Criterion (2024)

Abstract: During pre-training, the Text-to-Image (T2I) diffusion models encode factual knowledge into their parameters. These parameterized facts enable realistic image generation, but they may become obsolete over time, thereby misrepresenting the current state of the world. Knowledge editing techniques aim to update model knowledge in a targeted way. However, facing the dual challenges posed by inadequate editing datasets and unreliable evaluation criterion, the development of T2I knowledge editing encounter difficulties in effectively generalizing injected knowledge. In this work, we design a T2I knowledge editing framework by comprehensively spanning on three phases: First, we curate a dataset CAKE , comprising paraphrase and multi-object test, to enable more fine-grained assessment on knowledge generalization. Second, we propose a novel criterion, adaptive CLIP threshold , to effectively filter out false successful images under the current criterion and achieve reliable editing evaluation. Finally, we introduce MPE , a simple but effective approach for T2I knowledge editing. Instead of tuning parameters, MPE precisely recognizes and edits the outdated part of the conditioning text-prompt to accommodate the up-to-date knowledge. A straightforward implementation of MPE (Based on in-context learning) exhibits better overall performance than previous model editors. We hope these efforts can further promote faithful evaluation of T2I knowledge editing methods.

## introduction text-to-image (t2i) diffusion models have gained significant advancements in encoding real-world concepts via bridging the gap between textual descriptions and visual representations (zhang et al., ✦ corresponding author 2023a; @xcite @xcite . by pre-training on a large number of image-caption pairs, these generative models acquire statistical biases on visual concepts such as colors, objects, and personalities. for example, by inputting a text prompt "the ceo of tesla", the model can generate a portrait of "elon musk". while some concepts are ageless, other encoded knowledge facts may become invalid over time (e.g., head of a state) or induce harmful social biases (e.g., implicit gender of ceo). to address this oversight, knowledge editing @xcite @xcite @xcite @xcite @xcite provides an efficient solution by patching undesirable model outputs without significantly altering the model's general behavior on unrelated input. considering the emerging text-to-image scenario, several pioneering works have been explored for the knowledge editing of generative models @xcite @xcite . these studies all borrow the idea of localized parameter updating @xcite from language model editing. specifically, each fact edit is defined as a mapping from edit prompt to target prompt (e.g., "the president of the united states" → "joe biden") and is represented as a computed key-value vector pair. by locating this vector pair at a specific model component, such as mlp or self-attention block, one is capable of transitioning the generative model's perception on the edit prompt to accord with up-to-date knowledge, thereby achieving knowledge editing. however, the existing works still focus on exterior model editing, i.e., text mapping, instead of knowledge mapping and generalization reasoning. based on an edited stable diffusion @xcite , we generate images by creating the input prompts that are synonymous with the fact edit and consist of multiple objects. as illustrated in fig. 1 , we observe ➀paraphrase generalization failure: via replacing the input prompt of fact edit with its paraphrase (e.g., changing "united states" to "american"), the synthetic portrait looks significantly distorted from the ground truth and distinct from the one generated by the original prompt. ➁compositionality generalization failure: when incorporating multiple edited objects within a single input prompt, the model's generation behavior is only partially updated on a subset of fact edits. we attribute these generalization failures to superficial text mapping, where the knowledge editing lacks the reasoning flexibility to adequately comprehend various language concepts. to effectively address how to implement knowledge mapping in generative models, which requires the edited knowledge to generalize to free and varied language inputs, we must tackle two main challenges. ❶most of the t2i benchmark datasets @xcite @xcite used for knowledge editing do not include complex evaluation prompts comprising paraphrases and multiple edited objects. such simple datasets hinder the development of sophisticated editing methods associated with the desired generalization capability. ❷the evaluation criterion for t2i knowledge editing are underexplored. namely, given a synthesized image from an edited model, how can we determine whether the synthesis behavior is in line with the desired update? previous research @xcite formulates the decision of editing success as a binary classification task, comparing the closeness of synthesized images to outdated and target facts. however, as shown in fig. 1 , this approach often results in false successful images that appear closer to the target facts but fail to meet the intended editing goals. thus, a more reliable evaluation strategy is needed to advance knowledge editing efforts. in response to these challenges, we design a comprehensive text-to-image knowledge editing framework that spans three phases: dataset construction, evaluation strategy, and editing method. first, we curate a dataset named as counterfactual assessment of text-to-image knowledge editing (cake) to quantitatively assess the edited model's capabilities in addressing the above-mentioned complex cases. in particular, cake introduces two new types of evaluation prompts, built from the paraphrases of edit prompt and multiple edited objects, respectively. in addition to verifying superficial text-mapping, the use of these additional evaluation prompts allows cake to offer a more fine-grained assessment of editing performance and insights into how well an editing method generalizes text-mapping to knowledge-mapping. second, to establish a reliable evaluation strategy for editing, we propose a novel criterion termed adaptive clip threshold. unlike the previous criterion based on classification, this innovative criterion instead focuses on whether the synthesized image is "sufficiently" similar to the target fact. specifically, this criterion analyzes the clip score distribution of ideal synthesized images and utilizes its parameter estimations to calculate a score threshold that quantifies the degree of "sufficiency". utilizing this score threshold in decision-making can effectively filter out false successful images in editing evaluation scenarios. our validation experiments supported by qwen-vl-max, the state-of-theart open-source vision-language model @xcite on the celebrity recognition task, demonstrate the superiority of the novel criterion, significantly outperforming the current criterion. third, rather than tuning parameters, we explore a distinctive approach to t2i knowledge editing termed memory-based prompt editing (mpe). mpe stores all fact edits in an external memory and functions as a pre-processing module for the conditioning text prompt. before image synthesis, mpe identifies and edits outdated parts of the input prompt to align with current knowledge. our experiments include a simple, in-context learningbased @xcite ) implementation of mpe. extensive results suggest that current editing methods struggle to generalize text-mapping to desired knowledge-mapping, whereas mpe outperforms previous competitors in overall performance and applicability, demonstrating significant potential in addressing t2i knowledge editing. ## conclusion in this work, we aim to establish a reliable evaluation paradigm for t2i knowledge editing. specifically, we curate a dataset named cake, comprising fine-grained metrics to validate knowledge generalization. we then develop an innovative criterion, the adaptive clip threshold, to approximate the ideal decision boundary, effectively filtering out false successful images in evaluation scenarios. additionally, by transferring the editing impact from the parameter space to the input space, we design a distinctive approach, mpe, to achieve t2i knowledge editing. extensive results have demonstrated the limitations of current editing methods and the further potential of mpe.