Personalized shared memory construction system and method based on large model

By designing a personalized shared memory construction system in large language model applications, automatically collecting and persisting user preferences, the problem of insufficient user preference memory in the prior art is solved, and preference sharing and maintenance across applications and sessions is realized.

CN119558408AInactive Publication Date: 2025-03-04GUANGZHOU HUAWEI TOMORROW SOFTWARE TECH

Patent Information

Application Number
CN202510080042.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-19
Publication Date
2025-03-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing large language model has shortcomings in memory of user personalized preferences, especially in cross-session and cross-applications, which cannot effectively organize and remember user preferences, resulting in poor application experience.

Method used

Design a personalized shared memory construction system based on large models, automatically collect user preferences and persist them into a database for system calls by maintaining dialogue data in various applications and planning personalized preference keywords.

Benefits of technology

It realizes the sharing and maintenance of user preferences between different applications and sessions, improves the personalized service quality of applications, and ensures the continuous update and memory of user preference information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119558408A_ABST
    Figure CN119558408A_ABST
Patent Text Reader

Abstract

The invention discloses a personalized shared memory construction system and method based on a large model, and the construction system is provided with at least one question and answer service module, a preference database, and a central preference database. The question and answer service module receives questions of users, and in the chatting process of the users, the LLM large model collects user preferences and inputs the collected user preferences into the preference database of the application; and the central preference database receives the information of each preference database, and when the question and answer service module works, the user preference information obtained historically is input into the question and answer service module, so that the LLM large model can reply the question and answer of the user on the basis of the preference information. And when the question and answer service module receives question and answer information of the user, a preference question and answer process and another preference management process are performed at the same time. According to the method, the user preferences are automatically collected from the dialogues, and the preference data are persisted into the database to be called by the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of deep learning, natural language processing, and large model technology, and in particular to a large-model-based personalized shared memory construction system and method. Background Art

[0002] Large Language Model (LLM), also known as Large Language Model, is an artificial intelligence model designed to understand and generate human language. They are trained on large amounts of text data and can perform a wide range of tasks, including text summarization, translation, sentiment analysis, and more. LLMs are characterized by their large size, which helps them learn complex patterns in language data. These models are usually based on deep learning architectures, which helps them achieve impressive performance on various NLP tasks.

[0003] Large model (LLM) technology is now very mature in understanding and generating, but it also has many shortcomings. For example, when remembering the user's personalized preferences, especially across sessions and applications, it is impossible to organize answers based on user preferences. This is very fatal in some intelligent applications, such as planning travel plans, hotel accommodation, etc., without cross-application preference memory, the application experience is very poor. Memory refers to the memory of LLM during the conversation with the user. It generally includes model roles and conversation history data. As the number of conversation rounds increases, the memory data becomes larger and larger, and large models are prone to losing information mentioned by users, and are more difficult to understand.

[0004] Therefore, in view of the shortcomings of the prior art, it is necessary to provide a personalized shared memory construction system and method based on a large model to overcome the shortcomings of the prior art. Summary of the invention

[0005] The purpose of the present invention is to avoid the shortcomings of the prior art and provide a personalized shared memory construction system and method based on a large model, which automatically collects user preferences from the conversation by maintaining the conversation data with the large model in each application and planning personalized preference keywords and extracting preference data. The preference data is persisted in the database for system call.

[0006] The purpose of the present invention is achieved through the following technical measures.

[0007] A personalized shared memory construction system based on a large model is provided, which is provided with: at least one question-answering service module, a preference database corresponding to each question-answering service module, and a central preference database; The question-and-answer service module receives questions from users. During the user chat, the LLM model collects user preferences and inputs the collected user preferences into the preference database of this application corresponding to the question-and-answer service module. Different question-and-answer service modules assume different application functions. The central preference database receives information from each preference database. When the question-and-answer service module is working, the historically acquired user preference information is input into the question-and-answer service module so that the LLM model can respond to user questions based on the preference information.

[0008] Preferably, in the above-mentioned large-model-based personalized shared memory construction system, the central preference database aggregates user preferences collected in different sessions and different applications to form a cross-session and cross-application user preference information database.

