Data processing method and related equipment

By combining language models with entity representations in the recommendation model, and calculating lexical and entity scores, the problem of insufficient diversity in language model recommendation systems is solved, thus improving the user experience.

CN121765130APending Publication Date: 2026-03-31HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In language model-based recommendation systems, insufficient diversity of recommended information leads to a decline in user experience.

Method used

By combining a language model with an entity representation-based recommendation model, a decoding score is generated by calculating the first score of lexical units and the second score of entities. This reduces the influence of the language model copying contextual text and improves the diversity of recommendation information.

Benefits of technology

It enhances the diversity of recommended information and user experience, avoids homogeneity in recommendation results, and meets users' needs for diverse information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121765130A_ABST
    Figure CN121765130A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method and related equipment, relates to the field of artificial intelligence, and can improve the diversity of recommendation information. In the method, a first device determines a first probability of a first lexical element through a first model, and the first model is a language model; the first device determines a first decoding score of the first lexical element through the first model and a second model based on the first probability, and the second model is a recommendation model based on entity characterization; and when the first decoding score is greater than a first threshold value, the first device recommends first information to the target object according to the first lexical element.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and more particularly to a data processing method and related equipment. Background Technology

[0002] With the ever-increasing volume of data on the internet, recommender systems are playing an increasingly important role in various online products. Recommender systems help users discover information of interest (such as movies or products) from massive amounts of data, thus solving the problem of information overload. A recommender system is a system that recommends items of interest to users based on their historical interaction information. In recent years, research has found that language models can further promote the development of recommender systems. For example, a language model can generate a sequence of tokens to represent an item for recommendation, which can then be aligned with the target of the pre-training process, while fully utilizing the world knowledge learned during pre-training.

[0003] However, language model-based recommendation systems may be affected by the language model's pre-training process. For example, due to the characteristics of language models, when writing long articles, they frequently consider copying and using text from the preceding text. Because of this characteristic, language model-based recommendation systems tend to recommend information that is highly similar to information from past interactions, resulting in insufficient diversity of recommended information and negatively impacting the user experience.

[0004] Therefore, how to improve the diversity of recommended information is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] This application provides a data processing method and related equipment that can improve the diversity of recommendation information.

[0006] In a first aspect, this application provides a data processing method, which is executed by a first device, or by some components of the first device (e.g., a processor, chip, or chip system), or by a logic module or software capable of implementing all or part of the functions of the first device. In this first aspect and its possible implementations, the data processing method is described as being executed by a first device. The first device determines a first probability of a first word element using a first model, where the first model is a language model. Based on the first probability, the first device determines a first decoding score of the first word element using the first model and a second model, where the second model is a recommendation model based on entity representation. When the first decoding score is greater than a first threshold, the first device recommends first information to a target object based on the first word element.

[0007] In the first aspect, the second model, due to its inherent characteristics, can directly provide the recommendation probability for each item without first generating multiple tokens and constructing an item based on these tokens. Therefore, the second model does not need to copy parts of the preceding text. By combining the second model with the first model, the problem of low diversity in recommendation information caused by the language model copying parts of the context can be mitigated, thereby increasing the diversity of recommendation information and improving the user experience.

[0008] Optionally, the first model can be a large language model (LLM), such as a generative pre-training (GPT), Llama, Qwen, or ChatGLM.

[0009] Optionally, the first device converts the relevant identifier (id), identifier, or serial number into first text data. Optionally, the first text data may be an attribute used to describe an item, or the first text data may be the name of an item. For example, the ID may be used to indicate "Xinjiang", and the corresponding first text data is "Xinjiang". For example, the ID may be used to indicate "apple", and the corresponding first text data is "apple".

[0010] Optionally, the first device acquires the task description and converts it into second text data.

[0011] Optionally, the first device acquires the user's historical interaction data and converts it into third-party text data. For example, the historical interaction data may be the user's historical behavior, preferences, or the context of the current search or browsing.

[0012] Optionally, the first device concatenates the first text data, the second text data, and / or the third text data into target text data, then converts the target text data into a token sequence through the word segmenter of the language model, and then inputs the token sequence into the first model, wherein the token sequence includes the aforementioned first word element.

[0013] Optionally, when determining the first probability of the first word element using the first model, the core objective is to maximize the generation probability. This means that the first model needs to generate a series of possible results based on the user's historical interaction data and select the result most likely to be accepted by the user for recommendation. This approach can improve the accuracy and relevance of recommendations because the model makes predictions based on learning from a large amount of data, thus getting closer to the user's true preferences.

[0014] In one alternative implementation of the first aspect, the first device obtains a first score for the first word element based on the first probability through a first model; the first device obtains a second score for the first entity based on a second probability of recommending the first entity through a second model, and the entity generated based on the first word element includes the first entity; the first device obtains a first decoding score based on the first score and the second score.

[0015] The above implementation method allows for the calculation of the score of the first word element, i.e., the score estimate of the first word element, and the calculation of the second score of the first entity using an entity representation-based recommendation model, i.e., the second model. Due to its inherent characteristics, the second model can construct a recommendation system based on item IDs, directly providing the recommendation probability for each item without first generating multiple tokens and constructing an item from these tokens. Therefore, the second model does not need to copy text from the preceding context. The combination of the second and first models mitigates the problem of low diversity loss in recommendation information caused by the language model copying text from the context. Furthermore, the first score is calculated using the language model, the second score is obtained using the second model, and the first and second scores are combined to obtain a decoded score—that is, a decoded score is obtained by combining the language model and the entity representation-based recommendation model. Information is then recommended to the user based on this decoded score. This approach allows for more reasonable information recommendations to the user, improving the user experience.

[0016] Optionally, the first device can select tokens that meet the requirements from the input token sequence based on beam search. Beam search is a heuristic search algorithm commonly used in the decoding stage, especially in natural language processing tasks such as machine translation, text summarization, and speech recognition. The goal of beam search is to find the optimal or near-optimal solution from a large candidate set. It achieves this by maintaining a "beam" of size B, where B is called the beam width, a user-defined hyperparameter. At each step of decoding, it maintains a score estimate of the generated sequence at the current time step using the conditional probability formula generated by the model, and selectively discards some candidate sequences based on this estimate.

[0017] In one alternative implementation of the first aspect, the first decoding score is a combination of the first score, the second score, and the first weight.

[0018] Based on the above implementation, the first score is obtained through a language model, while the second score is obtained through an entity representation-based recommendation model. The first score, obtained through the language model, can determine the probability of generating the first word unit by combining historical interaction data and task descriptions, thereby determining the score of the first word unit and whether it is suitable for output. The entity representation-based recommendation model, because it can directly obtain the probability of entity output, directly reduces the risk of low diversity caused by the language model. The first weight can flexibly adjust the ratio of the first and second scores. For example, the first weight can be determined according to task requirements. For instance, when it is necessary to ensure the diversity of recommended information as much as possible, the weight of the second score can be set larger; for example, if the weight of the second score is 0.7, then the weight of the first score is 0.3. By combining these three factors, a first decoding score is obtained. Then, when recommending information based on this decoding score, the diversity of the final recommended information can be flexibly adjusted.

