Prompt information processing method and device and electronic equipment

By generating target prompt information with similar semantics but different representations, and combining it with user preference information to train the recommendation model, the accuracy and robustness issues of large models when faced with inconsistent prompt information are solved, and more accurate and stable personalized recommendations are achieved.

CN120671818APending Publication Date: 2025-09-19LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510727245.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

When large models face inconsistent or unseen prompt information, the accuracy and robustness of recommendation results are affected. Existing manually designed diversified prompts and data augmentation technologies cannot effectively cover user needs and retain semantic consistency.

Method used

By determining preference information based on user historical interaction information, the prompt information generation model is used to generate target prompt information with similar semantics but different representations, and combined with the training model to generate recommendation results that better meet user needs.

Benefits of technology

The accuracy and robustness of the recommendation model's understanding of new prompt information are improved, providing more stable and accurate personalized recommendation results and reducing dependence on expert knowledge.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120671818A_ABST
    Figure CN120671818A_ABST
Patent Text Reader

Abstract

The invention discloses a prompt information processing method and device and electronic equipment. The information processing method comprises the steps of determining at least one piece of preference information of a user based on historical interaction information of the user; generating at least one piece of target prompt information through a prompt information generation model based on the at least one piece of preference information of the user and the initial prompt information; wherein different target prompt messages are similar in semantics and different in representation mode; the at least one piece of target prompt information is used for a recommendation task related to the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to, but is not limited to, the field of computer technology, and in particular to a prompt information processing method, device, and electronic device. Background Art

[0002] In recommendation systems, large models can generate personalized recommendations by analyzing historical user behavior. However, these models face the problem of prompt sensitivity. Prompt sensitivity refers to the fact that large models respond significantly differently to even small changes in the prompt information provided by the user. This affects the accuracy and robustness of the recommendation results when the large model encounters inconsistent or unseen prompt information. This phenomenon significantly reduces the performance and stability of recommendation models when faced with ambiguous user input. Summary of the Invention

[0003] In view of this, the present application at least provides a prompt information processing method, device and electronic device.

[0004] The technical solution of this application is achieved as follows:

[0005] In one aspect, the present application provides a method for processing prompt information, the method comprising:

[0006] Determining at least one preference information of the user based on the historical interaction information of the user;

[0007] Based on at least one preference information and initial prompt information of the user, at least one target prompt information is generated by a prompt information generation model; wherein different target prompt information have similar semantics but different representations; and at least one target prompt information is used for a recommendation task related to the user.

[0008] In some embodiments, the method further comprises at least one of the following:

[0009] Based on at least one target prompt information, using a first initial model, generating at least one predicted recommendation result; calculating a first loss based on at least one sample recommendation result and at least one predicted recommendation result corresponding to the at least one target prompt information; updating the first initial model using the first loss to obtain a recommendation model; the recommendation model is used to perform a recommendation task related to the user;

[0010] The at least one target prompt information is input into the recommendation model, so as to generate a target recommendation result corresponding to the at least one target prompt information by using the recommendation model.

[0011] In some implementations, determining at least one preference information of a user based on the user's historical interaction information includes:

[0012] Construct a mask dataset based on users’ historical interaction information;

[0013] The mask prediction language model is used to predict mask information in the mask dataset to obtain at least one preference information.

[0014] In some embodiments, the method further comprises:

[0015] Based on the at least one sample preference information and the first prompt information, using a prompt information generation module to generate at least one first target prompt information; wherein each first target prompt information corresponds to the at least one sample preference information;

[0016] Calculating a second loss based on the at least one first target prompt information;

[0017] The prompt information generation module is updated based on the second loss to obtain a prompt information generation model.

[0018] In some embodiments, calculating the second loss based on at least one first target prompt information includes:

[0019] For any two pieces of first target prompt information among the plurality of first target prompt information, respectively calculating a first similarity and a second similarity between the two pieces of first target prompt information;

[0020] Based on the first similarity and the second similarity, a second loss is determined.

[0021] In some embodiments, the first similarity represents vector distance; and the second similarity represents probability distribution similarity.

[0022] In some embodiments, the method further comprises:

[0023] classifying at least one first target prompt information using a discrimination module according to at least one sample preference information to obtain first predicted preference information corresponding to each first target prompt information;

[0024] The prompt information generation module is updated based on the second loss to obtain a prompt information generation model, including:

[0025] In response to the second loss being less than the loss threshold, and the first predicted preference information corresponding to each first target prompt information corresponding to the sample preference information, a most recently updated prompt information generation module is determined as the prompt information generation model.

[0026] In some embodiments, the method further comprises:

[0027] classifying the at least one second target prompt information using a second initial module according to the at least one sample preference information to obtain second predicted preference information corresponding to each second target prompt information; the at least one second target prompt information is generated based on the second prompt information and the at least one sample preference information;

[0028] Calculating a third loss based on the second predicted preference information and the sample preference information corresponding to each second target prompt information;

[0029] The second initial module is updated based on the third loss to obtain the discriminative module.

[0030] On the other hand, the present application also provides an information processing device, comprising:

[0031] A first generating module, configured to determine at least one preference information of a user based on historical interaction information of the user;

