User representation understanding method and apparatus based on language model

By using the Q-Transformer model and independent linear layers, user representations are transformed into a vector space format usable by large-scale language models, generating user representations that understand text. This solves the problem of the lack of interpretability in user representation algorithm models and achieves interpretability and credibility of user representations.

WO2026031785A1PCT designated stage Publication Date: 2026-02-12ALIBABA (CHINA) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/101728
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-08
Filing Date
2025-06-18
Publication Date
2026-02-12

AI Technical Summary

Technical Problem

Existing user representation algorithm models lack interpretability, making it difficult for users to understand why the algorithm model interprets them, which affects credibility. Furthermore, large-scale language models cannot directly understand user representations.

Method used

The Q-Transformer model and independent linear layers are used to transform user representations into a vector space format that can be used by large-scale language models. The user representations are then input into the large-scale language model to generate user representations for understanding the text, and multi-turn interactions are used to mine deeper information.

Benefits of technology

It achieves interpretability of user representations, enabling users to understand the reasons for the algorithm model's output, thus enhancing user credibility, and outputs natural language text through a large-scale language model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025101728_12022026_PF_FP_ABST
    Figure CN2025101728_12022026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the embodiments of the present invention are a user representation understanding method and apparatus based on a language model. The method in the embodiments of the present invention comprises: acquiring a first user representation, wherein the user representation is a vector representation of a user in a preset algorithm; inputting the first user representation into a query transformer (Q-Transformer) model, so as to generate a second user representation, wherein the second user representation comprises some information in the first user representation; inputting the second user representation into an independent linear layer, and generating a third user representation by means of vector space transformation, wherein a vector representation of the third user representation is a vector space format usable by a large language model; and inputting the third user representation and first question information into the large language model, so as to generate a user representation understanding text. By means of the method, a large language model outputs natural language texts for understanding user representations, thereby realizing the interpretability of user representations in artificial intelligence algorithms.
Need to check novelty before this filing date? Find Prior Art

Description

Method and device for understanding user representation based on language model

[0001] The present application claims priority to the Chinese patent application No. 202411090577.6, filed on August 8, 2024, and entitled "Method and device for understanding user representation based on language model", the whole content of which is incorporated herein by reference. TECHNICAL FIELD

[0002] The present application relates to the technical field of computer, more particularly, to a method and device for understanding user representation based on language model. BACKGROUND

[0003] User representation refers to an abstract representation of a user in an artificial intelligence algorithm. The user representation is used in algorithms in various fields, such as recommendation system algorithms and user portrait algorithms. However, current algorithms for user representation lack interpretability, and cannot provide explanations for the user representation at the application level. From the user's perspective, the user can only get the results of the algorithm model, but cannot know the reasons for the results provided by the algorithm model. For example, a user is recommended a certain product, but cannot know how the user is understood in the algorithm model, which affects the user's confidence in the output results of the algorithm model.

[0004] With the development of large-scale language models, the large-scale language models have shown amazing effects in different applications, especially in knowledge memory, text understanding and text generation. However, existing large-scale language models can usually only understand text modalities and cannot directly understand user representations in algorithm models.

[0005] In summary, how to understand user representation based on large-scale language models is a problem to be solved. SUMMARY

[0006] Therefore, the embodiments of the present application provide a method and device for understanding user representation based on language model, which makes the large-scale language model output natural language text for understanding user representation, and realizes the interpretability of user representation in artificial intelligence algorithms.

[0007] In a first aspect, the embodiments of the present application provide a method for understanding user representation based on language model, which comprises:

[0008] obtaining a first user representation, wherein the user representation is a vector representation of a user in a set algorithm;

[0009] inputting the first user representation into a query transformer Q-Transformer model to generate a second user representation, wherein the second user representation includes part of the information in the first user representation.

[0010] inputting the second user representation into an independent linear layer to generate a third user representation through vector space conversion, wherein a vector of the third user representation is in a vector space format available to the large-scale language model;

[0011] inputting the third user representation and the first question information into the large-scale language model to generate user representation understanding text.

[0012] Optionally, the method further comprises:

[0013] storing the third user representation.

[0014] Optionally, the method further comprises:

[0015] inputting second question information into the large-scale language model;

[0016] generating user representation deep understanding text according to the second question information, the third user representation, and the first question information.

[0017] Optionally, the first user representation is obtained by:

[0018] obtaining user basic information;

[0019] inputting the user basic information into a user representation generator to generate the first user representation.

[0020] Optionally, the first user representation is inputted into a Q-Transformer model to generate a second user representation, and the method specifically comprises:

[0021] inputting the first user representation into a linear layer of the Q-Transformer model to generate an intermediate user representation through vector space conversion, wherein a vector of the intermediate user representation is in a vector space format available to the Q-Transformer model;

[0022] generating the second user representation according to the intermediate user representation and a learnable vector of the Q-Transformer model.

[0023] Optionally, the training process of the Q-Transformer model comprises:

[0024] obtaining user representation samples and description text samples;

