Ranking model training method, ranking method, device, equipment and medium
By employing multi-teacher model knowledge distillation and quantization pruning techniques, the problems of slow sorting speed of single large language models and insufficient semantic capture of traditional models are solved, achieving efficient, accurate sorting and interpretable recommendation of lightweight sorting student models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING QIYI CENTURY SCI & TECH CO LTD
- Filing Date
- 2026-03-11
- Publication Date
- 2026-06-09
AI Technical Summary
In existing technologies, the ranking results of a single large language model are prone to bias due to inherent biases and are slow. Traditional models cannot effectively capture the semantic relationship between user preferences and candidate sets, resulting in ranking accuracy and speed failing to meet real-time requirements.
Multiple ranking teacher models are used to generate reference ranking results. Knowledge distillation is then used to transfer the knowledge of these models to a lightweight ranking student model. By combining low-rank adaptation and quantization pruning techniques, the number of model parameters is reduced and the ranking speed is improved, while semantic understanding is preserved.
It achieves high ranking accuracy and speed with a relatively small number of model parameters, can explicitly generate recommendation reasons, improve user experience and meet the high-efficiency requirements of industrial recommendation engines.
Smart Images

Figure CN122173712A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a training method, sorting method, apparatus, device and medium for a sorting model. Background Technology
[0002] Sorting is widely used in online platforms such as video and news platforms. Efficient sorting can improve users' decision-making efficiency and enhance their experience. One related technology involves sorting using a single large language model. However, this method is prone to biases due to the inherent limitations of a single large language model, resulting in biased sorting results and slow sorting speed. Summary of the Invention
[0003] To address the aforementioned technical problems, this disclosure provides a training method, sorting method, apparatus, device, and medium for a sorting model.
[0004] This disclosure provides a method for training a ranking model, the method comprising: Obtain sample input data; wherein, the sample input data includes a first user description text and multiple first object description texts; wherein, the first object description text is used to describe a first object to be recommended; The sample input data is input into multiple ranking teacher models to obtain multiple reference ranking results output by the multiple ranking teacher models; wherein, the reference ranking results represent the ranking results of multiple first objects to be recommended; The sample input data is input into the initial ranking model to obtain the predicted ranking result. Based on the multiple reference ranking results and the predicted ranking result, the parameters of the initial ranking model are adjusted until a preset convergence condition is reached. Then, the initial ranking model is used as the ranking student model.
[0005] This disclosure provides a sorting method, the method comprising: Obtain the current input data; wherein, the current input data includes a current user description text and multiple current object description texts; The current input data is input into the ranking student model to obtain the current ranking result output by the ranking student model; wherein, the current ranking result represents the ranking result of multiple second objects to be recommended; wherein, the ranking student model is trained by the ranking model training method.
[0006] This disclosure also provides a training apparatus for a ranking model, the apparatus comprising: The first acquisition module is used to acquire sample input data; wherein, the sample input data includes a first user description text and multiple first object description texts; wherein, the first object description texts are used to describe a first object to be recommended; The reference module is used to input the sample input data into multiple ranking teacher models to obtain multiple reference ranking results output by the multiple ranking teacher models; wherein, the reference ranking results represent the ranking results of multiple first objects to be recommended; The training module is used to input the sample input data into the initial ranking model to obtain the predicted ranking result, and adjust the parameters of the initial ranking model based on the multiple reference ranking results and the predicted ranking result until a preset convergence condition is reached, and then use the initial ranking model as the ranking student model.
[0007] This disclosure also provides a sorting apparatus, the apparatus comprising: The second acquisition module is used to acquire current input data; wherein, the current input data includes a current user description text and multiple current object description texts; The sorting module is used to input the current input data into the sorting student model to obtain the current sorting result output by the sorting student model; wherein the current sorting result represents the sorting result of multiple second objects to be recommended; wherein the sorting student model is trained by the sorting model training method.
[0008] This disclosure also provides an electronic device, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement a training method or a sorting method for a sorting model as provided in this disclosure.
[0009] This disclosure also provides a computer-readable storage medium storing a computer program for executing a training method or a sorting method for the sorting model provided in this disclosure.
[0010] The technical solution provided in this disclosure has the following advantages compared with the prior art: The training scheme for the ranking model provided in this disclosure includes: acquiring sample input data; wherein the sample input data includes a first user description text and multiple first object description texts; wherein the first object description texts are used to describe a first object to be recommended; inputting the sample input data into multiple ranking teacher models to obtain multiple reference ranking results output by the multiple ranking teacher models; wherein the reference ranking results represent the ranking results of the multiple first objects to be recommended; inputting the sample input data into an initial ranking model to obtain a predicted ranking result, and adjusting the parameters of the initial ranking model based on the multiple reference ranking results and the predicted ranking result, until a preset convergence condition is reached, and then using the initial ranking model as a ranking student model.
[0011] By adopting the above technical solution, a sorting student model with a smaller number of model parameters is used to learn the sorting capabilities of multiple sorting teacher models with a larger number of model parameters. This largely preserves the ability of the sorting teacher models to analyze and process text styles during the sorting process. By reducing the number of model parameters, the sorting speed of the model is improved. Furthermore, the introduction of multiple sorting teacher models to collaboratively produce reference sorting results avoids the bias of a single model through the complementarity of data generated by multiple models. Therefore, based on this sorting student model, it is possible to achieve fast sorting while maintaining high sorting accuracy. Attached Figure Description
[0012] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0013] Figure 1 A flowchart illustrating a training method for a ranking model provided in this embodiment of the present disclosure; Figure 2 A flowchart illustrating a sorting method provided in an embodiment of this disclosure; Figure 3 A schematic diagram of the structure of a training device for a ranking model provided in an embodiment of this disclosure; Figure 4 This is a schematic diagram of the structure of a sorting device provided in an embodiment of the present disclosure; Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0014] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0015] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0016] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0017] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0018] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0019] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0020] In related technologies, ranking can be performed directly using large language models. Specifically, user data and candidate sets are input into the large language model, which then directly generates a ranking sequence. This approach can capture the semantic relationship between user preferences and the candidate set. However, large language models have a large parameter scale, requiring extensive matrix operations during inference, resulting in high computational power and a computational bottleneck. The inference latency for a single ranking request can reach 300-500ms, making it difficult to meet the needs of real-time ranking scenarios such as video search. Furthermore, the inherent biases of a single large language model can easily lead to biased ranking results.
[0021] In related technologies, ranking can also be performed using traditional models. Specifically, ranking can be based on traditional models such as collaborative filtering, logistic regression (LR), gradient boosting decision tree (GBDT), and neural networks, or lightweight models can be used to rank dense data after structured processing. Although this approach can achieve a low latency of 50-100ms, it only transmits dense digitized data (e.g., play rate, click rate), and cannot convey core knowledge content recorded in text, such as user preferences and video descriptions. Furthermore, it does not design training objectives that take into account the characteristics of the ranking task, making it difficult to achieve specific ranking tasks such as displaying reasons. This approach cannot capture the semantic relationship between user preferences and the candidate set, and it also loses the semantic coherence of generative ranking. For example, it cannot explain why video A ranks before video B, resulting in low ranking accuracy and low user trust.
[0022] It is evident that while large language models possess semantic understanding capabilities and can improve ranking accuracy and user experience, their large number of parameters leads to slow inference speed, making it difficult to meet the high-efficiency requirements of industrial recommendation engines. Traditional lightweight models, on the other hand, rely solely on dense features and cannot convey the core semantic knowledge of the text, nor do they have a dedicated training objective.
[0023] To address the aforementioned technical problems, this disclosure provides a method for training a ranking model, which will be described below with reference to specific embodiments.
[0024] Figure 1 This is a flowchart illustrating a training method for a ranking model provided in an embodiment of this disclosure. The method can be executed by a training device for the ranking model, which can be implemented in software and / or hardware, and is generally integrated into an electronic device. Figure 1 As shown, the method includes: Step 101: Obtain sample input data; wherein the sample input data includes a first user description text and multiple first object description texts; wherein the first object description text is used to describe the first object to be recommended.
[0025] The sample input data can be the data used to generate the training set for the input ranking teacher model. The first user can be a user involved in the model training process, and the first user description text can be the user description text corresponding to the first user. The user description text can be text describing the user's interests and / or characteristics, and can represent the user's preferences. This user description text is non-dense data. This embodiment does not limit the user description text. In some embodiments of this disclosure, the first object to be recommended is a video, and the first user description text includes at least one of the first user's interest tags, viewing history, search history, and click history. Interest tags can be tags representing the user's interest direction. Viewing history can be the user's historical video viewing history. Search history can be the text entered by the user in the past for video searches. Click history can be the user's history of clicking on videos.
[0026] The first object to be recommended can be any object involved in the model training process. This object can be anything to be recommended to the user, and this embodiment does not restrict the type of this object. In an e-commerce scenario, the object to be recommended can be a product; in a video viewing scenario, it can be a video; and in a news browsing scenario, it can be news or other information.
[0027] The first object description text can be the object description text corresponding to the first object to be recommended. The object description text can be text that describes the characteristics of the object to be recommended, and this object description text is non-dense data. This embodiment does not limit the object description text. In some embodiments of this disclosure, the first object to be recommended is a video, and the first object description text may include at least one of the following: video tags, video description, highlights, and actor information of the first object to be recommended.
[0028] The video tag can be used to characterize the video's classification attributes, recording one or more of the video's theme, category, and attributes. The video description is a brief introduction to the video, specifically summarizing one or more of its content, theme, and plot. Highlights are prompts designed to attract viewers, showcasing the video's exciting content and / or key highlights. Actor information includes information about the actors appearing in the video.
[0029] In this embodiment of the disclosure, the training device of the ranking model can acquire multiple first user description texts corresponding to multiple first users and multiple object description texts corresponding to multiple first objects to be recommended, and combine one first user description text with multiple first object description texts to obtain sample input data. Alternatively, the user can input one first user description text and multiple first object description texts into the training device of the ranking model, and the training device of the ranking model acquires the one first user description text and multiple first object description texts, and uses the one first user description text and multiple first object description texts as sample input data.
[0030] In some embodiments of this disclosure, the sample input data includes at least one of first user quantification data, first object quantification data, and first environment description data; the first user quantification data is the quantification feature of the first user, the first object quantification data includes at least one of the video click data, video score, video completion data, and video exposure data of the first object to be recommended, and the first environment description data includes at least one of time and location.
[0031] The first user quantitative data can be a quantitative number related to the first user, and this embodiment does not limit the type of user quantitative data. For example, the user quantitative data may include age, etc. The first object quantitative data can be a quantitative feature related to the first object to be recommended, specifically a number related to the first object to be recommended, and this embodiment does not limit the object quantitative data. Taking a video as the first object to be recommended as an example, the object quantitative data may include video clicks, video score, video completion data, and video exposure data. The user quantitative data and object quantitative data are dense data. Video clicks can be the number of times the video is clicked by a user. Video score can be the rating of the video. Video completion data can be used to record when a user plays the video completely. Video exposure data can be used to record the number of times the video is shown to a user.
[0032] The first environment description data can be text describing the environment in which the first user is located. This embodiment does not limit the environment description data; for example, it can include time and / or location. Time can record the time when the first user triggered video sorting. Location can record the geographical location of the first user when triggering video sorting. It should be noted that in this embodiment, user-related data such as user description text, user quantitative data, and environment description data are obtained with the user's authorization.
[0033] Optionally, the input data may also include images, videos, etc., thereby further improving the comprehensiveness of the input data in representing users and / or objects through multi-source input data.
[0034] In the above scheme, the input data includes text describing users and objects to be recommended, achieving the fusion of core data related to users and objects to be recommended. The input data can also include quantitative data of users and / or objects to be recommended, incorporating both numerical features and textual semantic features to construct a comprehensive multi-source profile. This provides more complete information support for subsequent semantic understanding and accurate ranking, avoiding the limitations of a single dimension, providing a richer data foundation, and improving the accuracy of ranking.
[0035] Step 102: Input the sample input data into multiple ranking teacher models to obtain multiple reference ranking results output by multiple ranking teacher models; wherein, the reference ranking results represent the ranking results of multiple first objects to be recommended.
[0036] The ranking teacher model can be a Large Language Model (LLM) used to rank the objects to be recommended. The number of parameters in this ranking teacher model can be on the order of tens of billions, hundreds of billions, trillions, etc. This ranking teacher model can be understood as the teacher model in knowledge distillation. Multiple ranking teacher models can be two or more different Large Language Models. The number of parameters can be on the order of the model's parameters. The reference ranking result can be the ranking result of the ranking teacher model for multiple first objects to be recommended determined by the first user; this reference ranking result can be understood as the standard ranking result.
[0037] In this embodiment, the training device for the ranking model can input sample input data and ranking prompt words into multiple ranking teacher models respectively. Each ranking teacher model performs semantic understanding analysis based on the first user description text and multiple first object description texts to generate a reference ranking result corresponding to each ranking teacher model.
[0038] The sorting prompts can be words that instruct the model to sort the objects to be recommended. These prompts can record sorting requirements, etc. The sorting prompts can include sorting task prompts and sorting reason prompts. The sorting task prompts can be used to prompt the model to perform a sorting task based on user-related data and data related to the objects to be recommended, in order to generate a ranking of the objects to be recommended. This embodiment does not limit the sorting task prompts. For example, in a video viewing scenario, the sorting task prompts could be to sort videos according to user viewing preferences; in a news browsing scenario, the sorting task prompts could be to sort news according to user interests. The sorting reason prompts can be used to prompt the model to generate a ranking of the objects to be recommended.
[0039] Because a single ranking teacher model is inherently biased, the reference ranking results can be somewhat one-sided due to its inherent biases. The above solution introduces multiple ranking teacher models to generate reference ranking results, thus addressing the bias problem of a single model through the complementarity of multiple models.
[0040] Step 103: Input the sample input data into the initial ranking model to obtain the predicted ranking result. Based on multiple reference ranking results and the predicted ranking result, adjust the parameters of the initial ranking model until the preset convergence condition is met. Then, use the initial ranking model as the ranking student model.
[0041] The initial ranking model can be a model trained with incomplete sample input data and reference ranking results. The ranking student model can be a model trained with sample input data and reference ranking results to rank the objects to be recommended. This ranking student model can be a lightweight large language model or an open-source small language model (SLM), etc. The predicted ranking result can be the ranking result of the initial ranking model for multiple objects to be recommended as determined by the user. This predicted ranking result can be understood as the ranking result determined during the model training process.
[0042] The number of parameters in the ranking teacher model is larger than that in the ranking student model. There can be only one ranking student model. This ranking student model is smaller in scale and has fewer parameters than the ranking teacher model. Its number of parameters can be in the hundreds of millions, billions, etc., and can differ from the ranking teacher model by at least one order of magnitude. This ranking student model can be understood as the student model in knowledge distillation.
[0043] In this embodiment of the disclosure, the training device for the ranking model can construct a training set based on the sample input data and the reference ranking result. Using the training set, the initial ranking model is fine-tuned in a supervised manner through training methods such as Low-Rank Adaptation (Lora). After the fine-tuning is completed, the ranking student model is obtained.
[0044] Specifically, the training device for the ranking model can input sample input data into an initial ranking model. This initial ranking model performs semantic understanding analysis based on user description text and multiple object description texts to generate predicted ranking results. Since there are multiple ranking teacher models, for the same sample input data, these models will output multiple reference ranking results. For the same sample input data, the initial ranking model will output a corresponding predicted ranking result. The training device can iteratively adjust the model parameters of the initial ranking model based on the differences between each reference ranking result and the predicted ranking result, thus obtaining a ranking student model. Therefore, by performing knowledge distillation based on the multiple reference ranking results corresponding to multiple ranking teacher models, the ranking knowledge and semantic understanding capabilities, such as text semantic correlation analysis, of the multiple ranking teacher models are transferred to the lightweight initial ranking model. This allows the subsequently trained ranking student model to perform a more balanced ranking of the recommended objects.
[0045] In some embodiments of this disclosure, the reference sorting result includes reference sorting data and reference sorting reason, and the predicted sorting result includes predicted sorting data and predicted sorting reason.
[0046] The reference ranking data can be the ranking order of the first recommended object determined by the ranking teacher model for the first user. This ranking order can include a ranking number and the corresponding name of the first recommended object, and can be generated in response to ranking task prompts. The reference ranking reason can be the ranking reason generated by the ranking teacher model for this reference ranking data. The ranking reason can be text explaining the reason for the ranking order. For example, the ranking reason could be "Based on your recent interest in technology content, we recommend this artificial intelligence technology article" or "Based on your search history for 'science fiction short films' and the current evening time, we prioritize recommending this highly-rated work." This ranking reason can be generated in response to ranking reason prompts. The predicted ranking data can be the ranking order of the first recommended object determined by the initial ranking model for the first user. The predicted ranking reason can be the ranking reason generated by the initial ranking model for this reference ranking data.
[0047] In related technologies, neural network models can only implicitly model the relationship between users and the objects to be recommended, thus failing to explicitly explain the recommendation criteria, resulting in a poor user experience. The above solution, however, specifically acquires the reference ranking reasons generated by the ranking teacher model during the knowledge distillation process, preserving the model's ability to generate ranking reasons. This allows the lightweight ranking student model, after final training, to not only output the ranking order but also generate explainable recommendation reasons based on data related to the first user and the first object to be recommended in the input data, thereby increasing user trust in the ranking order.
[0048] In some embodiments of this disclosure, the parameters of an initial ranking model are adjusted based on multiple reference ranking results and predicted ranking results until a preset convergence condition is met. The initial ranking model is then used as a ranking student model. This includes: determining multiple first loss values based on predicted ranking data and multiple reference ranking data; calculating text loss based on the predicted ranking reason and multiple reference ranking reasons respectively to obtain multiple second loss values; and updating the parameters of the initial ranking model based on the multiple first loss values and multiple second loss values until a preset convergence condition is met to obtain the ranking student model.
[0049] The first loss value can be used to characterize the error in the sorting order generated by the initial sorting model. The second loss value can be used to characterize the error in the reasoning behind the sorting generated by the initial sorting model. The text loss calculation can be an algorithm for calculating the differences between texts.
[0050] In this embodiment, for each reference ranking data, the training device of the ranking model can calculate the error between the reference ranking data and the predicted ranking data in the reference ranking data according to a pre-set error algorithm, thereby obtaining a first loss value corresponding to each reference ranking data. Furthermore, the training device of the ranking model can calculate the error between the reference ranking reason and the predicted ranking reason in the reference ranking data according to a pre-set text loss algorithm, thereby obtaining a second loss value corresponding to each reference ranking reason. Understandably, each reference ranking data has a corresponding first loss value and second loss value. The training device of the ranking model adjusts the model parameters of the initial ranking model based on multiple first loss values and multiple second loss values corresponding to multiple reference ranking data until a preset convergence condition is reached, thus obtaining the ranking student model.
[0051] In the above scheme, corresponding loss values are determined in the two dimensions of sorting order and sorting reason, and the initial sorting model is trained to obtain the sorting student model. Specific training objectives are set for the initial sorting model in the two dimensions of sorting order and sorting reason, so that the trained sorting student model can generate a more accurate sorting order and a more reasonable sorting reason.
[0052] The training scheme for the ranking model provided in this embodiment of the present disclosure involves acquiring sample input data, wherein the sample input data includes a first user description text and multiple first object description texts, wherein the first object description texts are used to describe a first object to be recommended; the sample input data is input into multiple ranking teacher models to obtain multiple reference ranking results output by the multiple ranking teacher models; wherein the reference ranking results represent the ranking results of the multiple first objects to be recommended; the sample input data is input into an initial ranking model to obtain a predicted ranking result, and the parameters of the initial ranking model are adjusted based on the multiple reference ranking results and the predicted ranking result until a preset convergence condition is reached, at which point the initial ranking model is used as a ranking student model.
[0053] By adopting the above technical solution, a sorting student model with a smaller number of model parameters is used to learn the sorting capabilities of multiple sorting teacher models with a larger number of model parameters. This largely preserves the ability of the sorting teacher models to analyze and process text styles during the sorting process. By reducing the number of model parameters, the sorting speed of the model is improved. Furthermore, the introduction of multiple sorting teacher models to collaboratively produce reference sorting results avoids the bias of a single model through the complementarity of data generated by multiple models. Therefore, based on this sorting student model, it is possible to achieve fast sorting while maintaining high sorting accuracy.
[0054] In addition, in e-commerce scenarios, the proportion of irrelevant products in recommendations has been reduced; in video viewing scenarios, the user swipe-away rate has been reduced by improving the relevance of recommended videos to users; and in news browsing scenarios, issues such as repetitive or irrelevant recommended information have been resolved.
[0055] Figure 2 This is a flowchart illustrating a sorting method provided in an embodiment of the present disclosure. The method can be executed by a sorting device, which can be implemented in software and / or hardware, and is generally integrated into an electronic device. Figure 2 As shown, the method includes: Step 201: Obtain the current input data; wherein, the current input data includes a current user description text and multiple current object description texts.
[0056] The current input data can be the data used for the current sorting, enabling the sorting of currently recommended objects for the current user. This current input data has the same data type as the sample input data. It can include one current user description text and multiple current object description texts, meaning one current user can correspond to multiple currently recommended objects. The current user refers to the user for whom the sorting of recommended objects is being performed. The currently recommended object can be the object to be sorted. The current input data can also include at least one of the following: current user quantitative data, current object quantitative data, and current environment description data.
[0057] In this embodiment of the disclosure, the sorting device can acquire a current user description text and multiple current object description texts, and use the current user description text and multiple current object description texts as current input data.
[0058] Step 202: Input the current input data into the ranking student model to obtain the current ranking result output by the ranking student model; wherein, the current ranking result represents the ranking result of multiple second objects to be recommended; wherein, the ranking student model is trained by the training method of the ranking model.
[0059] The current ranking result can be a ranking of multiple currently recommended objects determined by the current user. Optionally, the current ranking result includes current ranking data and current ranking reasons. The current ranking data can be the ranking order of the currently recommended objects determined by the ranking student model for the current user. The current ranking reasons can be the ranking reasons generated by the ranking student model for the current ranking data.
[0060] In this embodiment of the disclosure, the sorting device can input the current input data into the sorting student model, and the sorting student model can perform semantic understanding analysis based on the current user description text and multiple current object description texts to generate the current sorting result.
[0061] In some embodiments of this disclosure, before inputting the current input data into the sorting student model, the sorting method further includes: determining the parameters to be processed in the sorting student model, and adjusting the parameter type of the parameters to be processed from floating-point to integer.
[0062] The parameters to be processed can be model parameters to be quantized, and these parameters can be all or some of the parameters in the student ranking model.
[0063] In this embodiment, the sorting device can quantize the parameter type of the parameters to be processed in the student sorting model from floating-point to integer. Thus, by quantizing the model parameters, the student sorting model is pruned and accelerated, reducing the parameter size and computational load. While maintaining sorting accuracy close to that of the teacher sorting model, this meets the core requirement of industrial recommendation engines for high-efficiency response.
[0064] The sorting scheme provided in this embodiment obtains current input data; wherein the current input data includes a current user description text and multiple current object description texts; the current input data is input into a sorting student model to obtain the current sorting result output by the sorting student model; wherein the current sorting result represents the sorting result of multiple second objects to be recommended; wherein the sorting student model is trained by a sorting model training method.
[0065] By adopting the above technical solution, the student sorting model with a small number of model parameters largely retains the ability of multiple teacher sorting models to analyze and process the content of text styles during the sorting process. Based on the student sorting model, the current input data is processed to generate the current sorting result. The complementarity of data generated by multiple models avoids the bias of a single model, and can achieve a high sorting accuracy while performing a fast sorting.
[0066] In some embodiments of this disclosure, the sorting method further includes: performing matching processing on the current user description text in the text mapping relationship; if there is a successfully matched preset user description text in the text mapping relationship, then determining the preset object sorting result corresponding to the successfully matched preset user description text as the current sorting result; wherein, the text mapping relationship is used to record the correspondence between the preset user description text and the preset object sorting result.
[0067] The preset user description text can be user description text pre-set in the text mapping relationship, and this preset user description text can be user description text that appears more frequently than a frequency threshold. The preset object sorting result can be object sorting result pre-set in the text mapping relationship, and the preset user description text can be mapped to the corresponding preset object sorting result.
[0068] In this embodiment, at least one preset user description text is set in the text mapping relationship, and a corresponding preset object sorting result is set for each preset user description text. Before inputting the current input data into the sorting student model, the sorting device can calculate the text similarity between the current user description text and the preset user description text in the text mapping relationship. If the text similarity is greater than the corresponding threshold, it is determined that the preset user description text and the current user description text are successfully matched. Further, the preset object sorting result corresponding to the successfully matched preset user description text is determined as the current object sorting result corresponding to the current user description text. If the matching fails, the current input data is input into the sorting student model, and the current object sorting result corresponding to the current user description text is obtained through the sorting student model.
[0069] In the above scheme, by pre-storing the sorting results of high-frequency objects, the real-time sorting inference time is reduced. The combination of this pre-computation cache and quantization pruning can further shorten the average sorting latency of the sorting student model, thus further meeting the core requirement of industrial recommendation engines for efficient response.
[0070] The following example illustrates the training and ranking methods of the ranking model in this disclosure, using a video as the object to be recommended. The training and ranking methods of the ranking model include: During the preparation phase, the training device for the ranking model can acquire the first user description text, the first object description text, and object quantification data. It also determines multiple ranking teacher models as teacher models and an initial ranking model as student models.
[0071] During the model distillation phase, the training device for the ranking model can input the first user description text, the first object description text, and object quantization data into multiple ranking teacher models to generate multiple reference ranking results. A training set is constructed based on these multiple reference ranking results, and the initial ranking model is fine-tuned in a supervised manner using data from this training set to obtain the ranking student model. After fine-tuning, the ranking student model is pruned and accelerated using quantization parameters.
[0072] During the online ranking phase, the ranking device can use a ranking student model to rank the objects to be recommended based on the current user description text and the current object description text, and obtain the ranking result of the current object.
[0073] The above solution constructs a framework of multi-source profile fusion, multi-teacher model knowledge distillation, explicit generation, and lightweight inference. First, it fuses the numerical and textual semantic features of users and the objects to be recommended. Then, it uses multiple ranking teacher models to generate reference ranking data to avoid the bias of a single model, and generates a training set based on multiple reference ranking data corresponding to the same sample input data. Through hierarchical distillation, the lightweight initial ranking model inherits the ranking knowledge and semantic understanding capabilities of multiple ranking teacher models, while also being able to explicitly generate recommendation reasons. Finally, through quantization pruning and pre-computation caching, the ranking student model achieves ranking accuracy close to that of the ranking teacher models with low inference latency, and can explicitly explain the recommendation reasons. This solves the pain points of low search result matching and lack of understanding of recommendation criteria for users, meeting the high-concurrency search efficiency requirements of video platforms while improving user search experience and platform video click-through conversion efficiency. It achieves collaborative optimization of accurate ranking, interpretability, and efficient inference, adapting to the high-efficiency requirements of industrial recommendation engines and improving user experience.
[0074] Figure 3 This is a schematic diagram of a training device for a ranking model provided in an embodiment of this disclosure. This device can be implemented in software and / or hardware. Figure 3 As shown, the training apparatus for this ranking model includes: The first acquisition module 301 is used to acquire sample input data; wherein, the sample input data includes a first user description text and multiple first object description texts; wherein, the first object description text is used to describe a first object to be recommended; Reference module 302 is used to input the sample input data into multiple ranking teacher models to obtain multiple reference ranking results output by the multiple ranking teacher models; wherein, the reference ranking results represent the ranking results of multiple first objects to be recommended; The training module 303 is used to input the sample input data into the initial ranking model to obtain the predicted ranking result, and adjust the parameters of the initial ranking model based on the multiple reference ranking results and the predicted ranking result until a preset convergence condition is reached, and then use the initial ranking model as the ranking student model.
[0075] Optionally, the reference sorting result includes reference sorting data and reference sorting reasons, and the predicted sorting result includes predicted sorting data and predicted sorting reasons; The step of adjusting the parameters of the initial ranking model based on the multiple reference ranking results and the predicted ranking results until a preset convergence condition is met, and then using the initial ranking model as the ranking student model, includes: Multiple first loss values are determined based on the predicted sorting data and multiple reference sorting data; Based on the predicted ranking reasons and multiple reference ranking reasons, text loss is calculated to obtain multiple second loss values; The parameters of the initial ranking model are updated based on the plurality of first loss values and the plurality of second loss values until the preset convergence condition is met, thus obtaining the ranking student model.
[0076] Optionally, the first object to be recommended is a video, the first user description text includes at least one of the first user's interest tags, viewing history, search history, and click history, and the first object description text includes at least one of the first object to be recommended's video tags, video description, highlights, and actor information.
[0077] Optionally, the sample input data includes at least one of first user quantization data, first object quantization data, and first environment description data; The first user quantification data is the quantification characteristics of the first user, the first object quantification data includes at least one of the video click data, video score, video completion data, and video exposure data of the first object to be recommended, and the first environment description data includes at least one of time and location.
[0078] The training apparatus for the ranking model provided in this disclosure can execute the training method for the ranking model provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0079] Figure 4 This is a schematic diagram of a sorting device provided in an embodiment of the present disclosure. The device can be implemented by software and / or hardware. For example... Figure 4 As shown, the device includes: The second acquisition module 401 is used to acquire current input data; wherein, the current input data includes a current user description text and multiple current object description texts; The sorting module 402 is used to input the current input data into the sorting student model to obtain the current sorting result output by the sorting student model; wherein the current sorting result represents the sorting result of multiple second objects to be recommended; wherein the sorting student model is trained by the sorting model training method.
[0080] Optionally, before inputting the current input data into the sorting student model, the sorting device further includes: The quantization module is used to determine the parameters to be processed in the ranked student model and to adjust the parameter type of the parameters to be processed from floating point to integer.
[0081] Optionally, the sorting device further includes: The matching module is used to perform matching processing on the current user description text in the text mapping relationship. If there is a successfully matched preset user description text in the text mapping relationship, the preset object sorting result corresponding to the successfully matched preset user description text is determined as the current sorting result. The text mapping relationship is used to record the correspondence between the preset user description text and the preset object sorting result.
[0082] The sorting apparatus provided in this disclosure can execute the sorting method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the method execution.
[0083] This disclosure also provides a computer program product, including a computer program / instruction that, when executed by a processor, implements the training method and / or sorting method of the sorting model provided in any embodiment of this disclosure.
[0084] Figure 5 This is a schematic diagram of an electronic device provided in an embodiment of the present disclosure. See below for details. Figure 5 The diagram illustrates a structural schematic suitable for implementing the electronic device 500 in the embodiments of this disclosure. The electronic device 500 in the embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0085] like Figure 5 As shown, electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 502 or a program loaded from storage device 508 into random access memory (RAM) 503. RAM 503 also stores various programs and data required for the operation of electronic device 500. Processing unit 501, ROM 502, and RAM 503 are interconnected via bus 504. Input / output (I / O) interface 505 is also connected to bus 504.
[0086] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, magnetic tapes, hard disks, etc.; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0087] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 509, or installed from storage device 508, or installed from ROM 502. When the computer program is executed by processing device 501, it performs the functions defined in the training method and / or sorting method of the sorting model of embodiments of this disclosure.
[0088] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0089] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0090] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0091] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the training method and / or sorting method of the sorting model according to the embodiments of this disclosure.
[0092] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0093] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0094] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.
[0095] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0096] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0097] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0098] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0099] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0100] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A training method for a ranking model, characterized in that, include: Obtain sample input data; wherein, the sample input data includes a first user description text and multiple first object description texts; wherein, the first object description text is used to describe a first object to be recommended; The sample input data is input into multiple ranking teacher models to obtain multiple reference ranking results output by the multiple ranking teacher models; wherein, the reference ranking results represent the ranking results of multiple first objects to be recommended; The sample input data is input into the initial ranking model to obtain the predicted ranking result. Based on the multiple reference ranking results and the predicted ranking result, the parameters of the initial ranking model are adjusted until a preset convergence condition is reached. Then, the initial ranking model is used as the ranking student model.
2. The method according to claim 1, characterized in that, The reference sorting result includes reference sorting data and reference sorting reasons, and the predicted sorting result includes predicted sorting data and predicted sorting reasons; The step of adjusting the parameters of the initial ranking model based on the multiple reference ranking results and the predicted ranking results until a preset convergence condition is met, and then using the initial ranking model as the ranking student model, includes: Multiple first loss values are determined based on the predicted sorting data and multiple reference sorting data; Based on the predicted ranking reasons and multiple reference ranking reasons, text loss is calculated to obtain multiple second loss values; The parameters of the initial ranking model are updated based on the plurality of first loss values and the plurality of second loss values until the preset convergence condition is met, thus obtaining the ranking student model.
3. The method according to claim 1, characterized in that, The first object to be recommended is a video. The first user description text includes at least one of the first user's interest tags, viewing history, search history, and click history. The first object description text includes at least one of the first object to be recommended's video tags, video description, highlights, and actor information.
4. The method according to claim 3, characterized in that, The sample input data includes at least one of the following: first user quantization data, first object quantization data, and first environment description data; The first user quantification data is the quantification characteristics of the first user, the first object quantification data includes at least one of the video click data, video score, video completion data, and video exposure data of the first object to be recommended, and the first environment description data includes at least one of time and location.
5. A sorting method, characterized in that, include: Obtain the current input data; wherein, the current input data includes a current user description text and multiple current object description texts; The current input data is input into the ranking student model to obtain the current ranking result output by the ranking student model; wherein the current ranking result represents the ranking result of multiple second objects to be recommended; wherein the ranking student model is trained by the training method of the ranking model according to any one of claims 1-4.
6. The method according to claim 5, characterized in that, Before inputting the current input data into the ranked student model, the method further includes: Determine the parameters to be processed in the sorted student model, and adjust the parameter type of the parameters to be processed from floating point to integer.
7. The method according to claim 5, characterized in that, The method further includes: In the text mapping relationship, the current user description text is matched. If there is a successfully matched preset user description text in the text mapping relationship, the preset object sorting result corresponding to the successfully matched preset user description text is determined as the current sorting result. The text mapping relationship is used to record the correspondence between preset user description text and preset object sorting results.
8. A training device for a ranking model, characterized in that, The device includes: The first acquisition module is used to acquire sample input data; wherein, the sample input data includes a first user description text and multiple first object description texts; wherein, the first object description texts are used to describe a first object to be recommended; The reference module is used to input the sample input data into multiple ranking teacher models to obtain multiple reference ranking results output by the multiple ranking teacher models; wherein, the reference ranking results represent the ranking results of multiple first objects to be recommended; The training module is used to input the sample input data into the initial ranking model to obtain the predicted ranking result, and adjust the parameters of the initial ranking model based on the multiple reference ranking results and the predicted ranking result until a preset convergence condition is reached, and then use the initial ranking model as the ranking student model.
9. A sorting device, characterized in that, The device includes: The second acquisition module is used to acquire current input data; wherein, the current input data includes a current user description text and multiple current object description texts; The sorting module is used to input the current input data into the sorting student model to obtain the current sorting result output by the sorting student model; wherein the current sorting result represents the sorting result of multiple second objects to be recommended; wherein the sorting student model is trained by the training method of the sorting model according to any one of claims 1-4.
10. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1-7.
11. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for performing the method described in any one of claims 1-7.