[0032] The second generation module is used to generate at least one target prompt information based on at least one preference information and initial prompt information of the user through a prompt information generation model; wherein, different target prompt information have similar semantics but different representation methods; and at least one target prompt information is used for a recommendation task related to the user.

[0033] On the other hand, the present application also provides an electronic device, comprising a memory and a processor; wherein,

[0034] The memory stores a computer program executable on the processor;

[0035] When a processor executes a computer program, it:

[0036] Determining at least one preference information of the user based on the historical interaction information of the user;

[0037] Based on at least one preference information and initial prompt information of the user, at least one target prompt information is generated by a prompt information generation model; wherein different target prompt information have similar semantics but different representations; and at least one target prompt information can be used for a recommendation task related to the user.

[0038] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, are used to illustrate the technical solutions of the present application.

[0040] Figure 1A schematic diagram of the implementation flow of a prompt information processing method provided in this application;

[0041] Figure 2 A schematic diagram of generating target prompt information for training a recommendation model in an embodiment provided in this application;

[0042] Figure 3 A schematic diagram of generating preference information in an embodiment provided in this application;

[0043] Figure 4 A schematic diagram of a prompt information generation module trained using a generative adversarial network in an embodiment of the present application;

[0044] Figure 5 A schematic diagram of the structure of an information processing device provided in this application;

[0045] Figure 6 A schematic diagram of the hardware entity of an electronic device provided in this application. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions of this application are further elaborated in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0047] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0048] The terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understandable that "first / second / third" can be interchanged with a specific order or sequence where permitted so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing this application only and are not intended to limit this application.

[0050] In order to address the prompt sensitivity issue of large models, related technologies have proposed using diversified input prompts to fine-tune large models to improve their robustness. Common solutions for fine-tuning large models are as follows:

[0051] Solution 1: Use manually designed diverse prompts to improve the stability and adaptability of the model;

[0052] Option 2 uses data augmentation technology to perturb the training data and construct diverse input data to improve the generalization ability of the large model under different prompts.

[0053] However, the above solution still has the following shortcomings:

[0054] Regarding option 1, manually designed diverse prompts rely on human expert knowledge, making it difficult to cover all possible user needs or behaviors. Furthermore, they may not provide sufficient diversity and accuracy in complex scenarios. Therefore, manually designed diverse prompts have significant limitations.

[0055] Regarding option 2, traditional data augmentation techniques typically focus on perturbing training data, resulting in potentially inefficient and homogeneous diverse data. Furthermore, there's no guarantee that the diverse prompts generated using data augmentation will retain the global semantic consistency of user interests. This can lead to a decrease in the accuracy of recommendation results, especially when the context of the prompt changes.

[0056] Based on this, the present application provides a prompt information processing method, which can be executed by an electronic device, which can be various types of terminals such as laptops, tablet computers, desktop computers, set-top boxes, mobile devices (for example, mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), etc., and can also be implemented as a server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0057] Below, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the drawings in the embodiments of the present application.

[0058] Figure 1 This is a schematic diagram of the implementation flow of a prompt information processing method provided by this application, such as Figure 1 As shown, the method includes the following steps S11 to S12:

[0059] Step S11: determining at least one preference information of the user based on the historical interaction information of the user.

[0060] Here, the user's historical interaction information refers to any type of information related to the user determined within a specified period of time.

[0061] In some implementations, the historical interaction information may be any type of information, for example, text information, image information, video information, audio information, or multimodal information.

[0062] In some embodiments, the historical interaction information may be obtained by any means. In some embodiments, the historical interaction information may be obtained by detecting the user's interaction behavior with the electronic device. For example, the historical interaction information may be obtained by detecting the user's web browsing history. In some embodiments, the historical interaction information may also be obtained from an application service corresponding to a specified application. For example, the historical interaction information related to the user may be obtained from a server corresponding to a recommendation system.

[0063] In some embodiments, the historical interaction information may be any user-related behavior information, such as user-initiated rating, like, favorite, or purchase behavior, or user behavior of staying on a webpage for a long time.

[0064] Preference information refers to information about a user's preferences or tendencies. In some implementations, preference information can reflect a user's subjective preferences and needs for products, services, content, or interaction methods. Therefore, preference information can be leveraged in personalized recommendations, content filtering, or other scenarios based on user behavior to provide intelligent services that better meet user expectations.

[0065] Here, when determining at least one user's preference information based on the user's historical interaction information, common information or high-frequency information in the historical interaction information may be analyzed to determine the at least one user's preference information. In some embodiments, a machine learning model may be used to predict the at least one user's preference information based on the historical interaction information. The machine learning model may include a masked prediction language model, a collaborative filtering model, or a matrix factorization model.

[0066] Step S12: Based on at least one preference information of the user and the initial prompt information, at least one target prompt information is generated by a prompt information generation model; wherein different target prompt information have similar semantics but are expressed in different ways; and the at least one target prompt information is used for a recommendation task related to the user.

