Memory processing method and device of large language model, electronic equipment and medium

By introducing a memory mechanism into the large language model, extracting and updating user-related memory information, the problem of the large language model lacking memory function when handling user conversations is solved, and the interactive experience and multi-round interaction effect of the model is improved.

CN119740659AActive Publication Date: 2025-04-01BEIJING BAIDU NETCOM SCI & TECH CO LTD

Patent Information

Application Number
CN202411786775.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-01
Estimated Expiration
2044-12-05

AI Technical Summary

Technical Problem

Large language models lack memory functions when handling user conversations, resulting in poor conversation coherence and poor interactions in multiple rounds, especially when context is lost, too long or conflicts, the model effect is significantly reduced.

Method used

The memory mechanism is introduced, by extracting relevant memory information when the user talks with the large language model, and performing conflict detection before depositing it into the memory book. If there is a conflict, the memory in the memory book will be updated, thereby ensuring the accuracy and effectiveness of the memory in the memory book.

Benefits of technology

Through the introduction of memory mechanism, the user interaction experience is improved, the troubles caused by memory conflicts are reduced, the accuracy and effectiveness of memory in the memory book are ensured, and the performance of large language models in multiple rounds of interactions is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119740659A_ABST
    Figure CN119740659A_ABST
Patent Text Reader

Abstract

The invention provides a memory processing method and device for a large language model, electronic equipment, a computer readable storage medium and a computer program product, and relates to the field of artificial intelligence, in particular to the technical field of natural language processing, digital human, intelligent agents and generative search. According to the implementation scheme, in response to received first dialogue information of a user and a first language model, first memory information related to the user is extracted based on the first dialogue information; obtaining one or more pieces of second memory information in a memory book related to the user; performing conflict detection on the first memory information and one or more pieces of second memory information; and in response to determining that the first memory information conflicts with the corresponding second memory information in the one or more pieces of second memory information, deleting the corresponding second memory information in the memory book and storing the first memory information as new second memory information in the memory book.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence, in particular to the fields of natural language processing, digital humans, intelligent agents, and generative search technology, and specifically to a memory processing method, device, electronic device, computer-readable storage medium, and computer program product for a large language model. Background Art

[0002] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing. Artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0003] Human-computer interaction is a way for humans to interact with machines using natural language. With the continuous development of artificial intelligence technology, it has become possible for machines to understand the information output by humans, understand the inherent meaning of the information, and make corresponding feedback. In these operations, accurate understanding of semantics, rapid feedback, and giving corresponding opinions or suggestions have all become factors that affect the smoothness of human-computer interaction.

[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention

[0005] The present disclosure provides a memory processing method, device, electronic device, computer-readable storage medium and computer program product for a large language model.

[0006] According to one aspect of the present disclosure, a memory processing method for a large language model is provided, comprising: in response to receiving first dialogue information between a user and a first language model, extracting first memory information related to the user based on the first dialogue information; acquiring one or more second memory information in a memory book related to the user; performing conflict detection between the first memory information and the one or more second memory information; and in response to determining that the first memory information conflicts with corresponding second memory information in the one or more second memory information, deleting the corresponding second memory information in the memory book and storing the first memory information as new second memory information in the memory book.

[0007] According to another aspect of the present disclosure, a memory processing device for a large language model is provided, comprising: a memory extraction unit, configured to, in response to receiving first dialogue information between a user and a first language model, extract first memory information related to the user based on the first dialogue information; an acquisition unit, configured to acquire one or more second memory information in a memory book related to the user; a conflict detection unit, configured to perform conflict detection on the first memory information and the one or more second memory information; and a memory update unit, configured to, in response to determining that the first memory information conflicts with corresponding second memory information in the one or more second memory information, delete the corresponding second memory information in the memory book and store the first memory information as new second memory information in the memory book.

[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in the present disclosure.

[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to cause a computer to execute the method described in the present disclosure.

[0010] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the method described in the present disclosure when executed by a processor.

[0011] According to one or more embodiments of the present disclosure, the memory extraction function is triggered during a conversation between a user and a large language model, and a memory conflict detection is performed before the extracted memory is stored in a memory book. If a memory conflict occurs, the corresponding memory in the memory book is updated, thereby ensuring the accuracy and effectiveness of the memory in the memory book, greatly improving the user's interactive experience, and reducing the troubles caused by memory conflicts.

[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0014] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;

[0015] Figure 2 A flowchart of a memory processing method of a large language model according to an embodiment of the present disclosure is shown;

[0016] Figure 3 A flowchart of a memory processing method for a large language model according to an embodiment of the present disclosure is shown;

[0017] Figure 4 A flowchart of a memory processing method for a large language model according to another embodiment of the present disclosure is shown;

[0018] Figure 5 A structural block diagram of a memory processing device for a large language model according to an embodiment of the present disclosure is shown; and

[0019] Figure 6 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0020] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0021] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0022] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.