[0019] In one alternative implementation of the first aspect, when the first information indicates that the proportion of entities of the first type needs to be reduced, the second probability is less than a third threshold, the type of the first entity is the first type, and the first information includes: information for indicating the needs or preferences of the target object.

[0020] Based on the above implementation, when the target object's needs or preferences indicate that the proportion of the first type of entity needs to be reduced, the second probability of recommending the first entity can be reduced. The type of the first entity is the first type, that is, the probability of recommending all or part of the first type of entity is reduced, thereby reducing the proportion of the first type of entity to meet the target object's needs or preferences and thus improve the user experience.

[0021] In one alternative implementation of the first aspect, when the first information indicates that the proportion of the second type of entity needs to be increased, the value of the second probability is less than the fourth threshold, the type of the first entity is the first type, and the first information includes: information for indicating the needs or preferences of the target object, the first type being different from the second type.

[0022] Based on the above implementation, when the target object's needs or preferences indicate that the proportion of the second type of entity needs to be increased, the second probability of recommending the first entity can be reduced. The type of the first entity is the first type, that is, the probability of recommending all or part of the first type of entity is reduced, thereby increasing the proportion of the second type of entity to meet the target object's needs or preferences and thus improve the user experience.

[0023] In one alternative implementation of the first aspect, when the first word element includes the second word element, and the difference between the probability of the first model generating the second word element and 1 is less than a fifth threshold, the first device does not perform length normalization on the first word element, or when the first word element is normalized, the second word element does not participate in the calculation.

[0024] Based on the above implementation method, the impact of the second word on the overall score of the sequence can be reduced, thereby reducing the impact of the second word on the decoding result.

[0025] In one alternative implementation of the first aspect, the first information is information used to describe the item.

[0026] In the above implementation, the first aspect can be applied to the scenario of item recommendation. When used for item recommendation, compared with the method of building a recommendation system based solely on a language model, the first aspect introduces a recommendation model based on entity representation to assist the large model in generation. The recommendation model based on entity representation is usually a small model with a small computational load. Therefore, this approach will not increase the reasoning burden too much, and it can also alleviate the problems of high repetition and low diversity caused by using language generation for recommendation.

[0027] Secondly, this application provides a data processing apparatus, which includes a processing module and a recommendation module. The processing module is used to obtain a first score of the first word element through a first model based on a first probability; and to obtain a second score of the first entity through a second model based on a second probability of recommending the first entity, wherein the entity generated based on the first word element includes the first entity. The recommendation module is used to recommend first information to a target object based on the first word element when the first decoding score is greater than a first threshold.

[0028] In one possible implementation of the second aspect, the processing module is specifically used to: obtain a first score for the first word element through a first model based on the first probability; obtain a second score for the first entity through a second model based on a second probability of recommending the first entity, wherein the entity generated based on the first word element includes the first entity; and obtain a first decoding score based on the first score and the second score.

[0029] In one possible implementation of the second aspect, the first decoding score is a combination of the first score, the second score, and the first weight.

[0030] In one possible implementation of the second aspect, when the first information indicates that the proportion of entities of the first type needs to be reduced, the second probability is less than a third threshold, the type of the first entity is the first type, and the first information includes: information for indicating the needs or preferences of the target object.

[0031] In one possible implementation of the second aspect, when the first information indicates that the proportion of the second type of entity needs to be increased, the value of the second probability is less than the fourth threshold, the type of the first entity is the first type, and the first information includes: information for indicating the needs or preferences of the target object, the first type being different from the second type.

[0032] In one possible implementation of the second aspect, the first lexical element includes a second lexical element, the difference between the probability of the first model generating the second lexical element and 1 is less than a fifth threshold, and the processing module is further configured to: not perform length normalization on the first lexical element, or when the first lexical element is performed length normalization, the second lexical element does not participate in the calculation.

[0033] In one possible implementation of the second aspect, the first information is information used to describe the item.

[0034] Thirdly, this application provides a data processing apparatus, the apparatus comprising: a processor and a memory; the memory for storing a program; and the processor for executing the program in the memory, such that the methods described in the first aspect and any of their alternatives are performed.

[0035] In one possible design, the processor is coupled to the memory.

[0036] In one possible design, the device may also include a bus system.

[0037] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the first aspect and any optional method described above, as well as the first aspect and any optional method described above.

[0038] Fifthly, embodiments of this application provide a computer program that, when run on a computer, causes the computer to perform the first aspect and any of its optional methods described above.

[0039] Sixthly, embodiments of this application provide a chip system including a processor for supporting an execution device or training device in implementing the functions involved in the foregoing aspects, such as transmitting or processing data involved in the foregoing methods; or, information. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the execution device or training device. This chip system may be composed of chips or may include chips and other discrete devices.

[0040] The technical effects of the second to sixth aspects or any of their possible implementations can be found in the first aspect or the technical effects of its related possible implementations, and will not be repeated here. Attached Figure Description

[0041] Figure 1 A structural diagram illustrating the main framework of artificial intelligence;

[0042] Figure 2 A schematic diagram illustrating item recommendation based on a language model, provided as an embodiment of this application;

[0043] Figure 3 A schematic diagram of a system architecture provided for an embodiment of this application;

[0044] Figure 4 This is a schematic flowchart of a data processing method provided in an embodiment of this application;

[0045] Figure 5 A comparative diagram of this application and the LLM model provided for this application;

[0046] Figure 6 A schematic diagram of a test result provided in this application;

[0047] Figure 7 Another schematic diagram of a test result provided in this application;

[0048] Figure 8 Another schematic diagram of a test result provided in this application;

[0049] Figure 9 Another schematic diagram of a test result provided in this application;

[0050] Figure 10 A schematic diagram illustrating the length normalization process of a deceptive word element provided in this application;

[0051] Figure 11 Another schematic diagram of a test result provided in this application;

[0052] Figure 12 A schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application;

[0053] Figure 13 A schematic diagram of the structure of a terminal device provided in an embodiment of this application;

[0054] Figure 14 A schematic diagram of a server structure provided in an embodiment of this application;

[0055] Figure 15 This is a schematic diagram of a chip structure provided in an embodiment of this application. Detailed Implementation

[0056] The embodiments of the present invention will now be described with reference to the accompanying drawings. The terminology used in the implementation section is for illustrative purposes only and is not intended to limit the scope of the invention.

[0057] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0058] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "system" and "network" in the embodiments of this application can be used interchangeably. "Comprising" means "including but not limited to." When A includes multiple elements or situations, A can be one or more of those elements or situations. For example, if A includes B or C, then A can be B, A can be C, and A can also be B and C. "At least one" means one or more, and "multiple" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects have an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, "at least one of A, B, and C" includes A, B, C, AB, AC, BC, or ABC. Furthermore, unless otherwise specified, ordinal numbers such as "first" and "second" mentioned in the embodiments of this application are used to distinguish multiple objects and are not used to limit the order, sequence, priority, or importance of the multiple objects.

[0059] The terms “substantially,” “about,” and similar terms used herein are used as approximations rather than as terms of degree, and are intended to take into account the inherent biases of measurements or calculations known to those skilled in the art. Furthermore, the use of “may” in describing embodiments of the invention refers to “one or more possible embodiments.” The terms “use,” “using,” and “used” used herein are to be considered synonymous with the terms “utilize,” “utilizing,” and “utilized,” respectively. Additionally, the term “exemplary” is intended to refer to an instance or illustration.

