Table of Contents
Fetching ...

Editing Knowledge Representation of Language Model via Rephrased Prefix Prompts

Yuchen Cai, Ding Cao, Rongxi Guo, Yaqin Wen, Guiquan Liu, Enhong Chen

TL;DR

PSPEM introduces a lifetime soft-prompt editing framework that extracts, refines, and aligns prompt information to guide language-model outputs without changing model parameters. By integrating a Prompt Encoding module, an Encoding Converter, and a prompt-alignment objective, PSPEM achieves near-perfect editing accuracy on demanding benchmarks like COUNTERFACT and shows strong performance in attribute inserting and reasoning tasks. The method surmounts the inefficiencies of weight-modified and weight-preserved editing approaches and demonstrates high similarity to original prompts in internal representations, enabling effective, fluency-preserving knowledge edits. These results highlight PSPEM's potential to advance practical, interpretable knowledge editing and prompt-based reasoning in large transformers.

Abstract

Neural language models (LMs) have been extensively trained on vast corpora to store factual knowledge about various aspects of the world described in texts. Current technologies typically employ knowledge editing methods or specific prompts to modify LM outputs. However, existing knowledge editing methods are costly and inefficient, struggling to produce appropriate text. Additionally, prompt engineering is opaque and requires significant effort to find suitable prompts. To address these issues, we introduce a new method called PSPEM (Prefix Soft Prompt Editing Method), that can be used for a lifetime with just one training. It resolves the inefficiencies and generalizability issues in knowledge editing methods and overcomes the opacity of prompt engineering by automatically seeking optimal soft prompts. Specifically, PSPEM utilizes a prompt encoder and an encoding converter to refine key information in prompts and uses prompt alignment techniques to guide model generation, ensuring text consistency and adherence to the intended structure and content, thereby maintaining an optimal balance between efficiency and accuracy. We have validated the effectiveness of PSPEM through knowledge editing and attribute inserting. On the COUNTERFACT dataset, PSPEM achieved nearly 100\% editing accuracy and demonstrated the highest level of fluency. We further analyzed the similarities between PSPEM and original prompts and their impact on the model's internals. The results indicate that PSPEM can serve as an alternative to original prompts, supporting the model in effective editing.

Editing Knowledge Representation of Language Model via Rephrased Prefix Prompts

TL;DR

PSPEM introduces a lifetime soft-prompt editing framework that extracts, refines, and aligns prompt information to guide language-model outputs without changing model parameters. By integrating a Prompt Encoding module, an Encoding Converter, and a prompt-alignment objective, PSPEM achieves near-perfect editing accuracy on demanding benchmarks like COUNTERFACT and shows strong performance in attribute inserting and reasoning tasks. The method surmounts the inefficiencies of weight-modified and weight-preserved editing approaches and demonstrates high similarity to original prompts in internal representations, enabling effective, fluency-preserving knowledge edits. These results highlight PSPEM's potential to advance practical, interpretable knowledge editing and prompt-based reasoning in large transformers.

Abstract

Neural language models (LMs) have been extensively trained on vast corpora to store factual knowledge about various aspects of the world described in texts. Current technologies typically employ knowledge editing methods or specific prompts to modify LM outputs. However, existing knowledge editing methods are costly and inefficient, struggling to produce appropriate text. Additionally, prompt engineering is opaque and requires significant effort to find suitable prompts. To address these issues, we introduce a new method called PSPEM (Prefix Soft Prompt Editing Method), that can be used for a lifetime with just one training. It resolves the inefficiencies and generalizability issues in knowledge editing methods and overcomes the opacity of prompt engineering by automatically seeking optimal soft prompts. Specifically, PSPEM utilizes a prompt encoder and an encoding converter to refine key information in prompts and uses prompt alignment techniques to guide model generation, ensuring text consistency and adherence to the intended structure and content, thereby maintaining an optimal balance between efficiency and accuracy. We have validated the effectiveness of PSPEM through knowledge editing and attribute inserting. On the COUNTERFACT dataset, PSPEM achieved nearly 100\% editing accuracy and demonstrated the highest level of fluency. We further analyzed the similarities between PSPEM and original prompts and their impact on the model's internals. The results indicate that PSPEM can serve as an alternative to original prompts, supporting the model in effective editing.
Paper Structure (22 sections, 15 equations, 3 figures, 6 tables, 1 algorithm)

This paper contains 22 sections, 15 equations, 3 figures, 6 tables, 1 algorithm.

Figures (3)

  • Figure 1: By inputting the prompts on the left side into the model, traditional prompt engineering generate erroneous text, while PSPEM can correct such errors.
  • Figure 2: Illustration of PSPEM. Given a knowledge prompt (Danielle Darrieux was born in America.) and continuation words (The mother tongue of Danielle Darrieux is), PSPEM constructed more accurately encoded information from the prompt to increase the probability of the target token (English).
  • Figure 3: Subsequent text generated by different editing methods on the COUNTERFACT and BioBias datasets.