[0009] Preferably, in the above-mentioned large-model-based personalized shared memory construction system, the central preference database collects and acquires the preference data of each preference database for management, and provides an API interface to each corresponding question-and-answer service module.

[0010] Preferably, in the above-mentioned large-model-based personalized shared memory construction system, the central preference database contains user ID, preference type, and preference content information.

[0011] The present invention also provides a method for constructing a personalized shared memory based on a large model, which is based on the above-mentioned personalized shared memory construction system. When the question-and-answer service module receives the user's question-and-answer information, it simultaneously performs a preference question-and-answer process and another preference management process; The preference question answering process includes the following steps: A1, obtain historically stored user preference information from the central preference database based on user dialogue; A2, builds a context with preferences based on user preference information and conversation history; A3, input the context with preference to the LLM big model, and the big model will reply to the user; The preference management process includes the following steps: B1, LLM large model extracts preference information; B2, storing the preference information into the preference database of this application; B3, push the preference update data to the central preference database.

[0012] Preferably, the above-mentioned large-model-based personalized shared memory construction method, A1, obtains historically stored user preference information from a central preference database according to user conversations, specifically: the central preference database provides an API interface to the question-and-answer service module corresponding to each application, and calls the API interface to obtain user preferences by specifying the required preference categories.

[0013] Preferably, the above-mentioned large-model-based personalized shared memory construction method, A1, obtains historically stored user preference information from a central preference database according to user conversations, specifically: by inputting user conversation information, using model reasoning, obtaining preference classification, and then obtaining user preference data.

[0014] Preferably, the above-mentioned personalized shared memory construction method based on the big model, B1, the LLM big model extracts preference information, specifically by constructing a prompt, setting the user preference information prompt word, and after the prompt word is input into the big model, the preference content is obtained.

[0015] Preferably, in the above-mentioned large-model-based personalized shared memory construction method, the preference database contains user ID, user information, and information on different preference items of the user.

[0016] Preferably, in the above-mentioned method for constructing a personalized shared memory based on a large model, the central preference database provides an API interface to obtain preference data from each application, and organizes the preference type and preference content information corresponding to each user ID; The API interface provides the stored user preference data to the question-and-answer service module corresponding to each application.

[0017] The present invention provides a personalized shared memory construction system and method based on a large model, which automatically collects user preferences from the conversation by maintaining the conversation data with the large model in each application and planning personalized preference keywords, extracting preference data, and persisting the preference data in a database for system calls.

[0018] The solution of the present invention is a preference collection solution that is not perceived by the user, and completes the collection of user preferences during the chat process.

[0019] The solution of the present invention maintains the user's latest preferences during the conversation process, so that memory loss will not occur when chatting about topics related to the user.

[0020] The solution of the present invention is based on the case of a multi-application same account system, uses central preference management, obtains preference data from multiple applications, forms a user preference portrait, and can achieve preference sharing. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The present invention is further described with reference to the accompanying drawings, but the contents in the accompanying drawings do not constitute any limitation to the present invention.

[0022] Figure 1 It is a schematic diagram of a personalized shared memory construction system based on a large model of the present invention. DETAILED DESCRIPTION

[0023] The present invention will be further described with reference to the following examples.

[0024] Example 1 A personalized shared memory construction system based on large models, such as Figure 1 As shown, there are provided: at least one question-and-answer service module, a preference database corresponding one-to-one to the question-and-answer service module, and a central preference database.

[0025] The question-and-answer service module receives questions from users. During the user chat, the LLM model collects user preferences and inputs the collected user preferences into the preference database of the application corresponding to the question-and-answer service module. Different question-and-answer service modules have different application functions.

[0026] The central preference database receives information from each preference database. When the question-and-answer service module is working, the historically acquired user preference information is input into the question-and-answer service module so that the LLM model can respond to user questions based on the preference information.

[0027] The central preference database aggregates user preferences collected in different sessions and different applications to form a cross-session and cross-application user preference information database.

[0028] The central preference database collects and manages the preference data of each preference database. The central preference database contains user ID, preference type, and preference content information. The central preference database provides an API interface to each corresponding question-and-answer service module.

