Device, data structure and computer-implemented method for processing a model

The method addresses the inefficiencies of existing LLM editing by using sentence concatenation with random facts for regularization, ensuring efficient and accurate knowledge updates in LLMs.

DE102024209698A1Pending Publication Date: 2026-04-02ROBERT BOSCH GMBH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
DE · DE
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-10-02
Publication Date
2026-04-02

AI Technical Summary

Technical Problem

Existing methods for modifying knowledge in large language models (LLMs) are computationally inefficient and disrupt the model's behavior by affecting irrelevant knowledge, leading to generation errors and catastrophic forgetting.

Method used

A method using sentence concatenation with enriched random facts for regularization, which directly fine-tunes the model at requested edits without preprocessing, preserving irrelevant knowledge and maintaining generation quality.

Benefits of technology

The method effectively updates specific knowledge while minimizing disruption to the model's overall functionality, reducing generation failures and computational effort.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

Device (100), data structure and computer-implemented method for processing a model (102), the method comprising: providing parameters to the model (102), providing a first factual sentence representing a fact to be processed, wherein the fact to be processed comprises a subject, a relation and an object, the first factual sentence representing the subject and the relation, providing a second factual sentence representing a fact to be retained, determining a prompt to request that the model (102) output the object, the prompt comprising a concatenation of the sentences, and processing at least one parameter of the model depending on a conditional probability, dependent on the subject and the relation, that the model (102) outputs a concatenation of the object and the second factual sentence in response to the prompt.
Need to check novelty before this filing date? Find Prior Art

Description

State of the art

[0001] Model editing aims to modify specific knowledge stored in neural models, e.g., large language models (LLMs), without negatively affecting unrelated knowledge.

[0002] It has been shown that LLMs trained on massive corpora implicitly store factual knowledge in their parameters. Despite their remarkable progress, the facts induced by LLMs can become false or obsolete in a changing world. The need to modify their stored knowledge without destroying their overall functionality becomes crucial.

[0003] Examples of applications include LLM-based chatbots, which are learned once. An important component is keeping the chatbot's knowledge up-to-date, which can be achieved with our method.

[0004] Meng, Kevin, et al., “Locating and editing factual associations in GPT”, Advances in Neural Information Processing Systems 35 (2022), and Meng, Kevin, et al., “Mass-Editing Memory in a Transformer”, The Eleventh International Conference on Learning Representations, 2022, reveal methods that identify a subset of parameters associated with specific knowledge and then modify them via direct weight updates.

[0005] However, these search and processing methods are subject to a high level of computational effort and lack theoretical validation.

[0006] In contrast, it has been shown that directly fine-tuning the model based on requested editing operations, although simple, yields poor results. It affects the model's behavior with irrelevant knowledge (i.e., it unlearns other knowledge) and significantly disrupts the model generation flow and consistency.

[0007] Gangadhar, Govind and Karl Stratos, “Model Editing by Pure Fine-Tuning”, arXiv-Preprint arXiv:2402.11078 (2024), discloses a method that significantly improves model editing performance through pure fine-tuning by utilizing data enrichment with paraphrases and random facts during the requested editing operations [Gangadhar and Stratos, 2024]. However, this method still suffers from generation errors. Disclosure of the invention

[0008] The computer-implemented method according to claim 1 provides a model editing of a model, in particular an LLM, which uses sentence concatenation with enriched random facts to generate a regularization in order to overcome the challenges of model editing by fine-tuning.

[0009] The method uses sentence concatenation to avoid overfitting the model's target output while maintaining the model's generation quality. Additionally, the method uses random facts for data enrichment to effectively preserve the model's knowledge of irrelevant facts.

[0010] The model can be a model for analyzing text data from different languages ​​and domains.

[0011] The method can be applied in real-world model editing applications, although certain knowledge stored in the large language models needs to be modified.

[0012] The method updates specific knowledge within the model, such as the LLM, while leaving other irrelevant knowledge unchanged. The method relies on fine-tuning, which requires no preprocessing steps, making it computationally efficient. The method employs fine-tuning-based model editing, meaning the model is fine-tuned directly at the requested edits without any preprocessing steps.

[0013] The method addresses the challenges of catastrophic forgetting and knowledge transfer in continuous learning, a crucial aspect when deploying machine learning models in dynamic environments.

[0014] The method is effective because it reduces the influence of irrelevant knowledge outside the scope of processing on the behavior of the model and it reduces a complete generation failure, where the generation quality of the finely tuned model is completely damaged.

