Group chat robot system and data processing method based on multi-layer memory module
The group chat robot system, through its multi-layered memory modules, achieves hierarchical management and effective protection of memory information, solving the problems of memory overload and low effectiveness, and improving processing efficiency and user experience.
Patent Information
- Application Number
- CN202411679623.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-11-22
AI Technical Summary
Existing group chat robot systems suffer from overload and low validity of memory information, resulting in low processing efficiency.
It employs a multi-layered memory module, including a group chat message extraction module, a memory module, a forgetting and conversion module, an evaluation module, and a reply module. By adding a 'memory layer number' field, information is managed in layers. The forgetting and conversion module deletes information with low ratings and counts the amount of memory information at different layers, simulating the human forgetting process and protecting important information.
Effective management of memory information prevents overload, improves the effectiveness and processing efficiency of memory information, and ensures the long-term preservation and efficient retrieval of important information.
Smart Images

Figure CN119669401B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer technology and relates to a group chat robot system and data processing method, specifically a group chat robot system and data processing method based on a multi-layer memory module. Background Technology
[0002] A Large Language Model (LLM) is a large-scale generative language model with interactive capabilities. The model can accept natural language input from users, understand its meaning, and provide corresponding feedback.
[0003] Patent application CN118233420A, entitled "Automatic Reply Method and Related Equipment for Group Chat Messages," discloses a group chat robot system and data processing method. This invention first acquires chat history information within a preset historical timeframe in a chat room. Then, based on the chat room's description, chat history, and member information of each member, it determines the next speaker. If the next speaker is the current user, it retrieves relevant memories of the current user from a preset memory pool based on the description, member information, and chat history. Next, it generates a first prompt text based on the description, chat history, member information, and relevant memories. This first prompt text is then parsed using a preset large language model to generate the target chat message. Finally, the target chat message is sent as a message from the current user and replied to in the chat room. This achieves automatic and accurate replies to group chat messages in a real group chat, improving the user experience. However, the invention has shortcomings. It only stores memories and does not perform long-term maintenance of memories. It does not delete redundant memories or mark important memories, which leads to memory overload due to long-term accumulation of memory information, low memory effectiveness, and low memory retrieval efficiency. Summary of the Invention
[0004] The purpose of this invention is to overcome the defects of the prior art and propose a group chat robot system and data processing method based on a multi-layer memory module to solve the technical problem of low processing efficiency in the prior art.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] A group chat robot system based on a multi-layer memory module includes a cascaded group chat message extraction module, a memory module, a forgetting and conversion module, an evaluation module, and a reply module; the output of the group chat message extraction module is also connected to the input of the evaluation module and the reply module, and the output of the evaluation module is also connected to the input of the memory module; the memory module includes a cascaded path generation module, a field addition module, a storage module, and a statistics module.
[0007] A data processing method for a group chat robot system based on a multi-layer memory module includes the following steps:
[0008] (1) Initialize parameters:
[0009] The initial number of users chatting with the group chat robot system is A, where A ≥ 5, and the a-th user is H. a ;
[0010] (2) The group chat message extraction module converts the original chat information sent by each user:
[0011] The group chat message extraction module extracts each user's H... a N original chat messages E sent a And for each original chat message The transformation yields an original memory text F consisting of N declarative sentences containing the field "original memory text". a Where N≥3;
[0012] (3) The memory module acquires the first memory information and counts the number of user memory information at different "memory layers":
[0013] The memory module stores the original memory text F. a Each statement in Add a "Number of Memory Layers" field to obtain N user memory information J with the same format as the original stored memory information, containing the "Original Memory Text" and "Number of Memory Layers" fields. a and J a Together with the originally stored user memory information, they form the first memory information G, which contains X user memory information entries. a Then, count the amount of user memory information in each memory layer.
[0014] (4) The forgetting and conversion module acquires secondary memory information:
[0015] The forgetting and conversion module on the first memory information G a Each user memory information Perform a comprehensive evaluation, remove information with low scores, and then increment the value of the "Number of Memory Layers" field in each piece of information with a high score by 1 to obtain the second memory information T. a ;
[0016] (5) The evaluation module obtains third memory information:
[0017] For the second memory information T a Each piece of memory information is comprehensively scored, and the information with the highest score is selected from the evaluation results to obtain the third memory information U. a ;
[0018] (6) The reply module generates reply information:
[0019] The reply module will send the third memory information U a The original chat messages with A users are used as input to a large language model, Model A, for semantic parsing to obtain the response information Q.
[0020] Compared with the prior art, the present invention has the following advantages:
[0021] The memory module of this invention includes a field addition module and a statistics module. The field addition module adds a "memory layer number" field to the declarative sentences in the original memory text, which not only facilitates the management of memory information but also the preservation of long-term effective memory information. The statistics module can count the number of first memory information corresponding to different layers. Furthermore, the forgetting and conversion module effectively manages memory information by deleting information with low scores and converting the "memory layer number" in each piece of information with high scores. This prevents the overload of memory information and the excessive accumulation of invalid information, effectively improving processing efficiency compared with the prior art. Attached Figure Description
[0022] Figure 1 This is a schematic diagram of the overall structure of the group chat robot system of the present invention;
[0023] Figure 2 This is a flowchart illustrating the implementation of the data processing method of the present invention. Detailed Implementation
[0024] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0025] Reference Figure 1The group chat robot system of the present invention includes a cascaded group chat message extraction module, a memory module, a forgetting and conversion module, an evaluation module, and a reply module; the output of the group chat message extraction module is also connected to the input of the evaluation module and the reply module, and the output of the evaluation module is also connected to the input of the memory module; the memory module includes a cascaded path generation module, a field addition module, a storage module, and a statistics module.
[0026] The group chat message extraction module is used to retrieve chat history information within a defined range in a group chat;
[0027] The memory module is used to convert chat log information into user memory information in the form of declarative sentences. In this process, the field "memory layer number" is added to the original memory text to divide the memory into layers. Different layers represent different memory characteristics. The standardized classification of memory is conducive to the management of memory information. The statistics module counts the number of existing memories at different layers, providing data for the forgetting and conversion modules.
[0028] The forgetting and conversion module compares the existing number of memories with a pre-set threshold to ensure that the amount of memory information is maintained within the threshold range. The forgetting operation is completed by deleting memories with low scores. This process simulates the human forgetting process, thereby preventing the overload of memory information and the excessive accumulation of invalid information. The conversion operation is completed by modifying the "memory level" field of memories with high scores. Long-term effective memory information is stored in higher levels, which protects the memory from being easily deleted and facilitates the management of long-term effective memory information. It simulates the process of human memory deepening, thereby achieving the effect of protecting important information.
[0029] The evaluation module obtains a comprehensive score for the memory information based on importance, relevance, and time delay, thereby selecting the most suitable memory information for the current chat environment and helping the large language model understand the user.
[0030] The reply module uses a large model to perform semantic analysis on the current chat history and the corresponding user memory to understand the current chat background and user information, thereby generating reply information.
[0031] Reference Figure 2 The data processing method of the present invention includes the following steps:
[0032] Step 1) Initialize parameters:
[0033] The initial number of users chatting with the group chat robot system is A, where A ≥ 5, and the a-th user is H. a ;
[0034] A is not the total number of users in the group chat, but the number of users who participate in the chat within a certain period of time. In this embodiment, A = 5.
[0035] Step 2) The group chat message extraction module converts the original chat information sent by each user:
[0036] The group chat message extraction module extracts each user's H... a N original chat messages E sent a And for each original chat message The transformation yields an original memory text F consisting of N declarative sentences containing the field "original memory text". a Where N≥2, and in this example N=2.
[0037] The group chat message extraction module removes each user's H... a Each original chat message sent The colloquial content in it received The corresponding third-person declarative sentences include people, places, and events.
[0038] If too many messages are extracted at once, the running efficiency will decrease and the response effect will be reduced. Therefore, the message extraction module extracts messages based on the number of new messages. When the number of messages exceeds the set threshold, extraction is performed. If the number of messages does not exceed the threshold, it continues to wait until the number of messages exceeds the set threshold. In this embodiment, threshold = 10.
[0039] In this embodiment, each user H a N original chat messages E sent a This refers to a text segment, specifically the text content sent by the user in a group chat. The large language model (ModelA) is a generative deep neural network model based on the Transformer architecture, possessing superior semantic understanding and multi-turn dialogue capabilities. The large language model can be any of the models including GPT-4, GPT-3, and LaMDA.
[0040] prompt1 informs ModelA of the current task, which is "remove each user's H..." a Each original chat message sent The colloquial content in it received The corresponding third-person declarative sentences include people, places, and events. ".
[0041] The message sent by a member in the chat room, i.e.
[0042] prompt1 is "Please send the user's chat messages" After removing the colloquial language from this sentence, we get The corresponding third-person declarative sentences include people, places, and events. "
[0043] Will When prompt1 is input into the large language model ModelA, the following results are obtained:
[0044] At this time, it is "User H" a I traveled to Xiamen in 2020 and was satisfied with the trip.
[0045] Step 3) The memory module acquires the first memory information and counts the number of user memory information at different "memory layers":
[0046] The memory module stores the original memory text F. a Each statement in Add a "Number of Memory Layers" field to obtain N user memory information J with the same format as the original stored memory information, containing the "Original Memory Text" and "Number of Memory Layers" fields. a and J a Together with the originally stored user memory information, they form the first memory information G, which contains X user memory information entries. a Then, count the amount of user memory information in each memory layer. In this embodiment, X = 40, and the implementation steps are as follows:
[0047] (3a) The path generation module generates paths based on each user's H... a Name a The generated storage memory information includes the base address and Name. a And the file path P of the file format. a :
[0048] According to H a Name a The file path P consists of "jack", base address "C:\UsersMemory\", and file format ".json". a "C: / UsersMemory / jack.json", H a The corresponding memories are stored in this file.
[0049] The file path is an absolute file path, based on the format in the Windows platform. The storage file format is JSON. The obtained path provides a path for subsequent information storage. The method of directly concatenating to generate the path is more efficient than the method of querying the path.
[0050] (3b) Field addition module for the original memory text F a Each statement in Adding a "Memory Layer Number" field will retrieve user memory information in the same format as the original stored user memory information.
[0051] According to F a User H a The user traveled to Xiamen in 2020 and was satisfied with the trip. At this point, a "Memory Layer" field is added, and the memory field is simultaneously assigned a value that matches the original stored user memory information in the same format.
[0052] User H a I traveled to Xiamen in 2020 and was satisfied with the trip.
[0053] Number of memory layers: 1”
[0054] The field addition module serves the subsequent forgetting and conversion modules. The "Memory Layer" field added to this feature enables memory to be managed in layers.
[0055] (3c) The storage module stores N user-remembered information J a Stored in file path P a In, and J a With P a The original user memory information stored in the middle constitutes the first memory information G. a In this example, N=2.
[0056] N=2 user memory information J a Stored in P a Among them, and J a With P a The original user memory information stored in the middle is composed of the first memory information G of X user memory information. a G a for
[0057] “
[0058] 1: "User H" a I've had roujiamo (Chinese hamburger) in Xi'an and I really liked it.
[0059] Number of memory layers: 1”
[0060] …(Contains more user memory information)
[0061] 40: "User H" a I traveled to Xiamen in 2020 and was satisfied with the trip.
[0062] Number of memory layers: 1”
[0063] "
[0064] The storage module performs update operations without overwriting the original memory information, thus enabling real-time updates of the memory information and ensuring its timeliness.
[0065] (3d) The statistics module uses the first memory information G a The "Number of Memory Layers" field in the dataset calculates the G values corresponding to different number of layers. a The quantity, to obtain the numerical set Where i∈[1,I], The number of memory layers (i) represents the amount of user-remembered information. I represents the total number of memory layers, and I ≥ 3. In this embodiment, I = 3.
[0066] The statistics module calculates the G values corresponding to different levels. a Quantity, L a The value is [21, 12, 7], which means... There are 21 memories in the first layer. There are 12 memories in the second layer. There are 7 memories in the third layer.
[0067] Step 4) The forgetting and conversion module acquires secondary memory information:
[0068] The forgetting and conversion module on the first memory information G a Each user memory information Perform a comprehensive evaluation, remove information with low scores, and then increment the value of the "Number of Memory Layers" field in each piece of information with a high score by 1 to obtain the second memory information T. a .
[0069] (4a) Forgetting and Transition Module Judgment Does it satisfy the preset threshold D? If yes, proceed to step (4b); otherwise, G. a As the second memory information, D = 20 in this embodiment.
[0070] In this embodiment, D = 20, because Proceed to step (4b).
[0071] (4b) The forgetting and conversion module calculates each user's memory information. Overall rating Then, delete the memory information of B users with the lowest overall score, and increment the value of the "Number of Memory Layers" field in the memory information of R users with the highest overall score by 1 to obtain the second memory information T. a and T a Write P a Among them, The calculation formula is:
[0072]
[0073] in, For G in the th The xth memory of the layer, For the first The memory self-updating parameter matrix of layered memory. They represent The importance (Y), relevance (W), and time delay (P) are scored.
[0074] In this embodiment, the thresholds are D = 20, B = 5, R = 3, and C = 20. 1 =[3,4,3],C 2 =[4,5,1],C 3 =[5,4,1].
[0075] Importance Y reflects the importance of the event. In this embodiment, importance Y is obtained by inputting the keyword prompt2 into the large model ModelA. In this embodiment, prompt2 is...
[0076] Please rate the importance of the following memories on a scale of 1 to 10, where 1 represents the most ordinary content, such as "I ate steamed buns today," and 10 represents a very important event, such as "I finally got into ** University." Please rate the following memory: "User H" a I traveled to Xiamen in 2020 and was satisfied. Output requirement: Simply output the number.
[0077] In this case, the importance Y is the number output by Model A.
[0078] The correlation (W) reflects the relevance between memory and the current chat content. The greater the correlation, the higher the score. The correlation is calculated using the following formula:
[0079]
[0080]
[0081]
[0082] R and S represent the latest chat content, E, and S, respectively. The embedding feature vector of dimension M, R z S z They represent E and The z-th component, ||·|| represents the modulus length operation.
[0083] In this example, the embedded feature vectors R and S are obtained by the GPT-Text-embedding model.
[0084] The time delay P reflects the degree of decay of current memory. The shorter the duration of a memory, the less likely it is to decay, and the higher the score of the time delay P. The formula for calculating P is as follows:
[0085] P = e -λt
[0086] e is the natural constant, λ is the forgetting rate, and t is the value mentioned above. The time spent in the memory module, λ = 0.5.
[0087] By periodically checking the amount of memory information and deleting low-scoring memories, the process directly removes the memory from the corresponding file, thus simulating the human process of forgetting unimportant information.
[0088] By periodically detecting the amount of memory information and converting high-scoring information, the "memory layer" field of the memory information is increased. At a higher memory layer, the memory is more difficult to delete and is more frequently recalled, thereby realizing the function of deepening human memory of important information.
[0089] For the first The memory self-updating parameter matrix of layered memory reflects the importance, relevance, and latency of different memory layers. The higher the corresponding parameter, the more important the indicator is in that layer.
[0090] By adjusting the three indicators of importance, relevance, and time delay, as well as the parameter matrix, it is possible to ensure that different types of memories are stored in different memory layers. Through forgetting and conversion modules, forgetting can complete the periodic clearing of information, and conversion can complete the protection of important information, keeping more important information in higher layers, thereby ensuring that important information is not easily cleared.
[0091] Step 5) Evaluation module obtains third memory information:
[0092] For the second memory information T a Each piece of memory information is comprehensively scored, and the information with the highest score is selected from the evaluation results to obtain the third memory information U. a ;
[0093] The comprehensive scoring process is the same as (4a), with the same parameters, but the parameter matrix can still be freely set to adapt to different chat environments. After the calculation results are completed, they are still sorted according to the score. In this embodiment, the first 5 memory information in the first layer of memory, the first 3 memory information in the second layer of memory, and the first 2 memory information in the third layer of memory are taken as the fifth memory information U. a .
[0094] Step 6) The reply module generates reply information:
[0095] The reply module will send the third memory information U a The original chat messages with A users are used as input to a large language model, Model A, for semantic parsing to obtain the response information Q. a .
[0096] In this embodiment, the response is achieved by inputting the prompt2 and the fifth memory information U into the large model ModelA. a In this embodiment, prompt2 means: "Now you are playing the role of a user in a group chat. Your job is to participate in the group chat and provide them with a better chat experience. Next, I will provide you with some recent chat information and some relevant experiences of the corresponding users to help you generate better responses."
[0097] Group chat log: "E"
[0098] Corresponding memory information: U a
[0099] You can reply with multiple sentences, or you can reply with just one sentence. In special circumstances, you can also choose not to reply. Separate sentences with / n.
[0100] Please ensure your reply is fluent and coherent.
[0101] Obtain the output of ModelA and input it into the group chat.
Claims
1. A data processing method for a group chat robot system based on a multi-layer memory module, characterized in that, The group chat robot system includes a cascaded group chat message extraction module, a memory module, an evaluation module, and a reply module. The output of the group chat message extraction module is also connected to the inputs of the evaluation and reply modules, and the output of the evaluation module is also connected to the input of the memory module. The memory module includes a cascaded path generation module and a storage module, with a field addition module loaded between the path generation module and the storage module. The output of the storage module is also cascaded with a statistics module. The input of the evaluation module is also cascaded with a forgetting and conversion module. The specific steps of the method are as follows: (1) Initialize parameters: The initial number of users chatting with the group chat robot system is A, where A ≥ 5, and the a-th user is H. a ; (2) The group chat message extraction module converts the original chat information sent by each user: The group chat message extraction module extracts each user's H... a N original chat messages E sent a And for each original chat message The transformation yields an original memory text F consisting of N declarative sentences containing the field "original memory text". a Where N≥2; (3) The memory module acquires the first memory information and counts the number of user memory information at different "memory layers": The memory module stores the original memory text F. a Each statement in Add a "Number of Memory Layers" field to obtain N user memory information J with the same format as the original stored memory information, containing the "Original Memory Text" and "Number of Memory Layers" fields. a and J a Together with the originally stored user memory information, they form the first memory information G, which contains X user memory information entries. a Then, count the amount of user memory information in each memory layer. (4) The forgetting and conversion module acquires secondary memory information: The forgetting and conversion module on the first memory information G a Each user memory information Perform a comprehensive evaluation, remove information with low scores, and then increment the value of the "Number of Memory Layers" field in each piece of information with a high score by 1 to obtain the second memory information T. a ; (5) The evaluation module obtains third memory information: For the second memory information T a Each piece of memory information is comprehensively scored, and the information with the highest score is selected from the evaluation results to obtain the third memory information U. a ; (6) The reply module generates reply information: The reply module will send the third memory information U a The original chat messages with A users are used as input to a large language model, Model A, for semantic parsing to obtain the response information Q.
2. The method according to claim 1, characterized in that, Step (2) describes processing each original chat message The conversion is based on the large language model ModelA, and the generation method is as follows: The group chat message extraction module removes each user's H... a Each original chat message sent The colloquial content in it received The corresponding third-person declarative sentences include people, places, and events.
3. The method according to claim 1, characterized in that, The memory module described in step (3) acquires the first memory information and counts the number of user memory information for each "memory layer". The implementation steps are as follows: (3a) The path generation module generates paths based on each user's H... a Name a The generated storage memory information includes the base address and Name. a And the file path P of the file format. a : (3b) Field addition module for the original memory text F a Each statement in Adding a "Memory Layer Number" field will retrieve user memory information in the same format as the original stored user memory information. (3c) The storage module stores N user-remembered information J a Stored in file path P a In, and J a With P a The original user memory information stored in the middle constitutes the first memory information G. a : (3d) The statistics module uses the first memory information G a The "Number of Memory Layers" field in the dataset calculates the G values corresponding to different number of layers. a The quantity, to obtain the numerical set Where i∈[1,I], This represents the amount of user-remembered information when the "memory layer" is i, where I represents the total number of memory layers, and I ≥ 3.
4. The method of the system according to claim 1, characterized in that, The forgetting and conversion module described in step (4) acquires the second memory information T. a The implementation steps are as follows: (4a) Forgetting and Transition Module Judgment Does it satisfy the preset threshold D? If yes, proceed to step (4b); otherwise, G. a As secondary memory information; (4b) The forgetting and conversion module calculates each user's memory information. Overall rating Then, delete the memory information of B users with the lowest overall score, and increment the value of the "Number of Memory Layers" field in the memory information of R users with the highest overall score by 1 to obtain the second memory information T. a and T a Write P a Among them, The calculation formula is: in, For G in the th The xth memory of the layer, For the first The memory self-updating parameter matrix of layered memory. They represent The importance (Y), relevance (W), and time delay (P) are scored.
5. The method of the system according to claim 4, characterized in that, The steps described in step (4b) The correlation W and time delay P are calculated using the following formulas: P=e -λt Where R and S represent the latest chat content E, respectively. The embedding feature vector of dimension M, R m S m They represent E and The m-th component, ‖·‖ denotes the modulo-length operation, e is the natural constant, λ is the forgetting rate, and t is... The time that exists in the memory module.
6. The method of the system according to claim 4, characterized in that, The steps described in step (4b) The importance Y is generated by: based on the large language model ModelA. Semantic analysis is performed on the "original memory text" to generate a corresponding score Y.
Citation Information
Patent Citations
Automatic reply method of group chat message and related equipment
CN118233420A
Human-computer interaction method and device used for robot and based on forgetting mechanism
CN109202921A
End-to-end intention recognition system and method based on memory forgetting device
CN111062220A