[0029] Based on the personalized shared memory construction method of the personalized shared memory construction system, when the question-and-answer service module receives the question-and-answer information of the user, one preference question-and-answer process and another preference management process are carried out simultaneously.

[0030] The preference questioning process includes the following steps: A1, obtain historically stored user preference information from the central preference database based on user dialogue; A2, builds a context with preferences based on user preference information and conversation history; A3, input the context with preferences to the LLM big model, and the big model replies to the user.

[0031] The preference management process includes the following steps: B1, LLM large model extracts preference information; B2, storing the preference information into the preference database of this application; B3, push the preference update data to the central preference database.

[0032] The following describes the two processes in detail. In the preference question and answer process A1, historically stored user preference information is obtained from the central preference database based on the user dialogue. The central preference database collects and manages the preference data obtained from each application and provides an API interface to each application.

[0033] There are two ways to provide preferences: ①: The central preference database provides an API interface to the question-and-answer service module corresponding to each application. By specifying the required preference category, the API interface is called to obtain user preferences.

[0034] ②: By inputting the user’s conversation information, using model reasoning, obtaining preference classification, and then obtaining the user’s preference data.

[0035] The model here can use the LLM large model prompt project. Build prompt, for example: "You are an information classification expert. Based on the following conversation, what topic do you think the user is learning about? Filter from [accommodation, travel, dining, ...] Conversation content: xxx Your reply: ```” After the prompt word is input into the large model, the preference classification is obtained, and then the preference content is obtained.

[0036] A2, builds a context with preferences based on user preference information and conversation history, Build prompt, for example: “You are a personal assistant that combines user preferences to answer the user’s next question. User Preferences: Accommodation: xxx Catering: xxx ```” Use this prompt word as the system prompt word to rebuild the context with preference [ { "role": "system", "content":{system prompt words} }, { "role": "user", "content": "xxx" }, { "role": "assistant", "content": "xxxx" } ... ].

[0037] A3, input the context with preference to the LLM big model, and the big model will reply to the user. Since it contains the user preference information, the big model can reply according to the user's preference information. This is conducive to improving the intelligence of the big model's reply.

[0038] Another preference management process is described in detail below.

[0039] B1, LLM big model extracts preference information. Specifically, by constructing prompt, setting the user preference information prompt word, and inputting the prompt word into the big model, the preference content is obtained.

[0040] Build prompt, for example: "You are an information classification expert. Based on the following conversation, obtain the user's [accommodation, travel, catering,...] Preferences in other aspects. Leave blank for unmentioned preferences Conversation content: xxx Output in the following json format: ```json { "stay":"", "travel":"", "FOOD":"" } ``` ”.

[0041] After the prompt word is input into the large model, the preferred content is obtained.

[0042] B2, store the preference information into the preference database of this application.

[0043] The preference database contains user ID, user information, and information about different preference items of the user. The application preference database may be in the format of Table 1.

[0044] Table 1

[0045] The preference data obtained by B2 is stored in the preference database according to the user ID.

[0046] B3, push the preference update data to the central preference database.

[0047] The center preference database may be in the format of Table 2.

[0048] Table 2

[0049] The central preference database provides an API interface to obtain preference data from each application, and organizes the preference type and preference content information corresponding to each user ID. The API interface provides the stored user preference data to the question-and-answer service module corresponding to each application. The service where the central preference database is located provides an API interface to obtain preferences from each application and store them here. Provide it to subsequent applications for acquisition.

[0050] The personalized shared memory construction system and method based on the big model provided in this embodiment automatically collects user preferences from the conversation by maintaining the conversation data between each application and the big model and planning personalized preference keywords and extracting preference data. The preference data is persisted in the database for system calls.

[0051] The solution of the present invention is a preference collection solution that is not perceived by the user, and completes the collection of user preferences during the chat process.

[0052] The solution of the present invention maintains the user's latest preferences during the conversation process, so that memory loss will not occur when chatting about topics related to the user.

[0053] The solution of the present invention is based on the case of a multi-application same account system, uses central preference management, obtains preference data from multiple applications, forms a user preference portrait, and can achieve preference sharing.

[0054] Example 2 A specific embodiment is used to describe in detail a large-model-based personalized shared memory construction system and construction method of the present invention.

[0055] Information description of the embodiment: Assume user id, userId:1.

[0056] Suppose the current conversation is: "Q: Hello, is there any delicious food in Tianhe, Guangzhou?"

[0057] The current center preference has data as shown in three.

[0058] Table 3

[0059] When the question-and-answer service module receives the user's question-and-answer information, the system simultaneously performs one preference question-and-answer process and another preference management process.

[0060] Preference Question and Answer Process Package: A-1, Get user preferences based on user conversations The central preference database has collected and managed the preference data obtained from each application before this conversation. The central preference database provides an API interface to each application, providing the user preference information that has been collected historically to each application, that is, to each question and answer module. Different question and answer modules have different functions.

[0061] There are two ways to provide preferences: ① By specifying the required preference category, directly call the API to obtain Set preference categories according to the scope of the specific application. For example, the preferences that this application needs to collect are ["travel", "food"].

[0062] Then call the API directly to obtain the user's travel and food preferences API Input { "userId": "1", "preferences": [ "Travel", "diet" ] }.

[0063] API Output { "Travel": "Cloudy, travel mode: subway", "Diet": "None" }.

[0064] ② By inputting the user’s conversation information, using model reasoning, obtaining preference classification, and then obtaining preference data.

[0065] The model here can use LLM large model to prompt engineering.

[0066] Build prompt, for example: "You are an information classification expert. Based on the following conversation, what topic do you think the user is learning about? Filter from [Travel, Food]; Conversation content: Q: Hello, is there any delicious food in Tianhe, Guangzhou? Your reply: ```".