[0015] Sentence concatenation with enriched random facts forces regularization. The sentence concatenation strategy aims to avoid the problem of generation failure while maintaining processing efficiency.

[0016] The computer-implemented procedure for manipulating the model comprises: providing parameters to the model, providing a first factual sentence representing a fact to be manipulated, wherein the fact to be manipulated comprises a subject, a relation, and an object, with the first factual sentence representing the subject and the relation, providing a second factual sentence representing a fact to be retained, determining a prompt to request that the model output the object, wherein the prompt comprises a concatenation of the sentences, and manipulating at least one parameter of the model depending on a conditional probability, dependent on the subject and the relation, that the model outputs a concatenation of the object and the second factual sentence in response to the prompt.

[0017] The process can involve providing the model, which has been pre-trained on training data comprising a set of facts; extracting a sample containing the fact to be retained from the set of facts; and determining the second set of facts that depends on the fact to be retained. This means that the training data is used to provide the facts to be retained.

[0018] Determining the first factual statement can involve providing a set of facts to be processed, extracting a sample containing the fact to be processed from this set of facts, and determining the first factual statement based on that fact. This means that the first factual statement is determined directly based on the facts being processed.

[0019] Determining the second factual statement can involve verifying that the fact to be retained is not among the set of facts to be processed, and determining the second factual statement depending on the fact to be retained after successful verification, or otherwise not determining the second factual statement depending on the fact to be retained. This avoids inconsistencies.

[0020] A device for processing the model comprises at least one processor and at least one memory, wherein the at least one memory is designed to store the model and instructions which, when executed by the at least one processor, cause the device to perform a procedure.

[0021] A computer program for manipulating the model comprises computer-readable instructions which, when executed by a computer, cause the computer to perform the procedure.

[0022] A data structure for manipulating the model comprises at least one data field for the model, a first factual sentence representing a fact to be manipulated, wherein the fact to be manipulated comprises a subject, a relationship, and an object, with the first factual sentence representing the subject and the relationship, a second factual sentence representing a fact to be retained, a prompt to request that the model output the object, wherein the prompt comprises a concatenation of the sentences, and a conditional probability, dependent on the subject and the relationship, that the model outputs a concatenation of the object and the second factual sentence in response to the prompt.

[0023] The data structure can include at least one data field for training data, which comprises a set of facts, and for the fact to be retained, which is taken from the set of facts by sampling.

[0024] The data structure can include at least one data field, a set of facts to be processed, and the fact to be processed, which is randomly selected from the set of facts to be processed.

[0025] The data structure may include at least one data field for the result of a verification that the fact to be retained is not in the set of facts to be processed.

[0026] Further examples can be derived from the following description and the drawing. The following applies to the figures: Fig. Figure 1 schematically shows a device for machining a model. Fig. Figure 2 shows a flowchart that includes the steps of a procedure for editing the model. Fig. Figure 3 schematically shows a data structure for editing the model.

[0027] Fig. Figure 1 schematically shows a device 100 for processing a model 102. The model 102 is, for example, a large language model (LLM). The model 102 includes parameters. The model 102 is, for example, a function f. θ , which depends on parameters θ of model 102.

[0028] The Model 102, for example, is designed to be an object o i a fact (s i , r i ,O i ) to output if there is a prompt p i (s i ,r i ) is queried, which is a subject s i and a relationship r i which includes the fact.

[0029] The subject s iFor example, it is the first part of a sentence formulated in natural language. The relationship r i For example, a second part of the sentence is formulated in natural language. The object o i For example, a third part of the sentence is formulated in natural language.

[0030] The prompt p i For example, it is formulated as a natural language prompt for the LLM. The prompt p i includes, for example, the subject s i , the relationship r i and an interrogative question formulated in natural language.

[0031] The device 100 comprises at least one processor 104 and at least one memory 106. The at least one processor 104 is designed to execute instructions which, when executed by the at least one processor 104, cause the device 100 to perform a method for machining the model 102. The at least one memory 106 is designed to store the instructions.

[0032] The at least one memory 106, for example, is designed to store the model 102.

[0033] The device 100 is designed to process model 102 using sentence concatenation with enriched random facts for generation regularization.

[0034] Model 102 can be used with training data that contains a specific set of M training data points. D={(si,ri,oi)}i=1M include being pre-trained, whereby (s i , r i , o i) is a triad consisting of subject-relationship-object, which represents a fact (s i , r i , o i ) describes the training data.

