A large model updating method and device and related equipment
By deploying a memory management library and a large model locally on the user's end, and adjusting the LoRA matrix parameters using input information and long-term memory context to update the large model, the problem of insufficient user data privacy protection in cloud updates is solved, and data security and interaction accuracy are improved.
Patent Information
- Application Number
- CN202610593159.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-30
- Publication Date
- 2026-07-14
AI Technical Summary
Under the existing mechanism of centralized training and updating of large models in the cloud, the protection of user data privacy is weak, and there is a risk of data leakage.
The memory management library and large model are deployed locally on the user's end. Output results are generated by obtaining input information and long-term memory context, and the LoRA matrix parameters are adjusted incrementally to complete the large model update, avoiding data upload.
It enables localized processing of user data, prevents data leakage, improves data privacy protection capabilities, and enhances the personalized adaptation and interaction accuracy of large models.
Smart Images

Figure CN122389941A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus and related equipment for updating large models. Background Technology
[0002] Current mainstream large-scale models adopt a centralized cloud training and update mechanism. User interaction data and behavioral feedback must be uploaded to the cloud for batch training and model iteration. A large amount of sensitive raw user data needs to be transmitted over the network, stored and processed in the cloud, which poses a serious risk of data leakage and results in weak protection of user data privacy. Summary of the Invention
[0003] This application provides a method, apparatus, and related equipment for updating large models, which can solve the technical problem of weak protection of user data privacy.
[0004] In a first aspect, embodiments of this application provide a large model update method, the method comprising:
[0005] Obtain user input information;
[0006] The long-term memory context is determined based on the input information and the memory management library, which includes multiple historical interaction records between the user terminal and the large model. The large model and the memory management library are deployed locally on the user terminal.
[0007] The large model is used to generate output results based on the input information and the long-term memory context;
[0008] The parameters in the low-rank adaptation LoRA matrix are adjusted based on the input information, the long-term memory context, and the output result to obtain the adjusted LoRA matrix. The large model is then incrementally adjusted based on the adjusted LoRA matrix to obtain the updated large model.
[0009] Optionally, the method further includes:
[0010] A quality score is determined based on the input information, the long-term memory context, and the output result.
[0011] The step of adjusting the parameters in the LoRA matrix based on the input information, the long-term memory context, and the output result includes:
[0012] If the quality score is less than a preset threshold, the parameters in the low-rank adaptation LoRA matrix are adjusted according to the input information, the long-term memory context, and the output result.
[0013] Optionally, adjusting the parameters in the LoRA matrix based on the input information, the long-term memory context, and the output result includes:
[0014] The input information, the long-term memory context, and the output result are desensitized respectively to obtain the processed input information, the processed long-term memory context, and the processed output result.
[0015] The parameters in the LoRA matrix are adjusted based on the processed input information, the processed long-term memory context, and the processed output result.
[0016] Optionally, the step of incrementally adjusting the large model based on the adjusted LoRA matrix to obtain the updated large model includes:
[0017] The main parameters of the large model are frozen and remain unchanged. The main parameters are the parameters in the large model other than the parameters in the LoRA matrix.
[0018] The adjusted LoRA matrix is fused with the weight matrix of the attention layer to which the large model belongs and / or the weight matrix of the feedforward network layer to which it belongs, to obtain the updated large model.
[0019] Optionally, determining the long-term memory context based on the input information and the memory management library includes:
[0020] Based on the semantic vector corresponding to the input information, an approximate nearest neighbor search is performed on the corresponding semantic vectors of the multiple historical interaction records to obtain a preset number of historical interaction records in the memory management library.
[0021] The system prompts and enhanced historical dialogues are determined based on the preset number of historical interaction records. The system prompts include user history preferences, terminology mapping relationships, and user role information. The enhanced historical dialogues include summary information of the historical interaction records.
[0022] The long-term memory context is determined based on the system prompts and the enhanced history dialogue.
[0023] Optionally, determining system prompts and enhanced historical dialogues based on the preset number of historical interaction records includes:
[0024] The preset number of historical interaction records are filtered in multiple dimensions to obtain filtered historical interaction records. The multi-dimensional filtering includes at least one of time decay weighted filtering, topic filtering, keyword matching filtering, and privacy level filtering.
[0025] The filtered historical interaction records are structured and parsed to obtain system prompts. An enhanced historical dialogue is generated by summarizing the filtered historical interaction records.
[0026] Optionally, the method further includes:
[0027] If there are no long-term valuable information fragments in the input information, the long-term memory context, and the output result, the memory management library remains unchanged.
[0028] If there are long-term valuable information fragments in the input information, the long-term memory context, or the output result, a user interaction record is constructed based on the input information, the long-term memory context, and the output result. Metadata tags are added to the user interaction record to obtain a new historical interaction record, and the new historical interaction record is stored in the memory management library.
[0029] The long-term value information fragments include at least one of the following: newly confirmed user preference information, newly added term or alias mapping relationships, completed task status information, high-frequency tool call path information, and error correction information; the metadata tags include timestamps, memory types, confidence scores, access frequency, and privacy levels.
[0030] Secondly, embodiments of this application provide a large model update apparatus, the apparatus comprising:
[0031] The acquisition module is used to acquire input information from the user's client.
[0032] The first processing module is used to determine the long-term memory context based on the input information and the memory management library, wherein the memory management library includes multiple historical interaction records between the user terminal and the large model, and the large model and the memory management library are deployed locally on the user terminal.
[0033] The second processing module is used to generate output results based on the input information and the long-term memory context using the large model.
[0034] The third processing module is used to adjust the parameters in the low-rank adaptation LoRA matrix according to the input information, the long-term memory context and the output result to obtain the adjusted LoRA matrix, and to perform incremental adjustment on the large model according to the adjusted LoRA matrix to obtain the updated large model.
[0035] Thirdly, embodiments of this application provide an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, it implements the steps of the large model update method as described in the first aspect.
[0036] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the large model update method as described in the first aspect.
[0037] Fifthly, embodiments of this application provide a computer program product including computer instructions that, when executed by a processor, implement the steps of the large model update method as described in the first aspect.
[0038] In this embodiment, user input information is acquired; a long-term memory context is determined based on the input information and a memory management library, which includes multiple historical interaction records between the user and the large model. The large model and the memory management library are deployed locally on the user's device; an output result is generated using the large model based on the input information and the long-term memory context; parameters in the low-rank adaptation LoRA matrix are adjusted based on the input information, the long-term memory context, and the output result to obtain an adjusted LoRA matrix; and the large model is incrementally adjusted based on the adjusted LoRA matrix to obtain an updated large model. Since the acquisition of user input, the determination of the long-term memory context, the generation of the output result, and the updating of the large model are all completed locally on the user's device, user data leakage can be prevented, and the protection of user data privacy can be improved. Attached Figure Description
[0039] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0040] Figure 1 This is a flowchart of a large model update method provided in an embodiment of this application;
[0041] Figure 2 This is a schematic diagram of the workflow of a large model update system provided in an embodiment of this application;
[0042] Figure 3 This is a schematic diagram of the structure of a large model update device provided in an embodiment of this application;
[0043] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0045] The terms "first," "second," etc., used in this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, not limited in number; for example, the first object can be one or more. Furthermore, "and / or" in this application indicates at least one of the connected objects. For example, the scope of protection of "A and / or B" covers at least three scenarios: Scenario 1: including A but not B; Scenario 2: including B but not A; Scenario 3: including both A and B. Additionally, the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0046] See Figure 1 , Figure 1 This is a flowchart of a large model update method provided in an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:
[0047] Step 101: Obtain input information from the user's terminal;
[0048] The user terminal can be a local terminal device or local edge server with information input, output and processing capabilities, such as a personal computer, laptop, tablet computer or server; the user terminal supports operation in a local area network environment or in an offline state.
[0049] The input information may include the current query text entered by the user, and may also include the short-term context of the most recent preset rounds in the current session corresponding to the query text (e.g., the short-term context of the most recent 3 to 5 rounds of dialogue in the current session); in addition, the input information may also take the form of voice or video data, etc., without limitation.
[0050] In this step, we obtain the user's input information, which provides a data foundation for determining the long-term memory context and updating the large model as described later.
[0051] Step 102: Determine the long-term memory context based on the input information and the memory management library. The memory management library includes multiple historical interaction records between the user terminal and the large model. The large model and the memory management library are deployed locally on the user terminal.
[0052] The memory management library can be a pre-set database that includes multiple historical interaction records between the user client and the large model, supporting memory data storage, retrieval, updating, and forgetting mechanisms. Specifically, the memory management library can be a type of local vector database based on language memory (e.g., based on the LangMem framework), specifically a scalable, low-latency, semantically aware local memory system that can significantly improve the intent recognition accuracy and response coherence of the large model in complex, long-cycle dialogue scenarios.
[0053] The long-term memory context can be context data constructed based on the multiple historical interaction records, used to characterize the user's long-term interaction state, interaction characteristics, and dialogue preferences.
[0054] The multiple historical interaction records may include sequence data of question and answer texts, operation instructions and related status information generated by the user terminal and the large model during multiple rounds of dialogue.
[0055] The large model can be an artificial intelligence model built based on neural algorithms such as attention layers and feedforward networks. It realizes semantic encoding, context association and information processing through a multi-layer network structure. It has the ability to understand and generate input information such as text and conversation context, supports independent inference operations in offline environment, and can be adapted to a variety of interaction and inference scenarios.
[0056] Specifically, the large model can use the Qwen-32B large language model, which is finely tuned based on a large-scale general corpus and high-quality dialogue data, as the core inference engine. It can be deployed locally on the user's end, so that it still has independent inference capabilities in a completely offline or weak network (such as a local area network) environment.
[0057] More specifically, to ensure the operational efficiency of the large model in resource-constrained environments, it can be lightweighted. This lightweighting process can include half-precision floating-point (FP16) quantization, channel pruning, and knowledge distillation, compressing it into a micro-large model that can run efficiently on consumer-grade graphics processing units (GPUs) or neural processing units (NPUs), while maintaining over 95% of its original performance. This lightweight and localized deployment model not only reduces reliance on cloud connections and improves data privacy and security, but also significantly reduces latency caused by network transmission, providing a fundamental guarantee for real-time response.
[0058] In this step, since both the memory management library and the large model are deployed locally on the user's device, the input information, the multiple historical interaction records, and the output results described later are all stored locally without needing to be uploaded to the cloud. This avoids the risk of user data leakage during transmission and storage, and improves the protection of user data privacy. On the other hand, the long-term memory context is determined based on multiple historical interaction records. This long-term memory context can be used to continuously understand user interaction habits and dialogue preferences, achieving stable and coherent long-term memory interaction of the large model.
[0059] Step 103: Utilize the large model to generate output results based on the input information and the long-term memory context;
[0060] Specifically, generating output results using the large model based on the input information and the long-term memory context can involve fusing the long-term memory context with the input information (e.g., injecting the long-term memory context into the input information) to obtain fused data; then inputting the fused data into the large model to generate output results that align with the user's long-term interaction habits. It can be understood that the process of generating output results using the large model can be considered a generation task.
[0061] In this step, the large model generates output results based on the input information and the long-term memory context, enabling the large model to fully integrate historical interaction data for understanding and generation. This enhances the long-term memory effect of the large model interaction and improves the accuracy of the output results.
[0062] Step 104: Adjust the parameters in the Low-Rank Adaptation (LoRA) matrix according to the input information, the long-term memory context and the output result to obtain the adjusted LoRA matrix. Perform incremental adjustment on the large model according to the adjusted LoRA matrix to obtain the updated large model.
[0063] Optionally, after the LoRA matrix is adjusted, the adjusted LoRA matrix can be stored separately from the large model to support on-demand loading, version rollback, and access control.
[0064] In this step, since the acquisition of user input, the determination of the long-term memory context, the generation of the output result, the adjustment of the parameters of the LoRA matrix, and the update of the large model are all completed locally on the user's end, user data leakage can be effectively prevented and the security of user data privacy can be improved. On the other hand, by adjusting the parameters in the LoRA matrix, the large model is incrementally adjusted to obtain the updated large model. The low-rank adaptation feature of the LoRA matrix can significantly improve the model update speed.
[0065] In this embodiment, the large model generates output results based on the input information and the long-term memory context, which enhances the long-term memory capability of the large model interaction and improves the accuracy of the output results. In addition, since the acquisition of user input, the determination of the long-term memory context, the generation of the output results, and the updating of the large model are all completed locally on the user end, user data leakage can be effectively prevented and the protection of user data privacy can be improved.
[0066] Understandably, the aforementioned large model update method achieves continuous evolution and personalized adaptation capabilities of the large model after deployment through a local incremental training mechanism driven by terminal-side data. It breaks through the static "training-deployment-freeze" mode of existing large models and reconstructs a closed-loop "inference-feedback-learning" mechanism. This enables the large model to continuously optimize its performance during actual use and adapt to users' personalized expression habits, domain terminology preferences, and behavioral pattern evolution.
[0067] Specifically, through continuous local incremental updates, the large-scale model can gradually build up a user-specific model and adaptation, accurately understanding users' colloquial expressions, abbreviation habits, industry terminology, and sentiment tendencies. For example, if a user frequently uses "check phone bill" instead of "check account balance," the large-scale model will automatically adjust the word distribution, increasing the response priority for that expression; if a user repeatedly corrects the pronunciation or meaning of a place name, the large-scale model will learn and solidify this mapping relationship. This incremental update mechanism of the large-scale model achieves truly personalized intelligent services, significantly improving the accuracy of intent recognition and user satisfaction in long-term use.
[0068] In some embodiments, the method further includes:
[0069] A quality score is determined based on the input information, the long-term memory context, and the output result.
[0070] The step of adjusting the parameters in the LoRA matrix based on the input information, the long-term memory context, and the output result includes:
[0071] If the quality score is less than a preset threshold, the parameters in the low-rank adaptation LoRA matrix are adjusted according to the input information, the long-term memory context, and the output result.
[0072] Specifically, the quality score is determined based on the input information, the long-term memory context, and the output result. This can be achieved by performing multi-dimensional analysis based on preset evaluation indicators. The evaluation indicators may include at least one of the following evaluation items: whether the user provides explicit positive feedback, whether there are multiple clarifications or repeated questions, whether the generation task is successfully closed, whether the generated content contains factual errors or logical contradictions, whether new concepts are introduced, whether new terms are introduced, whether new aliases are introduced, and whether new preferences are introduced.
[0073] Specifically, the process of determining the quality score through multi-dimensional analysis based on preset evaluation indicators can be achieved by weighting and summing the above evaluation items according to preset rules; the specific score and evaluation rules for each evaluation aspect can be set as needed by those skilled in the art.
[0074] Optionally, when a new concept, term, alias, or preference is introduced, the quality score can be directly set to be less than a preset threshold to ensure that the new concept, term, alias, or preference can be incorporated into the update process of the large model.
[0075] The size of the preset threshold can be set as needed by those skilled in the art;
[0076] In this embodiment, the large model is updated based on the quality score and a preset threshold. The update is triggered by interactive data such as input information with memory value, long-term memory context and output results, which can improve the long-term memory capacity of the large model.
[0077] Optionally, if the quality score is greater than or equal to a preset threshold, the parameters in the LoRA matrix can be kept unchanged to avoid unnecessary parameter updates and computational overhead.
[0078] In some implementations, adjusting the parameters in the LoRA matrix based on the input information, the long-term memory context, and the output result includes:
[0079] The input information, the long-term memory context, and the output result are desensitized respectively to obtain the processed input information, the processed long-term memory context, and the processed output result.
[0080] The parameters in the LoRA matrix are adjusted based on the processed input information, the processed long-term memory context, and the processed output result.
[0081] The desensitization processing of the input information, the long-term memory context, and the output result may include at least one of the following:
[0082] The input information, the long-term memory context, and the output result are anonymized respectively to remove information that can identify the user, such as name, device unique identifier, ID card information, and other feature information that can be associated with the user.
[0083] The input information, the long-term memory context, and the output result are respectively subjected to preset sensitive information masking or replacement processing. The preset sensitive information includes geographical location information, contact information, communication content, behavioral trajectory information, and account information, etc.
[0084] The input information, the long-term memory context, and the output result are respectively subjected to data generalization processing or encryption processing.
[0085] In this embodiment, by desensitizing the input information, long-term memory context, and output results, sensitive information can be removed, resulting in processed data that does not carry privacy content. Adjusting the LoRA matrix parameters based on the processed data can further improve the security of user data privacy.
[0086] Optionally, the quality score can be anonymized to obtain a processed quality score. Specifically, the anonymization process may include at least one of the following: numerical normalization, numerical generalization, numerical perturbation, or numerical encryption of the quality score, in order to avoid obtaining the user's original data, user identity information, or sensitive information by reverse derivation through the quality score, thereby further improving data security and privacy protection.
[0087] Optionally, adjusting the parameters in the LoRA matrix based on the input information, the long-term memory context, and the output result can also be done by adjusting the parameters in the low-rank adaptation LoRA matrix based on the processed input information, the processed long-term memory context, the processed output result, and the processed quality score, in order to further improve the protection of user data privacy.
[0088] Optionally, the update process of the large model can be carried out in an encrypted environment, thereby improving the protection of user data privacy.
[0089] Optionally, the incremental adjustment of the large model based on the adjusted LoRA matrix to obtain the updated large model can be achieved by introducing a LoRA matrix decomposition module into the attention layer and feedforward network of the large model, updating only a small number of new parameters to effectively adjust the model behavior.
[0090] In some implementations, the step of incrementally adjusting the large model based on the adjusted LoRA matrix to obtain the updated large model includes:
[0091] The main parameters of the large model are frozen and remain unchanged. The main parameters are the parameters in the large model other than the parameters in the LoRA matrix.
[0092] The adjusted LoRA matrix is fused with the weight matrix of the attention layer to which the large model belongs and / or the weight matrix of the feedforward network layer to which it belongs, to obtain the updated large model.
[0093] The attention layer can be at least one of the following in the large model: self-attention layer, multi-head attention layer, grouped attention layer, or sliding window attention layer.
[0094] The feedforward network layer can be at least one of the following: a gated feedforward network layer in a large model, a dimension-upgrading or dimension-reducing feedforward network layer, or a multilayer perceptron layer with activation functions.
[0095] In this embodiment, the adjusted LoRA matrix is fused with the weight matrix of the attention layer and / or the weight matrix of the feedforward network layer to which the large model belongs, to obtain the updated large model. During the update process, only the parameters in the LoRA matrix are updated, which significantly reduces memory usage and computational consumption, and speeds up the update of the large model. In addition, freezing the main parameters of the large model can avoid overfitting and forgetting problems caused by adjusting all parameters of the large model, thus achieving a better model update effect.
[0096] In some implementations, determining the long-term memory context based on the input information and the memory management library includes:
[0097] Based on the semantic vector corresponding to the input information, perform an approximate nearest neighbor (ANN) search on the semantic vectors corresponding to the multiple historical interaction records to obtain a preset number of historical interaction records in the memory management library;
[0098] The system prompts and enhanced historical dialogues are determined based on the preset number of historical interaction records. The system prompts include user history preferences, terminology mapping relationships, and user role information. The enhanced historical dialogues include summary information of the historical interaction records.
[0099] The long-term memory context is determined based on the system prompts and the enhanced history dialogue.
[0100] Each of the multiple historical interaction records can be represented in the form of a semantic vector. This application can use a preset embedding model to vectorize the historical interaction records, generate a semantic vector of a preset dimension (e.g., 768 dimensions), and store the generated semantic vector as a historical interaction record in the memory management library.
[0101] The historical interaction records may also include metadata tags, which may include at least one of the following: timestamp, topic type, memory type, confidence score, access frequency, and privacy level.
[0102] The semantic vector corresponding to the input information can be the input information (e.g., text) encoded into a semantic vector. The semantic vector can be used as a query vector to perform an approximate nearest neighbor search in the vector space, thereby filtering the most semantically relevant historical interaction records (e.g., 5 records) from the memory management library.
[0103] Determining system prompts and enhanced historical dialogues based on the preset number of historical interaction records can avoid context overflow caused by excessively long original memory fragments. For example, if multiple historical interaction records about "the user likes pop music" are retrieved, they can be merged into a single structured statement: "User's music preference: Pop music (confidence: 0.92, most recent mention time: year, month, day)". Similarly, for task-related memories, such as "the user searched for flights from Beijing to Shanghai last week", a summary can be generated: "Historical travel intention: Beijing → Shanghai, time: year, month, day".
[0104] The system prompts and enhanced historical dialogues can be injected into the input information as long-term memory context. The system prompts can include static information such as user history preferences (e.g., long-term user preferences), terminology mapping relationships (e.g., common terminology mapping), and user role information (e.g., role setting information). Specifically, the enhanced historical dialogues can be summary information of historical interaction records inserted into the input information in chronological order, ensuring that the large model has global context awareness and long-term memory capabilities when generating the output results.
[0105] For example, when a user asks "recommend a song" through the user terminal, the big model can generate a personalized recommendation based on the user's memory of "music preference: pop music", rather than a generalized answer.
[0106] In this embodiment, by performing an approximate nearest neighbor search on the semantic vectors of the input information and historical interaction records, a preset number of historical interaction records can be quickly filtered from the memory management library, improving retrieval efficiency and accuracy. Based on the preset number of historical interaction records, system prompts containing user historical preferences, terminology mapping, and user role information, as well as enhanced historical dialogues with summary information, are generated, which can accurately extract long-term user characteristics and thus determine the long-term memory context. This not only enhances the long-term memory capability during large model interaction but also continuously adapts to and evolves the personalized needs of users during large model iterations and updates.
[0107] In some implementations, determining system prompts and enhanced historical dialogues based on the preset number of historical interaction records includes:
[0108] The preset number of historical interaction records are filtered in multiple dimensions to obtain filtered historical interaction records. The multi-dimensional filtering includes at least one of time decay weighted filtering, topic filtering, keyword matching filtering, and privacy level filtering.
[0109] The filtered historical interaction records are structured and parsed to obtain system prompts. An enhanced historical dialogue is generated by summarizing the filtered historical interaction records.
[0110] The time decay weighted filtering can be implemented by weighting historical interaction records according to a time decay factor, prioritizing recent historical interaction records. For example, a corresponding weight can be assigned based on the timestamp of the historical interaction record, with a higher weight for more recent times and a lower weight for more distant times. Historical interaction records within a preset weight range are then filtered to ensure the timeliness of the historical interaction records.
[0111] The topic-based filtering can be based on the topic category corresponding to the historical interaction records, retaining historical interaction records related to the current interaction topic and removing historical interaction records of irrelevant topics; ensuring that the filtered historical interaction records are consistent with the scenario of the current input information;
[0112] The keyword filtering can be performed by matching based on preset keywords or keywords in the input information, retaining historical interaction records containing the target keyword, and removing historical interaction records that do not contain the target keyword; for example, the best matching algorithm (BM25) can be used for keyword matching, and the preset number of historical interaction records can be reordered to enhance the recall capability of key entities.
[0113] The privacy-level filtering can be based on the privacy level of historical interaction records, retaining only historical interaction records within the allowed privacy level range, and blocking historical interaction records with high privacy or prohibited access.
[0114] The structured parsing of the filtered historical interaction records can be performed by extracting and summarizing structured information such as user historical preferences, terminology mapping relationships, user role information and interaction habits, and constructing the system prompts based on the above structured information;
[0115] The process of generating a summary of the filtered historical interaction records can involve retaining key interaction content and core semantics, removing redundant information, and obtaining a time-series interaction summary to form the enhanced historical dialogue; in this application, the enhanced historical dialogue can also be referred to as enhanced dialogue history.
[0116] In this embodiment, the preset number of historical interaction records are filtered in multiple dimensions to accurately select highly relevant, timely, and data privacy compliant interaction information, further improving the security of user data privacy. The filtered historical interaction records are then structured and parsed to generate system prompts to extract the user's key features. Enhanced historical dialogues are generated through summarization, which simplifies the context and preserves the core semantics. This improves the depth of understanding of user intent by long-term memory context, reduces computational overhead, and enhances the interaction effect of the large model.
[0117] Optionally, to further improve the user data privacy protection capability and user-side operating efficiency of the large model update method, the large model update method further includes:
[0118] In the application memory management library based on the LangMem framework, multiple historical interaction records are subject to a tiered access policy based on privacy levels; highly sensitive memories (such as historical interaction records with high privacy levels) can only be accessed after the context requirements corresponding to the user input are clearly defined and after secondary confirmation by the user.
[0119] The client can also support the "memory forgetting" command, which can trigger the secure erasure of the corresponding historical interaction records through natural language commands;
[0120] To avoid re-encoding historical memory records, feature extraction and vector generation can be performed only on newly added interaction content (such as newly added historical interaction records as described later). Real-time insertion can be achieved through the incremental indexing mechanism of the vector database. Combined with locality-sensitive hashing technology, ANN search efficiency can be improved by 40%, and it supports millisecond-level response for millions of historical interaction records.
[0121] In this embodiment, through the LangMem framework and the aforementioned privacy and efficiency optimization mechanisms, this application achieves secure, efficient, and intelligent management of users' long-term memory, breaking through the limitations of existing methods that rely on short-term context. This enables large models to have the dual capabilities of continuous learning and personalized services, while meeting data compliance requirements such as the General Data Protection Regulation (GDPR) and the California Consumer Privacy Act (CCPA). It is applicable to various highly privacy-sensitive scenarios such as intelligent assistants, medical companionship, and educational tutoring.
[0122] In some embodiments, the method further includes:
[0123] If there are no long-term valuable information fragments in the input information, the long-term memory context, and the output result, the memory management library remains unchanged.
[0124] If there are long-term valuable information fragments in the input information, the long-term memory context, or the output result, a user interaction record is constructed based on the input information, the long-term memory context, and the output result. Metadata tags are added to the user interaction record to obtain a new historical interaction record, and the new historical interaction record is stored in the memory management library.
[0125] The long-term value information fragments include at least one of the following: newly confirmed user preference information, newly added term or alias mapping relationships, completed task status information, high-frequency tool call path information, and error correction information; the metadata tags include timestamps, memory types, confidence scores, access frequency, and privacy levels.
[0126] The long-term value information fragment can be identified by performing semantic analysis on the input information, the long-term memory context, or the output result, and using a pre-trained sequence labeling and relation extraction model.
[0127] The newly added historical interaction records can also adopt a vectorized storage mechanism based on the LangMem framework, mapping each newly added historical interaction record to a high-dimensional semantic vector space and storing it in the memory management library; this can support efficient retrieval based on semantic similarity, thereby improving the maintainability and accuracy of the memory system.
[0128] In this embodiment, if there are long-term valuable information fragments in the input information, the long-term memory context, and the output result, the memory management library remains unchanged; if there are long-term valuable information fragments in the input information, the long-term memory context, or the output result, new historical interaction records are constructed and stored in the memory management library, thereby updating the memory management library, improving the timeliness and effectiveness of the data in the memory management library, providing a reliable data source for determining long-term context memory, and thus improving the effect of the large model interaction and the update effect of the large model.
[0129] Optionally, the memory management library can also be used to implement hierarchical storage and intelligent aging mechanism; high-frequency access or recently generated historical interaction records can reside in the memory cache to support low-latency retrieval; low-frequency access but important (e.g., historical interaction records with "important" level tags) are persisted to the memory management library (e.g., the memory management library on the user's local machine) to ensure data security.
[0130] It can also periodically execute memory cleanup strategies: demote or soft-delete historical interaction records that have not been retrieved for a long time, have a confidence level below the threshold, or have been covered by new information, to prevent the memory management library from expanding and affecting performance.
[0131] By deeply integrating with a memory management library based on the LangMem framework, this application enables the continuous accumulation and dynamic evolution of user knowledge, giving the large model long-term memory capabilities and providing more personalized, coherent, and accurate services based on complete historical cognition in subsequent interactions.
[0132] Optionally, in order to enhance the perception and operational capabilities of the external environment during the large model update process, the large model update method may also include a deeply integrated dynamic tool invocation and result fusion mechanism.
[0133] Specifically, a predefined set of structured tool descriptions can be defined, covering local and remote functional modules, such as schedule management, time calculation, unit conversion, database retrieval, knowledge base query, device control, weather service, and flight information retrieval. Each tool is described in a standard structural format (e.g., JavaScript Object Notation (JSON) schema), which may include at least one of the following: tool name, functional semantic description, input parameter types and constraints, calling prerequisites, expected return format, and security permission level. The tool descriptions can be injected into the input information as part of the system prompts and input into the large model, enabling the large model to have a complete understanding of the available functions during the inference and update phases.
[0134] During the reasoning process of the large model, when the large model analyzes that the current user's intent involves external data acquisition, status query, or action execution, it can autonomously determine whether a certain tool needs to be called and generate a tool call request that conforms to a preset structure format. This request can be output in the form of a structured JSON object, which can include the tool name and parameter assignments to ensure the accuracy and automation of parsing. For example, when a user asks "Do I have a meeting tomorrow morning?", after recognizing the intent, the large model generates a call request for the "Schedule Query" tool with parameters "Date = Tomorrow, Time Period = Morning".
[0135] It also supports a hybrid execution mode of local tools and remote application programming interfaces (APIs); for operations involving private data or requiring low latency, the aforementioned local tools and APIs can be executed in the user's local sandbox environment; for services that rely on real-time external data, cloud APIs can be called through a Hypertext Transfer Protocol Secure (HTTPS) channel; all calls are subject to permission verification and auditing to ensure compliance with user authorization policies and improve the security of user data privacy;
[0136] The tool's execution result can be returned in JSON structured data format and automatically appended to the current user input (e.g., the dialogue context), triggering a secondary inference process in the large model. The large model performs semantic parsing and summarization on the user input with the appended tool execution result and generates output in natural language form. For example, if a schedule query returns "There is a weekly meeting at 10:00 tomorrow", the large model will generate the response "You have a weekly meeting at 10:00 tomorrow morning", achieving a seamless integration of tool capabilities and language generation.
[0137] To further enhance the system's intelligence, the fusion mechanism can also introduce a call feedback learning model. This involves continuously recording metrics such as the success rate, response time, and user satisfaction of each tool call, and dynamically optimizing the call strategy based on this data. For high-frequency and stable call patterns, these can be abstracted into local caching rules or lightweight decision trees, prioritizing local processing in subsequent similar requests. This reduces resource consumption on the large model and improves overall response efficiency and stability. This call feedback learning model enables the large model not only to "use tools" but also to evolve by "learning how to use tools better."
[0138] In this embodiment, the deep integration of dynamic tool invocation and result fusion mechanism breaks through the fragmented process of "instruction parsing → rule matching → invocation execution" using static plugins in existing methods. It fully internalizes tool invocation decisions into the semantic understanding and reasoning process of the large model, realizing a leap from "passive response" to "active collaboration".
[0139] Optionally, the large model can employ a streaming decoding mechanism in its inference mode, supporting response generation even before the input text has been fully received. Specifically, after the long-term memory context is constructed, the input information and the long-term memory context are concatenated and fed into the model as the input sequence, without waiting for all contexts to be processed. The model generates output token-by-token based on the autoregressive characteristics of the attention mechanism (Transformer) architecture.
[0140] The generation time of the first token can also be used as a key performance indicator, with a target of less than 200ms. To achieve this goal, speculative decoding (SD) technology can be introduced. This involves using other large models (such as the lightweight Qwen3-1.7B model) to quickly predict candidate sequences of several future tokens, and then having these predictions verified in parallel by the large model. This batch processing acceleration mechanism significantly improves decoding efficiency. This method reduces overall inference latency by 30%-50% while maintaining generation quality, making it suitable for interactive scenarios sensitive to response speed.
[0141] During the generation process, the large model not only performs basic language generation tasks, but also simultaneously completes intent recognition, reference resolution, logical reasoning, and context consistency maintenance. For sentences with referential or ellipsis structures, the model combines the long-term memory entity records provided by the LangMem framework to perform semantic disambiguation, accurately associating historically mentioned people, events, or parameters, and avoiding misunderstandings caused by context breaks. For example, when a user asks "Are there any new songs recently?", the large model can combine the user's music preference record "user music preference: pop music" in its memory to automatically infer that "new songs" refers to pop music, and generate an accurate answer accordingly.
[0142] The output results can be continuously output in the form of a token stream. Each token can be passed to downstream modules through an internal message queue after it is generated, supporting the front-end application to achieve an immersive interactive experience of "generating and displaying at the same time".
[0143] Specifically, the step of generating output results using the large model based on the input information and the long-term memory context may also include real-time quality monitoring of the output results; detecting abnormal patterns such as repetition, off-topic, or logical contradictions, and triggering regeneration or clarification mechanisms when necessary to ensure the naturalness and accuracy of the output results.
[0144] The above reasoning process can be managed by a unified scheduler, which coordinates memory allocation, computing resource scheduling, and input / output (I / O) transmission to ensure stable operation in high-concurrency scenarios.
[0145] It should be noted that the large model update method described above can be executed by an electronic device, that is, all the steps included in the above method are executed by the electronic device, which can be an electronic device such as a server, computer or mobile phone.
[0146] Please see Figure 2 , Figure 2 This is a schematic diagram of the workflow of a large model update system provided in an embodiment of this application. The system includes: a long-term memory context construction and injection module 201, a dynamic tool invocation and result fusion mechanism module 202, a local incremental training and personalized adaptation module 203, a long-term memory update module 204, and a localized large model inference and streaming response generation module 205.
[0147] Through the collaborative work of the above modules, the long-term memory context is determined based on the user input, injected into the user input, and then imported into the large model. This process includes tool invocation and result fusion, local incremental training and personalized adaptation, long-term memory updates (e.g., updating the aforementioned memory management library), and the generation of output results through localized large model inference and streaming response. These output results are then sent to the user. Long-term memory updates enhance the long-term memory capability during large model interactions and enable continuous iterative updates to the large model. Localized deployment of the large model effectively strengthens the privacy and security of user data.
[0148] See Figure 3 , Figure 3 This is a schematic diagram of the structure of a large model update device provided in an embodiment of this application, as shown below. Figure 3 As shown, the large model update device 300 includes:
[0149] The acquisition module is used to acquire input information from the user's client.
[0150] The first processing module 301 is used to determine the long-term memory context based on the input information and the memory management library, wherein the memory management library includes multiple historical interaction records between the user terminal and the large model, and the large model and the memory management library are deployed locally on the user terminal.
[0151] The second processing module 302 is used to generate output results using the large model based on the input information and the long-term memory context.
[0152] The third processing module 303 is used to adjust the parameters in the low-rank adaptation LoRA matrix according to the input information, the long-term memory context and the output result to obtain the adjusted LoRA matrix, and to perform incremental adjustment on the large model according to the adjusted LoRA matrix to obtain the updated large model.
[0153] Optionally, the large model update device 300 further includes: a fourth processing module;
[0154] The fourth processing module is used to determine a quality score based on the input information, the long-term memory context, and the output result;
[0155] The step of adjusting the parameters in the LoRA matrix based on the input information, the long-term memory context, and the output result includes:
[0156] If the quality score is less than a preset threshold, the parameters in the low-rank adaptation LoRA matrix are adjusted according to the input information, the long-term memory context, and the output result.
[0157] Optionally, adjusting the parameters in the LoRA matrix based on the input information, the long-term memory context, and the output result includes:
[0158] The input information, the long-term memory context, and the output result are desensitized respectively to obtain the processed input information, the processed long-term memory context, and the processed output result.
[0159] The parameters in the LoRA matrix are adjusted based on the processed input information, the processed long-term memory context, and the processed output result.
[0160] Optionally, the step of incrementally adjusting the large model based on the adjusted LoRA matrix to obtain the updated large model includes:
[0161] The main parameters of the large model are frozen and remain unchanged. The main parameters are the parameters in the large model other than the parameters in the LoRA matrix.
[0162] The adjusted LoRA matrix is fused with the weight matrix of the attention layer to which the large model belongs and / or the weight matrix of the feedforward network layer to which it belongs, to obtain the updated large model.
[0163] Optionally, determining the long-term memory context based on the input information and the memory management library includes:
[0164] Based on the semantic vector corresponding to the input information, an approximate nearest neighbor search is performed on the corresponding semantic vectors of the multiple historical interaction records to obtain a preset number of historical interaction records in the memory management library.
[0165] The system prompts and enhanced historical dialogues are determined based on the preset number of historical interaction records. The system prompts include user history preferences, terminology mapping relationships, and user role information. The enhanced historical dialogues include summary information of the historical interaction records.
[0166] The long-term memory context is determined based on the system prompts and the enhanced history dialogue.
[0167] Optionally, determining system prompts and enhanced historical dialogues based on the preset number of historical interaction records includes:
[0168] The preset number of historical interaction records are filtered in multiple dimensions to obtain filtered historical interaction records. The multi-dimensional filtering includes at least one of time decay weighted filtering, topic filtering, keyword matching filtering, and privacy level filtering.
[0169] The filtered historical interaction records are structured and parsed to obtain system prompts. An enhanced historical dialogue is generated by summarizing the filtered historical interaction records.
[0170] Optionally, the large model update device 300 may also include: a fifth processing module;
[0171] The fifth processing module is used to maintain the memory management library unchanged when there are no long-term value information fragments in the input information, the long-term memory context, and the output result.
[0172] If there are long-term valuable information fragments in the input information, the long-term memory context, or the output result, a user interaction record is constructed based on the input information, the long-term memory context, and the output result. Metadata tags are added to the user interaction record to obtain a new historical interaction record, and the new historical interaction record is stored in the memory management library.
[0173] The long-term value information fragments include at least one of the following: newly confirmed user preference information, newly added term or alias mapping relationships, completed task status information, high-frequency tool call path information, and error correction information; the metadata tags include timestamps, memory types, confidence scores, access frequency, and privacy levels.
[0174] The large model update device 300 is capable of implementing the various processes of the above-described embodiments of the large model update method. The technical features correspond one-to-one and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0175] This application also provides an electronic device, including: a processor, a memory, and a program stored in the memory and executable on the processor. When the program is executed by the processor, it implements the various processes of the above-described large model update method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0176] For details, see Figure 4 This application also provides an electronic device, including a bus 401, a transceiver 402, an antenna 403, a bus interface 404, a processor 405, and a memory 406.
[0177] The transceiver 402 is used to acquire input information from the user terminal;
[0178] The processor 405 is configured to determine the long-term memory context based on the input information and the memory management library, wherein the memory management library includes multiple historical interaction records between the user terminal and the large model, and the large model and the memory management library are deployed locally on the user terminal.
[0179] The large model is used to generate output results based on the input information and the long-term memory context;
[0180] The parameters in the low-rank adaptation LoRA matrix are adjusted based on the input information, the long-term memory context, and the output result to obtain the adjusted LoRA matrix. The large model is then incrementally adjusted based on the adjusted LoRA matrix to obtain the updated large model.
[0181] Optionally, the processor 405 is further configured to determine a quality score based on the input information, the long-term memory context, and the output result;
[0182] The step of adjusting the parameters in the LoRA matrix based on the input information, the long-term memory context, and the output result includes:
[0183] If the quality score is less than a preset threshold, the parameters in the low-rank adaptation LoRA matrix are adjusted according to the input information, the long-term memory context, and the output result.
[0184] Optionally, adjusting the parameters in the LoRA matrix based on the input information, the long-term memory context, and the output result includes:
[0185] The input information, the long-term memory context, and the output result are desensitized respectively to obtain the processed input information, the processed long-term memory context, and the processed output result.
[0186] The parameters in the LoRA matrix are adjusted based on the processed input information, the processed long-term memory context, and the processed output result.
[0187] Optionally, the step of incrementally adjusting the large model based on the adjusted LoRA matrix to obtain the updated large model includes:
[0188] The main parameters of the large model are frozen and remain unchanged. The main parameters are the parameters in the large model other than the parameters in the LoRA matrix.
[0189] The adjusted LoRA matrix is fused with the weight matrix of the attention layer to which the large model belongs and / or the weight matrix of the feedforward network layer to which it belongs, to obtain the updated large model.
[0190] Optionally, determining the long-term memory context based on the input information and the memory management library includes:
[0191] Based on the semantic vector corresponding to the input information, an approximate nearest neighbor search is performed on the corresponding semantic vectors of the multiple historical interaction records to obtain a preset number of historical interaction records in the memory management library.
[0192] The system prompts and enhanced historical dialogues are determined based on the preset number of historical interaction records. The system prompts include user history preferences, terminology mapping relationships, and user role information. The enhanced historical dialogues include summary information of the historical interaction records.
[0193] The long-term memory context is determined based on the system prompts and the enhanced history dialogue.
[0194] Optionally, determining system prompts and enhanced historical dialogues based on the preset number of historical interaction records includes:
[0195] The preset number of historical interaction records are filtered in multiple dimensions to obtain filtered historical interaction records. The multi-dimensional filtering includes at least one of time decay weighted filtering, topic filtering, keyword matching filtering, and privacy level filtering.
[0196] The filtered historical interaction records are structured and parsed to obtain system prompts. An enhanced historical dialogue is generated by summarizing the filtered historical interaction records.
[0197] Optionally, the processor 405 is further configured to maintain the memory management library unchanged when there are no long-term value information fragments in the input information, the long-term memory context, and the output result;
[0198] If there are long-term valuable information fragments in the input information, the long-term memory context, or the output result, a user interaction record is constructed based on the input information, the long-term memory context, and the output result. Metadata tags are added to the user interaction record to obtain a new historical interaction record, and the new historical interaction record is stored in the memory management library.
[0199] The long-term value information fragments include at least one of the following: newly confirmed user preference information, newly added term or alias mapping relationships, completed task status information, high-frequency tool call path information, and error correction information; the metadata tags include timestamps, memory types, confidence scores, access frequency, and privacy levels.
[0200] exist Figure 4 In this context, a bus architecture (represented by bus 401) is used. Bus 401 can include any number of interconnected buses and bridges, linking various circuits including one or more processors represented by processor 405 and memory represented by memory 406. Bus 401 can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. Bus interface 404 provides an interface between bus 401 and transceiver 402. Transceiver 402 can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by processor 405 is transmitted over a wireless medium via antenna 403, which further receives data and transmits data to processor 405.
[0201] Processor 405 is responsible for managing bus 401 and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management, and other control functions. Memory 406 can be used to store data used by processor 405 during operation.
[0202] Optionally, the processor 405 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or a complex programmable logic device (CPLD).
[0203] This application also provides a computer-readable storage medium storing a computer program. When executed by a processor, this computer program implements the various processes of the above-described large model update method embodiments and achieves the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0204] This application also provides a computer program product, including computer instructions. When executed by a processor, these computer instructions implement the various processes of the above-described large model update method embodiments and achieve the same technical effects. To avoid repetition, they will not be described again here.
[0205] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0206] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0207] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. A method for updating a large model, characterized in that, The method includes: Obtain user input information; The long-term memory context is determined based on the input information and the memory management library, which includes multiple historical interaction records between the user terminal and the large model. The large model and the memory management library are deployed locally on the user terminal. The large model is used to generate output results based on the input information and the long-term memory context; The parameters in the low-rank adaptation LoRA matrix are adjusted based on the input information, the long-term memory context, and the output result to obtain the adjusted LoRA matrix. The large model is then incrementally adjusted based on the adjusted LoRA matrix to obtain the updated large model.
2. The method according to claim 1, characterized in that, The method further includes: A quality score is determined based on the input information, the long-term memory context, and the output result. The step of adjusting the parameters in the LoRA matrix based on the input information, the long-term memory context, and the output result includes: If the quality score is less than a preset threshold, the parameters in the low-rank adaptation LoRA matrix are adjusted according to the input information, the long-term memory context, and the output result.
3. The method according to claim 2, characterized in that, The step of adjusting the parameters in the LoRA matrix based on the input information, the long-term memory context, and the output result includes: The input information, the long-term memory context, and the output result are desensitized respectively to obtain the processed input information, the processed long-term memory context, and the processed output result. The parameters in the LoRA matrix are adjusted based on the processed input information, the processed long-term memory context, and the processed output result.
4. The method according to claim 1, characterized in that, The step of incrementally adjusting the large model based on the adjusted LoRA matrix to obtain the updated large model includes: The main parameters of the large model are frozen and remain unchanged. The main parameters are the parameters in the large model other than the parameters in the LoRA matrix. The adjusted LoRA matrix is fused with the weight matrix of the attention layer to which the large model belongs and / or the weight matrix of the feedforward network layer to which it belongs, to obtain the updated large model.
5. The method according to claim 1, characterized in that, The step of determining the long-term memory context based on the input information and the memory management library includes: Based on the semantic vector corresponding to the input information, an approximate nearest neighbor search is performed on the corresponding semantic vectors of the multiple historical interaction records to obtain a preset number of historical interaction records in the memory management library. The system prompts and enhanced historical dialogues are determined based on the preset number of historical interaction records. The system prompts include user history preferences, terminology mapping relationships, and user role information. The enhanced historical dialogues include summary information of the historical interaction records. The long-term memory context is determined based on the system prompts and the enhanced history dialogue.
6. The method according to claim 5, characterized in that, The step of determining system prompts and enhanced historical dialogues based on the preset number of historical interaction records includes: The preset number of historical interaction records are filtered in multiple dimensions to obtain filtered historical interaction records. The multi-dimensional filtering includes at least one of time decay weighted filtering, topic filtering, keyword matching filtering, and privacy level filtering. The filtered historical interaction records are structured and parsed to obtain system prompts. An enhanced historical dialogue is generated by summarizing the filtered historical interaction records.
7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: If there are no long-term valuable information fragments in the input information, the long-term memory context, and the output result, the memory management library remains unchanged. If there are long-term valuable information fragments in the input information, the long-term memory context, or the output result, a user interaction record is constructed based on the input information, the long-term memory context, and the output result. Metadata tags are added to the user interaction record to obtain a new historical interaction record, and the new historical interaction record is stored in the memory management library. The long-term value information fragments include at least one of the following: newly confirmed user preference information, newly added term or alias mapping relationships, completed task status information, high-frequency tool call path information, and error correction information; the metadata tags include timestamps, memory types, confidence scores, access frequency, and privacy levels.
8. A large model update device, characterized in that, The device includes: The acquisition module is used to acquire input information from the user's client. The first processing module is used to determine the long-term memory context based on the input information and the memory management library, wherein the memory management library includes multiple historical interaction records between the user terminal and the large model, and the large model and the memory management library are deployed locally on the user terminal. The second processing module is used to generate output results based on the input information and the long-term memory context using the large model. The third processing module is used to adjust the parameters in the low-rank adaptation LoRA matrix according to the input information, the long-term memory context and the output result to obtain the adjusted LoRA matrix, and to perform incremental adjustment on the large model according to the adjusted LoRA matrix to obtain the updated large model.
9. An electronic device, characterized in that, include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 7.
11. A computer program product, characterized in that, Includes computer instructions that, when executed by a processor, implement the steps of the method as described in any one of claims 1 to 7.