[0060] First, the overall workflow of the artificial intelligence system is described; please refer to [link / reference]. Figure 1 , Figure 1 The diagram illustrates a structural framework for artificial intelligence (AI). The framework is further elaborated below along two dimensions: the "Intelligent Information Chain" (horizontal axis) and the "IT Value Chain" (vertical axis). The "Intelligent Information Chain" reflects a series of processes from data acquisition to processing. For example, it could be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, and intelligent execution and output. In this process, data undergoes a condensation process of "data—information—knowledge—wisdom." The "IT Value Chain" reflects the value that AI brings to the information technology industry, from the underlying infrastructure of human intelligence and information (provided and processed through technological means) to the industrial ecosystem of the system.

[0061] (1) Infrastructure

[0062] The infrastructure provides computing power to support artificial intelligence systems, enabling communication with the external world and providing support through a basic platform. Communication with the outside world is achieved through sensors; computing power is provided by intelligent chips (such as central processing units (CPUs), neural processing units (NPUs), graphics processing units (GPUs), application-specific integrated circuits (ASICs), or field-programmable gate arrays (FPGAs) and other hardware acceleration chips); the basic platform includes distributed computing frameworks and related platform guarantees and support, which may include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to acquire data, and this data is provided to intelligent chips in the distributed computing system provided by the basic platform for computation.

[0063] (2) Data

[0064] The data at the next layer of infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, text, and IoT data from traditional devices, including business data from existing systems and sensor data such as force, displacement, liquid level, temperature, and humidity.

[0065] (3) Data processing

[0066] Data processing typically includes methods such as data training, machine learning, deep learning, search, reasoning, and decision-making.

[0067] Among them, machine learning and deep learning can perform intelligent information modeling, extraction, preprocessing, and training of data by symbolizing and formalizing it.

[0068] Reasoning refers to the process in which, in a computer or intelligent system, the machine thinks and solves problems by simulating human intelligent reasoning, based on reasoning control strategies and using formalized information. Typical functions include search and matching.

[0069] Decision-making refers to the process of making decisions based on intelligent information after reasoning, and it typically provides functions such as classification, sorting, and prediction.

[0070] (4) General ability

[0071] After the data processing mentioned above, the results of the data processing can be used to form some general capabilities, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.

[0072] (5) Smart Products and Industry Applications

[0073] Intelligent products and industry applications refer to products and applications of artificial intelligence systems in various fields. They are the encapsulation of overall artificial intelligence solutions, productizing intelligent information decision-making and realizing practical applications. Their application areas mainly include: intelligent terminals, intelligent transportation, intelligent healthcare, autonomous driving, smart cities, etc.

[0074] First, we will introduce the application scenarios of this application. This application can be applied to scenarios such as item recommendation, content recommendation, and media recommendation. Below, we will use the item recommendation scenario as an example to briefly introduce the application scenarios of this application.

[0075] like Figure 2 As shown, item recommendation based on language models typically involves the following parts:

[0076] (1) Item representation: When using a large language model, we use a piece of text to represent an item, such as the name of the item, the serial number of the item, or other information that can identify the item.

[0077] (2) Model input representation: Model input includes task description and user history interaction data. Regardless of the scenario, model input may also include user profile, context or external information.

[0078] (3) Model Training: Training a generative recommendation model on recommendation data involves two main steps: text data construction and model optimization. Text data construction refers to transforming the recommendation task and historical interaction sequences into natural language through fine-tuning instructions. Regarding model optimization, given <input, output> data, the training objective of the generative model is to maximize the conditional likelihood of predicting the output given the input.

[0079] (4) Model reasoning: Input text data into the optimized model and use the model to predict the user's future interactive items.

[0080] (5) Item location: In order to achieve material recommendation, the generative recommendation system needs to locate the generated results in the inference stage. That is, after the model generates items, since the generated items may be meaningful but do not exist in the current platform, it is necessary to project the model's inference results into the item space existing in the current platform for recommendation by limiting decoding or representation retrieval.

[0081] The relevant concepts involved in the embodiments of this application will be introduced below.

[0082] 1. Natural Language Processing

[0083] Natural Language Processing (NLP) is an important field within computer science and artificial intelligence. It studies the theories and methods for enabling effective communication between humans and computers using natural language. NLP deals with natural language, the language people use in daily life, and is closely related to linguistics; furthermore, it involves computer science and mathematics. Pre-trained models, a crucial technique for model training in artificial intelligence, evolved from large language models in NLP. After fine-tuning, large language models can be widely applied to downstream tasks. NLP techniques typically include text processing, semantic understanding, machine translation, question answering, and knowledge graphs.

[0084] 2. Pre-training model

[0085] Pre-trained models, also known as foundational models or large models, refer to deep neural networks (DNNs) with a large number of parameters. These DNNs are trained on massive amounts of unlabeled data, leveraging the function approximation capabilities of large-parameter DNNs to enable Producer-Made Transformers (PTMs) to extract common features from the data. Through fine-tuning techniques such as PEFT (Performance-Efficient Parameter Adjustment) and prompt-tuning, they are suitable for downstream tasks. Therefore, pre-trained models can achieve ideal results in few-shot or zero-shot scenarios. PTMs can be categorized according to the data modality they process, including language models (ELMO, BERT, GPT), visual models (swin-transformer, ViT, V-MOE), speech models (VALL-E), and multimodal models (ViBERT, CLIP, Flamingo, Gato). Multimodal models refer to models that establish feature representations for two or more data modalities. Pre-trained models are important tools for outputting AI-generated content (AIGC) and can also serve as a general interface connecting multiple specific task models. A pre-trained model is trained on a batch of corpus data first, and then further trained or used on this pre-trained model. The training and use of a pre-trained model correspond to two stages: the pre-training stage and the fine-tuning stage.

[0086] 3. Large Language Model

[0087] Large language models have demonstrated outstanding capabilities in natural language generation and related fields. At the same time, they contain rich world knowledge, making it possible to use this knowledge to enrich the recommendation system's understanding of items and thus make recommendations.

[0088] Currently, there are two main approaches to using large models for recommendations:

[0089] Representation Extractor: This approach follows the traditional method of extracting representations from linguistic information as item representations. It uses a large model as a feature extractor to initialize item representations and utilizes a traditional model architecture for retrieval-based recommendations.

[0090] Direct item generation: Currently used language models are trained by "predicting the next token," which is inherently unsuitable as a feature extractor and cannot effectively extract features. Therefore, the mainstream approach is to directly ask the language model to generate a sequence of tokens to represent an item for recommendation. This method aligns with the pre-training objective and can fully utilize the world knowledge learned during pre-training.

[0091] 4. Beam Search

[0092] Instead of using a greedy search approach that selects only the most likely word when generating sequences, the model maintains a candidate list of size beam width containing multiple hypothetical sequences. At each step, the model generates the next word for each sequence in the candidate list and sorts the sequences according to a scoring mechanism. Typically, this scoring mechanism combines the model's predicted word probabilities with previous accumulated scores to measure the likelihood of each sequence.

[0093] As the generated sequence grows, the model continuously updates the candidate list based on the scoring mechanism, ensuring its size does not exceed the bundle width. After generating the complete sequence, the bundle search selects the highest-scoring sequence from the candidate list as the final output.