[0035] The processing of model 102 is exemplified by means of a processing operation of model 102 based on a given set of N processing operations. ε={(si,ri,oi)}i=1N described, whereby (s i , r i , o i ) is a triad consisting of subject-relationship-object, which represents a fact (s i ,r i ,O i ) describes.

[0036] A factual statement xi∈χe=(pi(si,ri),oi) becomes an object o i created, which the Model 102 created in response to a prompt p i (s i , r i ) outputs. The factual sentence x i For example, it is formulated as a sentence in natural language.

[0037] An example of the factual statement x ifor a fact (Danielle Darrieux, is_mother tongue, English), which is formulated as the sentence in natural language, is: Danielle Darrieux's native language is English.

[0038] An example of the prompt p i (s i , r i ) for the exemplary factual sentence x i is: What is Danielle Darrieux's native language? where "what?" represents the interrogative case, "Danielle Darrieux" the subject. i represents and “The mother tongue of ... is” the relationship r i represented.

[0039] A random factual sentence a i ∈ A is provided from a set of factual sentences A. The set of factual sentences A comprises sentences that should not be changed by editing Model 102 based on the editing operations ℇ.

[0040] The random factual set a iFor example, it is formulated as a sentence in natural language.

[0041] An example of the random factual set a i , which is formulated as the sentence in natural language, reads: The capital of France is Paris.

[0042] Following an example, the random factual set a i based on a fact (s i , r i , o i ) determined. The fact (s i , r i , o i ) for the random factual set a i is, for example, (Paris, is the capital of France).

[0043] The random factual set a i for example, based on a fact (s i ,r i , o i ) determined from the training data D, which differs from the facts in the processing operations ℇ.

[0044] The fact (s i ,r i ,O i) to determine the random factual set a i is taken, for example, from the training data D in a random sample, and it is verified that the fact (s i , r i , o i ) to determine the random factual set a i is not a fact that is located in the processing operations ℇ.

[0045] The factual sentence x i and the random factual set a i are chained together to form a chained prompt.

[0046] Model 102 is trained depending on the chained prompt.

[0047] The training goal of the method is the direct optimization of minθ−∑(si,ri,oi,ai)log pθ(oi,ai|si,ri) where θ are the parameters of model 102.

