Devices for editing models, data structures for editing models, and computer-implemented methods for editing models.
The method addresses inefficiencies in LLM editing by using sentence concatenation and random fact augmentation for fine-tuning, ensuring efficient and accurate updates to specific knowledge while preserving irrelevant knowledge in LLMs.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- ROBERT BOSCH GMBH
- Filing Date
- 2025-10-01
- Publication Date
- 2026-04-14
AI Technical Summary
Existing methods for editing knowledge in large-scale language models (LLMs) face significant computational overhead and inefficiencies, leading to impaired model behavior and generation errors, particularly when updating specific knowledge while preserving irrelevant knowledge.
A computer-implemented method using sentence concatenation and random fact augmentation for fine-tuning, which avoids overfitting and maintains model generation quality by editing specific knowledge without altering irrelevant knowledge.
This method effectively updates specific knowledge in LLMs while preserving irrelevant knowledge, reducing computational overhead and minimizing generation errors, thus maintaining model fluency and consistency.
Smart Images

Figure 2026064977000001_ABST
Abstract
Description
[Technical Field]
[0001] background Model editing aims to modify specific knowledge stored in a neural model, such as a large-scale language model (LLM), without negatively impacting irrelevant knowledge. [Background technology]
[0002] LLMs, trained on vast corpora, have been shown to implicitly memorize factual knowledge as one of their parameters. Despite significant progress, the facts induced by LLMs may become inaccurate or obsolete in a changing world. It is crucial to correct the memorized knowledge without interfering with overall functionality.
[0003] An exemplary application is a chatbot based on LLM that performs a single learning cycle. A crucial aspect is keeping the chatbot's knowledge up-to-date, which can be achieved using the method according to the present invention. [Prior art documents] [Non-patent literature]
[0004] [Non-Patent Document 1] Meng, Kevin et al., ““Locating and editing factual associations in GPT.”, Advances in Neural Information Processing Systems 35 (2022).” [Non-Patent Document 2] Meng, Kevin et al., ““Mass-Editing Memory in a Transformer.”, The Eleventh International Conference on Learning Representations. 2022” [Non-Patent Document 3] Gangadhar, Govind and Karl Stratos, ““Model Editing by Pure Fine-Tuning.”, arXiv preprint arXiv:2402.11078 (2024)” [Overview of the project] [Problems that the invention aims to solve]
[0005] "Locating and editing factual associations in GPT," Advances in Neural Information Processing Systems 35 (2022) by Meng, Kevin et al., and "Mass-Editing Memory in a Transformer," The Eleventh International Conference on Learning Representations, 2022 by Meng, Kevin et al., disclose methods for identifying a subset of parameters associated with specific knowledge and then modifying that subset of parameters through direct weighted updates.
[0006] However, these locate-and-edit methods have significant computational overhead and lack theoretical validation.
[0007] In contrast, directly fine-tuning the model for requested edits is simple but has been shown to be inefficient. This affects the model's behavior regarding irrelevant knowledge (i.e., other knowledge is not learned), significantly impairing the fluency and consistency of model generation.
[0008] "Model Editing by Pure Fine-Tuning," arXiv preprint arXiv:2402.11078 (2024) by Gangadhar, Govind, and Karl Stratos, discloses a method that significantly improves the performance of model editing through pure fine-tuning by utilizing paraphrasing and data augmentation with random facts for the requested edits [Gangadhar and Stratos, 2024]. However, this method still suffers from generation errors. [Means for solving the problem]
[0009] Disclosure of the invention The computer-implemented method described in claim 1 provides model editing for models, particularly LLMs, that use sentence concatenation including extended random facts for generative regularization, in order to address the challenges of model editing by fine tuning.
[0010] This method avoids overfitting the model to the target output by utilizing sentence concatenation, thereby maintaining the model's generation quality. It also uses random facts for data augmentation to effectively preserve irrelevant factual knowledge in the model.
[0011] The model may be defined as a model for analyzing text data from different languages and domains.
[0012] This method is applicable to real-world model editing applications that require modification of specific knowledge stored in large-scale language models.
[0013] This method updates specific knowledge within a model, such as an LLM, while maintaining other irrelevant knowledge without modification. This method is based on fine-tuning that requires no preprocessing steps and is therefore computationally efficient. It uses fine-tuning-based model editing, i.e., direct model fine-tuning for the requested edit without any preprocessing steps.
[0014] This method addresses the challenges of catastrophic forgetting and knowledge transfer during continuous learning, which are critical aspects of deploying machine learning models in dynamic environments.
[0015] This method is effective because it mitigates the impact of the model's behavior on irrelevant knowledge outside the editing range, and reduces the likelihood of complete generation errors that would completely impair the quality of a finely tuned model.
[0016] Concatenating sentences containing augmented random facts forces regularization. The sentence concatenation strategy aims to avoid generation errors while maintaining editing efficiency.
[0017] A computer-implemented method for editing a model includes supplying parameters to the model, supplying a first fact statement expressing facts to be edited, including a subject, relation and object, the first fact statement expressing a subject and relation, supplying a second fact statement expressing facts to be retained, determining a prompt for requesting the model to output an object, the prompt including a concatenation of each sentence, and editing at least one parameter of the model, depending on a conditional likelihood conditioned on the subject and relation, such that the model outputs a concatenation of objects and a second fact statement in response to the prompt.
[0018] This method may include providing a pre-trained model on training data containing a set of facts, sampling facts to be retained from the set of facts, and determining a second factual statement based on the facts to be retained. This means that the training data is used to supply the facts to be retained.
[0019] Determining the first factual statement may include supplying a set of facts for editing, sampling facts to be edited from the set of facts for editing, and determining the first factual statement depending on the facts to be edited. This means that the first factual statement is determined directly based on the facts to be edited.
[0020] Determining a second factual statement may involve verifying that the facts to be retained are not included in the set of facts for editing, determining the second factual statement based on the facts to be retained depending on the success of the verification, or not determining a second factual statement based on the facts to be retained if the verification is unsuccessful. This avoids contradictions.
[0021] A device for editing a model comprises at least one processor and at least one memory, the at least one memory being configured to store a model and instructions for causing the device to perform a method when executed by the at least one processor.
[0022] A computer program for editing a model, when executed by a computer, includes computer-readable instructions that cause the computer to perform the methods described above.
[0023] A data structure for editing a model includes a model, a first fact statement expressing a fact to be edited, which includes a subject, relation and object, a first fact statement expressing the subject and relation, a second fact statement expressing a fact to be maintained, a prompt for requesting the model to output an object, the prompt including a concatenation of each sentence, and a conditional likelihood conditioned on the subject and relation, which the model outputs in response to the prompt, which includes a concatenation of the object and the second fact statement.
[0024] The data structure may include at least one data field for training data containing a set of facts, and for facts to be retained, which are sampled from the set of facts.
[0025] The data structure may include at least one data field for a set of facts for editing and for facts to be edited, which are sampled from the set of facts for editing.
[0026] The data structure may include at least one data field for verification that the facts to be maintained are not included in the fact set for editing.
[0027] Further examples can be found in the following description and drawings. The drawings show the following: [Brief explanation of the drawing]
[0028] [Figure 1] This is a schematic diagram showing the equipment used for editing the model. [Figure 2] This flowchart shows the steps involved in editing a model. [Figure 3] This diagram schematically shows the data structure for editing the model. [Modes for carrying out the invention]
[0029] Figure 1 schematically shows an apparatus 100 for editing a model 102. The model 102 is, for example, a large language model (LLM). The model 102 includes a plurality of parameters. The model 102 is a function f θ for example, that depends on the parameters θ of the model 102.
[0030] The model 102, for example, has a subject s i of a fact and a relation r i and is configured to output an object o i (s i , r i ) of the fact when the prompt p i , r i , o i ) of the fact is indicated. i
[0031] The subject s i is, for example, the first part of a sentence formulated in natural language. The relation r i is, for example, the second part of a sentence formulated in natural language. The object o i is, for example, the third part of a sentence formulated in natural language.
[0032] The prompt p i is formulated for the LLM, for example, as a natural language prompt. The prompt p i includes, for example, the subject s i formulated in natural language, the relation r i and a question word.
[0033] The apparatus 100 includes at least one processor 104 and at least one memory 106. The at least one processor 104 is configured to execute instructions that cause the apparatus 100 to perform a method for editing the model 102 when executed by the at least one processor 104. The at least one memory 106 is configured to store the instructions.
[0034] At least one memory 106 is configured to store, for example, model 102.
[0035] The device 100 is configured to edit model 102 using sentence concatenation that includes augmented random facts for generational regularization.
[0036] Model 102 is a training data containing a given set of M training data points.
number
[0037] The editing of Model 102 is described as an example of editing Model 102 based on a given set of N edits.
number
[0038] Facts
number
[0039] A factual statement x, formalized as a natural language sentence, relating to the fact (Danielle Darrieux, is_mother_tongue, English). i Examples include: The mother tongue of Danielle Darrieux is English. That is the case.
[0040] Example factual statement x i prompt p i (s i ,r i Examples of ) are, The mother tongue of Danielle Darrieux is which? Here, "which?" is a question word, and "Danielle Darrieux" is the subject. i It expresses the relationship, and "The mother tongue of … is" is related to r i It expresses this.
[0041] Random factual statements
number
[0042] Random factual statement a i For example, it is formulated as a natural language sentence.
[0043] Random factual sentence a, formulated as a natural language sentence i Examples include: The capital of France is Paris. That is the case.
[0044] For example, a random factual statement a i is a fact (s i ,r i,o i Determined based on ). Random factual statement a i Facts about (s i ,r i ,o i For example, (Paris, is_capital_of, France).
[0045] Random factual statement a i For example, facts from training data D that differ from facts in edited ε (s i ,r i ,o i It is determined based on the following criteria.
[0046] Random factual statement a i Facts to determine (s i ,r i ,o i ) is, for example, sampled from training data D, and the random factual statement a i Facts to determine (s i ,r i ,o i It is verified that the fact that ) is not included in edit ε is verified.
[0047] Fact statement x i and a random factual statement a i The two are linked to a concatenation prompt.
[0048] Model 102 is trained in reliance on concatenated prompts.
[0049] The target audience for training using this method is:
number
[0050] This is because this method is a fact (s i ,r i ,o i ) subject s i and relation r iConditional likelihood log p θ (o i ,a i │s i ,r i This means directly optimizing ).
[0051] This means that this method targets the object o i and a random factual statement a linked thereto i The prompt p i In response, the conditional likelihood log p of the output of Model 102 θ (o i ,a i │s i ,r i This means directly optimizing ).
[0052] Figure 2 shows a flowchart illustrating each step of the method. Each step of the method will be explained using an example of a single edit. According to one embodiment, the method processes N edits to optimize the training target.
[0053] This method includes step 202.
[0054] Step 202 is Model 102, for example f θ This includes supplying a parameter θ to it.
[0055] Model 102 is pre-trained on training data that includes a set of facts, for example, training data point D.
[0056] This method includes step 204.
[0057] Step 204 is to create the first factual statement x that expresses the fact to be edited. i This includes supplying [the product / service].
[0058] The fact to be edited is the subject s i , relationship r i and object o i Includes.
[0059] The first factual sentence represents the subject s i and the relationship r i as such.
[0060] For example, a fact set for editing, such as edit ε, is supplied.
[0061] The facts to be edited are sampled, for example, from the fact set for editing.
[0062] The first factual sentence is determined, for example, depending on the sampled facts to be edited.
[0063] This method includes step 206.
[0064] Step 206 includes supplying a second factual sentence a that represents the facts to be maintained i The second factual sentence a i is, for example, a random factual sentence a i as such.
[0065] The facts to be maintained are sampled, for example, from a fact set consisting of training data. The second factual sentence is determined, for example, depending on the sampled facts to be maintained.
[0066] The determination of the second factual sentence may include verifying that the facts to be maintained are not included in the fact set for editing.
[0067] The second factual sentence is determined, for example, depending on the facts to be maintained in response to successful verification and not determined depending on the facts to be maintained if the verification fails.
[0068] This method includes step 208.
[0069] Step 208 includes determining a prompt p for requesting the model 102 to output an object word i as such.
[0070] Prompt p i is the concatenation of each sentence, i.e., the concatenation of the first factual sentence x i and the second factual sentence a i is included.
[0071] This method includes step 210.
[0072] Step 210 includes editing at least one parameter of model 102, such as one of the parameters θ, depending on the conditional likelihood conditioned on the subject and relationship, where model 102 outputs the concatenation of the target language and the second factual sentence in response to the prompt.
[0073] For example, the training target of this method is directly optimized to determine at least one parameter.
[0074] Figure 3 schematically shows a data structure 300 for editing model 102.
[0075] The data structure 300 - model 102, - the first factual sentence, - the second factual sentence, - the prompt, and, - the conditional likelihood, includes at least one data field 302 for.
[0076] The data structure 300 - training data, - facts to be maintained, - set of facts for editing, - facts to be edited, and / or, - verification result that the facts to be maintained are not included in the set of facts for editing, may also include at least one data field 302 for.
Claims
1. A computer-implemented method for editing a model (102), This method is (202) provides parameters to the model (102), (204) to supply a first factual sentence that expresses the fact to be edited, including a subject, relation and object, wherein the first factual sentence expresses the subject and relation, To provide a second factual statement that expresses the facts to be maintained (206), Determining a prompt (208) for requesting the model (102) to output the object, wherein the prompt includes the concatenation of each sentence (208), The model (102) outputs the concatenation of the object and the second factual statement in response to the prompt, and the editing of at least one parameter of the model (210) is performed depending on the conditional likelihood conditioned on the subject and the relationship. including, A computer-implemented method characterized by the following:
2. The aforementioned method, To provide (202) the model (102) that has been pre-trained on training data including a set of facts, Sampling the facts to be maintained from the set of facts (206), Determining the second factual statement based on the facts to be maintained (206), including, The method according to claim 1.
3. Determining the first factual statement (204) is, To supply a set of facts for editing, Sampling the facts to be edited from the set of facts for the editing, The first factual statement is determined based on the facts to be edited, including, The method according to claim 1 or 2.
4. Determining the second factual statement (206) is, To verify that the facts to be preserved are not included in the set of facts for editing, Depending on the success of the verification, the second factual statement may be determined based on the facts to be maintained, or, if the verification is unsuccessful, the second factual statement may not be determined based on the facts to be maintained. including, The method according to claims 2 and 3.
5. In a device (100) for editing a model (102), The aforementioned device is At least one processor (104), At least one memory (106) and Equipped with, The aforementioned at least one memory (106) is The aforementioned model (102) and, An instruction, when executed by the at least one processor (104), to cause the device (100) to perform the method according to any one of claims 1 to 4, It is configured to store, A device (100) for editing a model (102), characterized by the above.
6. A computer program for editing a model (102), When executed by a computer, the method includes a computer-readable instruction causing the computer to perform the method according to any one of claims 1 to 4. A computer program characterized by the following features.
7. A data structure (300) for editing the model (102), The aforementioned data structure (300) is The aforementioned model (102) and, A first factual statement expressing the fact to be edited, including a subject, relation and object, comprising a first factual statement expressing the subject and relation, A second factual statement expressing the facts that should be maintained, A prompt for requesting the model (102) to output the object, the prompt including the concatenation of each sentence, The model (102) outputs the concatenation of the object and the second factual statement in response to the prompt, and the conditional likelihood conditioned on the subject and the relationship. Including at least one data field (302) for, A data structure (300) characterized by the following.
8. The aforementioned data structure is Training data including a set of facts, Facts to be preserved, sampled from the set of facts and Including at least one data field (302) for, The data structure (300) according to claim 7.
9. The aforementioned data structure is A set of facts for editing, The facts to be edited, sampled from the set of facts for the editing, and Including at least one data field (302) for, The data structure (300) according to claim 7.
10. The aforementioned data structure is Verification results indicate that the aforementioned facts to be preserved are not included in the set of facts for the aforementioned editing. Including at least one data field (302) for, The data structure (300) according to claim 7.