[0094] The system architecture on which the embodiments of this application are based is illustrated below.

[0095] Figure 3 This is a schematic diagram of the system architecture provided for an embodiment of this application. Figure 3 As shown, the system architecture 300 includes an execution device 310, a training device 320, a database 330, a client device 340, a data storage system 350, and a data acquisition device 360.

[0096] The execution device 310 includes a calculation module 311, an input / output (I / O) interface 312, a preprocessing unit 313, and a preprocessing unit 314. The calculation module 311 may include a target model / rule 301, and the preprocessing units 313 and 314 are optional.

[0097] The data acquisition device 360 ​​is used to collect training samples. Training samples can be image data or text data, etc. After collecting the training samples, the data acquisition device 360 ​​stores these training samples in the database 330.

[0098] The training device 320 can maintain training samples in the database 330 and the neural network model to be trained to obtain the target model / rule 301.

[0099] It should be understood that the training device 320 can perform a pre-training process on the neural network to be trained based on the training samples maintained in the database 330, or fine-tune the model based on the pre-training.

[0100] It should be noted that in practical applications, the training samples maintained in database 330 may not all come from the data acquisition device 360; they may also be received from other devices. Furthermore, it should be noted that training device 320 may not necessarily train the target model / rule 301 entirely based on the training samples maintained in database 330; it may also obtain training samples from the cloud or other sources for model training. The above description should not be construed as limiting the embodiments of this application.

[0101] The target model / rule 301 trained using training device 320 can be applied to different systems or devices, such as... Figure 3 The execution device 310 shown can be a terminal, such as a mobile phone terminal, tablet computer, laptop computer, augmented reality (AR) / virtual reality (VR) device, vehicle terminal, etc., or it can be a server, etc.

[0102] Specifically, the training device 320 can transfer the trained model to the execution device 310.

[0103] exist Figure 3 In the execution device 310, the I / O interface 312 is configured to interact with external devices. Users can input data (such as image data or text data in this embodiment) into the I / O interface 312 through the client device 340.

[0104] Preprocessing units 313 and 314 are used to preprocess the input data received from the I / O interface 312. It should be understood that preprocessing units 313 and 314 may be absent, or only one preprocessing unit may be used. When preprocessing units 313 and 314 are absent, the calculation module 311 can directly process the input data.

[0105] During the preprocessing of input data by the execution device 310, or during the calculation module 311 of the execution device 310 performing calculations and other related processes, the execution device 310 can call data, code, etc. in the data storage system 350 for corresponding processing, or store the data, instructions, etc. obtained from the corresponding processing into the data storage system 350.

[0106] Finally, the I / O interface 312 provides the processing result to the client device 340, thereby providing it to the user.

[0107] exist Figure 3 In the illustrated scenario, the user can manually provide input data, which can be done through the interface provided by I / O interface 312. Alternatively, the client device 340 can automatically send input data to I / O interface 312. If user authorization is required for the client device 340 to automatically send input data, the user can set the corresponding permissions in the client device 340. The user can view the output results of the execution device 310 on the client device 340, which can be presented in various forms such as display, sound, or animation. The client device 340 can also act as a data acquisition terminal, collecting the input data and output results of the input I / O interface 312 as new sample data and storing them in the database 330. Alternatively, data can be collected directly from the I / O interface 312 without going through the client device 340, using the input data and output results of the input I / O interface 312 as new sample data and storing them in the database 330.

[0108] It is worth noting that, Figure 3 This is merely a schematic diagram of a system architecture provided in an embodiment of this application. The positional relationships between the devices, components, modules, etc., shown in the diagram do not constitute any limitation. For example, in Figure 3 In this context, the data storage system 350 is an external storage device relative to the execution device 310. However, in other cases, the data storage system 350 may also be placed within the execution device 310. It should be understood that the aforementioned execution device 310 may be deployed within the client device 340.

[0109] As mentioned earlier, with the continuous increase in the amount of data on the internet, recommender systems are playing an increasingly important role in various online products. Recommender systems help users discover information of interest (such as movies or products) from massive amounts of data, thus solving the problem of information overload. A recommender system is a system that recommends items of interest to users based on their historical interaction information. In recent years, related research has found that language models can further promote the development of recommender systems. For example, a token sequence can be generated using a language model to represent an item for recommendation, and then aligned with the target of the pre-training process, while fully utilizing the world knowledge learned during pre-training.

[0110] When decoding language models, natural language generation is generally used. This approach is suitable for language generation scenarios, but not necessarily for generating items for recommendation. An item's description may contain a large number of "deceptive" tokens. A "deceptive" token refers to a token generated by the model with a probability of 1 when a portion of the item's description is converted into a token. Losing these tokens during language model decoding can bias the item representation, but the unnormalized probabilities (logits) of these tokens themselves can also affect the decoding result.

[0111] Furthermore, in language model-based recommendation systems, the recommendation results are often highly homogeneous due to the decoding method. When the model is asked to provide five recommendations, it may end up with five very similar recommendations. These results lack variation, while users often expect to see different recommendations and discover more preferences. Therefore, this has a negative impact on the user experience.

[0112] Furthermore, language model-based recommendation systems may be affected by the language model pre-training process. For example, due to the characteristics of language models, when writing long articles, users often consider copying and using text from previous paragraphs. Because of this characteristic, language model-based recommendation systems tend to recommend information that is highly similar to information in past interactions, resulting in insufficient diversity of recommended information, reduced user novelty, and a negative impact on the user experience.

[0113] To address the aforementioned problems, this application provides a method 100 that can improve the diversity of recommended information and enhance user experience. Figure 4 This is a schematic flowchart of a method 100 provided in an embodiment of this application. Optionally, when method 100 is applied to... Figure 3 In the system shown, method 100 can be executed by execution device 210. It should be noted that... Figure 4The method is illustrated using the first device as the execution subject in the interactive illustration, but this application does not limit the execution subject of the interactive illustration. For example, the execution subject of S401-S403 and related implementations can be the first device, which can optionally be a server or terminal, etc. The first device in S401-S403 and related implementations can also be replaced by a chip, chip system, or processor that supports the first device in implementing the method, or it can be replaced by a logic module or software that can implement all or part of the controller functions.

[0114] like Figure 4 As shown, the method 100 provided in this application embodiment includes the following steps:

[0115] S401: The first device determines the first probability of the first word element through the first model;

[0116] The first model is a language model.

[0117] Optionally, the term "token" in this application is an exemplary designation and can be replaced with any possible designation, such as a tag, word, or token. Optionally, a token can be the smallest unit into which text data is segmented before or during model processing. For example, these units can be words, punctuation marks, subwords, etc., depending on the model's vocabulary and segmentation strategy. For example, in the first model described above, the token is the basic unit of input to the first model. Each token is converted into a numerical form (e.g., a vector) that the first model can understand, and these vectors are subsequently used for computation within the first model.

[0118] Optionally, the first model can be a large language model (LLM), such as a generative pre-training (GPT), Llama, Qwen, or ChatGLM.