[0025] updating parameters of the Q-Transformer model according to the user representation samples and the description text samples.

[0026] Optionally, the updating the parameters of the Q-Transformer model according to the user representation sample and the description text sample comprises:

[0027] The user representation sample and the description text sample are subjected to a contrast learning task, a matching task and a text generation task, and the parameters of the Q-Transformer model and the learnable vector of the Q-Transformer model are updated.

[0028] Optionally, the method further comprises:

[0029] The user representation sample is input to a linear layer of the Q-Transformer model through a cross-attention layer, and an intermediate user representation sample is generated through vector space conversion, wherein a vector representation of the intermediate user representation sample is in a vector space format available to the Q-Transformer model.

[0030] The description text sample is input to the Q-Transformer model through an input layer.

[0031] Optionally, the method further comprises:

[0032] The description text sample is generated according to a large-scale language model.

[0033] Optionally, the method further comprises:

[0034] The intermediate user representation sample is input to an independent linear layer, and a target user representation sample is generated through vector space conversion, wherein a vector representation of the target user representation sample is in a vector space format available to the large-scale language model.

[0035] The target user representation sample and a question information sample are input to the large-scale language model, and a user representation understanding text sample is generated.

[0036] The user representation understanding text sample is compared with the description text sample, and the parameters of the Q-Transformer model and the independent linear layer are updated.

[0037] In a second aspect, an embodiment of the present application provides a device for understanding user representation based on a language model, and the device comprises:

[0038] An acquisition unit is configured to acquire a first user representation, wherein the user representation is a vector representation of a user in a set algorithm.

[0039] The first generating unit is configured to input the first user representation into a query transformer (Q-Transformer) model to generate a second user representation, wherein the second user representation includes part of information in the first user representation;

[0040] The second generating unit is configured to input the second user representation into an independent linear layer to generate a third user representation through vector space conversion, wherein a vector representation of the third user representation is in a vector space format available for a large-scale language model;

[0041] The third generating unit is configured to input the third user representation and first question information into the large-scale language model to generate user representation understanding text.

[0042] Optionally, the apparatus further comprises:

[0043] The saving unit is configured to save the third user representation.

[0044] Optionally, the third generating unit is further configured to:

[0045] input second question information into the large-scale language model;

[0046] generate user representation deep understanding text according to the second question information, the third user representation and the first question information.

[0047] Optionally, the obtaining unit is specifically configured to:

[0048] obtain user basic information;

[0049] input the user basic information into a user representation generator to generate the first user representation.

[0050] Optionally, the first generating unit is specifically configured to:

[0051] input the first user representation into a linear layer of the Q-Transformer model to generate an intermediate user representation through vector space conversion, wherein a vector representation of the intermediate user representation is in a vector space format available for the Q-Transformer model;

[0052] generate the second user representation according to the intermediate user representation and a learnable vector of the Q-Transformer model.

[0053] Optionally, during training of the Q-Transformer model, the obtaining unit is further configured to:

[0054] obtain user representation samples and description text samples;

[0055] The apparatus further comprises:

[0056] An updating unit configured to update parameters of the Q-Transformer model according to the user representation sample and the description text sample.

[0057] Optionally, the updating unit is specifically configured to:

[0058] perform a contrast learning task, a matching task and a text generation task on the user representation sample and the description text sample, and update parameters of the Q-Transformer model and the learnable vector of the Q-Transformer model.

[0059] Optionally, the apparatus further comprises:

[0060] An input unit configured to input the user representation sample to a linear layer of the Q-Transformer model through a cross-attention layer, and generate an intermediate user representation sample through vector space conversion, wherein a vector of the intermediate user representation sample is in a vector space format available to the Q-Transformer model.

[0061] The description text sample is input to the Q-Transformer model through an input layer.

[0062] Optionally, the apparatus further comprises:

[0063] A fourth generating unit configured to generate the description text sample according to a large-scale language model.

[0064] Optionally, the updating unit is further configured to:

[0065] input the intermediate user representation sample to an independent linear layer, and generate a target user representation sample through vector space conversion, wherein a vector of the target user representation sample is in a vector space format available to the large-scale language model.

[0066] input the target user representation sample and a question information sample to the large-scale language model, and generate a user representation understanding text sample.

[0067] compare the user representation understanding text sample with the description text sample, and update parameters of the Q-Transformer model and the independent linear layer.

[0068] In a third aspect, an electronic device is provided, which includes a memory and a processor, the memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method in the first aspect or any possible implementation of the first aspect.

[0069] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores computer program instructions, and the computer program instructions implement the method in the first aspect or any possible combination of the first aspect when executed by a processor.

[0070] In the embodiment of the present application, the first user representation is obtained, wherein the user representation is a vector representation of the user in a set algorithm; the first user representation is input into a Q-Transformer model to generate a second user representation, wherein the second user representation includes part of the information in the first user representation; the second user representation is input into an independent linear layer to generate a third user representation through vector space conversion, wherein the vector representation of the third user representation is in a vector space format that can be used by a large-scale language model; and the third user representation and first question information are input into the large-scale language model to generate a user representation understanding text. Through the above method, the large-scale language model outputs a natural language text that understands the user representation, and the interpretability of the user representation in the artificial intelligence algorithm is realized. BRIEF DESCRIPTION OF DRAWINGS