[0067] Here, the initial prompt information refers to the original prompt information used to generate the diversified prompt information. In some embodiments, the initial prompt information can be any recognizable information, such as text information, voice information, image information, video information, or gesture information. In some embodiments, when the initial prompt information is text information, the initial prompt information can be in the form of a noun, a complete sentence, or any other form of information with semantic content. For example, the initial information can be "books", "flowers", or "please recommend books".

[0068] The target prompt information refers to the prompt information generated by perturbing the initial prompt information in combination with at least one preference information of the user.

[0069] The semantic similarity between different target prompt information means that the at least one target prompt information has similarity at the semantic level. For example, the at least one target prompt information is used to express the semantic information of the initial prompt information.

[0070] Different representations of different target prompt information refer to different ways of expressing the at least one target prompt information. For example, different target prompt information may have different data formats, data structures, etc.

[0071] The prompt information generation model refers to a pre-trained model with a prompt information generation function. In some embodiments, the prompt information generation model can be obtained by training a large language model.

[0072] Here, after at least one preference information of the user and the initial prompt information are input into the prompt information generation model, the prompt information generation model perturbs the initial prompt information based on the at least one preference information, thereby obtaining at least one target prompt information.

[0073] In some implementations, at least one user preference information and initial prompt information can be input into a preference attention framework that meets the input requirements of the prompt information generation model to construct a preference attention template, and the preference attention template can be input into the prompt information generation model. For example, an exemplary preference attention framework is as follows:

[0074] "Focus on the attributes of <attribute domain> to understand the product title in <item title>."

[0075] When constructing the preference attention template, at least one preference information of the user is filled into the "attribute field", and the initial prompt information is filled into the "project title".

[0076] In some embodiments, the prompt information generation model can expand, rewrite, or modify the initial prompt information based on at least one user preference to obtain at least one target prompt information. For example, if the initial prompt information is "books" and the preference information is "romance," the preference information can be combined with the initial prompt information to obtain the target prompt information "romantic books." Alternatively, the preference information can be combined with the initial prompt information and the combined prompt information can be rewritten or modified using words with similar semantics to the preference information and the initial prompt information to obtain another target prompt information, and so on.

[0077] In some embodiments, the prompt information generation model may combine at least one user's preference information with the initial prompt information in any suitable combination manner.

[0078] In some embodiments, when there are multiple pieces of preference information, the prompt information generation model can use each piece of preference information in combination with the initial prompt information to generate corresponding target prompt information. That is, there is a one-to-one correspondence between preference information and target prompt information. For example, if the user has five pieces of preference information, five target prompt information can be generated for the initial prompt information.

[0079] In some embodiments, when there are multiple pieces of preference information, the prompt information generation model can arrange and combine these multiple pieces of preference information to generate multiple groups of preference information, where each group of preference information includes at least one piece of preference information. In this way, each group of preference information can be combined with the initial prompt information to generate corresponding target prompt information. That is, there is a one-to-one correspondence between the number of preference information groups and the target prompt information. For example, by arranging and combining the five pieces of user preference information described above into 10 groups, 10 target prompt information pieces can be generated for the initial prompt information.

[0080] In some embodiments, when generating at least one target prompt information corresponding to the initial prompt information in combination with at least one preference information, the user's historical interaction information can be simultaneously input into the prompt information generation model, so that the prompt information generation model can simultaneously perturb the initial prompt information based on at least one preference information and the historical interaction information to generate more accurate and diverse target prompt information.

[0081] In some embodiments, when there are multiple pieces of preference information, the prompt information generation model can select a portion of the preference information with higher relevance from the multiple pieces of preference information based on the type of the initial prompt information, and use this portion of the preference information and the initial prompt information to generate at least one target prompt information. For example, when there are 10 pieces of preference information and the initial prompt information is "Please recommend a book," the prompt information generation model can select five pieces of preference information related to books from the ten pieces of preference information based on the type of the initial prompt information, i.e., a book-related recommendation request, and generate multiple target prompt information based on these five pieces of preference information and the initial prompt information. For example, during the selection process, the prompt information generation model can retain preference information related to books such as "romantic," "short stories," "modern times," "ancient costumes," and "high popularity," while discarding preference information unrelated to books such as "skin color" and "height."

[0082] Here, the at least one target prompt information is used for a recommendation task related to the user, which means that the at least one target prompt information can be applied to the recommendation system so that the recommendation system can perform the recommendation task based on the diversified prompt information.

[0083] In the above-mentioned embodiments provided in the present application, first, based on the user's historical interaction information, at least one preference information of the user is determined; then, based on the user's at least one preference information and initial prompt information, at least one target prompt information is generated through a prompt information generation model, wherein different target prompt information have similar semantics and different representation methods, and the at least one target prompt information is used for recommendation tasks related to the user. In this way, on the one hand, the different target prompt information corresponding to the initial prompt information are semantically similar but expressed in different ways, so that the at least one target prompt information semantically retains the global consistency of user interests and can express the initial prompt information from different angles or levels. Therefore, compared with manually designed prompt information or prompt information generated by data enhancement technology, the at least one target prompt information in this application can better cover a wide range of user intentions and behaviors; on the other hand, compared with the initial prompt information, the target prompt information generated in combination with the user's preference information can better express the user's personal characteristics. Therefore, when the target prompt information is used for user-related recommendation tasks, a recommendation result that is more in line with user expectations can be obtained; on the other hand, using the prompt information generation model to generate target prompt information can reduce the dependence of the target prompt information generation effect on expert knowledge, and can use the model's advantages in semantic understanding, automatic adjustment of generation strategies, etc. to generate diversified target prompt information in a higher dimension, thereby improving the generation effect of the target prompt information.