[0067] The output of LLM is diet; Then call the API Call the API to obtain the user's travel and food preferences API Input { "userId": "1", "preferences": [ "diet" ] } API Output { "Diet": "None" }.

[0068] A2: Build context with preferences based on user preferences and conversation history Build prompt, for example: “You are a personal assistant that combines user preferences to answer the user’s next question. You are a personal assistant that answers the user's next question based on the user's preferences. <User Preferences> Diet: None ”.

[0069] Use this prompt word as the system prompt word to rebuild the context with preference [ { "role": "system", "content":"You are a personal assistant, combining user preferences to answer the user's next question <User Preferences> Diet: None }, { "role": "user", "content": "Hello, is there anything delicious to eat in Tianhe, Guangzhou?" } ].

[0070] A3, input the context with preferences to the LLM big model, and the big model replies to the user.

[0071] In this embodiment, the large model responds as follows: There are many famous restaurants and food in Tianhe District, Guangzhou. Here are a few well-known places: 1. Tianhe North Road: There are a variety of restaurants and snacks here, ranging from traditional Cantonese cuisine to international cuisine.

[0072] 2. Zhengjia Plaza: There are many brand restaurants, including Cantonese cuisine, Western cuisine, Japanese cuisine, etc., which are suitable for different tastes.

[0073] 3. Bingsheng Taste near Lake View Primary School: This restaurant specializes in traditional Cantonese cuisine with authentic flavors.

[0074] 4. Dian Du De in Zhujiang New Town: You can taste dim sum and other Guangzhou specialties.

[0075] You can choose the right place based on your taste and preference. If you have a particular cuisine or restaurant type you want to eat, you can tell me and I will give you more specific recommendations. ” Another way to manage preferences is as follows: Assume that there is a conversation going on, with Q representing the user's question and A representing the output response of the big model.

[0076] Q: Hello, is there anything delicious to eat in Tianhe District, Guangzhou? A: There are many famous restaurants and food in Tianhe District, Guangzhou. Here are a few well-known places: Tianhe North Road: There are a variety of restaurants and snacks here, ranging from traditional Cantonese cuisine to international cuisine.

[0077] Zhengjia Plaza: There are many brand restaurants, including Cantonese cuisine, Western cuisine, Japanese cuisine, etc., which are suitable for different tastes.

[0078] Bingsheng Taste near Lakeview Primary School: This restaurant specializes in traditional Cantonese cuisine with authentic flavors.

[0079] Diandude in Zhujiang New Town: You can taste dim sum and other Guangzhou specialties.

[0080] You can choose the right place according to your taste and preference. If you have a particular cuisine or restaurant type you want to eat, you can tell me and I will give you more specific suggestions.

[0081] Q: Do you have Hunan cuisine? During the above dialogue, B1 is performed, and the LLM large model extracts preference information.

[0082] Build prompt, for example: “You are an information classification expert. Based on the following conversation, obtain the user’s preferences in [travel, food], etc. Do not fill in the unmentioned preferences.

[0083] Dialogue content: Q: Hello, is there anything delicious to eat in Tianhe District, Guangzhou? A: There are many famous restaurants and food in Tianhe District, Guangzhou. Here are a few well-known places: Tianhe North Road: There are a variety of restaurants and snacks here, ranging from traditional Cantonese cuisine to international cuisine.

[0084] Zhengjia Plaza: There are many brand restaurants, including Cantonese cuisine, Western cuisine, Japanese cuisine, etc., which are suitable for different tastes.

[0085] Bingsheng Taste near Lakeview Primary School: This restaurant specializes in traditional Cantonese cuisine with authentic flavors.

[0086] Diandude in Zhujiang New Town: You can taste dim sum and other Guangzhou specialties.

[0087] You can choose the right place according to your taste and preference. If you have a particular cuisine or restaurant type you want to eat, you can tell me and I will give you more specific suggestions.

[0088] Q: Do you have Hunan dishes? Output in the following json format: ```json { "Travel":"", "diet":"" } ``` ” After the prompt word is input into the large model, the preferred content is obtained.

[0089] Large model output: { "Travel":"", "Diet": "I like Hunan cuisine" }.

[0090] B1, LLM large model extracts preference information. By constructing prompt, set the user preference information prompt words "travel" and "food", and after inputting the prompt words into the large model, obtain the preference content "like Hunan cuisine".

[0091] B2, store the preference information into the preference database of this application.

[0092] The preference database contains user ID, user information, and information about different preference items of the user. The preference database of this application stores the results of Table 4.

[0093] Table 4

[0094] B3, push the preference update data to the central preference database.

[0095] Call the API to push the user's travel and food preferences API Input { "userId": "1", "preferences": { "Diet": "I like Hunan cuisine" } }.

[0096] The central preference database provides an API interface to obtain preference data from various applications, and organizes the preference type and preference content information corresponding to each user id. The storage content is shown in Table 5: Table 5

[0097] The above introduction is just an example of a conversation. It should be noted that the information of different applications inquired by the user at different times is all processed according to the above method.

[0098] For example, the user asked again the next day Q: Hello, can you recommend some restaurants in Nansha District? At this time, the system will make recommendations based on his eating habits and build a context with preferences. [ { "role": "system", "content":"You are a personal assistant, combining user preferences to answer the user's next question <User Preferences> Diet: I like Hunan cuisine. }, { "role": "user", "content": "Hello, please recommend some restaurants in Nansha District" } ] At this time, the big model answered: “Hello! In Nansha District, although the selection of Hunan cuisine may not be as much as in other areas of Guangzhou, I can recommend you several restaurants that may offer Hunan cuisine or be suitable for you: 1. Xiang Qing Ju - This is a restaurant that focuses on serving Hunan-style dishes. If there is a branch in Nansha District, its taste should suit your preferences.

[0100] 2. Lao Changsha Restaurant-If there is one, this is also a restaurant that mainly serves Hunan cuisine. You can try their classic Hunan dishes such as chopped pepper fish head and flavored shrimp.

[0101] 3. Nansha District Food Street or Food Court - These places usually bring together a variety of restaurants with different flavors, and it is possible to find a Hunan restaurant that suits your taste.

[0102] Please note that restaurants are subject to change, so it is recommended that you check reviews online or call to confirm before going. I hope these suggestions are helpful! Let me know if you need a more specific recommendation. ” In the subsequent interactive communication process, the collection process of the present invention is repeated. On the one hand, preferences are collected without perception during the interaction with the user, and user information and preferences can be continuously updated. On the other hand, preference information can be shared using the central preference database service and used across applications.

[0103] The personalized shared memory construction system and method based on the big model provided in this embodiment automatically collects user preferences from the conversation by maintaining the conversation data between each application and the big model and planning personalized preference keywords and extracting preference data. The preference data is persisted in the database for system calls.

[0104] The solution of the present invention is a preference collection solution that is not perceived by the user, and completes the collection of user preferences during the chat process.

[0105] The solution of the present invention maintains the user's latest preferences during the conversation process, so that memory loss will not occur when chatting about user-related topics.

[0106] The solution of the present invention is based on the case of a multi-application same account system, uses central preference management, obtains preference data from multiple applications, forms a user preference portrait, and can achieve preference sharing.

[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit the scope of protection of the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the essence and scope of the technical solution of the present invention.

Claims

1. A personalized shared memory construction system based on a large model, characterized in that: It is provided with: at least one question-answering service module, a preference database corresponding to each question-answering service module, and a central preference database; The question-and-answer service module receives questions from users. During the user chat, the LLM model collects user preferences and inputs the collected user preferences into the preference database of this application corresponding to the question-and-answer service module. Different question-and-answer service modules assume different application functions. The central preference database receives information from each preference database. When the question-and-answer service module is working, the historically acquired user preference information is input into the question-and-answer service module so that the LLM model can respond to user questions based on the preference information.

2. The large model-based personalized shared memory construction system according to claim 1, characterized in that: The central preference database aggregates user preferences collected in different sessions and different applications to form a cross-session and cross-application user preference information database.

3. The large model-based personalized shared memory construction system according to claim 1 or 2, characterized in that: The central preference database collects and acquires the preference data of each preference database for management, and provides an API interface to each corresponding question-and-answer service module.

4. The large model-based personalized shared memory construction system according to claim 3, characterized in that: The central preference database contains user ID, preference type, and preference content information.

5. A method for constructing a personalized shared memory based on a large model, based on the personalized shared memory construction system according to any one of claims 1 to 4, characterized in that: When the question-and-answer service module receives the user's question-and-answer information, it simultaneously performs a preference question-and-answer process and another preference management process; The preference questioning process includes the following steps: A1, obtain historically stored user preference information from the central preference database based on user dialogue; A2, builds a context with preferences based on user preference information and conversation history; A3, input the context with preference to the LLM big model, and the big model will reply to the user; The preference management process includes the following steps: B1, LLM large model extracts preference information; B2, storing the preference information into the preference database of this application; B3, push the preference update data to the central preference database.

6. The method for constructing a personalized shared memory based on a large model according to claim 5, characterized in that: A1. Obtain historically stored user preference information from the central preference database based on user conversations. Specifically, the central preference database provides an API interface to the question-and-answer service module corresponding to each application. By specifying the required preference category, the API interface is called to obtain user preferences.

7. The method for constructing a personalized shared memory based on a large model according to claim 5, characterized in that: A1, based on the user conversation, obtain the historically stored user preference information from the central preference database. Specifically, by inputting the user's conversation information, using model reasoning, obtaining the preference classification, and then obtaining the user's preference data.

8. The method for constructing a personalized shared memory based on a large model according to claim 5, characterized in that: B1, the LLM big model extracts preference information, specifically by constructing a prompt, setting the user preference information prompt word, and inputting the prompt word into the big model to obtain the preference content.

9. The method for constructing a personalized shared memory based on a large model according to claim 8, characterized in that: The preference database contains user ID, user information, and information about different preference items of the user.

10. The method for constructing a personalized shared memory based on a large model according to claim 9, characterized in that: The central preference database provides an API interface to obtain preference data from various applications, and organizes the preference type and preference content information corresponding to each user ID; The API interface provides the stored user preference data to the question-and-answer service module corresponding to each application.

Citation Information

Patent Citations

  • Question answering system and method based on vector and large language model

    CN117493513A

  • Question and answer model training method, question and answer method and question and answer method under subject question and answer scene

    CN118312784A

  • Chat robot response method and device, equipment and medium

    CN118797014A

Cited By

  • Multi-level modular personal memory large model and construction method thereof

    CN121031669A