[0119] Optionally, before step S401 above, method 100 may further include: the first device converting the relevant ID, identifier or serial number into first text data. Optionally, the first text data may be an attribute used to describe an item, or the first text data may be the name of an item. For example, the ID may be used to indicate "Xinjiang", and the corresponding first text data is "Xinjiang". For example, the ID may be used to indicate "apple", and the corresponding first text data is "apple".

[0120] Optionally, the first device acquires the task description and converts it into second text data.

[0121] Optionally, the first device acquires the user's historical interaction data and converts it into third-party text data. For example, the historical interaction data may be the user's historical behavior, preferences, or the context of the current search or browsing.

[0122] Optionally, the first device concatenates the first text data, the second text data, and / or the third text data into target text data, then converts the target text data into a token sequence through the word segmenter of the language model, and then inputs the token sequence into the first model, wherein the token sequence includes the aforementioned first word element.

[0123] Optionally, when determining the first probability of the first word element using the first model, the core objective is to maximize the generation probability. This means that the first model needs to generate a series of possible results based on the user's historical interaction data and select the result most likely to be accepted by the user for recommendation. This approach can improve the accuracy and relevance of recommendations because the model makes predictions based on learning from a large amount of data, thus getting closer to the user's true preferences.

[0124] Generally, language models can calculate the probability of a token sequence using the following formula:

[0125]

[0126] Where, x input The first token sequence is the input token sequence to the first model, which is the token sequence converted from the target text data mentioned above. The first word element can be one or more tokens in the input token sequence to the first model, i.e., x. input One or more of them. For example, the first lexical unit could be x. i x output This represents the token sequence output by the first model. In the above formula, i, n, and m are all non-negative integers.

[0127] S402: The first device determines the first decoding score of the first word based on the first probability, using the first model and the second model;

[0128] The second model is a recommendation model based on entity representation.

[0129] Optionally, the second model mentioned above includes: a self-attentive sequential recommendation model (SASRec), a convolutional sequence embedding recommendation model (Caser), a recommendation model based on gated recurrent units (GRU4Rec), or a sequential recommendation model based on bidirectional context encoders (BERT4Rec).

[0130] As mentioned earlier, existing recommendation systems suffer from high redundancy between recommended items and historical recommendations, as well as severe homogenization of recommended items. This problem stems from two factors. First, beam search selects the currently optimal candidate token at each step, rather than considering the global optimum. This means it may miss candidate tokens that score poorly in early steps but could ultimately achieve a higher score when combined with global optimization. Therefore, beam search may get stuck in local optima, limiting the diversity of the final results. Furthermore, the width of the beam search also limits its retrieval space. Second, language models tend to copy tokens from previous text. To address this issue, this application introduces a second model, namely an entity representation-based recommendation model, which effectively avoids the aforementioned problems and reduces the adverse effects caused by the inherent characteristics of language models. Optionally, this application can introduce the second model during the beam search stage, as detailed in the following implementation:

[0131] In one alternative implementation, the first device obtains a first score for the first word element based on the first probability using a first model; the first device obtains a second score for the first entity based on a second probability of recommending the first entity using a second model, and the entity generated based on the first word element includes the first entity; the first device obtains a first decoding score based on the first score and the second score.

[0132] The above implementation method allows for the calculation of the score of the first word element, i.e., the score estimate of the first word element, and the calculation of the second score of the first entity using an entity representation-based recommendation model, i.e., the second model. Due to its inherent characteristics, the second model can construct a recommendation system based on item IDs, directly providing the recommendation probability for each item without first generating multiple tokens and constructing an item from these tokens. Therefore, the second model does not need to copy text from the preceding context. The combination of the second and first models mitigates the problem of low diversity loss in recommendation information caused by the language model copying text from the context. Furthermore, the first score is calculated using the language model, the second score is obtained using the second model, and the first and second scores are combined to obtain a decoded score—that is, a decoded score is obtained by combining the language model and the entity representation-based recommendation model. Information is then recommended to the user based on this decoded score. This approach allows for more reasonable information recommendations to the user, improving the user experience.

[0133] Optionally, the first entity in this application includes: an item (such as a physical item or a virtual item), text data, audio data, or image data. In a typical application example of this application, the first entity is an item, such as an apple or clothing. A second score for the item can be obtained through the second model, and combined with the first score obtained from the first model, a first decoding score is finally obtained. Then, based on the first decoding score, it is determined whether the item needs to be recommended. Recommending the item means recommending information used to describe the item; for example, the item could be a product available for sale on an e-commerce platform, and the information used to describe the item could be images, text, or audio related to the product.

[0134] Please see Figure 5 , Figure 5 The paper compares the proposed solution with traditional large language model-based recommendation systems. The architecture of this application differs from traditional large language model-based recommendation systems; specifically, this application introduces an entity representation-based recommendation model on top of the language model, and calculates the decoding score using both the language model and the entity representation-based recommendation model.

[0135] Please see Figure 6 , Figure 6 This is a schematic diagram of the test results obtained from testing the technical effects of this application. Figure 6 In this context, Recommendation Strategy (RD) represents a recommendation strategy based on the second model, and "+RD" is a recommendation strategy that introduces the second model on top of the first model. Figure 6 The scores in the table represent the model's performance. (From...) Figure 6 It can be seen that introducing a second model can improve the overall performance, with significant effects on both large models and generative recommendation models.

[0136] Please see Figure 7 , Figure 7 This is another schematic diagram showing the test results obtained from testing the technical effects of this application. Figure 7 In the diagram, BIGRec represents an example of the first model, the recommendation strategy (RD) represents the second model, and temperature is a parameter used to control diversity in the larger model. The vertical axis represents the diversity of recommended information. It can be seen that, compared to the single first model, the scheme combining the first and second models, i.e., the scheme of this application, provides higher diversity of recommended information. Furthermore, this application is compatible with the diversity decoding strategies commonly used in language models.

[0137] Optionally, the first device can select tokens that meet the requirements from the input token sequence based on beam search. Beam search is a heuristic search algorithm commonly used in the decoding stage, especially in natural language processing tasks such as machine translation, text summarization, and speech recognition. The goal of beam search is to find the optimal or near-optimal solution from a large candidate set. It achieves this by maintaining a "beam" of size B, where B is called the beam width, a user-defined hyperparameter. At each step of decoding, it maintains a score estimate of the generated sequence at the current time step using the conditional probability formula generated by the model, and selectively discards some candidate sequences based on this estimate.

[0138] For example, in the beam search phase, the first device obtains the first score of the first word element through a first model. Specifically, the first model obtains the first score of the first word element using the following formula:

[0139] score(h t ) = score(h t-1 )+log(p(x t |h t-1 )

[0140] Wherein, h in the above formula t That is, the aforementioned x i , that is, the first word element, h in the above formula t-1 That is, the aforementioned x <i Where t is a positive integer.

[0141] Combining the probability calculation of the token sequence using the language model described above, the first score can be written as:

[0142] score1 = log(p recLLM (x t |(h <t )).

[0143] Optionally, during the beam search phase, based on the second probability of recommending the first entity, the first device obtains the second score of the first entity using a second model. Specifically, I can be defined as the set of all entities. The probability of recommending each entity based on the second model is represented as P. ID (I i Optionally, the second probability mentioned above can be P. ID (I i ), where I i Let represent the i-th entity. In the recommendation system containing both the first and second models, when generating a token at each step, the already generated hypothesis h is taken into account. <t and the new token x to be generated t Based on the already generated assumptions, it is determined that only a subset of entity I is eligible for further generation. For example, if the entity can be determined to be an apple based on the previous few tokens, then a banana token will not be generated, but an apple token will be generated instead. Therefore, the definition is... For token x t The set of entities that might be recommended during generation. The second model can then obtain the second score for the first entity using the following formula:

[0144]

[0145] In one alternative implementation, the first decoding score is a combination of the first score, the second score, and the first weight.

[0146] Based on the above implementation, the first score is obtained through a language model, while the second score is obtained through an entity representation-based recommendation model. The first score, obtained through the language model, can determine the probability of generating the first word unit by combining historical interaction data and task descriptions, thereby determining the score of the first word unit and whether it is suitable for output. The entity representation-based recommendation model, because it can directly obtain the probability of entity output, directly reduces the risk of low diversity caused by the language model. The first weight can flexibly adjust the ratio of the first and second scores. For example, the first weight can be determined according to task requirements. For instance, when it is necessary to ensure the diversity of recommended information as much as possible, the weight of the second score can be set larger; for example, if the weight of the second score is 0.7, then the weight of the first score is 0.3. By combining these three factors, a first decoding score is obtained. Then, when recommending information based on this decoding score, the diversity of the final recommended information can be flexibly adjusted.

[0147] For example, the first decoding score is defined as score(x) t |h <t If the first weight is defined as 'a', then the first decoding score can be calculated using the following formula:

[0148] score(x t |h <t )=(1+a)score1+ascore2

[0149] By completing score1 and score2, the first decoding score can be determined using the following formula:

[0150]

[0151] Optionally, the second probability for recommending the first entity can be adjusted based on the first information, as shown in the following example:

[0152] Example a1: When the first information indicates that the proportion of the first type of entity needs to be reduced, the second probability is less than the third threshold, the type of the first entity is the first type, and the first information includes: information used to indicate the needs or preferences of the target object.

[0153] Based on example a1 above, when the target object's needs or preferences indicate that the proportion of the first type of entity needs to be reduced, the second probability of recommending the first entity can be reduced. The type of the first entity is the first type, that is, the probability of recommending all or part of the first type of entity is reduced, thereby reducing the proportion of the first type of entity to meet the target object's needs or preferences, thereby improving the user experience.

[0154] It's understandable that the needs or preferences of the target audience may differ in different scenarios. In such cases, the recommendation ratio of a specific category of entities can be adjusted based on the target audience's needs or preferences, i.e., based on the primary information. For example, when the target audience is high school students, the recommendation ratio of children's books can be appropriately reduced, thereby improving the target audience's experience with almost no impact on the recommendation performance of other areas. For instance, the P value in the aforementioned formula can be reduced. ID (I i This reduces the recommendation entity I. i The ratio, for example, can be directly set to the corresponding P. ID (I i The initial score is set to 0. Since the conditional probabilities from the language model are considered when generating the first score, this does not lead to completely rejecting these items. This method allows for easy adjustment of the distribution of recommended items for different user groups, thereby improving the user experience.

[0155] Example a2: When the first information indicates that the proportion of the second type of entity needs to be increased, the value of the second probability is less than the fourth threshold, the type of the first entity is the first type, and the first information includes: information for indicating the needs or preferences of the target object, and the first type is different from the second type.

[0156] Based on example a2 above, when the target object's needs or preferences indicate that the proportion of the second type of entity needs to be increased, the second probability of recommending the first entity can be reduced. The type of the first entity is the first type, that is, the probability of recommending all or part of the first type of entity can be reduced, thereby increasing the proportion of the second type of entity to meet the target object's needs or preferences and thus improve the user experience.

[0157] For example, when it is necessary to increase the recommendation ratio of the second type of entity, the P of other types of entities can be increased. ID (I i ) = 0, for example, we can set P of the first type of entity (such as the first entity) to 0. ID (I i ) = 0.

[0158] In Examples a1 and a2, the first device can incorporate distribution control during model decoding, enabling better control over the distribution of recommended items when using the model for information recommendation, such as item recommendation, thereby better meeting user needs.

[0159] Please see Figure 8 , Figure 8 This is another schematic diagram showing the test results obtained from testing the technical effects of this application. Figure 8 The origin represents the case without adjusting the second probability, and the control represents the case without adjusting the second probability. Figure 8 The vertical axis represents the recommended proportion of items other than the first type. Figure 8 It can be seen that by reducing the second probability, the recommended proportion of items other than the first type, such as items of the second type, can be increased.

[0160] Please see Figure 9 , Figure 9 This is another schematic diagram showing the test results obtained from testing the technical effects of this application. Figure 9 In the original text, "origin" represents the case where the second probability is not adjusted, and "control" represents the case where the second probability is not adjusted. Figure 9 The vertical axis represents the recommended performance of items other than the first type. Figure 9 It can be seen that by reducing the second probability, the recommendation performance of items other than the first type, such as items of the second type, can be improved.

[0161] Optionally, after calculating the first decoding score, length normalization may or may not be performed, as detailed in the following implementation:

[0162] In one alternative implementation, when the first word element includes the second word element, and the difference between the probability of the first model generating the second word element and 1 is less than a fifth threshold, the first device does not perform length normalization on the first word element, or when the first word element is normalized, the second word element does not participate in the calculation.

[0163] Based on the above implementation method, the impact of the second word on the overall score of the sequence can be reduced, thereby reducing the impact of the second word on the decoding result.

[0164] It should be noted that the second lexical unit is an example of the aforementioned deceptive lexical unit.

[0165] Understandably, typical decoding methods often originate from large language models and natural language tasks. Since each step in the generation process of natural language involves many possible words, there are often no generation moments with a conditional probability of 1. Furthermore, to prevent the model from generating excessively long sequences, a length penalty term is added. This application, to avoid deceptive words negatively impacting the decoding results, stipulates that deceptive words are not included in the calculation or are not subject to length normalization during length normalization.

[0166] by Figure 10 For example, the second word element can be a word element with a probability of 1 or close to 1. For instance, the second word element could be P(B|A) or...

[0167] P(G|A,B,D,F). Typically, during length normalization, P(B|A) and P(G|A,B,D,F) are involved in the following calculations:

[0168]

[0169] In this application, the second word can be excluded from the above calculations, thereby avoiding the influence of the second word's logits on the decoding result. Furthermore, the second word is not lost in this application, thus preventing any bias in the item representation.

[0170] Please see Figure 11 , Figure 11 This is another test diagram of the technical effect of this application. Figure 11 The example shown is BIGRec as a first model, and BIGRec is a combination of the first model and the second model, i.e., an example of this application. Figure 11 The values ​​in the table represent the performance on HR@10. (Source: [Insert data here]) Figure 11 It is evident that the method described in this application can improve performance on HR@10.

[0171] S403: When the first decoding score is greater than the first threshold, the first information is recommended to the target object based on the first word.

[0172] It should be noted that, generally speaking, the target object mentioned above is the user. However, in some scenarios, the target object can also be a device. For example, after recommending the first information to the device, the device can further process the first information, send the first information to the user, or recommend the first information to the user.

[0173] Optionally, the first information can be various types of information. For example, the first information can be information used to describe the item. Accordingly, this application can be applied to the scenario of item recommendation. When used in the scenario of item recommendation, compared with the method of building a recommendation system based solely on a language model, this application introduces a recommendation model based on entity representation to assist the large model in generation. The recommendation model based on entity representation is usually a small model with a small computational load. Therefore, this approach will not increase the reasoning burden too much, and it can also alleviate the problems of high repetition and low diversity caused by using language generation for recommendation.

[0174] Optionally, the information used to describe the item can be multimodal information, such as text, images, or audio.

[0175] It should be noted that this application does not limit the first information to information used to describe the item; the first information can also be other information, such as streaming media information, personalized advertising, or news information.

[0176] As described above, this application proposes a decoding strategy to address deceptive lexical units, reducing their impact on decoding results. To address the issue of homogenized recommendation information, it also provides a recommendation system-friendly derivation method (RD), which can further adjust the distribution of recommended items to achieve customized enhancement of the recommendation ratio for certain types of items. Furthermore, this application presents a plug-and-play decoding method suitable for language model recommendations, solving the problems of excessive homogenization and over-similarity with historical interaction sequences in current language model recommendations. It proposes using an entity representation-based recommendation model to assist language model decoding, significantly alleviating the aforementioned problems with minimal changes in inference time. This method can also control the distribution of recommended items through simple technical extensions and has wide applicability.

[0177] Specifically, taking a large language model as an example, this application addresses the mismatch between large model recommendation and natural language decoding. It reduces the impact of probabilities close to 1 on the decoding process by either not performing length normalization or excluding deceptive words from the calculation during length normalization, thereby improving the performance of the recommendation system. To address the issue of high homogeneity and repetition with historical sequences due to limited analysis of large model recommendations, this application utilizes a small entity representation-based recommendation model to assist the large model in generation and recommendation during the decoding process, simultaneously improving the performance and diversity of the large model recommendation. Furthermore, to address the difficulty in appropriately adjusting the item distribution of large model recommendations, this application adjusts the probability distribution of some entities in the entity representation-based recommendation model to increase constraints on specific item categories. This allows for easy control of the distribution of recommended entities, and when applied to specific scenarios, its recommendation performance can be improved imperceptibly.

[0178] Please refer to Figure 12 , Figure 12 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application, as shown below. Figure 12 As shown in the embodiment of this application, a data processing apparatus 1200 is provided, which includes:

[0179] Processing module 1201 is used to obtain a first score of the first word element through a first model based on the first probability; obtain a second score of the first entity through a second model based on a second probability of recommending the first entity; and generate an entity based on the first word element that includes the first entity.

[0180] The recommendation module 1202 is used to recommend first information to the target object based on the first word when the first decoding score is greater than the first threshold.

[0181] In one possible implementation, the processing module 1201 is specifically used to: obtain a first score for the first word element through a first model based on the first probability; obtain a second score for the first entity through a second model based on a second probability of recommending the first entity, wherein the entity generated based on the first word element includes the first entity; and obtain a first decoding score based on the first score and the second score.

[0182] In one possible implementation, the first decoding score is a combination of the first score, the second score, and the first weight.

[0183] In one possible implementation, when the first information indicates that the proportion of a first type of entity needs to be reduced, the second probability is less than a third threshold, the type of the first entity is the first type, and the first information includes: information for indicating the needs or preferences of the target object.

[0184] In one possible implementation, when the first information indicates that the proportion of the second type of entity needs to be increased, the value of the second probability is less than the fourth threshold, the type of the first entity is the first type, and the first information includes: information for indicating the needs or preferences of the target object, the first type being different from the second type.

[0185] In one possible implementation, the first word element includes a second word element, and the difference between the probability of the first model generating the second word element and 1 is less than a fifth threshold. The processing module 1201 is further configured to: not perform length normalization on the first word element, or when the first word element is normalized, the second word element does not participate in the calculation.

[0186] In one possible implementation, the first information is information used to describe the item.

[0187] The following describes a terminal device provided in an embodiment of this application. Please refer to [link to relevant documentation]. Figure 13 , Figure 13 This is a schematic diagram of a terminal device provided in an embodiment of this application. The terminal device 1300 can specifically be a virtual reality (VR) device, a mobile phone, a tablet, a laptop computer, a smart wearable device, etc., and is not limited thereto. Specifically, the terminal device 1300 includes: a receiver 1301, a transmitter 1302, a processor 1303, and a memory 1304 (wherein the number of processors 1303 in the terminal device 1300 can be one or more). Figure 13 (Taking a processor as an example), processor 1303 may include application processor 13031 and communication processor 13032. In some embodiments of this application, receiver 1301, transmitter 1302, processor 1303 and memory 1304 may be connected via bus or other means.

[0188] Memory 1304 may include read-only memory and random access memory, and provides instructions and data to processor 1303. A portion of memory 1304 may also include non-volatile random access memory (NVRAM). Memory 1304 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.

[0189] Processor 1303 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together through a bus system, which may include not only the data bus, but also power buses, control buses, and status signal buses. However, for clarity, all buses are referred to as the bus system in the diagram.

[0190] The methods disclosed in the embodiments of this application can be applied to or implemented by the processor 1303. The processor 1303 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by the integrated logic circuitry in the hardware of the processor 1303 or by instructions in software form. The processor 1303 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include an ASIC, FPGA, or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The processor 1303 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 1304. Processor 1303 reads the information in memory 1304 and, in conjunction with its hardware, completes the steps involved in the model training or model inference process in the above method.

[0191] Receiver 1301 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the execution device. Transmitter 1302 can be used to output digital or character information through the first interface; transmitter 1302 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 1302 may also include a display device such as a display screen.

[0192] This application also provides a server; please refer to [link / reference]. Figure 14 , Figure 14This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1400 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1411 (e.g., one or more processors) and memory 1432, and one or more storage media 1430 (e.g., one or more mass storage devices) for storing application programs 1442 or data 1444. The memory 1432 and storage media 1430 can be temporary or persistent storage. The program stored in the storage media 1430 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the server. Furthermore, the CPU 1411 may be configured to communicate with the storage media 1430 and execute the series of instruction operations in the storage media 1430 on the server 1400.

[0193] Server 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input / output interfaces 1458; or, one or more operating systems 1441, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0194] In this embodiment, the central processing unit 1411 is used to perform actions related to model training or model inference in the above embodiments.

[0195] This application also provides a computer program product that, when run on a computer, causes the computer to perform steps as performed by the aforementioned execution device, or causes the computer to perform steps as performed by the aforementioned training device.

[0196] This application also provides a computer-readable storage medium storing a program for signal processing, which, when run on a computer, causes the computer to perform steps as performed by the aforementioned execution device, or causes the computer to perform steps as performed by the aforementioned training device.

[0197] The execution device, training device, or terminal device provided in this application embodiment can specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuits. The processing unit can execute computer execution instructions stored in the storage unit to cause the chip within the execution device to execute the data processing method described in the above embodiments, or to cause the chip within the training device to execute the data processing method described in the above embodiments. Optionally, the storage unit can be a storage unit within the chip, such as a register or cache. Alternatively, the storage unit can be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, such as random access memory (RAM).

[0198] For details, please refer to Figure 15 , Figure 15 This is a schematic diagram of a chip provided in an embodiment of this application. The chip can be represented as a neural network processor (NPU) 1500. The NPU 1500 is mounted as a coprocessor on the host CPU, and tasks are assigned by the host CPU. The core part of the NPU is the arithmetic circuit 1503, which is controlled by the controller 1504 to extract matrix data from the memory and perform multiplication operations.

[0199] In some implementations, the arithmetic circuit 1503 internally includes multiple process engines (PEs). In some implementations, the arithmetic circuit 1503 is a two-dimensional pulsating array. The arithmetic circuit 1503 can also be a one-dimensional pulsating array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 1503 is a general-purpose matrix processor.

[0200] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 1502 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 1501 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is ​​stored in the accumulator 1508.

[0201] Unified memory 1506 is used to store input and output data. Weight data is directly transferred to weight memory 1502 via direct memory access controller (DMAC) 1505. Input data is also transferred to unified memory 1506 via DMAC.

[0202] The bus interface unit (BIU) 1510 is used for interaction between the AXI bus and the DMAC and the instruction fetch buffer (IFB) 1509.

[0203] The bus interface unit 1510 is also used by the instruction fetch memory 1509 to fetch instructions from external memory, and by the memory access controller 1505 to fetch the original data of the input matrix A or the weight matrix B from external memory.

[0204] The DMAC is mainly used to move input data from external memory DDR to unified memory 1506, or to weight data to weight memory 1502, or to input data to input memory 1501.

[0205] The vector computation unit 1507 includes multiple processing units that further process the output of the computation circuit 1503 when necessary, such as vector multiplication, vector addition, exponential operations, logarithmic operations, and size comparisons. It is mainly used for computation in non-convolutional / fully connected layers of neural networks, such as batch normalization, pixel-level summation, and upsampling of feature planes.

[0206] In some implementations, the vector computation unit 1507 can store the processed output vector in the unified memory 1506. For example, the vector computation unit 1507 can apply a linear function, or a nonlinear function, to the output of the computation circuit 1503, such as linear interpolation of feature planes extracted by a convolutional layer, or, for example, a vector of accumulated values, to generate activation values. In some implementations, the vector computation unit 1507 generates normalized values, pixel-level summed values, or both. In some implementations, the processed output vector can be used as activation input to the computation circuit 1503, for example, for use in subsequent layers of the neural network.

[0207] The instruction fetch buffer 1509 connected to the controller 1504 is used to store the instructions used by the controller 1504.

[0208] Unified memory 1506, input memory 1501, weighted memory 1502, and instruction fetch memory 1509 are all on-chip memories. External memory is proprietary to this NPU hardware architecture.

[0209] The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the above program.

[0210] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the accompanying drawings of the device embodiments provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0211] Through the above description of the implementation methods, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by the corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods of the various embodiments of this application.

[0212] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0213] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0214] Through the above description of the implementation methods, those skilled in the art can clearly understand that, for the sake of convenience and brevity, the specific working process of the systems, devices, units, and computer program products described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0215] Finally, it should be noted that the above are merely specific implementations of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A data processing method, characterized in that, The method includes: The first probability of the first word element is determined by the first model, where the first model is a language model. Based on the first probability, the first decoding score of the first word is determined by the first model and the second model, wherein the second model is a recommendation model based on entity representation; When the first decoding score is greater than the first threshold, first information is recommended to the target object based on the first word.