[0071] The above and other objects, features and advantages of the present application will become more apparent from the following description of embodiments of the present application, taken in conjunction with the accompanying drawings, in which:

[0072] FIG. 1 is a flowchart of a method for understanding a user representation based on a language model according to an embodiment of the present application;

[0073] FIG. 2 is a flowchart of another method for understanding a user representation based on a language model according to an embodiment of the present application;

[0074] FIG. 3 is a flowchart of still another method for understanding a user representation based on a language model according to an embodiment of the present application;

[0075] FIG. 4 is a schematic diagram of a system for generating a user representation understanding text according to an embodiment of the present application;

[0076] FIG. 5 is a flowchart of a method for training a Q-Transformer model according to an embodiment of the present application;

[0077] FIG. 6 is a flowchart of another method for training a Q-Transformer model according to an embodiment of the present application;

[0078] FIG. 7 is a schematic diagram of a system for training a user representation understanding text according to an embodiment of the present application;

[0079] FIG. 8 is a schematic diagram of a device for understanding a user representation based on a language model according to an embodiment of the present application;

[0080] FIG. 9 is a schematic diagram of an electronic device in an embodiment of the application. DETAILED DESCRIPTION

[0081] The present application is described herein based on the embodiments. However, the present application is not limited to the embodiments described herein. In the following detailed description of the present application, some specific details are described in order to provide a thorough understanding of the present application. The present application can be understood by one of ordinary skill in the art without these specific details. In order to avoid obscuring the essence of the present application, well-known methods, procedures, components, and circuits are not described in detail.

[0082] In addition, it will be understood by those of ordinary skill in the art that the drawings provided herein are for illustrative purposes and are not necessarily drawn to scale.

[0083] Unless the context clearly requires otherwise, throughout the description, the words "comprise", "comprising", and the like are to be construed in an inclusive sense as opposed to an exclusive or exhaustive sense; that is to say, in the sense of "including, but not limited to".

[0084] In the description of the present application, it is to be understood that the terms "first", "second", and the like are used only for descriptive purposes and are not to be construed as indicating or implying relative importance. In addition, in the description of the present application, the meaning of "a plurality of" is two or more unless otherwise specified.

[0085] In the prior art, user representation refers to an abstract representation of a user in an artificial intelligence algorithm, wherein the abstract representation is a multidimensional digital vector, for example, a 256-dimensional digital vector; the user representation is used in algorithms in various fields, for example, a recommendation system algorithm, a user portrait algorithm, etc.; but the current user representation related algorithm model lacks interpretability and cannot provide an explanation for the above-mentioned user representation at the application level, that is, the multidimensional digital vector cannot be explained; from the perspective of the user, the user can only get the result of the algorithm model corresponding to the recommendation system algorithm, but cannot know the specific reason why the algorithm model provides the result; for example, the recommendation system algorithm recommends a certain product to the user, but cannot know how the user himself is understood in the algorithm model, which will affect the user's confidence in the output result of the algorithm model. With the development of large-scale language models (LLMs), the above-mentioned large-scale language models have shown amazing effects in different applications, especially in knowledge memory, text understanding and text generation, etc.; the above-mentioned large-scale language model is a language model constructed by a deep neural network containing more than hundreds of billions of parameters, which is trained by a large amount of unlabeled text using a self-supervised learning method, can process various natural language tasks, and is an important way to artificial intelligence; BERT model and GPT model promote the development of large-scale language models; specifically, the large-scale language model is applied to ChatGPT, can have a natural and fluent conversation with the user, and can answer various questions, etc.; in this application, the above-mentioned large-scale language model can also be referred to as a language model; although the application of the above-mentioned large-scale language model is widespread, the existing large-scale language model can usually only understand the text mode and cannot directly understand the user representation in the algorithm model. Therefore, how to understand the user representation based on the large-scale language model and make the large-scale language model output natural language text that understands the user representation is a problem to be solved at present.

[0086] In the embodiment of the application, in order to solve the above-mentioned problems, a method for understanding user representation based on a language model is provided, as shown in FIG. 1, the method comprises:

[0087] Step S101, obtaining a first user representation, wherein the user representation is a vector representation of a user in a set algorithm.

[0088] Specifically, the set algorithm is an artificial intelligence algorithm, and the user representation is an abstract representation of a user in the artificial intelligence algorithm, which can also be referred to as a vector representation, a vector space, a vector, etc.; the first user representation is a multidimensional vector, for example, 256-dimensional, 512-dimensional, etc., which is determined according to actual conditions.

[0089] In the embodiment of the present application, it is assumed that the first user representation is a 256-dimensional vector, specifically (0.4, 06, 0.5, 0.4, …), a total of 256-dimensional numbers, which will not be described here.