[0023] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0024] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.

[0025] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable the method of memory processing of a large language model to be performed.

[0026] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.

[0027] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.

[0028] The user may use client devices 101, 102, 103, 104, 105 and / or 106 to input corresponding dialog information. The client device may provide an interface that enables the user of the client device to interact with the client device. The client device may also output information to the user via the interface. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.

[0029] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.

[0030] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0031] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0032] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0033] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.

[0034] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0035] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as memory books, conversation information. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.

[0036] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.

[0037] Figure 1The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.

[0038] Large Language Model (LLM) is a generative neural network-based technology that can generate corresponding responses based on user input. However, the large language model itself does not have a memory function, which means that each user's conversation is an independent processing process for the model. In order to ensure the continuity of the conversation and support multiple rounds of interaction, the context conversation content needs to be provided as input to the large language model. If the context is lost, the context is too long, the context dialogue conflicts, etc., the model effect will be poor.

[0039] To solve this problem, a memory mechanism can be introduced. Therefore, according to an embodiment of the present disclosure, a memory processing method for a large language model is provided.

[0040] Figure 2 A flow chart of a memory processing method for a large language model according to an embodiment of the present disclosure is shown, Figure 2 As shown, method 200 includes: in response to receiving first dialogue information between a user and a first language model, extracting first memory information related to the user based on the first dialogue information (step 210); acquiring one or more second memory information in a memory book related to the user (step 220); performing conflict detection between the first memory information and the one or more second memory information (step 230); and in response to determining that the first memory information conflicts with corresponding second memory information in the one or more second memory information, deleting the corresponding second memory information in the memory book and storing the first memory information as new second memory information in the memory book (step 240).

[0041] According to the embodiments of the present disclosure, the memory extraction function is triggered during the conversation between the user and the large language model, and a memory conflict detection is performed before the extracted memory is stored in the memory book. If a memory conflict occurs, the corresponding memory in the memory book is updated, thereby ensuring the accuracy and effectiveness of the memory in the memory book, greatly improving the user's interactive experience, and reducing the troubles caused by memory conflicts.

[0042] In some embodiments, the first dialogue information may be input by the user in the form of text, voice, etc. When input in the form of voice, the voice may be converted into text through voice recognition technology to obtain the first dialogue information.

[0043] According to some embodiments, extracting first memory information related to the user based on the first conversation information includes: inputting the first conversation information and a first preset instruction into a second language model to obtain the first memory information generated by the second language model, wherein the first preset instruction is used to guide the generation process of the first memory information.

[0044] Specifically, in some examples, the corresponding memory information can be extracted from the first dialogue information through the large language model. It is understandable that the second language model used to implement memory extraction and the first language model for dialogue with the user can be the same model or different models, which is not limited here.

[0045] In some examples, the first preset instruction is used to guide the generation process of the first memory information.

[0046] Therefore, when the first dialogue information for the first language model is obtained, at least one first preset instruction (prompt) can be introduced to guide the second language model to extract memory information related to the user's facts, preferences, etc. in the first dialogue information, thereby realizing automatic extraction of memory information and improving user experience.

