Interaction method, device and equipment based on memory system, storage medium and vehicle
Through the interaction method based on the memory system, users' long-term memory and short-term memory are acquired and integrated, and prompt words are generated, which solves the problem that the language model cannot fully consider user background information, and significantly improves the accuracy of the reply.
Patent Information
- Application Number
- CN202411804130.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-12-09
AI Technical Summary
When generating reply statements, existing language models cannot fully consider the user's long-term interests and background information, resulting in low accuracy of reply.
Through the interaction method based on the memory system, users' long-term memory, short-term memory and memory summary are obtained and fused, prompt words are generated, and inputted into the trained language big model to improve the accuracy of the reply.
By combining the user's historical behavior and current context information, the language model is more accurate when generating replies, reducing misunderstandings and context breaks, and significantly improving the accuracy of replies.
Smart Images

Figure CN119293191A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of language model technology, and in particular, relates to an interaction method, device, equipment, storage medium and vehicle based on a memory system. Background Art
[0002] During the conversation between the user and the language model, after the user enters a query, the electronic device usually splices the query with the user's previous conversation content to obtain a prompt word, and then uses the prompt word as the input of the language model. This splicing method maintains the continuity of the conversation and the consistency of the context.
[0003] However, the above method cannot add the user's historical behavior to the prompt word. Therefore, the language model cannot fully consider the user's long-term interests and background information, and is prone to missing key information, affecting the accuracy and depth of the reply, resulting in low accuracy of the reply sentence generated by the language model based on the prompt word. Summary of the invention
[0004] The embodiments of the present application provide an interactive method, device, equipment, storage medium and vehicle based on a memory system, which can solve the problem of low accuracy of reply sentences of existing large language models.
[0005] In a first aspect, an embodiment of the present application provides an interaction method based on a memory system, the method comprising: Get the input query statement; Determine a target memory associated with the query statement through a language macro model, wherein the target memory includes at least one of a long-term memory, a short-term memory, and a memory summary, and the memory summary is a content obtained by summarizing the long-term memory and the short-term memory through the language macro model; Merging the target memory and the query sentence to obtain a prompt word; The prompt word is input into a trained language model to obtain a response sentence output by the language model.
[0006] In some embodiments, before determining the target memory associated with the query statement by using the language big model, the method further includes: Acquire transient memory, wherein the transient memory includes at least one of device information of an interactive device, feature information of a user, and interaction information between the user and the interactive device; The instantaneous memory is sorted according to a preset specification to obtain a short-term memory; The short-term memory is incrementally processed to obtain behavior sequence data, and the long-term memory is generated according to the behavior sequence data.
[0007] In some embodiments, the organizing the transient memory according to a preset specification includes at least one of the following: cleaning the noise data or invalid data in the transient memory; performing normalization processing on the instantaneous memory; Aggregate the repeated data in the transient memory.
[0008] In some embodiments, when the interactive device is a vehicle, the transient memory includes vehicle control signals, sensor signals of the vehicle, and at least one of image information, voice information, and text information received by the vehicle.
[0009] In some embodiments, the long-term memory includes a summary, and the summary includes an overall summary and a topic summary. After obtaining the input query statement, the method further includes: Determine a topic tag corresponding to the query statement; Querying a first topic abstract corresponding to the topic tag; The overall abstract and the first topic abstract are updated according to the query statement.
[0010] In some embodiments, the long-term memory includes preference data, and the preference data includes primary topic preference and secondary topic preference. After obtaining the input query statement, the method further includes: Determine a primary topic tag and a secondary topic tag corresponding to the query statement; Obtaining primary preference data of the primary topic tag and secondary preference data corresponding to the secondary topic tag; The primary preference data and the secondary preference data are updated according to the query statement.
[0011] In some embodiments, the secondary preference data includes memory strength, and updating the secondary preference data according to the query statement includes: Determining the relevance between the query statement and the secondary topic tag; Acquire the total number of interactions associated with the secondary topic tag and a first time interval, wherein the first time interval is the time interval between the time when the query statement is acquired and the time when the interaction information associated with the secondary topic tag is last received; The memory strength is updated according to the correlation, the total number of interactions, and the first time interval.
[0012] In some embodiments, the method for generating the memory summary comprises: Acquire N memory fragments matching the query statement by target matching, wherein the target matching method includes at least one of keyword matching and vector matching, and N is a positive integer; Sorting the N memory segments according to the correlation between the N memory segments and the query statement, and selecting P memory segments with the highest correlation from the sorted N memory segments, where P is a positive integer less than or equal to N; Input the P memory fragments, the query statement, and the short-term memory associated with the query statement into the language macro model to obtain K memory fragments obtained by the language macro model based on the thought chain reasoning, wherein the P memory fragments include the K memory fragments, and K is a positive integer less than P; The K memory fragments and the short-term memory associated with the query statement are summarized by the language macro model to obtain the memory summary.
[0013] In a second aspect, an embodiment of the present application provides an interactive device based on a memory system, the device comprising: A first acquisition module, used to acquire an input query statement; A first determination module is configured to determine a target memory associated with the query statement through a language macro model, wherein the target memory includes at least one of a long-term memory, a short-term memory, and a memory summary, and the memory summary is a content obtained by summarizing the long-term memory and the short-term memory through the language macro model; A fusion module, used to fuse the target memory and the query sentence to obtain a prompt word; The reply module is used to input the prompt word into the trained language model to obtain the reply sentence output by the language model.
[0014] In a third aspect, an embodiment of the present application provides an interactive device based on a memory system, the device comprising: a processor and a memory storing computer program instructions; The processor implements the above memory system-based interaction method when executing computer program instructions.
[0015] In a fourth aspect, an embodiment of the present application provides a computer storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the above-mentioned memory system-based interaction method is implemented.
[0016] In a fifth aspect, an embodiment of the present application provides a vehicle, comprising computer program instructions, which, when executed by a processor, implement the above-mentioned memory system-based interaction method.
[0017] In the present application, since the target memory includes the user's long-term memory, short-term memory and memory summary, the target memory can fully reflect the user's historical behavior, preferences and interaction records, as well as the current context information. Therefore, by combining the target memory with the query sentence to obtain the prompt word, and inputting the prompt word into the language model to obtain the reply sentence, the model can not only rely on the current input when generating a reply, but also combine the user's short-term context information and long-term interests and background. Therefore, the language model is more accurate in understanding user needs, can reduce misunderstandings or context breaks, and can also generate replies that are more in line with personal needs based on the user's historical behavior, thereby significantly improving the accuracy of the reply. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1 is a flowchart of an interactive method based on a memory system provided in one embodiment of the present application; Figure 2 is a schematic diagram of the structure of an interactive device based on a memory system provided in an embodiment of the present application; Figure 3 It is a schematic diagram of the hardware structure of an interactive device based on a memory system provided in one embodiment of the present application. DETAILED DESCRIPTION
[0020] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.
[0021] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0022] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The embodiments will be described in detail below in conjunction with the accompanying drawings.
[0023] Specifically, in order to solve the problems of the prior art, the embodiments of the present application provide an interaction method, device, equipment, storage medium and vehicle based on a memory system. The following first introduces the interaction method based on a memory system provided in the embodiments of the present application.
[0024] Figure 1 A flow chart of an interactive method based on a memory system provided by an embodiment of the present application is shown. The interactive method based on a memory system can be used in vehicles, smart phones or other smart devices with interactive functions. The method includes the following steps: S110, obtaining an input query statement.
[0025] The method in this embodiment can be applied to a vehicle, and a query statement is a natural language instruction input by a user into an interactive device of the vehicle to ask a question or express a need, which is used to obtain information or perform a specific task. For example, the query statement can be "navigate to the place you visited last night" or "play the song that was played before".
[0026] S120, determining a target memory associated with the query statement through a large language model, wherein the target memory includes at least one of long-term memory, short-term memory, and memory summary, and the memory summary is content obtained by summarizing the long-term memory and the short-term memory through the large language model.
[0027] In this embodiment, the target memory may include long-term memory, short-term memory, and memory summary. The vehicle may include a memory module in which long-term memory is stored. Long-term memory refers to historical memory information stored in the device, which may be memory information obtained by summarizing long-term accumulated data such as the user's historical behavior, interest preferences, historical device information, and past conversation records.
[0028] After the vehicle receives the query statement input by the user, the vehicle system can retrieve the long-term memory content associated with the user's query statement in the memory module. The retrieval process of the long-term memory can be performed through keyword matching, vector matching, etc., to ensure that the extracted long-term memory is highly relevant to the query statement.
[0029] For example, if the user's query is "Please obtain my past meal ordering information", the system can find specific content related to "meal ordering" from the user's long-term memory through keyword matching or vector matching.
[0030] Short-term memory can be memory information that is close in time to the time when the query statement is obtained, or context information of the query statement. For example, short-term memory can be memory information within 30 minutes before the acquisition time, or it can be the ten rounds of conversations between the user and the interactive device before the query statement.
[0031] The memory summary is the content generated by the language model after semantic fusion and generalization of long-term memory and short-term memory.
[0032] Specifically, as an optional embodiment, the method for generating the memory summary includes: Acquire N memory fragments matching the query statement by target matching, wherein the target matching method includes at least one of keyword matching and vector matching, and N is a positive integer; Sorting the N memory segments according to the correlation between the N memory segments and the query statement, and selecting P memory segments with the highest correlation from the sorted N memory segments, where P is a positive integer less than or equal to N; Input the P memory fragments, the query statement, and the short-term memory associated with the query statement into the language macro model to obtain K memory fragments obtained by the language macro model based on the thought chain reasoning, wherein the P memory fragments include the K memory fragments, and K is a positive integer less than P; The K memory fragments and the short-term memory associated with the query statement are summarized by the language macro model to obtain the memory summary.
[0033] In this embodiment, the system can first retrieve the long-term memory associated with the query statement input by the user from the memory bank through a target matching method. Specifically, N memory fragments of the long-term memory associated with the query statement can be retrieved. Among them, the target matching method can include keyword matching, user ID matching, vector matching, time period matching, and memory dimension matching.
[0034] Among them, keyword matching is to identify the keywords in the query statement, and then directly match the keywords in the query statement with the content in the memory bank to find the long-term memory fragments containing the same keywords. Vector matching is to calculate the semantic vector of each memory fragment in the memory bank, and calculate the semantic vector of the query statement, and then compare the similarity of the semantic vector of the query statement and the semantic vector of each memory fragment, and find the memory fragment with a high similarity to the semantic vector of the query statement. User ID matching is to retrieve the memory fragment related to the user based on the user's unique identifier, such as account ID or device ID. Time period matching is to match the memory fragments within the time range specified by the query statement. Memory dimension matching is to match the dimension information most relevant to the query statement based on the dimension to which the memory fragment belongs, where the dimension of the memory fragment can include topics, interest preferences or behavior types, etc.
[0035] After retrieving N memory fragments, the N memory fragments can be input into the refined ranking model, which will sort them according to their relevance to the query statement. This relevance can be measured by the matching degree of keywords or the similarity of vectors. After the sorting is completed, the refined ranking model can select the top P memory fragments with the highest relevance from the sorted results.
[0036] After obtaining P memory fragments, the P memory fragments can be input into the language big model. The language big model, the query statement, and the short-term memory associated with the query statement are input into the language big model. The language big model can autonomously analyze the query statement and the contents of the P memory fragments through CoT (Chain of Thought), and gradually determine which memory fragments are most valuable to the current query statement, thereby refining the K optimal memory fragments.
[0037] Then, the language model semantically fuses the K memory fragments with the short-term memory, summarizes and extracts key information, and generates a concise and accurate memory summary. In this way, it can ensure that multiple memory fragments and short-term memories related to the query can be integrated into an overall memory summary.
[0038] For example, N can be 10, P can be 5, and K can be 3. If the user's query is "recent fuel consumption data", the system can obtain 10 possibly relevant memory fragments through at least one of the above keyword matching and vector matching. Then the refined ranking model sorts according to the relevance of the query, and finally selects the top 5 most relevant memory fragments. The language model performs reasoning analysis on the top 5 memory fragments through CoT to obtain the 3 optimal memory fragments. The 3 memory fragments are merged with the short-term memory to obtain a memory summary related to the query.
[0039] For example, the DSSM (Deep Structured Semantic Model) dual-tower model can be used to accurately sort N memory fragments and screen out P memory fragments, and then K memory fragments can be selected from the P memory fragments through the CoT (Chain of Thought).
[0040] Through the above methods, accurate matching, sorting and fusion can ensure that the system can effectively extract the long-term memory most relevant to the user query from a large amount of data, and summarize these long-term and short-term memories to obtain a memory summary. This multi-stage processing method improves the accuracy of memory extraction through precise sorting and large model reasoning, and combines context and semantic logic to generate a memory summary that better meets user needs.
[0041] S130, integrating the target memory and the query sentence to obtain a prompt word.
[0042] In this embodiment, after acquiring the long-term memory associated with the query statement, the query statement and the retrieved long-term memory can be combined to generate a complete prompt word. The prompt word is the input of the language model. Specifically, the fusion process of the long-term memory and the query statement can be to integrate the user's long-term memory with the current query statement to form a complete prompt word.
[0043] For example, the user enters the query "What is the name of the book I ordered last time?" The system retrieves from the memory platform that the user last purchased a book called "Introduction to Artificial Intelligence". Then the fused prompt words can be: "The user is asking the name of the book they bought last time. According to the historical records, they ordered "Introduction to Artificial Intelligence" last time. Generate a relevant answer." S140, inputting the prompt word into a trained language model to obtain a reply sentence output by the language model.
[0044] In this embodiment, after the prompt word is obtained by fusing the long-term memory and the query sentence, the system can input the generated prompt word into the pre-trained language model, and the language model can generate a reply sentence based on the information in the prompt word and the context. The language model refers to a generative model based on natural language processing, which can generate a coherent dialogue reply sentence based on the input text.
[0045] Before applying the language model, it is necessary to train the language model. Specifically, a large amount of text data can be collected first, which may include books, encyclopedias, news, articles, and user conversation records. The above text data can be cleaned, annotated, and formatted to obtain the training set of the language model.
[0046] Then, the untrained language model is initialized, and the weight parameters of the language model are initialized to random values. Then, the training data in the training set are input into the language model in batches, and the prediction results corresponding to each batch of training data output by the language model are obtained.
[0047] For each batch of training data, the actual answer of the training data is obtained, and the actual answer is compared with the predicted result, and the loss of the quality inspection of the actual answer and the predicted result is calculated. Then, the gradient of the model parameters is calculated according to the loss and propagated to each layer of the neural network. Then, the model parameters of the language model are adjusted through the optimization algorithm to minimize the loss.
[0048] According to the above method, all batches of training data in the training set can be iteratively trained. When the loss value during the training process drops to within the allowable error range, the training of the language model can be considered completed, that is, the training of the language model is ended.
[0049] In the embodiment of the present application, since the target memory includes the user's long-term memory, short-term memory and memory summary, the target memory can fully reflect the user's historical behavior, preferences and interaction records, as well as the current context information. Therefore, by combining the target memory with the query sentence to obtain the prompt word, and inputting the prompt word into the language macro model to obtain the reply sentence, the model can not only rely on the current input when generating a reply, but also combine the user's short-term context information and long-term interests and background, so that the language macro model is more accurate in understanding user needs, can reduce misunderstandings or context breaks, and can also generate replies that are more in line with personal needs based on the user's historical behavior, thereby significantly improving the accuracy of the reply.
[0050] As an optional embodiment, before determining the target memory associated with the query statement through the language macro model, the method may further include: Acquire transient memory, wherein the transient memory includes at least one of device information of an interactive device, feature information of a user, and interaction information between the user and the interactive device; The instantaneous memory is sorted according to a preset specification to obtain a short-term memory; The short-term memory is incrementally processed to obtain behavior sequence data, and the long-term memory is generated according to the behavior sequence data.
[0051] In this embodiment, first, the system will collect a variety of transient memories from various sensors and devices of the vehicle. Transient memory refers to the instant information related to the interaction between the user and the device collected by the device in a short period of time. Transient memory may include the device information of the interactive device, the characteristic information of the user, and the interaction information between the user and the interactive device. Among them, device information refers to the hardware or software attributes of the interactive device, such as the device model, system version or sensor status of the interactive device. Interaction information refers to the operation or input and output behavior between the user and the interactive device, such as the user clicking on the interactive device, the user sending voice commands to the interactive device, etc. Characteristic information refers to the attributes or behavioral characteristics of the user, such as the user's name, voiceprint characteristics, preference habits or historical behavior records.
[0052] In the case where the interactive device is a vehicle, the transient memory includes a vehicle control signal, a sensor signal of the vehicle, and at least one of image information, voice information, and text information received by the vehicle.
[0053] For example, when the interactive device is a vehicle computer, the interactive information may include image information, voice information, and text information received by the vehicle; the device information may include the vehicle control signal and sensor signal of the vehicle. Among them, the image information may include images collected by the vehicle camera; the voice information may be the voice command of the user interacting with the vehicle, the text information may be the text input by the user in the vehicle navigation system, the vehicle control signal may be the user's steering, acceleration, braking and other signals, and the sensor signal may be the temperature, pressure, GPS positioning and other signals collected by the sensors in the vehicle.
[0054] Whenever the interactive device acquires the transient memory, it can standardize the transient memory in real time according to the preset specifications. Standardization processing includes cleaning, normalizing and format alignment of these signals to ensure the consistency and availability of the data. For example, the images collected by the on-board camera will be processed into a unified format, and the output data of the in-vehicle sensor will be calibrated or aligned with the time axis. The data after these processes constitute the short-term memory of the interactive device.
[0055] After that, the interactive device will perform incremental processing on the short-term memory, that is, continuously update and integrate the existing information in the system based on the newly acquired short-term memory. The short-term memory after incremental processing is classified and processed according to different dimensions, which can be time, event type or user behavior habits. Through incremental processing, short-term memory can be converted into long-term memory.
[0056] Specifically, after acquiring short-term memory, the system can incrementally process the user's recent behavior in the short-term memory to form the user's behavior sequence data. The behavior sequence data records the user's operations and habits in the short term, and the system can then extract long-term memory based on these behavior sequence data.
[0057] In the above scheme, the instantaneous memory of the interactive device is obtained and standardized into short-term memory, and then incrementally processed and classified to form the long-term memory of the interactive device. In this way, by combining long-term memory and user query statements, the interactive device can provide a more accurate and intelligent interactive experience based on the user's historical behavior and the historical records of the interactive device.
[0058] As an optional embodiment, the step of normalizing the instantaneous memory to obtain the short-term memory may include at least one of the following: cleaning the noise data or invalid data in the transient memory; performing normalization processing on the instantaneous memory; Aggregate the repeated data in the transient memory.
[0059] In this embodiment, the process of standardizing the transient memory may include data cleaning, normalization or aggregation of the transient memory.
[0060] Among them, data cleaning can first clean the system of noisy data or invalid data in the transient memory. Transient memory may be interfered by environmental noise, sensor failure or other external factors, resulting in inaccurate or irrelevant information. The cleaning process can identify and remove these interfering data, making the retained short-term memory more accurate. For example, the image captured by the on-board camera may contain overexposed parts, and the vehicle control signal may produce abnormal readings due to a faulty sensor, which will be filtered out through the cleaning process.
[0061] Normalization can be used to unify the standard processing of signals with the same dimension or correlation in transient memory so that they can be compared or calculated under the same benchmark. For example, the unit of speed data collected by different speed sensors can be unified into km / h, and the unit of temperature data collected by different temperature sensors can be unified into degrees Celsius, so that signals of the same dimension from different sources are comparable. Transient memory may come from different sensors, and their units, time frequencies or value ranges may be inconsistent. Normalization can ensure that this information is processed under a unified standard.
[0062] Aggregation processing is to merge duplicate information to avoid data redundancy and improve storage and processing efficiency.
[0063] In this way, by standardizing the short-term memory, including cleaning noisy data, normalizing and aggregating repeated data, the system is able to generate high-quality short-term memory.
[0064] As an optional embodiment, after obtaining the input query statement, the method further includes: The long-term memory is updated according to the query statement.
[0065] In this embodiment, after the user enters a query, the system will not only retrieve the target memory to generate a response, but also update the long-term memory in the memory platform based on the query. Specifically, the system will record the user's latest query and adjust the system's understanding of the user's preferences or behavior patterns based on the content involved in the query.
[0066] For example, the system can save the user's query records to long-term memory as new information about the user's behavior in long-term memory. If the system discovers new interests or behavior patterns of the user through the user's query records, the system can integrate these newly discovered information into long-term memory and adjust the understanding of the user's preferences. In addition, the system can also update or overwrite existing long-term memory based on the content of the query statement.
[0067] In this way, the system can continuously learn the user's new behaviors and interests and incorporate them into long-term memory, thereby improving the real-time and accuracy of long-term memory.
[0068] As an optional embodiment, the long-term memory includes a summary, and the summary includes an overall summary and a subject summary. After obtaining the input query statement, the method further includes: Determine a topic tag corresponding to the query statement; Querying a first topic abstract corresponding to the topic tag; The overall abstract and the first topic abstract are updated according to the query statement.
[0069] In this embodiment, long-term memory includes summaries, which include overall summaries and topic summaries. The topic summary is a summary and condensation of information related to a certain topic by the system, including the user's long-term behavior and preferences. The overall summary is a global summary generated by integrating the contents of all topic summaries, covering information on all topics.
[0070] Specifically, after the user inputs a query statement, the system can analyze the topic label of the query statement through the topic classification model. Then, the first topic summary of the history under the topic label can be retrieved in the long-term memory. After determining the topic label and the first topic summary, the query statement proposed by the user can be integrated with the first topic summary of the history in the long-term memory to form a new first topic summary. The new first topic summary covers the first topic summary of the history.
[0071] Specifically, the integration process may be to input the query statement and the first topic abstract into the language macro model, and the language macro model may summarize the contents of the query statement and the first topic abstract to generate a new first topic abstract.
[0072] In addition, the overall summary can be updated based on the query statement. The query statement and all the subject summaries can be input into the language model, and the language model summarizes the query statement and all the subject summaries to generate a new overall summary.
[0073] For example, if a user asks "What are the results of recent basketball games?", the system will identify the topic tag as the basketball topic. The system will retrieve historical topic summaries and overall summaries related to the basketball topic. The topic summary of the historical basketball topic can be "The Basketball World Cup is in progress, and the A national basketball team won the last game." The overall summary of the history can be "Users pay attention to current affairs and entertainment." Then, the system can obtain the query result of "recent basketball games", and the query result can be "The B national basketball team won the last game." Then, the system can input the query result and the topic summary in the long-term memory into the language model, and the language model outputs a new topic summary under the "basketball" topic: "The Basketball World Cup is in progress, and the A national basketball team and the B national basketball team both won the last game." And all the topic summaries and query statements are input into the language model, and the language model can output a new overall summary as "Users pay attention to sports, current affairs and entertainment."
[0074] In the above method, by determining the subject tags, querying and integrating the subject summaries, the dynamic updating of the summaries in the long-term memory is realized, which can ensure the real-time and accuracy of the summaries.
[0075] As an optional embodiment, the long-term memory includes preference data, and the preference data includes primary topic preference and secondary topic preference. After obtaining the input query statement, the method further includes: Determine a primary topic tag and a secondary topic tag corresponding to the query statement; Obtaining primary preference data of the primary topic tag and secondary preference data corresponding to the secondary topic tag; The primary preference data and the secondary preference data are updated according to the query statement.
[0076] In this embodiment, long-term memory includes preference data. Preference data refers to specific data dynamically generated by the system for each user based on their behavior, interests, historical interaction records and other information for personalized services. These preference data can help the system understand the user's habits, concerns, interests and hobbies, etc., so as to provide more accurate information recommendations during the interaction process. Among them, preference data can include two categories: topic preference and entity word preference.
[0077] Topic preference refers to the user's interest in certain broad topics or fields. The system determines the depth of the user's interest in a topic based on the user's historical queries, number of interactions, last interaction time, etc. Topics can include sports, technology, and entertainment. Entity word preference refers to the user's interest in specific things, such as names of people, places, brands, products, etc. Topics can be divided into primary topics and secondary topics. Primary topics are broad classifications of content areas, indicating the overall direction of the topic, such as "sports"; secondary topics are specific subdivisions under primary topics, indicating specific subcategories of the topic, such as "basketball".
[0078] In this embodiment, after the user enters a query statement, the system can first use the topic classification model to determine which topic tag the content of the query statement belongs to. After determining the topic tag, the preference data related to the topic tag can be retrieved from the long-term memory. After obtaining the preference data, the system will update the preference data in combination with the user's query statement.
[0079] For example, the query statement input by the user may be "What are the results of the latest basketball games?" The input time of the query is 2024-03-05. The system can query the query statement through the topic classification model, and the first-level topic label corresponding to sports and the second-level topic label is basketball. Then, the system can obtain the first-level preference data of the first-level topic label and the second-level preference data corresponding to the second-level topic label. The preference data may include the total number of queries under the corresponding topic label, the most recent query time, and the memory strength of the topic label.
[0080] For example, the original first-level preference data of the first-level topic tag "sports" may include: total query times (25 times), the last query time (2024-03-02), and the memory strength 0.3. The original second-level preference data of the second-level topic tag "basketball" may include: total query times (15 times), the last query time (2024-03-01), and the memory strength 0.7.
[0081] Then, updating the primary preference data and the secondary preference data according to the query statement may specifically include updating the total query times, the most recent query time, and the primary memory strength. The total query times in the primary preference data and the secondary preference data may be increased by 1. For example, the query times for "sports" are updated from 25 to 26, and the query times for "basketball" are updated from 15 to 16. The most recent query time in the primary preference data and the secondary preference data is updated to 2024-03-05. The memory strength in the primary preference data and the secondary preference data is recalculated using the Ebbinghaus forgetting curve.
[0082] In this way, the solution can dynamically parse query statements and update the preference data of primary and secondary topics in real time, so that long-term memory can more accurately reflect the user's latest interests and behavior changes.
[0083] Specifically, in some embodiments, the secondary preference data includes memory strength, and updating the secondary preference data according to the query statement includes: Determining the relevance between the query statement and the secondary topic tag; Acquire the total number of interactions associated with the secondary topic tag and a first time interval, wherein the first time interval is the time interval between the time when the query statement is acquired and the time when the interaction information associated with the secondary topic tag is last received; The memory strength is updated according to the correlation, the total number of interactions, and the first time interval.
[0084] In this embodiment, the Ebbinghaus forgetting curve can be used to calculate the user's memory strength for each topic. Through the calculation of the Ebbinghaus forgetting curve, the system can dynamically adjust the user's preference data. Among them, the Ebbinghaus forgetting curve describes the law of human memory gradually declining over time, indicating that memory decreases rapidly in the initial time, and then the forgetting speed gradually slows down.
[0085] For example, the memory strength can be calculated by the following formula: R=e -t / s Wherein, t is the first time interval between the acquisition time of the query statement and the last time the interaction information associated with the secondary topic tag was received, and s is the total number of interactions between the user and the secondary topic before. The more times, the stronger the memory and the slower the decay. R is used to characterize the user's memory strength of the secondary topic tag.
[0086] In the above method, the system determines the corresponding secondary topic tags through the user's query statement, analyzes the correlation between the query statement and the secondary topic tag, the total number of user interactions and the time interval, dynamically updates the memory strength, and can accurately capture the user's interest changes in specific topics.
[0087] Based on the memory system-based interaction method provided in the above embodiment, the present application also provides a specific implementation of the memory system-based interaction device. Please refer to the following embodiment.
[0088] See first Figure 2 The memory system-based interactive device 200 provided in the embodiment of the present application includes the following modules: A first acquisition module 201 is used to acquire an input query statement; A first determination module 202 is configured to determine a target memory associated with the query statement through a language macro model, wherein the target memory includes at least one of a long-term memory, a short-term memory, and a memory summary, and the memory summary is a content obtained by summarizing the long-term memory and the short-term memory through the language macro model; A fusion module 203 is used to fuse the target memory and the query sentence to obtain a prompt word; The reply module 204 is used to input the prompt word into the trained language model to obtain a reply sentence output by the language model.
[0089] In this embodiment, since the target memory includes the user's long-term memory, short-term memory and memory summary, the target memory can fully reflect the user's historical behavior, preferences and interaction records, as well as the current context information. Therefore, by combining the target memory with the query sentence to obtain the prompt word, and inputting the prompt word into the language macro model to obtain the reply sentence, the model can not only rely on the current input when generating a reply, but also combine the user's short-term context information and long-term interests and background. Therefore, the language macro model is more accurate in understanding user needs, can reduce misunderstandings or context breaks, and can also generate replies that are more in line with personal needs based on the user's historical behavior, thereby significantly improving the accuracy of the reply.
[0090] As an implementation of the present application, the interaction device 200 of the memory system may further include: A second acquisition module, configured to acquire transient memory, wherein the transient memory includes at least one of device information of an interactive device, feature information of a user, and interaction information between the user and the interactive device; A sorting module, used to sort the instantaneous memory according to a preset specification to obtain short-term memory; A processing module is used to perform incremental processing on the short-term memory to obtain behavior sequence data, and generate the long-term memory according to the behavior sequence data.
[0091] As an implementation of the present application, the above-mentioned sorting module is specifically used for: cleaning the noise data or invalid data in the transient memory; performing normalization processing on the instantaneous memory; Aggregate the repeated data in the transient memory.
[0092] As an implementation of the present application, the interaction device 200 of the memory system may further include: A second determination module, used to determine a topic tag corresponding to the query statement; A query module, used for querying a first topic abstract corresponding to the topic tag; A first updating module is used to update the overall abstract and the first topic abstract according to the query statement.
[0093] As an implementation of the present application, the interaction device 200 of the memory system may further include: A third determination module is used to determine the primary topic label and the secondary topic label corresponding to the query statement; A third acquisition module, used to acquire the primary preference data of the primary topic tag and the secondary preference data corresponding to the secondary topic tag; The second updating module is used to update the primary preference data and the secondary preference data according to the query statement.
[0094] As an implementation of the present application, the second update module is specifically used for: Determining the relevance between the query statement and the secondary topic tag; Acquire the total number of interactions associated with the secondary topic tag and a first time interval, wherein the first time interval is the time interval between the time when the query statement is acquired and the time when the interaction information associated with the secondary topic tag is last received; The memory strength is updated according to the correlation, the total number of interactions, and the first time interval.
[0095] As an implementation of the present application, the interaction device 200 of the memory system may further include: A matching module, used for acquiring N memory segments matching the query statement through a target matching method, wherein the target matching method includes at least one of keyword matching and vector matching, and N is a positive integer; A sorting module, used to sort the N memory segments according to the correlation between the N memory segments and the query statement, and select P memory segments with the highest correlation from the sorted N memory segments, where P is a positive integer less than or equal to N; A reasoning module, used for inputting the P memory segments, the query statement and the short-term memory associated with the query statement into the language macro model, and obtaining K memory segments obtained by the language macro model based on the thought chain reasoning, wherein the P memory segments include the K memory segments, and K is a positive integer less than P; A summarizing module is used to summarize the K memory fragments and the short-term memory associated with the query statement through the language macro model to obtain the memory summary.
[0096] The memory system-based interaction device provided in the embodiment of the present invention can implement each step in the above method embodiment, and will not be described again here to avoid repetition.
[0097] Figure 3 A schematic diagram of the hardware structure of an interactive device based on a memory system provided in an embodiment of the present application is shown.
[0098] The memory system-based interactive device may include a processor 1001 and a memory 1002 storing computer program instructions.
[0099] Specifically, the processor 1001 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0100] The memory 1002 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 1002 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 1002 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 1002 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 1002 is a non-volatile solid-state memory.
[0101] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.
[0102] The processor 1001 implements any one of the memory system-based interaction methods in the above embodiments by reading and executing computer program instructions stored in the memory 1002 .
[0103] In one example, the memory system-based interactive device may further include a communication interface 1003 and a bus 1010. Figure 3 As shown, the processor 1001, the memory 1002, and the communication interface 1003 are connected via a bus 1010 and communicate with each other.
[0104] The communication interface 1003 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0105] Bus 1010 includes hardware, software or both, and couples the components of the interactive device based on the memory system to each other. For example, but not limitation, the bus may include an accelerated graphics port (AGP) or other graphics bus, an enhanced industrial standard architecture (EISA) bus, a front-side bus (FSB), a hypertransport (HT) interconnect, an industrial standard architecture (ISA) bus, an infinite bandwidth interconnect, a low pin count (LPC) bus, a memory bus, a microchannel architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standard association local (VLB) bus or other suitable bus or a combination of two or more of these. Where appropriate, bus 1010 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnect.
[0106] The memory system-based interaction device may be based on the above-mentioned embodiment, thereby realizing the interaction method and apparatus based on the memory system described above.
[0107] In addition, in combination with the memory system-based interaction method in the above-mentioned embodiment, the embodiment of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by the processor, any one of the memory system-based interaction methods in the above-mentioned embodiments is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here. Among them, the above-mentioned computer-readable storage medium may include a non-transitory computer-readable storage medium, such as a read-only memory (Read-Only Memory, referred to as ROM), a random access memory (RandomAccess Memory, referred to as RAM), a disk or an optical disk, etc., which is not limited here.
[0108] In addition, an embodiment of the present application also provides a vehicle, including computer program instructions, which, when executed by a processor, can implement the steps and corresponding contents of the aforementioned method embodiment.
[0109] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.
[0110] The functional blocks shown in the above structural block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier. "Machine-readable medium" may include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.
[0111] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.
[0112] Aspects of the present disclosure are described above with reference to the flowcharts and / or block diagrams of the methods, devices and vehicles according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field programmable logic circuit. It can also be understood that each box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.
[0113] The above are only specific implementation methods of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.
Claims
1. An interactive method based on a memory system, characterized in that: The method comprises: Get the input query statement; Determine a target memory associated with the query statement through a language macro model, wherein the target memory includes at least one of a long-term memory, a short-term memory, and a memory summary, and the memory summary is a content obtained by summarizing the long-term memory and the short-term memory through the language macro model; Merging the target memory and the query sentence to obtain a prompt word; The prompt word is input into a trained language model to obtain a response sentence output by the language model.
2. The memory system-based interaction method according to claim 1, characterized in that: Before determining the target memory associated with the query statement through the language macro model, the method further includes: Acquire transient memory, wherein the transient memory includes at least one of device information of an interactive device, feature information of a user, and interaction information between the user and the interactive device; The instantaneous memory is sorted according to a preset specification to obtain a short-term memory; The short-term memory is incrementally processed to obtain behavior sequence data, and the long-term memory is generated according to the behavior sequence data.
3. The memory system-based interaction method according to claim 2, characterized in that: The step of organizing the instantaneous memory according to a preset specification includes at least one of the following: cleaning the noise data or invalid data in the transient memory; performing normalization processing on the instantaneous memory; Aggregate the repeated data in the transient memory.
4. The memory system-based interaction method according to claim 2, characterized in that: In the case where the interactive device is a vehicle, the transient memory includes a vehicle control signal, a sensor signal of the vehicle, and at least one of image information, voice information, and text information received by the vehicle.
5. The memory system-based interaction method according to claim 1, characterized in that: The long-term memory includes a summary, and the summary includes an overall summary and a subject summary. After obtaining the input query statement, the method further includes: Determine a topic tag corresponding to the query statement; Querying a first topic abstract corresponding to the topic tag; The overall abstract and the first topic abstract are updated according to the query statement.
6. The memory system-based interaction method according to claim 1, characterized in that: The long-term memory includes preference data, and the preference data includes primary topic preference and secondary topic preference. After obtaining the input query statement, the method further includes: Determine a primary topic tag and a secondary topic tag corresponding to the query statement; Obtaining primary preference data of the primary topic tag and secondary preference data corresponding to the secondary topic tag; The primary preference data and the secondary preference data are updated according to the query statement.
7. The memory system-based interaction method according to claim 6, characterized in that: The secondary preference data includes memory strength, and updating the secondary preference data according to the query statement includes: Determining the relevance between the query statement and the secondary topic tag; Acquire the total number of interactions associated with the secondary topic tag and a first time interval, wherein the first time interval is the time interval between the time when the query statement is acquired and the time when the interaction information associated with the secondary topic tag is last received; The memory strength is updated according to the correlation, the total number of interactions, and the first time interval.
8. The memory system-based interaction method according to claim 1, characterized in that: The method for generating the memory summary comprises: Acquire N memory fragments matching the query statement by target matching, wherein the target matching method includes at least one of keyword matching and vector matching, and N is a positive integer; Sorting the N memory segments according to the correlation between the N memory segments and the query statement, and selecting P memory segments with the highest correlation from the sorted N memory segments, where P is a positive integer less than or equal to N; Input the P memory fragments, the query statement, and the short-term memory associated with the query statement into the language macro model to obtain K memory fragments obtained by the language macro model based on the thought chain reasoning, wherein the P memory fragments include the K memory fragments, and K is a positive integer less than P; The K memory fragments and the short-term memory associated with the query statement are summarized by the language macro model to obtain the memory summary.
9. An interactive device based on a memory system, characterized in that: The device comprises: A first acquisition module, used to acquire an input query statement; A first determination module is configured to determine a target memory associated with the query statement through a language macro model, wherein the target memory includes at least one of a long-term memory, a short-term memory, and a memory summary, and the memory summary is a content obtained by summarizing the long-term memory and the short-term memory through the language macro model; A fusion module, used to fuse the target memory and the query sentence to obtain a prompt word; The reply module is used to input the prompt word into the trained language model to obtain the reply sentence output by the language model.
10. An interactive device based on a memory system, characterized in that: The memory system-based interactive device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the memory system-based interaction method according to any one of claims 1 to 8 is implemented.
11. A computer storage medium, characterized in that: The computer storage medium stores computer program instructions, which, when executed by a processor, implement the memory system-based interaction method according to any one of claims 1 to 8.
12. A vehicle, characterized in that: The vehicle includes at least one of the device as claimed in claim 9, the apparatus as claimed in claim 10, and the medium as claimed in claim 11.
Citation Information
Patent Citations
Interaction control method and system and electronic equipment
CN117193582A
Information interaction method and device, electronic equipment and storage medium
CN118210886A
Question and answer method and device based on large language model and electronic equipment
CN118377878A
Text processing method and device, equipment, medium and vehicle
CN118626600A
Adaptation for statistical language model
US20100250251A1
Cited By
Dialogue model training method and device, equipment and medium
CN119578558A
Intelligent agent long-term memory modeling method based on memory network
CN120688545A
Memory system of AI intelligent agent and updating method and retrieval method thereof
CN120875055A
Memory processing method and system of generative model, information interaction method and system, medium and equipment
CN120892511A
Navigation service recommendation method and device, electronic equipment and storage medium
CN121210770A