2. The data processing method according to claim 1, characterized in that, The step of determining the first decoding score of the first word based on the first probability using the first model and the second model includes: Based on the first probability, the first score of the first word element is obtained through the first model; Based on the second probability of recommending the first entity, the second score of the first entity is obtained through the second model, and the first entity is included in the entity generated based on the first word element. The first decoding score is obtained based on the first score and the second score.

3. The data processing method according to claim 2, characterized in that, The first decoding score is a combination of the first score, the second score, and the first weight.

4. The data processing method according to claim 2 or 3, characterized in that, When the first information indicates that the proportion of the first type of entity needs to be reduced, the second probability is less than the third threshold, the type of the first entity is the first type, and the first information includes: information for indicating the needs or preferences of the target object.

5. The data processing method according to any one of claims 2 to 4, characterized in that, When the first information indicates that the proportion of the second type of entity needs to be increased, the value of the second probability is less than the fourth threshold, the type of the first entity is the first type, and the first information includes: information for indicating the needs or preferences of the target object, and the first type is different from the second type.

6. The data processing method according to any one of claims 1 to 5, characterized in that, The first lexical element includes the second lexical element, and the difference between the probability of the first model generating the second lexical element and 1 is less than a fifth threshold. The method further includes: If the first word is not normalized in length, or if the first word is normalized in length, the second word is not included in the calculation.