[0047] In some examples, the extracted memory information may be information related to the user's facts, preferences, etc. Here, "facts" may refer to the user's own attributes, such as age, place of origin, gender, education, etc.; "preferences" may refer to the user's preference or orientation towards things, representing the user's inclination towards one or a category of things, such as food tastes, interests, and hobbies.

[0048] In some examples, the first preset instruction may include at least one of the following items: background knowledge to indicate that the current task is to extract user-related memories in the current conversation information; information to guide the generation of memories that are more in line with user expectations or in a more structured form, for example, "multiple memories can be extracted at the same time", "the extracted memories should be concise and rich in information", etc.

[0049] For example, the first preset instruction may be as follows:

[0050] “#YourPersonality: You are an expert at retrieving memories. You can easily infer facts, preferences, and memories from the text provided, while returning them succinctly.

[0051] #Core task: Infer user facts and preferences based on {conversation information}:

[0052] #Core Requirements:

[0053] -Facts, preferences, and memories should be concise and informative;

[0054] -Don't start with "This person likes xx". Instead, start with "The user likes xx";

[0055] -Do not remember provided user / agent details. Only remember facts, preferences and memories;

[0056] -Multiple memories can be retrieved at the same time.

[0057] #Details: {Conversation information}

[0058] #Reply example: {Extracted memory}".

[0059] Through the above-mentioned first preset instruction, for example, when the dialogue information of "remember that I like to eat strawberries" is input, the extracted memory of "the user likes to eat strawberries" can be obtained.

[0060] It is understandable that the corresponding memory information may also be obtained based on the dialogue information by any other suitable method, including but not limited to semantic analysis, and other methods based on deep learning or machine learning.

[0061] In the present disclosure, "conflict detection" refers to knowledge conflict detection, which is used to detect whether there is a semantic inconsistency or contradiction between multiple memories. For example, if one memory indicates that the user is 18 years old this year, and another memory indicates that the user is 19 years old this year, it can be seen that there is an inconsistency or contradiction between the two memories. Through conflict detection, it can be automatically determined whether there is a conflict between the two memories.

[0062] According to some embodiments, performing conflict detection on the first memory information and the one or more second memory information includes: inputting the first memory information, the one or more second memory information, and a second preset instruction into a third language model to obtain a conflict detection result generated by the third language model, wherein the conflict detection result is used to indicate whether there is a conflict between the first memory information and the corresponding second memory information in the one or more second memory information, and wherein the at least one preset instruction is used to guide the generation process of the conflict detection result.

[0063] In some examples, the conflict detection result can be used to indicate which of the one or more second memory information the first memory information conflicts with. In some cases, the conflict detection result can also include: the reason why the first memory information conflicts with the second memory information. Through the conflict detection result, the system can accurately implement the update of the memory book.

[0064] In some examples, the conflict detection result may be new memory book data formed by a new set of second memory information. For example, the new memory book data includes: the second memory information remaining in the original memory book after deleting the second memory information that conflicts with the first memory information, and the new second memory information generated by the first memory information. In this case, the original memory book data may be directly replaced by the new memory book data. Thus, the memory in the memory book is updated, modified, and maintained based on the newly extracted memory through the large language model.

[0065] In some examples, the second preset instruction may include at least one of the following items: background knowledge to indicate that the current task is to detect conflicts between new memories and existing memories; information to guide the generation of conflict detection results that are more in line with user expectations or in a more structured form, for example, "build a JSON object that meets the requirements to represent the new memory book data", etc.

[0066] For example, the second preset instruction may be as follows:

[0067] “#YourPersonality: You are an expert at merging, updating, and organizing memories. As you gain access to existing memories and new information, your task is to merge and update your memory lists to reflect the most accurate and up-to-date information. You are also given a score for how well each existing memory matches the new information. Be sure to use this information to make informed decisions about which memories to update or merge.

[0068] #Core task: Calculate the fused memory based on {existing memory} and {new memory}.

[0069] #Core Requirements:

[0070] - Eliminate duplicate memories and merge related memories to keep the list concise and up-to-date.

[0071] If the new information directly contradicts several memories, carefully evaluate these three pieces of information:

[0072] -If the new memory conflicts with multiple old memories, please refer to the first old memory;

[0073] - Update the old memory with the new one if the new one provides newer or more accurate updated content

[0074] Remember and update as_id at the same time;

[0075] -If the new memory seems inaccurate or not detailed enough, keep the original memory and discard the new one.

[0076] -Maintain a consistent, clear style across all memories, ensuring each entry is concise and informative.

[0077] -If the new memory is a variation or extension of an existing memory, update the existing memory to reflect the new information.

[0078] Here are the task details:

[0079] - Existing memory: {Existing memory}

[0080] -New Memory: {New Memory}

[0081] #Output format:

[0082] -Output in JSON format. This JSON object contains the following properties

[0083] -The type of the attribute name "id" is Interger, which means the second memory identifier.

[0084] -The type of the attribute name "content" is String, and its meaning is [user memory].

[0085] -The type of the attribute name "as_id" is String, and its meaning is [first memory identifier].

[0086] #Notice:

[0087] - No need to explain the reason, just output in the output format.

[0088] -Build a JSON object that meets the requirements".

[0089] It is understandable that the above second preset instruction is merely exemplary and is not intended to be limiting.

[0090] In some embodiments, any one of the first language model, the second language model, and the third language model can be a knowledge-enhanced large language model for conversation (e.g., ERNIE bot, etc.), and the first language model is obtained by training with massive knowledge resources and conversation data (e.g., more than trillions of web page data, billions of search data, hundreds of millions of image data, billions of voice request data, more than 50 billion text request data, and more than 550 billion factual knowledge every day).

[0091] Therefore, the application of this type of model can not only directly process small talk conversation information, but also directly generate reply information for logical reasoning, common sense, and image generation conversation information, which can further improve the generation efficiency while generating higher quality reply information.

[0092] According to some embodiments, the method further includes: in response to determining that there is no conflict between the first memory information and the one or more second memory information, storing the first memory information as new second memory information in the memory book.

[0093] Through the above-mentioned embodiments, by capturing the latest conversation information and updating the long-term memory in real time, a more human-like memory mechanism is provided to ensure the timeliness and accuracy of the long-term memory.

[0094] According to some embodiments, the extracted first memory information includes a corresponding first memory identifier.

[0095] Specifically, the first memory identifier can be used to uniquely identify the first memory information. In the above embodiment of obtaining the first memory information based on the second language model, the first memory information output by the second language model may include the corresponding first memory identifier. Alternatively, after obtaining the first memory information returned by the second language model, a first memory identifier for uniquely identifying the first memory information may be generated.

[0096] Therefore, according to some embodiments, the new second memory information includes a second memory identifier corresponding to the first memory identifier. That is, after the first memory information is updated to the memory book as the new second memory information, the new second memory information is assigned the second memory identifier corresponding to the first memory identifier.

[0097] In some examples, "the new second memory information includes a second memory identifier corresponding to the first memory identifier" may mean that the second memory identifier of the new second memory information may be the first memory identifier of the corresponding first memory information. For example, after obtaining the extracted first memory information, the memory extraction ID (as-id) corresponding to the first memory information is obtained; after the first memory information is updated as the new second memory information to the memory book, the second memory information may also be uniquely identified by the memory extraction ID (as-id).

[0098] In some examples, "the new second memory information includes a second memory identifier corresponding to the first memory identifier" may also mean: after generating the new second memory information in the memory book, generating a second memory identifier for uniquely identifying the second memory information, and storing the second memory identifier in association with the first memory identifier of the corresponding first memory information. For example, after obtaining the extracted first memory information, obtain the memory extraction ID (as-id) corresponding to the first memory information; after updating the first memory information as the new second memory information to the memory book, generate a second memory identifier (m-id) for uniquely identifying the new second memory information, and store the memory extraction ID (as-id) in association with the second memory identifier (m-id) (such as: as-id—m-id).

[0099] In the above embodiment, by representing the new second memory information through the second memory identifier corresponding to the first memory identifier, it is convenient to determine which first memory information (i.e., the first conversation information) the corresponding second memory information in the memory book originates from. Thus, the memory stored in the memory book is associated with the conversation information, which is convenient for the user to retrieve the memory.