[0090] In a possible implementation, the first user representation is obtained by a user representation generator.

[0091] In step S102, the first user representation is input into a query transformer Q-Transformer model to generate a second user representation, wherein the second user representation includes part of the information in the first user representation.

[0092] Specifically, the user representation generator inputs the first user representation into the query transformer (Q-Transformer) model, wherein the Q-Transformer model refers to a Transformer model with a learnable vector (query) as input. The query can extract information related to the user representation description text from the first user representation, that is, extract part of the information in the first user representation to generate a second user representation. The Transformer model is a deep learning model based on an attention mechanism and is used for natural language processing tasks. The training process of the Q-Transformer model is the same as that of the Transformer model, including forward propagation, loss calculation, back propagation, and optimization calculation processes. Specifically, first, preprocessed data is input into the Transformer model, and after multi-layer processing of the encoder and the decoder, the output of the Transformer model is obtained. Then, the difference between the output generated by the Transformer model and the target sequence is calculated to obtain a loss function, wherein the loss function includes cross-entropy loss, etc. Then, the gradient information of the loss function is used to update the parameters of the Transformer model through a back propagation algorithm to minimize the loss function. Finally, the parameters of the Transformer model are iteratively adjusted by using an optimization algorithm, and the training of the Transformer model is finally completed.

[0093] In the embodiment of the present application, although the Q-Transformer model is an open source model that can be obtained, inputting the first user representation into the Q-Transformer model and generating the second user representation through the Q-Transformer model are not easily thought of.

[0094] In the embodiment of the application, the first user representation is input into the query transformer Q-Transformer model to generate a second user representation, specifically comprising:

[0095] The first user representation is input into the linear layer of the Q-Transformer model to generate an intermediate user representation through vector space conversion, wherein the vector representation of the intermediate user representation is in a vector space format that can be used by the Q-Transformer model; and the second user representation is generated according to the intermediate user representation and a learnable vector of the Q-Transformer model.

[0096] Specifically, the first user representation is input into the linear layer of the Q-Transformer model through a cross-attention layer. Since the vector length of the first user representation is different from the vector length that can be processed in the Q-Transformer model, the vector length of the first user representation is aligned with the vector length that can be processed in the Q-Transformer model through the linear layer of the Q-Transformer model, i.e., vector space conversion is performed to convert the first user representation into an intermediate user representation. The learnable vector queries of the Q-Transformer model extracts information related to the description text of the first user representation in the intermediate user representation to generate the second user representation, and the second user representation is also represented by a vector.

[0097] In step S103, the second user representation is input into an independent linear layer to generate a third user representation through vector space conversion, wherein the vector representation of the third user representation is in a vector space format that can be used by a large-scale language model.

[0098] In the embodiment of the application, the independent linear layer is independently located at an intermediate position outside the Q-Transformer model and the large-scale language model. Since the vector length of the second user representation is different from the vector length that can be processed in the large-scale language model, the vector length of the second user representation is aligned with the vector length that can be processed in the large-scale language model through the independent linear layer, i.e., vector space conversion is performed to convert the second user representation into a third user representation, and the third user representation is also represented by a vector.

[0099] In step S104, the third user representation and the first question information are input into the large-scale language model to generate a user representation understanding text.

[0100] In a possible implementation, the first question information can also be referred to as a first prompt, and the third user representation and the first question information are spliced and input to the large language model; for example, the first question information is "what kind of person is this user?", and the content after splicing the third user representation and the first question information is "[third user representation], what kind of person is this user?". The large language model is input with "[third user representation], what kind of person is this user?", and user representation understanding text, that is, natural language text understandable by a user, is generated. The generated user representation understanding text is specifically "this user may be a person who pays attention to life quality, likes decoration and plum environment, and may like to buy various furniture users and …".

[0101] In the embodiment of the application, in order to further mine deeper user information, after step S104, other steps are further provided, as shown in FIG. 2, which is another method for understanding user representation based on a language model, including the following steps:

[0102] Step S105, saving the third user representation.

[0103] Specifically, the third user representation is saved to the large language model.

[0104] Step S106, inputting second question information to the large language model.

[0105] In the embodiment of the application, in order to further mine deeper user information by using the internal knowledge of the large language model through multi-round interaction, the second question information is input to the large language model.

[0106] Specifically, the second question information can be "why does he buy what goods because he may be a person who pays attention to life quality?".

[0107] Step S107, generating user representation deep understanding text according to the second question information, the third user representation and the first question information.

[0108] Specifically, the second question information, the third user representation and the first question information are combined, and the large language model generates the user representation deep understanding text by combining the second question information, the third user representation and the first question information.

[0109] In the embodiment of the application, after obtaining the user representation deep understanding text, the large language model can further obtain third question information and generate an answer corresponding to the third question information, that is, generate new user representation deep understanding text according to the third question information, the third user representation and the content of previous interaction, and so on.

[0110] Through the above method, deeper user information can be further mined by utilizing the internal knowledge of the large language model through multiple rounds of interaction.