[0084] In some embodiments, the method provided herein further includes at least one of the following steps S13 to S14:

[0085] Step S13: Based on the at least one target prompt information, use the first initial model to generate at least one predicted recommendation result; calculate the first loss based on the at least one sample recommendation result corresponding to the at least one target prompt information and the at least one predicted recommendation result; use the first loss to update the first initial model to obtain a recommendation model; the recommendation model is used to perform recommendation tasks related to the user.

[0086] Here, after generating at least one target prompt information corresponding to the initial prompt information, the at least one target prompt information is used for the training task of the first initial model, so that the recommendation model obtained after training can better complete the recommendation task related to the user.

[0087] When at least one target prompt information is used for a training task, the recommendation result corresponding to the corresponding initial prompt information is used as the true value label, that is, the recommendation result is used as the sample recommendation result.

[0088] When training the first initial model,

[0089] First, at least one target prompt information is input into a first initial model, so that the first initial model performs model reasoning based on the at least one target prompt information and generates at least one predicted recommendation result corresponding to the at least one target prompt information;

[0090] Then, based on the at least one sample recommendation result and the at least one predicted recommendation result, a first loss is calculated. The first loss can be any type of loss. For example, the first loss can be Binary Cross-Entropy Loss, Bayesian Personalized Ranking Loss (BPR Loss), Mean Squared Error (MSE), Mean Absolute Error (MAE), etc.

[0091] Afterwards, the first initial model is updated using the first loss, and when a convergence condition preset for model training is met, the last updated first initial model is used as the recommended model. The preset convergence condition may be that the number of model updates reaches a threshold, or the first loss is less than a loss threshold.

[0092] Figure 2 This is a schematic diagram of generating target prompt information for training a recommendation model in an embodiment provided by this application. Figure 2 As shown,

[0093] First, multiple preference information 210 is input into a preset preference attention framework to construct a preference attention template 220 that meets the input requirements of the prompt information generation model 230; wherein the preference attention template 220 also includes initial prompt information;

[0094] Then, the preference attention template 220 is input into the prompt information generation model 230 to generate a plurality of target prompt information 240 using the prompt information generation model 230;

[0095] Afterwards, the plurality of target prompt information 240 is input into a recommendation task framework that meets the input requirements of the first initial model 260 to construct a recommendation task template 250;

[0096] Finally, the recommendation task template 250 is input into the first initial model 260 to perform model training on the first initial model 260 to obtain a recommendation model.

[0097] In the above embodiment, the target prompt information is generated by combining the initial prompt information and the user's preference information, and has semantic similarity and representation diversity. Therefore, the recommendation model trained based on the target prompt information can better understand user needs and behaviors from a variety of perspectives, so that when the recommendation model faces new unprocessed prompt information, it can analyze the new prompt information from multiple perspectives, thereby improving the accuracy and robustness of the understanding of the new prompt information, and making the recommendation results more stable and accurate.

[0098] Step S14: inputting the at least one target prompt information into a recommendation model, so as to generate a target recommendation result corresponding to the at least one target prompt information by using the recommendation model.

[0099] Here, the at least one target prompt information is input into the recommendation model for direct reasoning, so that the recommendation model performs task processing based on the at least one target prompt information to obtain a corresponding target recommendation result.

[0100] In the above embodiment, since the target prompt information is generated by combining the initial prompt information and the user's preference information, and has semantic similarity and representation diversity, compared with the initial prompt information, when performing model reasoning based on the target prompt information, the recommendation model can obtain a more comprehensive and accurate understanding of user needs and behaviors, and thus can provide more stable, accurate and personalized recommendation results.

[0101] In some implementations, determining at least one preference information of a user based on the user's historical interaction information, that is, the above step S11, can be implemented as the following steps S111 to S112:

[0102] Step S111: construct a mask dataset based on the user's historical interaction information.

[0103] Masked data refers to data obtained by masking part of the original data. For example, masking part of the user behavior sequence to obtain the corresponding masked data.

[0104] The masked dataset refers to a dataset obtained by performing masking processing on at least one historical interaction information of a user.

[0105] In some embodiments, the user's historical interaction information can be inserted into the preference prediction template to construct a mask dataset. For example, first, prepare the preference prediction template and the user's historical interaction information; then, use the historical interaction information to replace the "User History" position in the preference prediction template, and reserve the "MASK" token for mask prediction. In some embodiments, the data domain information to which the historical interaction information belongs can also be used to replace the "Data domain" position in the preference prediction template to improve the prediction accuracy of the mask information. For example, an example of a mask dataset constructed using a mask prediction template is as follows:

[0106] "You are a professional book shopping guide. Please generate accurate book attributes based on the user's browsing history below:

[0107] Pride and Prejudice, The Notebook, Twilight, Me Before You...

[0108] If you recommend books to this user, the attributes you should focus on are <mask>.”

[0109] Step S112: using a mask prediction language model to predict mask information in the mask data set to obtain the at least one preference information.

[0110] The mask data set is input into the mask prediction language model, so as to predict the mask information in the data set by using the mask prediction language model, and obtain at least one preference information of the user.

[0111] When the mask dataset is constructed using a mask prediction template, the dataset is input into a mask prediction language model. The mask prediction language model can predict the information at the mask based on the user's historical interaction information and data domain in the dataset, and use the prediction result as the user's preference information.

[0112] Figure 3 This is a schematic diagram of generating preference information in an embodiment provided by this application. Figure 3 As shown, first, the historical interaction information 310 is filled into the multiple positions 321 in the preference prediction template 320 for filling in the user historical information. At the same time, the preference prediction template 320 includes a mask information bit 322; then, the preference prediction template 320 is input into the mask prediction language model 330 to use the mask prediction language model 330 to predict the information in the mask information bit 322; finally, according to the prediction results, the mask prediction language model 330 outputs multiple preference information 340.

[0113] In the above embodiment, the user's historical interaction information is input into the mask prediction language model in the form of a mask dataset, especially when the mask dataset is constructed using a mask prediction template. This can help the mask prediction language model better organize and understand the historical interaction information and prediction tasks, thereby improving the speed and accuracy of preference prediction.

[0114] In some embodiments, the method further comprises the following steps S15 to S17:

[0115] Step S15: Based on the at least one sample preference information and the first prompt information, generate at least one first target prompt information using a prompt information generation module; wherein each first target prompt information corresponds to at least one sample preference information.

[0116] Here, the first prompt information is original prompt information used to train the prompt information generation module.

[0117] The at least one sample preference information is preference information related to the first prompt information. For example, the first prompt information is prompt information related to the user corresponding to the sample preference information.

[0118] The prompt information generation module can be any suitable language model to be trained. For example, the prompt information generation module can be a language model based on deep learning such as a large language model or a transformer model.

[0119] In this way, the prompt information generation module is used to generate at least one first target prompt information corresponding to the first prompt information in combination with at least one sample preference information, so as to achieve diversified processing of the first prompt information.

[0120] Step S16: Calculate the second loss based on the at least one first target prompt information.

[0121] Here, for at least one first target prompt information, the second loss is calculated using a specified loss calculation function.

[0122] Since the model training goal of the prompt information generation module is to make the different first target prompt information generated by the model have similar semantics and diverse representations, the second loss calculated using the specified loss function can at least characterize the degree of semantic similarity and representation diversity between different first target prompt information.

[0123] Therefore, in some embodiments, step S16 can be implemented as the following steps S161 to S162:

[0124] Step S161: for any two pieces of first target prompt information among a plurality of first target prompt information, respectively calculate a first similarity and a second similarity between the two pieces of first target prompt information;

[0125] Step S162: Determine the second loss based on the first similarity and the second similarity.

[0126] Here, in order to use the second loss to limit the degree of semantic similarity and representation diversity between different first target prompt information, two similarities are calculated for any two first target prompt information. In some embodiments, the first similarity is used to represent the degree of semantic similarity between the two first target prompt information, and the second similarity is used to represent the degree of representation diversity between the two first target prompt information.

[0127] In some implementations, the semantic similarity between two pieces of first target prompt information may be calculated using any appropriate method.

[0128] In some embodiments, a vector distance between two pieces of first target prompt information can be calculated, and semantic similarity can be determined based on the vector distance. In this way, the first similarity represents the vector distance. In some embodiments, the first similarity can be Euclidean distance, Manhattan distance, cosine similarity, etc.

[0129] In some embodiments, the semantic similarity between two pieces of first target prompt information can be calculated based on the knowledge graph. For example, entities and relationships between entities in two pieces of first target prompt information are identified, and then the entities and relationships in the two pieces of first target prompt information are compared to determine whether they are similar. The semantic similarity between the two pieces of first target prompt information is then determined based on the comparison result.

[0130] In some implementations, the degree of representation diversity between two pieces of first target prompt information may be calculated using any appropriate method.

[0131] In some embodiments, the second similarity represents probability distribution similarity. Probability distribution similarity is used to measure the degree of similarity between two probability distributions. In this application, it is used to measure the degree of similarity between two first target prompts. In some embodiments, the probability distribution similarity can be JS divergence (Jensen-Shannon Divergence), KL divergence (Kullback-Leibler Divergence), etc.

[0132] After determining the first and second similarities between the two first target prompt information, the second loss may be calculated using the two similarities. In some embodiments, the sum of the first and second similarities may be used as the second loss. In some embodiments, the first and second similarities may be weighted, respectively, and the sum of the weighted first and second similarities may be used as the second loss.

[0133] Step S17: updating the prompt information generation module based on the second loss to obtain the prompt information generation model.

[0134] Here, the prompt information generation module is updated using the second loss, and when a preset convergence condition is met, the last updated prompt information generation module is used as the prompt information generation model. In some embodiments, the preset convergence condition may include the second loss being less than a preset second loss threshold, or the number of updates to the prompt information generation module reaching a threshold.