[0100] According to some embodiments, each of the one or more second memory information includes a corresponding second memory identifier. Deleting the corresponding second memory information and storing the first memory information as new second memory information in the memory book includes: storing the deleted second memory identifier of the corresponding second memory information in association with the second memory identifier of the new second memory information.

[0101] Specifically, for example, the second memory information that conflicts with the first memory information includes a memory identifier as-id1, and the first memory information (i.e., the new second memory information) used to replace the conflicting memory includes a memory identifier as-id2. After deleting the conflicting memory in the memory book, its memory identifier is associated with the memory identifier of the new replacement memory, that is, as-id1 and as-id2 are associated and stored.

[0102] Through the above embodiment, the memory identifier of the deleted memory in the memory book is associated with the memory identifier of the new memory and stored, so that the deleted memory (i.e., the old memory) can be recorded because of which new memory replaced it. Thus, it is convenient for subsequent users to recall the memory and facilitate subsequent viewing and management.

[0103] According to some embodiments, Figure 3 As shown, the method according to the present disclosure may also include (method 300): displaying the extracted first memory information (step 310); in response to receiving a first operation, determining whether second memory information corresponding to the first memory information already exists in the memory book, wherein the first operation is used to update the first memory information to the memory book (step 320); in response to determining that second memory information corresponding to the first memory information exists in the memory book, generating first prompt information (step 330); and in response to determining that second memory information corresponding to the first memory information does not exist in the memory book, storing the first memory information as new second memory information in the memory book (step 340).

[0104] In some examples, displaying the extracted first memory information may include: displaying the extracted first memory information through a user interface. That is, the extracted memory may be displayed to the user. The user may anchor the displayed memory to the memory book by himself, and when the corresponding memory already exists in the memory book, the user is prompted, for example, prompting "the memory already exists in the memory book".

[0105] In some examples, after the extracted first memory information is obtained, conflict detection and display operations of the first memory information may be performed in parallel.

[0106] Through the above embodiments, the level of user experience is further improved, and memory loss can be effectively prevented.

[0107] According to some embodiments, the method further includes: in response to receiving a second operation, deleting second memory information corresponding to the second operation in the memory book, wherein the second operation is used to delete the second memory information.

[0108] Through the above embodiments, the user can delete the corresponding memories in the memory book by himself through corresponding operations, so that the user can manage and maintain the relevant memories in the memory book by himself, which greatly improves the user's interactive experience and reduces the troubles caused by memory conflicts.

[0109] According to some embodiments, Figure 4 As shown, according to the method disclosed herein, it may also include (method 400): in response to receiving a third operation, obtaining a first memory identifier of the first memory information corresponding to the third operation (step 410); determining a second memory identifier corresponding to the first memory identifier (step 420); in response to the existence of a second memory identifier corresponding to the first memory identifier, querying the memory book for the second memory information corresponding to the second memory identifier (step 430); in response to querying the second memory information corresponding to the second memory identifier, locating and displaying the second memory information corresponding to the second memory identifier in the memory book (step 440), wherein the third operation is used to view the second memory information corresponding to the first memory information.

[0110] In this embodiment, the third operation is used to view the second memory information corresponding to the first memory information.