[0111] In the embodiment of the application, before step S102, the step S101 can be replaced by two steps. Specifically, as shown in FIG. 3, FIG. 3 is another method for understanding user representation based on language model, comprising the following steps:

[0112] Step S108, obtaining user basic information.

[0113] In the embodiment of the application, the user basic information includes personal information of the user, historical interaction goods, historical behavior records, etc. Specifically, the user representation generator collects personal information of the user, historical interaction goods, historical behavior records, etc.

[0114] Step S109, inputting the user basic information into the user representation generator to generate the first user representation.

[0115] Specifically, the personal information of the user, the historical interaction goods, the historical behavior records, etc. are input into the user representation generator to generate the first user representation.

[0116] In the embodiment of the application, it can be known from the above embodiment that, based on the user representation generator, the Q-Transformer model, the independent linear layer and the large-scale language model, the user representation generated by the user representation generator is input into the large-scale language model after being converted into a vector space by the Q-Transformer model and the independent linear layer, to generate a natural language text that can be understood by the user, i.e. the user representation understanding text.

[0117] In a possible implementation manner, the system for generating user representation understanding text is shown in FIG. 4, comprising a user representation generator 401, a Q-Transformer model 402, an independent linear layer 403 and a large-scale language model 404, wherein the input of the Q-Transformer model 402 includes not only the user representation generated by the user representation generator 401, but also a learnable vector queries, and the large-scale language model 404 receives question information Q as input in addition to the output of the independent linear layer 403, specifically, the learnable vector queries can also be regarded as part of the Q-Transformer model 402.

[0118] In the above processing flow, the user representation generator and the Q-Transformer model do not need to be trained, the parameters of the user representation generator and the Q-Transformer model are frozen in training, any user representation generator can be accessed in the system, the user representation generator can generate user representation by using any user representation algorithm, any large-scale language model can be accessed in the system, the better the user representation algorithm and the large-scale language model, the better the effect of user representation understanding, and replacing the user representation algorithm and the large-scale language model will not increase the required computing resources during training, because only the Q-Transformer model and the independent linear layer need to be trained in the embodiment of the application.

[0119] In the embodiment of the application, the training process of the Q-Transformer model is specifically shown in FIG. 5, and includes the following steps:

[0120] Step S501, obtaining a user representation sample and a description text sample.

[0121] In the embodiment of the application, the user representation generator obtains user basic information, the user basic information includes personal information of the user, historical interaction commodities, historical behavior records, etc., generates the user representation sample according to the user basic information, the user representation sample is an abstract representation of the user in an artificial intelligence algorithm, and the user representation sample is a multi-dimensional vector.

[0122] In a possible implementation manner, the user representation generator is a user representation algorithm used in an application scenario, the application scenario can be a recommendation system, a user portrait system, etc., and is specifically determined according to actual conditions.

[0123] In the embodiment of the application, the description text sample can be constructed by the personal information of the user, the historical interaction commodities, and the historical behavior records, and specifically, part of the content in the personal information of the user, the historical interaction commodities, and the historical behavior records is selected in the construction process.

[0124] In a possible implementation manner, if the text length of the user historical interaction behavior is possibly too long, the description text sample can be generated according to the large-scale language model, wherein the user historical interaction behavior is the personal information of the user, the historical interaction commodities, the historical behavior records, etc.

[0125] Specifically, first, a prompt text is constructed, and then the prompt text is input into a pre-trained large language model, and the large language model outputs the description text sample; wherein the prompt text can be as follows: "this user has ever purchased [historical purchase goods], this user is a cat lover", the [historical purchase goods] refers to the name text sequence of the goods that the user has ever purchased, and the output description text sample is "this user is a cat lover", which is only an example for illustration, and the specific construction of the prompt text is determined according to the actual situation; the large language model here is only used to generate the description text sample, and is not the same model as the large language model used to generate the user representation understanding text.

[0126] Step S502, updating the parameters of the Q-Transformer model according to the user representation sample and the description text sample.

[0127] Specifically, the user representation sample and the description text sample are subjected to a contrast learning task, a matching task and a text generation task, and the parameters of the Q-Transformer model and the learnable vector of the Q-Transformer model are updated.

[0128] In the embodiment of the application, the user representation sample is input into the linear layer of the Q-Transformer model through the cross-attention layer, and an intermediate user representation sample is generated through vector space conversion, wherein the vector representation of the intermediate user representation sample is in the vector space format available to the Q-Transformer model; the description text sample is input into the Q-Transformer model through the input layer.