[0135] In the above embodiment, the first similarity and the second similarity can be used to indicate two types of similarities between any two first target prompt information. Therefore, the second loss can guide and measure the optimization direction of the prompt information generation module from two aspects, thereby making the different target prompt information generated by the trained prompt information generation model have multiple types of similarities. In addition, when the first similarity is used to represent the degree of semantic similarity (for example, vector distance) and the second similarity is used to represent the degree of diversity (for example, probability distribution similarity), using the second loss to optimize the prompt information generation module can make the different target prompt information generated by the trained prompt information generation model have semantic similarity and representation diversity.

[0136] In some embodiments, the method further comprises the following step S18:

[0137] Step S18: Classify the at least one first target prompt information using a discrimination module according to the at least one sample preference information to obtain first predicted preference information corresponding to each first target prompt information.

[0138] Here, the first target prompt information is used as input information for the discrimination module, and the sample preference information corresponding to the first target prompt information is used as a classification label for the discrimination module, so that the discrimination module classifies at least one first target prompt information according to the classification label. Here, the classification result of the discrimination module for each first target prompt information is used as the first predicted preference information corresponding to the first target prompt information.

[0139] In some embodiments, the discrimination module can be implemented as any type of network structure, for example, a multi-layer perceptron (MLP) network, a convolutional neural network, or a self-attention mechanism network.

[0140] In this way, the prompt information generation module is updated based on the second loss to obtain the prompt information generation model. That is, the above step S17 can be implemented as the following step S171:

[0141] Step S171 , in response to the second loss being less than a loss threshold, and the first predicted preference information corresponding to each first target prompt information corresponding to the sample preference information, determining the most recently updated prompt information generation module as the prompt information generation model.

[0142] The training process for the prompt information generation module converges under two conditions: the second loss is less than a corresponding loss threshold, and the first predicted preference information determined by the discriminant module for each first target prompt information corresponds to the sample preference information. When both conditions are met, the training process for the prompt information generation module is determined to have converged, and the last updated prompt information generation module is determined as the prompt information generation model.

[0143] In the above embodiment, a discriminator module is introduced into the training process of the prompt information generation module, thereby forming a generative adversarial network (GAN) composed of the prompt information generation module and the discriminator module. In this way, the classification accuracy of the discriminator module for at least one first prompt information is used as one of the convergence conditions in the training process of the prompt information generation module, thereby improving the training effect of the prompt information generation module.

[0144] Figure 4 This is a schematic diagram of a prompt information generation module using a generative adversarial network training in one embodiment of the present application. Figure 4 As shown:

[0145] First, multiple sample preference information 410 is input into a preset template framework to obtain a preference attention template 420 that meets the input requirements of the prompt information generation module 430; wherein the preference attention template 420 also includes the first prompt information;

[0146] Then, the preference attention template 420 is input into the prompt information generation module 430 so as to generate a plurality of first target prompt information 440 using the prompt information generation module 430;

[0147] Then, the cosine similarity and JS divergence are calculated for any two first target prompt information pieces from the plurality of first target prompt information pieces 440, and a second loss 450 is calculated based on the calculated cosine similarity and JS divergence. Simultaneously, the plurality of first target prompt information pieces 440 are input into a discrimination module 460, so that the discrimination module 460 classifies the plurality of first target prompt information pieces 440 according to the plurality of sample preference information pieces 410, thereby obtaining first predicted preference information 470 corresponding to each first target prompt information piece.

[0148] Finally, the second loss 450 is used to update the prompt information generation module 430. When the second loss 450 is less than the preset loss threshold and the first predicted preference information corresponding to each first target prompt information matches the sample preference information, it is determined that the model training process for the prompt information generation module 430 has converged, and the last updated prompt information generation module 430 is used as the prompt information generation model.

[0149] In some embodiments, before using the discrimination module to assist in determining whether the training process of the prompt information generation module has converged, model training is performed on the second initial module to obtain the discrimination module.

[0150] Thus, in some embodiments, the method further includes the following steps S181 to S183:

[0151] Step S181: Based on at least one sample preference information, use the second initial module to perform classification on at least one second target prompt information to obtain second predicted preference information corresponding to each second target prompt information; the at least one second target prompt information is generated based on the second prompt information and at least one sample preference information.

[0152] Here, the second prompt information refers to the original prompt information. The second target prompt information is generated based on the second prompt information and at least one sample preference information. Thus, each second target prompt information has corresponding sample preference information. In some embodiments, the at least one second target prompt information is generated by a prompt information generation module based on the second prompt information and at least one sample preference information.

[0153] The second target prompt information is used as input information for the second initial module, and the sample preference information is used as a classification label for the second initial module, so that the second initial module classifies at least one second target prompt information according to the classification label. Here, the classification result of the second initial module for each second target prompt information is used as the second predicted preference information corresponding to the second target prompt information.

[0154] Step S182: Calculate a third loss based on the second predicted preference information and sample preference information corresponding to each piece of the second target prompt information.