[0111] In some examples, the extracted first memory information can be displayed along with user operations (e.g., operations of multiple rounds of dialogue information between the user's browser and the model). For example, when the user browses to the corresponding dialogue information, the extracted first memory information corresponding to the dialogue information is displayed near the dialogue information (e.g., in the form of a pop-up window). At this time, the user can initiate a third operation related to the first memory information, for example, by clicking on the first memory information, to realize the operation of viewing the corresponding second memory information in the memory book. Through the above operation, the location of the corresponding second memory information in the memory book can be automatically located and the second memory information can be displayed.

[0112] In some examples, the user can view the multi-round dialogue information (i.e., context information) with the large language model. For example, by clicking on the corresponding dialogue information, the user can initiate a third operation related to the first memory information extracted through the dialogue information. At this time, the first memory identifier of the first memory information corresponding to the dialogue information can be obtained, and then the corresponding second memory information in the memory book can be automatically located and displayed.

[0113] According to some embodiments, the method according to the present disclosure also includes: in response to not finding the second memory information corresponding to the second memory identifier, determining whether there is a second memory identifier associated with the second memory identifier; in response to the existence of the associated second memory identifier, querying the memory book for the second memory information corresponding to the associated second memory identifier; in response to finding the second memory information corresponding to the associated second memory identifier, locating and displaying the second memory information corresponding to the associated second memory identifier in the memory book.

[0114] In some examples, the second memory information associated with the corresponding conversation information (first memory information) is viewed through the third operation. When the second memory information (i.e., old memory) associated with the conversation information has been updated or deleted, the new memory in the memory book can be automatically located based on the associated second memory identifier and displayed.

[0115] According to some embodiments, the method according to the present disclosure further includes: in response to the absence of the associated second memory identifier, generating second prompt information.

[0116] In some examples, the second memory information associated with the corresponding dialogue information (first memory information) is viewed through a third operation. When the second memory information (i.e., old memory) associated with the dialogue information has been updated or deleted, the new memory in the memory book can be automatically located based on the associated second memory identifier and the new memory can be displayed. If the associated second memory identifier is not found, that is, there is no new memory to update the old memory, the user can be prompted that the memory has been deleted.

[0117] According to some embodiments, the method according to the present disclosure may further include: in response to obtaining second dialogue information input by the user, inputting the second dialogue information and corresponding second memory information in the memory book into the first language model to generate reply information for replying to the second dialogue information.

[0118] In some embodiments, the second dialogue information is a new round of dialogue between the user and the large language model. The second dialogue information can be input by the user in the form of text, voice, etc. When input in the form of voice, the voice can be converted into text through voice recognition technology to obtain the second dialogue information.

[0119] Through the above embodiment, when conducting questions and answers based on the first language model, the user's memory in the memory book is also input into the first language model to ensure that the memory in the memory book is effectively used in the conversation, so as to improve the coherence and intelligence level of the conversation between the user and the first language model. Therefore, even in the face of complex and changeable multi-round conversation scenarios, the first language model can rely on its excellent memory maintenance ability and conversation focus to answer users' questions more efficiently and ensure that every communication is accurate and correct.

[0120] According to the embodiments of the present disclosure, Figure 5 As shown, a memory processing device 500 for a large language model is also provided, including: a memory extraction unit 510, configured to extract first memory information related to the user based on the first dialogue information in response to receiving first dialogue information between the user and the first language model; an acquisition unit 520, configured to acquire one or more second memory information in a memory book related to the user; a conflict detection unit 530, configured to perform conflict detection on the first memory information and the one or more second memory information; and a memory update unit 540, configured to delete the corresponding second memory information in the memory book and store the first memory information as new second memory information in the memory book in response to determining that the first memory information conflicts with the corresponding second memory information in the one or more second memory information.

[0121] Here, the operations of the above-mentioned units 50-540 of the memory processing device 500 for a large language model are similar to the operations of steps 210-240 described above, and will not be repeated here.

[0122] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0123] According to an embodiment of the present disclosure, an electronic device, a readable storage medium and a computer program product are also provided.

[0124] refer to Figure 6 , a block diagram of an electronic device 600 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0125] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0126] Multiple components in the electronic device 600 are connected to the I / O interface 605, including: an input unit 606, an output unit 607, a storage unit 608, and a communication unit 609. The input unit 606 can be any type of device that can input information to the electronic device 600. The input unit 606 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 607 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 608 can include but is not limited to a disk, an optical disk. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0127] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as method 200. For example, in some embodiments, the method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the method 200 in any other appropriate manner (e.g., by means of firmware).

[0128] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0129] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0130] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0131] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0132] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0133] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0134] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0135] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.

Claims