[0129] The comparison learning task, the matching task and the text generation task of the user representation sample and the description text sample are specifically as follows: the intermediate user representation sample and the description text sample are subjected to the comparison learning task, the matching task and the text generation task; the process of the comparison learning task is specifically as follows: the intermediate user representation sample and the description text sample respectively obtain output data through the Q-Transformer model, the output data corresponding to the intermediate user representation sample and the description text sample are compared, and the Q-Transformer model and the parameters of the learnable vector of the Q-Transformer model are updated; the process of the matching task is specifically as follows: the intermediate user representation sample and the description text sample are combined to form a positive sample pair and a negative sample pair, the positive sample pair and the negative sample pair are input into the Q-Transformer model, a matching relationship is predicted, and the Q-Transformer model and the parameters of the learnable vector of the Q-Transformer model are updated; the specific process of the text generation task is specifically as follows: the intermediate user representation sample and the description text sample are subjected to information fusion in a self-attention layer of the Q-Transformer model, then a description text is predicted, and the Q-Transformer model and the parameters of the learnable vector of the Q-Transformer model are generated and updated.

[0130] In the embodiment of the application, after the parameters of the Q-Transformer model are updated through the step S502, the Q-Transformer model completes the first stage of training, the Q-Transformer model is initialized through the updated parameters, and the second stage of training is started. Specifically, the training process of the Q-Transformer model is specifically shown in FIG. 6, and after the step S502, the following steps are further included:

[0131] In step S503, the intermediate user representation sample is input into an independent linear layer, and a target user representation sample is generated through vector space conversion, wherein the vector representation of the target user representation sample is in a vector space format that can be used by a large-scale language model.

[0132] In the embodiment of the present application, the independent linear layer is independently located at the intermediate position of the Q-Transformer model and the large-scale language model, that is, neither belongs to the Q-Transformer model nor belongs to the large-scale language model. Since the vector length of the intermediate user representation sample and the vector length that can be processed in the large-scale language model are different, the vector length of the intermediate user representation sample and the vector length that can be processed in the large-scale language model are aligned through the independent linear layer, that is, the vector space is converted, and the intermediate user representation sample is converted into a target user representation sample. The target user representation sample is also represented by a vector.

[0133] In step S504, the target user representation sample and the question information sample are input into the large-scale language model to generate a user representation understanding text sample.

[0134] In a possible implementation, the question information sample can also be referred to as a prompt. After splicing the target user representation sample and the question information sample, the large-scale language model is input. For example, the question information sample is "what kind of person is this user?", and the content after splicing the target user representation sample and the question information sample is "[target user representation sample], what kind of person is this user?". The large-scale language model is input into the large-scale language model, and the large-scale language model generates a user description task, that is, generates a user representation understanding text sample. For example, the generated user representation understanding text sample is "this user is a pet lover".

[0135] In step S505, the user representation understanding text sample is compared with the description text sample, and the parameters of the Q-Transformer model and the independent linear layer are updated.

[0136] Specifically, the user representation understanding text sample is compared with the description text sample to determine the loss of the Q-Transformer model and the independent linear layer, and then the parameters of the Q-Transformer model and the independent linear layer are updated.

[0137] For example, the user representation understanding text sample "this user is a pet lover" is compared with the description text sample "this user is a cat lover".

[0138] In a possible implementation, training the system for generating user representation to understand text is shown in FIG. 7, including a user representation generator 701, a Q-Transformer model 702, an independent linear layer 703, and a large-scale language model 704, wherein the input of the Q-Transformer model 702 includes a learnable vector queries and a description text in addition to the user representation generated by the user representation generator 701; the large-scale language model 704 receives question information Q as input in addition to the output of the independent linear layer 703, specifically, the learnable vector queries can also be regarded as part of the Q-Transformer model 702.

[0139] Through the above embodiment, a method for understanding user representation based on a language model is provided, which outputs the understanding of the user representation in the form of natural language text, provides a new solution for the explainability of artificial intelligence, and the parameters of the user representation algorithm and the large-scale language model do not need to participate in training, so that the required resources in the training process are less, the training speed is fast, and the availability is high; the newly added user representation can be directly understood by the trained Q-Transformer model and the untrained large-scale language model, and the implicit information in the user representation can be understood by the large language model.

[0140] In the embodiment of the application, an apparatus for understanding user representation based on a language model is provided, as shown in FIG. 8, specifically comprising: an acquisition unit 801, a first generation unit 802, a second generation unit 803, and a third generation unit 804, wherein the acquisition unit 801 is configured to acquire a first user representation, wherein the user representation is a vector representation of a user in a set algorithm; the first generation unit 802 is configured to input the first user representation into a Q-Transformer model to generate a second user representation, wherein the second user representation includes part of the information in the first user representation; the second generation unit 803 is configured to input the second user representation into an independent linear layer to generate a third user representation through vector space conversion, wherein the vector representation of the third user representation is in a vector space format that can be used by a large-scale language model; and the third generation unit 804 is configured to input the third user representation and first question information into the large-scale language model to generate user representation understanding text.

[0141] Further, the apparatus further comprises:

[0142] A saving unit configured to save the third user representation.

[0143] Further, the third generation unit is further configured to:

[0144] inputting second question information to the large-scale language model;

[0145] generating user representation deep understanding text according to the second question information, the third user representation and the first question information.

[0146] Further, the acquisition unit is further configured to:

[0147] acquire user basic information;

[0148] input the user basic information to a user representation generator to generate the first user representation.

[0149] Further, the first generation unit is specifically configured to:

[0150] input the first user representation to a linear layer of a Q-Transformer model to generate an intermediate user representation through vector space conversion, wherein a vector representation of the intermediate user representation is in a vector space format available to the Q-Transformer model;

[0151] generate the second user representation according to the intermediate user representation and a learnable vector of the Q-Transformer model.

[0152] Further, in the training process of the Q-Transformer model, the acquisition unit is further configured to:

[0153] acquire user representation samples and description text samples;

[0154] The device further comprises:

[0155] an updating unit configured to update parameters of the Q-Transformer model according to the user representation samples and the description text samples.

[0156] Further, the updating unit is specifically configured to:

[0157] perform a contrastive learning task, a matching task and a text generation task on the user representation samples and the description text samples to update parameters of the Q-Transformer model and the learnable vector of the Q-Transformer model.

[0158] Further, the device further comprises:

[0159] The input unit is configured to input the user representation sample into a linear layer of the Q-Transformer model through a cross-attention layer, and generate an intermediate user representation sample through vector space conversion, wherein a vector representation of the intermediate user representation sample is in a vector space format available for the Q-Transformer model.

[0160] The description text sample is input into the Q-Transformer model through an input layer.

[0161] Further, the apparatus further comprises:

[0162] The fourth generation unit is configured to generate the description text sample according to a large-scale language model.

[0163] Further, the update unit is further configured to:

[0164] The intermediate user representation sample is input into an independent linear layer to generate a target user representation sample through vector space conversion, wherein a vector representation of the target user representation sample is in a vector space format available for a large-scale language model.

[0165] The target user representation sample and the question information sample are input into the large-scale language model to generate a user representation understanding text sample.

[0166] The user representation understanding text sample is compared with the description text sample, and parameters of the Q-Transformer model and the independent linear layer are updated.

[0167] In a possible implementation, the method for understanding user representation based on a language model is implemented using BLIP2 framework open source code.

[0168] Figure 9 is a schematic diagram of the structure of the electronic device in the embodiment of the present application. As shown in Figure 9, it includes a general computer hardware structure, which at least includes a processor 901 and a memory 902. The processor 901 and the memory 902 are connected through a bus 903. The memory 902 is adapted to store instructions or programs executable by the processor 901. The processor 901 can be a stand-alone microprocessor, or a collection of one or more microprocessors. Thus, the processor 901 performs the processing of data and the control of other devices by executing the instructions stored in the memory 902, thereby implementing the method flow of the embodiment of the present application as described above. The bus 903 connects the above-mentioned components together, while connecting the above-mentioned components to a display controller 904 and a display device, and an input / output (I / O) device 905. The input / output (I / O) device 905 can be a mouse, a keyboard, a modem, a network interface, a touch input device, a body-sensing input device, a printer, and other devices known in the art. Typically, the input / output device 905 is connected to the system through an input / output (I / O) controller 906.

[0169] The instructions stored in the memory 902 are executed by the at least one processor 901 to implement: obtaining a first user representation, wherein the user representation is a vector representation of a user in a setting algorithm; inputting the first user representation into a Q-Transformer model to generate a second user representation, wherein the second user representation includes part of the information in the first user representation; inputting the second user representation into an independent linear layer to generate a third user representation through vector space conversion, wherein the vector representation of the third user representation is in a vector space format that can be used by a large-scale language model; and inputting the third user representation and first question information into the large-scale language model to generate a user representation understanding text.

[0170] Specifically, the electronic device includes one or more processors 901 and a memory 902, and Figure 9 takes one processor 901 as an example. The processor 901 and the memory 902 can be connected through a bus or other means, and Figure 9 takes the connection through a bus as an example. The memory 902, as a non-volatile computer readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The processor 901 performs various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory 902, i.e. implements the method of determining the understanding of the user representation based on the large-scale language model as described above.

[0171] The memory 902 can include a program storage area and a data storage area, where the program storage area can store an operating system, application programs required by at least one function, and the data storage area can store an option list and the like. In addition, the memory 902 can include a high-speed random access memory, and can also include a nonvolatile memory such as at least one disk memory device, a flash memory device, or other nonvolatile solid-state memory device. In some embodiments, the memory 902 can optionally include a memory disposed remotely with respect to the processor 901, which can be connected to an external device through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0172] One or more modules are stored in the memory 902, which, when executed by the one or more processors 901, perform the method of understanding a user representation based on a large-scale language model in any of the above method embodiments.

[0173] As those skilled in the art will appreciate, the various aspects of the embodiments of the present application can be implemented as a system, method or computer program product. Accordingly, the various aspects of the embodiments of the present application can take the form of an entirely hardware embodiment, an entirely software embodiment (including firmware, resident software, microcode, etc.) or an embodiment combining software and hardware aspects that can all generally be referred to herein as a "circuit", "module" or "system". Furthermore, the various aspects of the embodiments of the present application can take the form of a computer program product embodied in one or more computer readable medium(s) having computer readable program code embodied thereon.