7. The data processing method according to any one of claims 1 to 6, characterized in that, The first piece of information is information used to describe the item.

8. A data processing apparatus, characterized in that, The device includes: The processing module is used to determine a first probability of a first word element through a first model, wherein the first model is a language model; and based on the first probability, to determine a first decoding score of the first word element through the first model and a second model, wherein the second model is a recommendation model based on entity representation. The recommendation module is used to recommend first information to the target object based on the first word when the first decoding score is greater than the first threshold.

9. The apparatus according to claim 8, characterized in that, The processing module is specifically used for: Based on the first probability, the first score of the first word element is obtained through the first model; Based on the second probability of recommending the first entity, the second score of the first entity is obtained through the second model, and the first entity is included in the entity generated based on the first word element. The first decoding score is obtained based on the first score and the second score.

10. The apparatus according to claim 9, characterized in that, The first decoding score is a combination of the first score, the second score, and the first weight.

11. The apparatus according to any one of claims 9 or 10, characterized in that, When the first information indicates that the proportion of the first type of entity needs to be reduced, the second probability is less than the third threshold, the type of the first entity is the first type, and the first information includes: information for indicating the needs or preferences of the target object.

12. The apparatus according to any one of claims 9 to 11, characterized in that, When the first information indicates that the proportion of the second type of entity needs to be increased, the value of the second probability is less than the fourth threshold, the type of the first entity is the first type, and the first information includes: information for indicating the needs or preferences of the target object, and the first type is different from the second type.

13. The apparatus according to any one of claims 8 to 12, characterized in that, The first lexical unit includes the second lexical unit, the difference between the probability of the first model generating the second lexical unit and 1 is less than a fifth threshold, and the processing module is further configured to: If the first word is not normalized in length, or if the first word is normalized in length, the second word is not included in the calculation.

14. The apparatus according to claims 8 to 13, characterized in that, The first piece of information is information used to describe the item.

15. A data processing apparatus, characterized in that, The apparatus includes: a processor and a memory; the memory for storing a program; and the processor for executing the program in the memory, such that the method as described in any one of claims 1 to 7 is performed.

16. A computer-readable storage medium, characterized in that, The medium stores instructions that, when executed by a processor, implement the method of any one of claims 1 to 7.

17. A computer program product, characterized in that, Includes instructions that, when executed on a processor, perform the method as described in any one of claims 1 to 7.

18. A chip, characterized in that, It includes at least one processing unit and an interface circuit, the interface circuit being used to provide program instructions or data to the at least one processing unit, the at least one processing unit being used to execute the program instructions to implement the method of any one of claims 1 to 7.