[0155] Here, the third loss between the second predicted preference information and the sample preference information corresponding to each second target prompt information can be calculated using any suitable method. In some embodiments, the third loss can be a binary cross entropy loss, a Bayesian personalized ranking loss, a mean square error loss, or a mean absolute error loss.

[0156] Step S183: Update the second initial module based on the third loss to obtain the discrimination module.

[0157] Here, the second initial module is updated using the third loss, and in response to the convergence of the training process for the second initial module, the last updated second initial module is used as the discriminative module.

[0158] In some embodiments, the second initial module and the prompt information generation module are alternately trained by adversarial training, thereby continuously optimizing the prompt information generation module and improving the quality of data generated by the prompt information generation module.

[0159] Based on the foregoing embodiments, the present application provides an information processing device, which includes the various units included and the various modules included in each unit, and can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.

[0160] Figure 5 This is a schematic diagram of the structure of an information processing device provided by this application, such as Figure 5 As shown, the information processing device 500 includes: a first generating module 510 and a second generating module 520, wherein:

[0161] A first generating module 510 is configured to determine at least one preference information of a user based on the user's historical interaction information;

[0162] The second generation module 520 is used to generate at least one target prompt information based on at least one preference information and initial prompt information of the user through a prompt information generation model; wherein different target prompt information have similar semantics but different representation methods; and the at least one target prompt information is used for recommending tasks related to the user.

[0163] In some embodiments, the apparatus 500 further includes at least one of the following:

[0164] A first training module is configured to generate at least one predicted recommendation result based on the at least one target prompt information using a first initial model; calculate a first loss based on at least one sample recommendation result corresponding to the at least one target prompt information and the at least one predicted recommendation result; and update the first initial model using the first loss to obtain a recommendation model; the recommendation model is configured to perform a recommendation task related to the user;

[0165] The recommendation module is configured to input the at least one target prompt information into a recommendation model, so as to generate a target recommendation result corresponding to the at least one target prompt information by using the recommendation model.

[0166] In some implementations, the first generating module 510 is configured to:

[0167] Construct a mask dataset based on users’ historical interaction information;

[0168] The mask information in the mask data set is predicted using a mask prediction language model to obtain the at least one preference information.

[0169] In some embodiments, the apparatus 500 further includes a second training module; the second training module is configured to:

[0170] Based on the at least one sample preference information and the first prompt information, generating at least one first target prompt information using a prompt information generation module; wherein each first target prompt information corresponds to at least one sample preference information;

[0171] Calculating a second loss based on the at least one first target prompt information;

[0172] The prompt information generation module is updated based on the second loss to obtain the prompt information generation model.

[0173] In some embodiments, the second training module is used to:

[0174] For any two pieces of first target prompt information among the plurality of first target prompt information, respectively calculating a first similarity and a second similarity between the two pieces of first target prompt information;

[0175] The second loss is determined based on the first similarity and the second similarity.

[0176] In some embodiments, the first similarity represents a vector distance; and the second similarity represents a probability distribution similarity.

[0177] In some embodiments, the second training module is further configured to:

[0178] classifying the at least one first target prompt information using a discrimination module according to the at least one sample preference information to obtain first predicted preference information corresponding to each first target prompt information;

[0179] In response to the second loss being less than a loss threshold, and the first predicted preference information corresponding to each first target prompt information corresponding to the sample preference information, a most recently updated prompt information generation module is determined as the prompt information generation model.

[0180] In some embodiments, the apparatus 500 further includes a third training module;

[0181] The third training module is used to:

[0182] classifying at least one second target prompt information using a second initial module according to at least one sample preference information to obtain second predicted preference information corresponding to each second target prompt information; wherein the at least one second target prompt information is generated based on the second prompt information and the at least one sample preference information;

[0183] Calculating a third loss based on the second predicted preference information and the sample preference information corresponding to each of the second target prompt information;

[0184] The second initial module is updated based on the third loss to obtain the discrimination module.

[0185] In addition, the present application also provides an electronic device. Figure 6 As shown, the electronic device 600 includes a processor 601 and a memory 602; wherein,

[0186] The memory 602 stores a computer program that can be run on the processor 601;

[0187] When the processor 601 executes the computer program, it is configured to:

[0188] Determining at least one preference information of the user based on the historical interaction information of the user;

[0189] Based on at least one preference information and initial prompt information of the user, at least one target prompt information is generated by a prompt information generation model; wherein different target prompt information have similar semantics but different representations; and the at least one target prompt information can be used for a recommendation task related to the user.

[0190] In some implementations, the electronic device 600 further includes a communication interface 602. The communication interface 602 enables the electronic device to communicate with other terminals or servers via a network.

[0191] In some embodiments, the memory 602 can also cache data to be processed or processed by the processor 601 and each module in the electronic device 600 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0192] In some implementations, data may be transmitted between the processor 601 , the memory 602 , and the communication interface 603 via a bus 604 .

[0193] It should be noted that the descriptions of the above device embodiments and equipment embodiments are similar to the descriptions of the above method embodiments and have similar beneficial effects as the method embodiments. In some embodiments, the functions, modules, units, or components of the devices and equipment provided in the embodiments of the present application can be used to perform the methods described in the above method embodiments. For technical details not disclosed in the device embodiments and equipment embodiments of the present application, please refer to the description of the method embodiments of the present application for understanding.