[0174] Any combination of one or more computer readable medium(s) can be utilized. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of the present embodiments, a computer readable storage medium can be any tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.

[0175] A computer readable signal medium can include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated signal can take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium can be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.

[0176] Program code embodied on a computer readable medium can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0177] Computer program code for carrying out operations for aspects of the present application can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).

[0178] The flow diagrams and / or block diagrams in above described flow diagrams and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application illustrate the architecture, functionality, and operation of possible implementations of various aspects of the present application. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in the flow diagrams and / or block diagrams block or blocks.

[0179] These computer program instructions can also be stored in a computer readable medium that can direct a computer, a other programmable data processing apparatus, or other devices to function in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function / act specified in the flow diagrams and / or block diagrams block or blocks.

[0180] The computer program instructions can also be loaded onto a computer, other programmable data processing device, or other device to cause a series of operational steps to be performed on the computer, other programmable device, or other device to generate a computer implemented process so that the instructions executed on the computer or other programmable device provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks.

[0181] The preferred embodiments of the present application are described above with the specific details. The present application is not limited to the above preferred embodiments, and can be modified and changed by those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.

[0182] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for the user to choose authorization or refusal. The user refuses to process personal information other than the necessary information required for basic functions, which does not affect the user's use of basic functions.

Claims

A method for understanding a user representation based on a language model, characterized by, The method comprises: obtaining a first user representation, wherein the user representation is a vector representation of a user in a set algorithm; inputting the first user representation into a query transformer Q-Transformer model to generate a second user representation, wherein the second user representation includes part of the information in the first user representation; inputting the second user representation into an independent linear layer to generate a third user representation through vector space conversion, wherein the vector representation of the third user representation is in a vector space format that can be used by a large-scale language model; inputting the third user representation and first question information into the large-scale language model to generate user representation understanding text. The method of claim 1, wherein The method further comprises: saving the third user representation. The method of claim 1, wherein The method further comprises: inputting second question information into the large-scale language model; generating user representation deep understanding text according to the second question information, the third user representation, and the first question information. The method of claim 1, wherein The method further comprises: obtaining user basic information; inputting the user basic information into a user representation generator to generate the first user representation. The method of claim 1, wherein The method further comprises: inputting the first user representation into a linear layer of the Q-Transformer model to generate an intermediate user representation through vector space conversion, wherein the vector representation of the intermediate user representation is in a vector space format that can be used by the Q-Transformer model; generating the second user representation according to the intermediate user representation and learnable vectors of the Q-Transformer model. The method of claim 1, wherein The training process of the Q-Transformer model comprises: obtaining user representation samples and description text samples; updating parameters of the Q-Transformer model according to the user representation samples and the description text samples. The method according to claim 6, characterized in that The method further comprises: performing a contrastive learning task, a matching task, and a text generation task on the user representation samples and the description text samples to update parameters of the Q-Transformer model and learnable vectors of the Q-Transformer model. The method according to claim 6, characterized in that The method further comprises: inputting the user representation samples into a linear layer of the Q-Transformer model through a cross-attention layer to generate intermediate user representation samples through vector space conversion, wherein the vector representation of the intermediate user representation samples is in a vector space format that can be used by the Q-Transformer model; inputting the description text samples into the Q-Transformer model through an input layer. The method according to claim 6, characterized in that The method further comprises: generating the description text samples according to a large-scale language model. The method of claim 8, wherein The method further comprises: The intermediate user representation sample is input to an independent linear layer to generate a target user representation sample through vector space conversion, wherein a vector representation of the target user representation sample is in a vector space format available to a large-scale language model; The target user representation sample and a question information sample are input to the large-scale language model to generate a user representation understanding text sample; The user representation understanding text sample is compared with the description text sample to update parameters of the Q-Transformer model and the independent linear layer. An apparatus for understanding a user representation based on a language model, characterized by The apparatus comprises: An acquisition unit configured to acquire a first user representation, wherein the user representation is a vector representation of a user in a set algorithm; A first generation unit configured to input the first user representation to a query converter Q-Transformer model to generate a second user representation, wherein the second user representation includes part of information in the first user representation; A second generation unit configured to input the second user representation to an independent linear layer to generate a third user representation through vector space conversion, wherein a vector representation of the third user representation is in a vector space format available to a large-scale language model; A third generation unit configured to input the third user representation and first question information to the large-scale language model to generate a user representation understanding text. An electronic device comprising a memory and a processor, characterized in that The memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1-10. A computer-readable storage medium, characterized by, The computer readable storage The computer program is stored in the computer readable storage medium and is executed by the processor to implement the method according to any one of claims 1-10.

Citation Information

Patent Citations

  • Keyword recommendation method and device, electronic equipment and readable storage medium

    CN117951386A

  • Visual language model instruction fine tuning method and device

    CN117975475A

  • Cross-domain recommendation method and device, electronic equipment and storage medium

    CN118070139A

  • Method and device for understanding user representation based on language model

    CN119005348A

  • Systems and methods for a vision-language pretraining framework

    US20240160853A1