[0048] This means that the procedure directly calculates the conditional probability log p. θ (O i , a i |s i , r i) optimized, which is determined by the subject s i and the relationship r i the fact (s i ,r i ,O i depends.

[0049] This means that the procedure calculates the conditional probability log p θ (O i ,a i |s i ,r i ) the output of model 102 in response to the prompt p i , which is the target object o i linked to the random factual sentence a i is directly optimized.

[0050] Fig. Figure 2 shows a flowchart that includes the steps of the procedure. The steps of the procedure are described using the example of a machining operation. Following this example, the procedure processes N machining operations to optimize the training objective.

[0051] The procedure includes step 202.

[0052] Step 202 involves providing the parameters θ to model 102, e.g., fθ .

[0053] For example, model 102 is pre-trained on training data that includes a set of facts, e.g., the training data points D.

[0054] The procedure includes step 204.

[0055] Step 204 involves providing a first factual set x i , which represents a fact to be processed.

[0056] The fact to be processed comprises a subject s i , a relationship r i and an object o i .

[0057] The first factual sentence represents the subject s i and the relationship r i .

[0058] For example, a set of facts is provided for editing, e.g., the editing operations ℇ.

[0059] The fact to be processed is, for example, randomly selected from the set of facts to be processed.

[0060] The first factual statement, for example, is determined depending on the fact to be processed, which is taken from a sample.

[0061] The procedure includes step 206.

[0062] Step 206 involves providing a second factual set a i , which represents a fact to be retained. The second factual statement a i For example, the random factual set a i .

[0063] The fact to be retained is, for example, randomly selected from the set of facts in the training data. The second factual statement is determined, for example, depending on the randomly selected fact to be retained.

[0064] Determining the second factual statement may involve verifying that the fact to be retained is not among the set of facts to be processed.

[0065] The second factual statement, for example, is determined depending on the fact to be retained after successful verification, and is not determined otherwise depending on the fact to be retained.

[0066] The procedure includes step 208.

[0067] Step 208 involves determining a prompt p i to request that model 102 output the object.

[0068] The prompt p; comprises a concatenation of sentences, i.e., the first factual sentence x i and the second factual sentence a i .

[0069] The procedure includes step 210.

[0070] Step 210 involves editing at least one parameter of model 102, e.g., one of the parameters θ, depending on the conditional probability, dependent on the subject and the relationship, that model 102 outputs a concatenation of the object and the second factual sentence in response to the prompt.

[0071] For example, the training goal of the procedure is directly optimized to determine at least one parameter.

[0072] Fig. Figure 3 schematically shows a data structure 300 for editing model 102.

[0073] Data structure 300 includes at least one data field 302 for - the model 102, - the first factual sentence, - the second factual sentence, - the prompt and - the conditional probability.

[0074] Data structure 300 can contain at least one data field 302 for - the training data, - the fact to be retained, - the amount of facts to process, - the fact to be processed and / or - the result of the verification that the fact to be retained is not among the set of facts to be processed. QUOTES INCLUDED IN THE DESCRIPTION

[0000] This list of documents cited by the applicant was automatically generated and is included solely for the reader's convenience. The list is not part of the German patent or utility model application. The DPMA accepts no liability for any errors or omissions. Cited non-patent literature

[0000] Meng, Kevin, et al., “Locating and editing factual associations in GPT,” Advances in Neural Information Processing Systems 35 (2022

[0004] Meng, Kevin, et al., „Mass-Editing Memory in a Transformer“, The Eleventh International Conference on Learning Representations, 2022

[0004] Gangadhar, Govind und Karl Stratos, „Model Editing by Pure Fine-Tuning“, arXiv-Preprint arXiv:2402.11078 (2024

[0007]

Claims

[1] Computer-implemented method for processing a model (102), characterized by , that the procedure comprises: providing (202) parameters to the model (102), providing (204) a first factual sentence representing a fact to be processed, wherein the fact to be processed comprises a subject, a relation and an object, the first factual sentence representing the subject and the relation, providing (206) a second factual sentence representing a fact to be retained, determining (208) a prompt to request that the model (102) output the object, the prompt comprising a concatenation of the sentences, and processing (210) at least one parameter of the model depending on a conditional probability, dependent on the subject and the relation, that the model (102) outputs a concatenation of the object and the second factual sentence in response to the prompt. [2] Method according to claim 1, characterized by , that the procedure comprises: providing (202) the model (102) which has been pre-trained on training data comprising a set of facts, taking a sample (206) containing the fact to be retained from the set of facts, determining (206) the second factual set which depends on the fact to be retained. [3] Method according to any one of the preceding claims, characterized by , that the determination (204) of the first factual sentence includes providing a set of facts to be processed, taking a sample containing the fact to be processed from the set of facts to be processed, determining the first factual sentence depending on the fact to be processed. [4] Method according to claims 2 and 3, characterized by, that the determination (206) of the second factual statement comprises verifying that the fact to be retained is not in the set of facts to be processed, and determining the second factual statement depending on the fact to be retained after successful verification or otherwise not determining the second factual statement depending on the fact to be retained. [5] Device (100) for machining a model (102), characterized by , that the device comprises at least one processor (104) and at least one memory (106), wherein the at least one memory (106) is configured to store the model (102) and instructions which, when executed by the at least one processor (104), cause the device (100) to execute a method according to any one of claims 1 to 4. [6] Computer program for editing a model (102), characterized bythat the computer program comprises computer-readable instructions which, when executed by a computer, cause the computer to execute a method according to any one of claims 1 to 4. [7] Data structure (300) for editing a model (102), characterized by, that the data structure (300) includes at least one data field (302) for the model (102), a first factual sentence representing a fact to be processed, wherein the fact to be processed includes a subject, a relation and an object, wherein the first factual sentence represents the subject and the relation, a second factual sentence representing a fact to be retained, a prompt to request that the model (102) output the object, wherein the prompt includes a concatenation of the sentences, and a conditional probability, dependent on the subject and the relation, that the model (102) outputs a concatenation of the object and the second factual sentence in response to the prompt. [8] Data structure (300) according to claim 7, characterized by, that the data structure includes at least one data field (302) for training data comprising a set of facts, and for the fact to be retained, which is sampled from the set of facts. [9] Data structure (300) according to claim 7, characterized by , that the data structure includes at least one data field (302), a set of facts to be processed and the fact to be processed, which is randomly selected from the set of facts to be processed. [10] Data structure (300) according to claim 7, characterized by , that the data structure includes at least one data field (302) for a result of a verification that the fact to be retained is not in the set of facts to be processed.