[0194] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the individual of the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, a clear and prominent sign is set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that they agree to the collection of their personal information; or on the personal information processing device, when the personal information processing rules are notified by obvious signs / information, the individual's authorization is obtained through pop-up information or by asking the individual to upload their personal information. Among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.

[0195] It should be noted that, in the embodiment of the present application, if the above-mentioned prompt information processing method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific hardware, software or firmware, or any combination of hardware, software and firmware.

[0196] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.

[0197] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps in the above method. The computer-readable storage medium may be transient or non-transient.

[0198] An embodiment of the present application provides a computer program, including computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.

[0199] An embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, implements some or all of the steps in the above method. The computer program product can be implemented specifically by hardware, software, or a combination thereof. In some embodiments, the computer program product is embodied as a computer storage medium. In other embodiments, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.

[0200] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between the various embodiments, and their similarities or similarities can be referenced to each other. The descriptions of the above device, storage medium, computer program, and computer program product embodiments are similar to the descriptions of the above method embodiments and have similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this application, please refer to the description of the method embodiments of this application for understanding.

[0201] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned steps / processes does not mean the order of execution. The execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0202] It should be noted that, in this document, the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a..." does not preclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0203] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0204] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.

[0205] In addition, all functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above-mentioned integrated units can be implemented in the form of hardware or in the form of hardware plus software functional units.

[0206] Those skilled in the art will understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, and other media that can store program codes.

[0207] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0208] The above is only an implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application.< / mask>

Claims

1. A method for processing prompt information, comprising: Determining at least one preference information of the user based on the historical interaction information of the user; Based on at least one preference information and initial prompt information of the user, at least one target prompt information is generated by a prompt information generation model; wherein different target prompt information have similar semantics but different representations; and the at least one target prompt information is used for recommending tasks related to the user.

2. The method according to claim 1, further comprising at least one of the following: Based on the at least one target prompt information, using a first initial model, generating at least one predicted recommendation result; based on the at least one sample recommendation result corresponding to the at least one target prompt information and the at least one predicted recommendation result, calculating a first loss; Updating the first initial model using the first loss to obtain a recommendation model; The recommendation model is used to perform recommendation tasks related to users; The at least one target prompt information is input into a recommendation model, so as to generate a target recommendation result corresponding to the at least one target prompt information by using the recommendation model.

3. The method according to claim 1, wherein determining at least one preference information of a user based on the user's historical interaction information comprises: Construct a mask dataset based on users’ historical interaction information; The mask information in the mask data set is predicted using a mask prediction language model to obtain the at least one preference information.

4. The method according to any one of claims 1 to 3, further comprising: Based on the at least one sample preference information and the first prompt information, generating at least one first target prompt information using a prompt information generation module; wherein each first target prompt information corresponds to at least one sample preference information; Calculating a second loss based on the at least one first target prompt information; The prompt information generation module is updated based on the second loss to obtain the prompt information generation model.

5. The method according to claim 4, wherein the calculating the second loss based on the at least one first target prompt information comprises: For any two pieces of first target prompt information among the plurality of first target prompt information, respectively calculating a first similarity and a second similarity between the two pieces of first target prompt information; The second loss is determined based on the first similarity and the second similarity.

6. The method according to claim 5, wherein: The first similarity represents vector distance; the second similarity represents probability distribution similarity.

7. The method according to claim 4, further comprising: classifying the at least one first target prompt information using a discrimination module according to the at least one sample preference information to obtain first predicted preference information corresponding to each first target prompt information; The updating of the prompt information generation module based on the second loss to obtain the prompt information generation model includes: In response to the second loss being less than a loss threshold, and the first predicted preference information corresponding to each first target prompt information corresponding to the sample preference information, a most recently updated prompt information generation module is determined as the prompt information generation model.

8. The method according to claim 7, further comprising: classifying at least one second target prompt information using a second initial module according to at least one sample preference information to obtain second predicted preference information corresponding to each second prompt information; The at least one second target prompt information is generated based on the second prompt information and the at least one sample preference information; Calculating a third loss based on the second predicted preference information and the sample preference information corresponding to each of the second target prompt information; The second initial module is updated based on the third loss to obtain the discrimination module.

9. An information processing device comprising: A first generating module, configured to determine at least one preference information of a user based on historical interaction information of the user; The second generation module is used to generate at least one target prompt information through a prompt information generation model based on at least one preference information and initial prompt information of the user; wherein different target prompt information have similar semantics but different representation methods; and the at least one target prompt information is used for recommending tasks related to the user.

10. An electronic device comprising a memory and a processor; wherein: The memory stores a computer program executable on the processor; When the processor executes the computer program, it is configured to: Determining at least one preference information of the user based on the historical interaction information of the user; Based on at least one preference information and initial prompt information of the user, at least one target prompt information is generated by a prompt information generation model; wherein different target prompt information have similar semantics but different representations; and the at least one target prompt information can be used for a recommendation task related to the user.