1. A memory processing method for a large language model, comprising: In response to receiving first dialogue information between a user and a first language model, extracting first memory information related to the user based on the first dialogue information; Acquire one or more second memory information in a memory book related to the user; Performing conflict detection between the first memory information and the one or more second memory information; as well as In response to determining that the first memory information conflicts with corresponding second memory information in the one or more second memory information, the corresponding second memory information in the memory book is deleted and the first memory information is stored in the memory book as new second memory information.

2. The method of claim 1, wherein: The extracted first memory information includes a corresponding first memory identifier, and wherein the new second memory information includes a second memory identifier corresponding to the first memory identifier.

3. The method of claim 2, wherein: Each of the one or more pieces of second memory information includes a corresponding second memory identifier, and wherein deleting the corresponding second memory information and storing the first memory information as new second memory information in the memory book includes: The deleted second memory identifier of the corresponding second memory information is associated with the second memory identifier of the new second memory information and stored.

4. The method according to any one of claims 1 to 3, further comprising: Displaying the extracted first memory information; In response to receiving a first operation, determining whether second memory information corresponding to the first memory information already exists in the memory book, wherein the first operation is used to update the first memory information to the memory book; In response to determining that second memory information corresponding to the first memory information exists in the memory book, generating first prompt information; and In response to determining that the second memory information corresponding to the first memory information does not exist in the memory book, the first memory information is stored in the memory book as new second memory information.

5. The method according to any one of claims 1 to 3, further comprising: In response to receiving a second operation, deleting second memory information corresponding to the second operation in the memory book, wherein the second operation is used to delete the second memory information.

6. The method of claim 3, further comprising: In response to receiving the third operation, acquiring a first memory identifier of the first memory information corresponding to the third operation; Determining a second memory identifier corresponding to the first memory identifier; In response to the existence of a second memory identifier corresponding to the first memory identifier, querying the memory book for second memory information corresponding to the second memory identifier; In response to finding the second memory information corresponding to the second memory identifier, locating and displaying the second memory information corresponding to the second memory identifier in the memory book, The third operation is used to view the second memory information corresponding to the first memory information.

7. The method of claim 6, further comprising: In response to not finding the second memory information corresponding to the second memory identifier, determining whether there is a second memory identifier associated with the second memory identifier; In response to the existence of the associated second memory identifier, querying the memory book for second memory information corresponding to the associated second memory identifier; In response to querying the second memory information corresponding to the associated second memory identifier, the second memory information corresponding to the associated second memory identifier in the memory book is located and displayed.

8. The method of claim 7, further comprising: In response to the absence of a second memory identifier associated with the second memory identifier, second prompt information is generated.

9. The method of claim 1, further comprising: In response to obtaining the second dialogue information input by the user, the second dialogue information and the corresponding second memory information in the memory book are input into the first language model to generate reply information for replying to the second dialogue information.

10. The method of claim 1, wherein: Extracting first memory information related to the user based on the first conversation information includes: The first dialogue information and the first preset instruction are input into a second language model to obtain the first memory information generated by the second language model, wherein the first preset instruction is used to guide the generation process of the first memory information.

11. The method of claim 1 , further comprising: In response to determining that there is no conflict between the first memory information and the one or more second memory information, the first memory information is stored in the memory book as new second memory information.

12. The method according to claim 1 or 11, wherein: Performing conflict detection on the first memory information and the one or more second memory information includes: inputting the first memory information, the one or more second memory information, and the second preset instruction into a third language model to obtain a conflict detection result generated by the third language model, wherein the conflict detection result is used to indicate whether the first memory information conflicts with corresponding second memory information in the one or more second memory information, The at least one preset instruction is used to guide the generation process of the conflict detection result.

13. A memory processing device for a large language model, comprising: a memory extraction unit, configured to, in response to receiving first dialogue information between a user and a first language model, extract first memory information related to the user based on the first dialogue information; an acquisition unit, configured to acquire one or more pieces of second memory information in a memory book related to the user; a conflict detection unit, configured to perform conflict detection between the first memory information and the one or more second memory information; as well as A memory updating unit is configured to delete the corresponding second memory information in the memory book and store the first memory information as new second memory information in the memory book in response to determining that the first memory information conflicts with corresponding second memory information in the one or more second memory information.

14. The device of claim 13, wherein: The extracted first memory information includes a corresponding first memory identifier, and wherein the new second memory information includes a second memory identifier corresponding to the first memory identifier.

15. The device of claim 14, wherein: Each of the one or more second memory information includes a corresponding second memory identifier, and wherein the memory update unit includes: a unit for storing the deleted second memory identifier of the corresponding second memory information in association with the second memory identifier of the new second memory information.

16. The device according to any one of claims 13 to 14, further comprising: a unit for displaying the extracted first memory information; a unit for determining, in response to receiving a first operation, whether second memory information corresponding to the first memory information already exists in the memory book, wherein the first operation is used to update the first memory information to the memory book; A unit for generating first prompt information in response to determining that second memory information corresponding to the first memory information exists in the memory book; and A unit for storing the first memory information as new second memory information in the memory book in response to determining that the second memory information corresponding to the first memory information does not exist in the memory book.

17. The apparatus of any one of claims 13-14, further comprising: A unit for deleting second memory information corresponding to the second operation in the memory book in response to receiving the second operation, wherein the second operation is used to delete the second memory information.

18. The apparatus of claim 15, further comprising: a unit for, in response to receiving a third operation, acquiring a first memory identifier of first memory information corresponding to the third operation; a unit for determining a second memory identifier corresponding to the first memory identifier; A unit for querying the memory book for second memory information corresponding to the second memory identifier in response to the presence of the second memory identifier corresponding to the first memory identifier; a unit for locating and displaying the second memory information corresponding to the second memory identifier in the memory book in response to querying the second memory information corresponding to the second memory identifier; The third operation is used to view the second memory information corresponding to the first memory information.

19. The apparatus of claim 18, further comprising: A unit for determining whether there is a second memory identifier associated with the second memory identifier in response to failure to find the second memory information corresponding to the second memory identifier; a unit for querying the memory book for second memory information corresponding to the associated second memory identifier in response to the existence of the associated second memory identifier; A unit for locating and displaying the second memory information corresponding to the associated second memory identifier in the memory book in response to querying the second memory information corresponding to the associated second memory identifier.

20. The apparatus of claim 19, further comprising: A unit for generating second prompt information in response to the absence of a second memory identifier associated with the second memory identifier.

21. The apparatus of claim 13, further comprising: A unit for, in response to obtaining second dialogue information input by a user, inputting the second dialogue information and corresponding second memory information in the memory book into the first language model to generate reply information for replying to the second dialogue information.

22. The device of claim 13, wherein: The memory extraction unit comprises: A unit for inputting the first dialogue information and a first preset instruction into a second language model to obtain the first memory information generated by the second language model, wherein the first preset instruction is used to guide the generation process of the first memory information.

23. The apparatus of claim 13, further comprising: In response to determining that there is no conflict between the first memory information and the one or more second memory information, the first memory information is stored in the memory book as new second memory information.

24. The device of claim 13 or 23, wherein: The conflict detection unit comprises: a unit for inputting the first memory information, the one or more second memory information, and a second preset instruction into a third language model to obtain a conflict detection result generated by the third language model, wherein the conflict detection result is used to indicate whether the first memory information conflicts with corresponding second memory information in the one or more second memory information, The at least one preset instruction is used to guide the generation process of the conflict detection result.

25. An electronic device comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 12.

26. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-12.

27. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented.

Citation Information

Patent Citations

  • Man-machine conversation generation method and device, electronic equipment and storage medium

    CN114969250A

  • Conversation memory storage and extraction method and electronic equipment

    CN117216180A

  • Information storage method and device, electronic equipment and storage medium

    CN118012328A

  • Dialogue system and dialogue processing method

    US20200320981A1

  • Information interaction method and apparatus, device and medium

    WO2024036899A1

Cited By

  • Memory management method, memory management device and computer storage medium

    CN121029932A

  • Intelligent agent-based business processing method and apparatus, electronic device, and storage medium

    CN122529669A