Method and device for training resource ranking model, method and device for recommending resources, equipment and medium
Patent Information
- Application Number
- CN202611247915.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-17
- Publication Date
- 2026-10-30
AI Technical Summary
[0012]根据本公开的一个或多个实施例,本公开通过基于多组样本偏序数据对大语言模型进行微调,利用微调后的大语言模型生成多个偏序维度上的多组目标偏序数据,并对多组目标偏序数据进行融合处理得到统一偏序关系以构建训练数据,训练参数量小于大语言模型的资源排序模型,使资源排序模型的输出结果与用户在多个偏序维度上的偏好相匹配,提升了资源排序的准确性,从而能够为用户提供与其需求更匹配的资源,并且降低了线上排序的计算开销。
Smart Images

Figure CN123012579A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, particularly to the fields of recommender systems, deep learning, and large models, and can be used in application scenarios such as generative search, intelligent document editing, intelligent assistants, virtual assistants, and intelligent e-commerce. Specifically, it relates to a training method for a resource ranking model, a resource recommendation method, a training device for a resource ranking model, a resource recommendation device, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] Artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies mainly include natural language processing, computer vision, speech recognition, machine learning / deep learning, big data processing, and knowledge graph technologies.
[0003] The methods described in this section are not necessarily methods that had been previously conceived or adopted. Unless otherwise specified, no method described in this section should be assumed to be prior art simply because it is included in this section. Similarly, unless otherwise specified, the issues mentioned in this section should not be considered to be accepted in any prior art. Summary of the Invention
[0004] This disclosure provides a method for training a resource ranking model, a method for recommending resources, a training apparatus for a resource ranking model, a resource recommendation apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] According to one aspect of this disclosure, a training method for a resource ranking model is provided, comprising: acquiring multiple sets of sample partial-order data, each set of sample partial-order data representing the relative priority of multiple sample resources in one of a set of preset partial-order dimensions; fine-tuning a large language model based on the multiple sets of sample partial-order data; using the fine-tuned large language model, processing based on multi-source information of historical users and multiple historical resources to obtain multiple sets of target partial-order data for multiple historical resources in multiple partial-order dimensions; fusing the multiple sets of target partial-order data in multiple partial-order dimensions to obtain a unified partial-order relationship between multiple historical resources, and constructing training data based on the unified partial-order relationship; and training the resource ranking model using the training data, wherein the number of parameters in the resource ranking model is smaller than that in the large language model, and the resource ranking model is used to rank multiple candidate resources based on multi-source information of target users.
[0006] According to another aspect of this disclosure, a resource recommendation method is provided, comprising: acquiring multi-source information of a target user and multiple candidate resources; using a resource ranking model to process the multiple candidate resources based on the multi-source information of the target user to obtain estimated scores for each of the multiple candidate resources, wherein the resource ranking model is trained according to the training method of the above aspect of this disclosure; and ranking the multiple candidate resources based on the estimated scores and recommending resources to the target user according to the ranking results.
[0007] According to another aspect of this disclosure, a training apparatus for a resource ranking model is provided, comprising: an acquisition unit configured to acquire multiple sets of sample partial order data, each set of sample partial order data representing the relative priority of multiple sample resources in one of a preset multiple partial order dimensions; a fine-tuning unit configured to fine-tune a large language model based on the multiple sets of sample partial order data; a generation unit configured to use the fine-tuned large language model to process multiple sets of target partial order data for multiple historical resources based on multi-source information of historical users and multiple historical resources, thereby obtaining multiple sets of target partial order data for multiple historical resources in multiple partial order dimensions; a fusion unit configured to fuse the multiple sets of target partial order data in multiple partial order dimensions to obtain a unified partial order relationship between multiple historical resources, and to construct training data based on the unified partial order relationship; and a training unit configured to train the resource ranking model using the training data, wherein the number of parameters of the resource ranking model is smaller than that of the large language model, and the resource ranking model is used to rank multiple candidate resources based on multi-source information of target users.
[0008] According to another aspect of this disclosure, a resource recommendation apparatus is provided, comprising: an information acquisition unit configured to acquire multi-source information of a target user and multiple candidate resources; an estimation unit configured to process the multiple candidate resources based on the multi-source information of the target user using a resource ranking model to obtain estimated scores for each of the multiple candidate resources, wherein the resource ranking model is trained using a training apparatus according to the above aspects of this disclosure; and a recommendation unit configured to rank the multiple candidate resources based on the estimated scores and recommend resources to the target user according to the ranking results.
[0009] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods described above.
[0010] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause a computer to perform the above-described method.
[0011] According to another aspect of this disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-described method when executed by a processor.
[0012] According to one or more embodiments of this disclosure, this disclosure fine-tunes a large language model based on multiple sets of sample partial order data, uses the fine-tuned large language model to generate multiple sets of target partial order data in multiple partial order dimensions, and fuses the multiple sets of target partial order data to obtain a unified partial order relationship to construct training data. The number of training parameters is smaller than that of the large language model, so that the output of the resource ranking model matches the user's preferences in multiple partial order dimensions, improving the accuracy of resource ranking, thereby providing users with resources that are more in line with their needs, and reducing the computational overhead of online ranking.
[0013] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0014] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0015] Figure 1 A schematic diagram of an exemplary system in which the various methods described herein may be implemented according to embodiments of the present disclosure is shown; Figure 2 A flowchart illustrating a training method for a resource ranking model according to an embodiment of the present disclosure is shown; Figure 3 A flowchart illustrating the process of fine-tuning a large language model according to an embodiment of the present disclosure is shown; Figure 4 A flowchart illustrating the process of generating multiple sets of target partial-order data according to embodiments of the present disclosure is shown; Figure 5 A flowchart illustrating the fusion process according to an embodiment of the present disclosure is shown; Figure 6 A flowchart of a resource recommendation method according to an embodiment of the present disclosure is shown; Figure 7 A flowchart of a resource recommendation method according to an embodiment of the present disclosure is shown; Figure 8 A structural block diagram of a training apparatus for a resource ranking model according to an embodiment of the present disclosure is shown; Figure 9 A structural block diagram of a resource recommendation apparatus according to an embodiment of the present disclosure is shown; Figure 10 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0016] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0017] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.
[0018] The terminology used in the description of the various examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.
[0019] In related technologies, resource ranking models are usually trained based on users' historical behavior signals, but their accuracy in predicting users' actual browsing intentions is limited.
[0020] To address the aforementioned issues, this disclosure fine-tunes a large language model based on multiple sets of sample partially ordered data. The fine-tuned model then generates multiple sets of target partially ordered data across various partially ordered dimensions. These sets of target partially ordered data are fused to obtain a unified partially ordered relationship, which is then used to construct training data. This training model uses fewer parameters than the large language model, ensuring that its output matches user preferences across multiple partially ordered dimensions. This improves the accuracy of resource ranking, providing users with resources that better match their needs and reducing the computational overhead of online ranking.
[0021] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0022] Figure 1A schematic diagram of an exemplary system 100 in which the various methods and apparatus described herein can be implemented according to embodiments of this disclosure is shown. Reference Figure 1 The system 100 includes one or more client devices 101, 102, 103, 104, 105 and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105 and 106 can be configured to execute one or more applications.
[0023] In embodiments of this disclosure, server 120 may run one or more services or software applications that enable the execution of the methods of this disclosure.
[0024] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtual and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, such as to users of client devices 101, 102, 103, 104, 105 and / or 106 under a Software as a Service (SaaS) model.
[0025] exist Figure 1 In the configuration shown, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or combinations thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 can sequentially interact with server 120 using one or more client applications to utilize the services provided by these components. It should be understood that various different system configurations are possible and may differ from system 100. Therefore, Figure 1 This is an example of a system used to implement the various methods described herein, and is not intended to be limiting.
[0026] Users can use client devices 101, 102, 103, 104, 105, and / or 106 for human-computer interaction. The client devices provide interfaces that enable users to interact with them. The client devices can also output information to the user through these interfaces. Although... Figure 1 Only six client devices are described, but those skilled in the art will understand that this disclosure can support any number of client devices.
[0027] Client devices 101, 102, 103, 104, 105, and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors, or other sensing devices. These computer devices can run various types and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as Google Chrome OS); or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablets, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. Client devices are capable of executing various applications, such as various internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and can use various communication protocols.
[0028] Network 110 can be any type of network well known to those skilled in the art, and can support data communication using any of a variety of available protocols (including but not limited to TCP / IP, SNA, IPX, etc.). By way of example only, one or more networks 110 can be a local area network (LAN), an Ethernet-based network, a token ring network, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0029] Server 120 may include one or more general-purpose computers, special-purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running a virtual operating system, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for servers). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0030] The computing unit in server 120 can run one or more operating systems, including any of the aforementioned operating systems and any commercially available server operating system. Server 120 can also run any of a variety of additional server applications and / or middleware applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0031] In some implementations, server 120 may include one or more applications to analyze and merge data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105 and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105 and / or 106.
[0032] In some implementations, server 120 can be a server for a distributed system or a server integrated with blockchain. Server 120 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in the cloud computing service system, designed to address the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.
[0033] System 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. Databases 130 may reside in various locations. For example, a database used by server 120 may be local to server 120, or it may be located away from server 120 and may communicate with server 120 via a network-based or dedicated connection. Databases 130 may be of different types. In some embodiments, the database used by server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data from and from the databases in response to commands.
[0034] In some embodiments, one or more of the databases 130 may also be used by an application to store application data. The databases used by the application may be of different types, such as key-value stores, object stores, or regular stores supported by a file system.
[0035] Figure 1The system 100 can be configured and operated in various ways to enable the application of the various methods and apparatus described in this disclosure.
[0036] The embodiments of this disclosure can be applied to various scenarios of recommending resources to users. For example, resources can be content data such as short videos, text content, graphic information, audio, and video. Accordingly, the embodiments of this disclosure can be applied to the sorting stage in scenarios such as short video recommendation, news feed recommendation, and audio / video content recommendation. The aforementioned resources can exist in the form of content data and its attribute data. The attribute data of the resources can include the content category and publication time of the resources. Multi-source information can include attribute data and behavioral data associated with users, such as user profile data, query text data generated in search scenarios, and behavioral data generated by user interaction with resources. Sample partial-order data can be generated based on collected user interaction behavior data. Interaction behavior data can include behavioral signals representing interactive behaviors such as display, swiping, clicking, and viewing duration.
[0037] The training method described below uses the above data as the processing object in each step. By encoding, generating partial order, fusion processing and training the model, the predicted score of the resource ranking model obtained by training is consistent with the preferences reflected by the user interaction behavior data, thereby improving the accuracy of resource ranking.
[0038] According to one aspect of this disclosure, a method for training a resource ranking model is provided. Figure 2 This is a flowchart illustrating a training method 200 for a resource ranking model according to an exemplary embodiment.
[0039] Method 200 involves a large language model and a resource ranking model. The large language model is a neural network model with natural language understanding and generation capabilities, pre-trained on a large-scale corpus. The resource ranking model is used to rank resources by outputting predicted scores, and its parameter count is smaller than that of the large language model. Method 200 uses partially ordered data generated by a fine-tuned large language model to construct training data, and then trains the resource ranking model, thus transferring the reasoning ability of the large language model to the resource ranking model with a smaller parameter count.
[0040] refer to Figure 2 In step S201, multiple sets of sample partial order data are obtained. Each set of sample partial order data represents the relative priority of multiple sample resources in one of the preset multiple partial order dimensions.
[0041] Sample resources refer to resources selected from historical recommendation business data. For example, sample resources can be content items previously displayed to users in an information flow recommendation system. Relative priority describes the order of two resources. Partially ordered data records relative priorities in the form of resource pairs; a single piece of partially ordered data indicates that one resource in a resource pair has a higher priority than the other. A partially ordered dimension refers to the perspective used to evaluate the relative priority between resources. Different partially ordered dimensions characterize the value of resources to users from different angles, and the relative priority of the same resource pair can differ across different partially ordered dimensions. Each set of sample partially ordered data corresponds to one of multiple partially ordered dimensions; that is, the relative priority represented by this set of sample partially ordered data is valid on its corresponding partially ordered dimension. In some embodiments, each set of sample partially ordered data can carry a dimension identifier, which indicates the partially ordered dimension corresponding to that set of sample partially ordered data.
[0042] In some embodiments, sample partial order data can be automatically generated based on real user behavior data. Specifically, for a certain partial order dimension, behavioral signals corresponding to that partial order dimension can be selected from behavior logs, and the relative priority of sample resources on that partial order dimension can be determined based on the intensity of behavioral signals on different sample resources in the same request. In an exemplary embodiment, for a partial order dimension representing the degree of matching between resources and user interests, the relative priority of sample resources clicked by the user in the same request can be determined to be higher than that of sample resources not clicked, and a set of sample partial order data on that partial order dimension can be generated accordingly. Sample partial order data can also be obtained through other methods such as manual annotation, and this disclosure does not limit the method of obtaining sample partial order data.
[0043] In step S202, the large language model is fine-tuned based on multiple sets of sample partial order data.
[0044] Fine-tuning refers to further training a pre-trained large language model using partially ordered sample data, adjusting at least some of its parameters to enable the fine-tuned model to output partially ordered data between resources based on input information along the partially ordered dimension. Since each set of partially ordered sample data corresponds to a single partially ordered dimension, the large language model learns to predict the relative priority between sample resources group by group during fine-tuning. Multiple sets of partially ordered sample data collectively cover multiple partially ordered dimensions, thus enabling the fine-tuned large language model to perform partially ordered predictions in each of the multiple partially ordered dimensions.
[0045] In some embodiments, fine-tuning can be based on a loss function that represents the difference between the partial order prediction results of the large language model for sample resources and the relative priority represented by the partial order data of the samples. The parameters of the large language model are adjusted by minimizing the loss function. In some embodiments, a parameter-efficient fine-tuning method can be adopted, that is, freezing the basic parameters of the large language model obtained through pre-training and training only a small number of additional parameters. In an exemplary embodiment, a low-rank adaptive approach can be used for fine-tuning, and the low-rank weights are merged into the large language model after training to obtain the fine-tuned large language model.
[0046] In step S203, the fine-tuned large language model is used to process the multi-source information of historical users and multiple historical resources to obtain multiple sets of target partial order data of multiple historical resources in multiple partial order dimensions.
[0047] Historical users refer to users who have used the recommendation service and generated behavioral data within a historical time period. Historical resources refer to resources associated with historical users that are to be used to generate partially ordered data. For example, historical resources may be resources that were shown to the historical user within a historical time period, or resources that can be recommended to the historical user. Multi-source information refers to user-related information from multiple information sources. In some embodiments, multi-source information may include information describing user attributes and information describing user behavior.
[0048] In some embodiments, multi-source information of historical users and resource information of multiple historical resources can be constructed into prompt information. This prompt information is input into a fine-tuned large language model, which then outputs target partial order data for multiple historical resources across various partial order dimensions. Similar to the sample partial order data, each set of target partial order data corresponds to a partial order dimension. Unlike the fine-tuning stage where each set of sample partial order data corresponds to only a single partial order dimension, in this step, the fine-tuned large language model generates a set of target partial order data for each of the multiple partial order dimensions for the same batch of historical resources. In one exemplary embodiment, the partial order dimension can be specified in the prompt information. By specifying different partial order dimensions, target partial order data corresponding to each of the multiple partial order dimensions can be obtained. In another exemplary embodiment, the fine-tuned large language model responds to a single input and outputs the target partial order data corresponding to each of the multiple partial order dimensions at once.
[0049] In step S204, multiple sets of target partial order data on multiple partial order dimensions are fused to obtain a unified partial order relationship between multiple historical resources, and training data is constructed based on the unified partial order relationship.
[0050] Because different partial order dimensions characterize the relative priority between resources from different perspectives, the relative priority directions of the same resource pair may be consistent or inconsistent across different partial order dimensions. Fusion processing is used to integrate target partial order data across multiple partial order dimensions to determine a unified relative priority among multiple historical resources, resulting in a unified partial order relationship. In a unified partial order relationship, the relative priorities among multiple historical resources are self-consistent, and there are no resource pairs with contradictory directions. When the relative priority directions of the same resource pair are inconsistent across different partial order dimensions, fusion processing determines a unique direction for that resource pair within the unified partial order relationship.
[0051] In some embodiments, constructing training data based on a unified partial order relation may include training data that expands the unified partial order relation into resource pairs, with each training data pair including a resource pair and the relative priority direction of that resource pair. In some embodiments, multi-source information of corresponding historical users may also be associated with resource pairs and recorded in the training data to provide user context when training the resource ranking model.
[0052] In step S205, the resource ranking model is trained using training data. The resource ranking model has fewer parameters than the large language model. The resource ranking model is used to rank multiple candidate resources based on the target user's multi-source information.
[0053] The input to the resource ranking model can include user features determined based on multi-source information about users and resource features of resources. The output of the resource ranking model is a predicted score for each resource. In some embodiments, training can be performed in pairs. Specifically, for each resource pair in the training data, the resource ranking model outputs the predicted scores of the two historical resources in that pair. Based on the two predicted scores and the relative priority direction of the resource pair, a loss is determined. By minimizing the loss, the resource ranking model is prompted to output higher predicted scores for historical resources with higher relative priority. Thus, the inference results of the large language model carried by the unified partial order relation are transferred to the resource ranking model.
[0054] In an exemplary embodiment, the loss used to train the resource ranking model can be determined by the following formula: L distill = Σ{(r a >r b )∈O } max(0, s'(r b ) – s'(r a ) + margin d ) Among them, O Represents a uniform partial order relation, r a >r bRepresents the historical resource r in a unified partial order relation. a Its relative priority is higher than that of historical resources. b ,s'(r a ), s'(r b ) represent the resource ranking model for historical resources r respectively. a Historical resources b Predicted score, margin d This is the interval hyperparameter. When the estimated score of a historical resource with a relatively higher priority exceeds the estimated score of a historical resource with a relatively lower priority, and the difference reaches the interval hyperparameter, the loss of the corresponding resource's contribution is zero.
[0055] Where, Σ{(r a >r b )∈O } represents the relationship between the unified partial order relation O. The resource pairs recorded in the table are summed, that is, each historical resource r in the unified partial order relation is traversed. a Its relative priority is higher than that of historical resources. b For each resource pair, the corresponding loss items are summed to obtain the loss.
[0056] In some embodiments, the interval hyperparameter can take a fixed value. In other embodiments, the interval hyperparameter can be positively correlated with the partial order strength of the corresponding resource pair, which can be determined based on the difference in importance scores of the corresponding resource pairs, so that resource pairs with large importance score differences are constrained to have larger predicted score differences during training.
[0057] After the resource ranking model is trained, it is used to rank multiple candidate resources based on multi-source information from the target user. The target user refers to the user who initiates the recommendation request when actually providing the recommendation service; they can also be called online users. For the recommendation request from the target user, the trained resource ranking model outputs a predicted score for each candidate resource based on the target user's multi-source information and the multiple candidate resources. The predicted score is used to determine the ranking of the multiple candidate resources.
[0058] In some embodiments, method 200 can perform updates periodically. Specifically, it can collect behavioral data of online users towards recommended resources after the resource ranking model is launched, update the sample partial order data based on the newly added behavioral data, fine-tune the large language model based on the updated sample partial order data, and regenerate the target partial order data using the fine-tuned large language model and retrain the resource ranking model. Through periodic updates, the large language model and the resource ranking model adapt to changes in user preferences over time.
[0059] According to one or more embodiments of this disclosure, this disclosure fine-tunes a large language model based on multiple sets of sample partial order data, uses the fine-tuned large language model to generate multiple sets of target partial order data in multiple partial order dimensions, and fuses the multiple sets of target partial order data to obtain a unified partial order relationship to construct training data. The number of training parameters is smaller than that of the large language model, so that the output of the resource ranking model matches the user's preferences in multiple partial order dimensions, improving the accuracy of resource ranking, thereby providing users with resources that are more in line with their needs, and reducing the computational overhead of online ranking.
[0060] Specifically, each set of sample partial order data represents the relative priority in a single partial order dimension. The large language model, fine-tuned based on such samples, can generate target partial order data for each partial order dimension for the same batch of historical resources, thereby explicitly expressing the multi-dimensional preferences contained in the user's multi-source information as the relative priority between resources. The fusion processing normalizes the target partial order data in multiple partial order dimensions into a unified partial order relation, providing a single and mutually compatible supervision signal for the resource ranking model. The training data constructed with this unified partial order relation trains the resource ranking model, enabling the multi-dimensional inference results of the large language model to be transferred to the resource ranking model with fewer parameters. In the online ranking stage, only the resource ranking model needs to be run without calling the large language model, which reduces the computational overhead and response latency of online inference while maintaining the ranking accuracy.
[0061] Figure 3 A flowchart of a process 300 for fine-tuning a large language model according to an exemplary embodiment of the present disclosure is shown. Process 300 can be used to implement step S202 in the method 200 described above. Figure 3 As shown, process 300 may include: step S301, for each group of sample partial order data, using a large language model, processing based on the multi-source information of the corresponding sample user and the corresponding multiple sample resources to generate an output word sequence; step S302, based on the output word sequence, determining the partial order score for the corresponding multiple sample resources; step S303, based on the output word sequence and the partial order score, determining the joint loss; and step S304, based on the joint loss, fine-tuning the large language model.
[0062] Therefore, by determining the partial order score based on the output lexical sequence and constructing a joint loss accordingly, the large language model is supervised at both the lexical and partial order levels during fine-tuning, thereby improving the accuracy of the partial order data output by the fine-tuned large language model.
[0063] Sample users refer to the users corresponding to the sample partial order data. The multi-source information of sample users and multiple sample resources together constitute the input of the large language model, enabling the partial order scoring to be performed in a specific user context. In some embodiments, the multi-source information of sample users, the resource information of multiple sample resources, and the partial order dimension to be predicted can be organized into prompt information according to a preset template. The prompt information is input into the large language model, which then generates the output word sequence word by word in an autoregressive manner.
[0064] In some embodiments, determining the partial order score based on the output lexical sequence may include parsing the numerical values corresponding to each of the multiple sample resources from the output lexical sequence and using these numerical values as the partial order score of the corresponding sample resource. In other embodiments, the output lexical sequence indicates the order of the multiple sample resources, and the partial order score can be determined based on the position of the sample resource in the order, with higher partial order scores for sample resources that are placed earlier in the order.
[0065] In some embodiments, during fine-tuning, the pre-trained base parameters of the large language model can be frozen, and only the additional low-rank parameters can be trained. After fine-tuning, the low-rank parameters are merged back into the base parameters. In one exemplary embodiment, the low-rank dimension of the low-rank parameters is 16, and the scaling factor is 32.
[0066] According to some embodiments, step S303, determining the joint loss based on the output word sequence and the partial order score, may include (not shown in the figure): determining the language modeling loss based on the output word sequence, wherein the language modeling loss characterizes the semantic understanding and generation capabilities of the large language model; determining the partial order prediction loss based on the partial order score and the sample partial order data, wherein the partial order prediction loss characterizes the degree of deviation between the partial order score and the relative priority characterized by the sample partial order data; and determining the joint loss based at least on the language modeling loss and the partial order prediction loss.
[0067] Therefore, the language modeling loss constrains the large language model to maintain its semantic understanding and generation capabilities, while the partial order prediction loss constrains the large language model to correctly predict relative priorities. The combination of the two improves the accuracy of the fine-tuned large language model in partial order prediction while maintaining its language capabilities.
[0068] The language modeling loss is determined based on the deviation of the output lexical sequence from the ground truth lexical sequence, which can be constructed based on the relative priority represented by the sample partial order data. During fine-tuning, if the parameter updates of the large language model are only driven by supervision at the partial order level, it may be biased towards the partial order prediction task, thus degrading the semantic understanding and generation capabilities obtained through pre-training. This, in turn, affects the understanding of multi-source information by the fine-tuned large language model and the reliability of the generated partial order data. The language modeling loss suppresses the above degradation by constraining the generation quality at the lexical level.
[0069] In some embodiments, the language modeling loss can be determined based on the difference between the lexical probability distributions output by the fine-tuned large language model and the pre-trained large language model for the same input. The greater the difference, the greater the language modeling loss, thereby constraining the output distribution of the fine-tuned large language model from deviating excessively from the pre-trained large language model. In other embodiments, the language modeling loss can be calculated only for the lexical components in the output lexical sequence that are related to the partial order conclusion, thereby reducing the computational cost of loss calculation.
[0070] The partial order prediction loss is determined based on the deviation between the partial order score and the relative priority represented by the sample partial order data. For resource pairs recorded in the sample partial order data, when the partial order score of the sample resource with higher relative priority is not higher than that of the sample resource with lower relative priority, it indicates that the partial order prediction of the large language model does not match the label, and the corresponding loss term increases. By minimizing the partial order prediction loss during fine-tuning, the large language model is prompted to output a higher partial order score for the sample resource with higher relative priority.
[0071] In some embodiments, the partial order prediction loss can be a pairwise loss in logarithmic form. For each resource pair, a loss term is determined based on the difference in the partial order scores of the sample resource with relatively lower priority and the sample resource with relatively higher priority; the larger the difference, the larger the loss term. The partial order prediction loss is obtained by summing the loss terms for each resource pair.
[0072] In some embodiments, determining the joint loss based at least on the language modeling loss and the partial order prediction loss may include a weighted sum of the language modeling loss and the partial order prediction loss, wherein the weights of each loss are preset hyperparameters. By adjusting the weights of each loss, the training emphasis of the large language model between semantic capability preservation and partial order prediction can be balanced.
[0073] According to some embodiments, the language modeling loss can be determined by the following formula: L lm = - Σ t log P(y t | y <t , X) Where X represents the input prompt information of the large language model, the prompt information including the multi-source information of the corresponding sample user and the corresponding multiple sample resources, y t Let y represent the t-th target word element output by the large language model. <t This represents the sequence of output tokens preceding the t-th target token.
[0074] P(y t | y <t, X) denotes the t-th target token y output by the large language model under the condition of the given prompt information X and the output token sequence y<t before the t-th target token t The probability of. Σ t denotes summing over the serial number t of the target token, where the value of t ranges from 1 to the length of the ground-truth token sequence, that is, the language modeling loss is the sum of the negative logarithms of the generation probability of each target token over the entire ground-truth token sequence.
[0075] Accordingly, the generation probability of each target token is constrained in an autoregressive manner, which preserves the semantic understanding and generation capabilities of the fine-tuned large language model.
[0076] In some embodiments, the target token refers to a token in the ground-truth token sequence for supervising the output of the large language model, and the ground-truth token sequence may be constructed according to the relative priority represented by the sample partial order data. For example, the ground-truth token sequence may be a token sequence corresponding to a text that records the precedence relationship of sample resources according to the relative priority.
[0077] According to some embodiments, the partial order prediction loss may be determined by the following formula: L rank = Σ (ri>rj) max(0, s(r j ) - s(r i ) + margin) where s(r i ), s(r j ) respectively denote the partial order scores of the sample resource r by the large language model i and the sample resource r j , r i >r j denotes that the sample partial order data represents that the relative priority of the sample resource r i is higher than that of the sample resource r j , and margin is the partial order margin hyperparameter.
[0078] where Σ(r i >r j ) denotes summing over the resource pairs recorded in the sample partial order data, that is, traversing each resource pair in the sample partial order data that satisfies that the relative priority of the sample resource r i is higher than that of the sample resource r j , and accumulating the loss terms corresponding to each resource pair to obtain the partial order prediction loss.
[0079] Accordingly, a loss is generated when the partial order score of the sample resource with a higher relative priority does not exceed the partial order score of the sample resource with a lower relative priority by the partial order margin, which prompts the large language model to distinguish sample resources with a score gap no less than the partial order margin, and improves the discrimination degree of partial order prediction.
[0080] In some embodiments, the partial order interval hyperparameter can take a fixed positive value. The larger the value of the partial order interval hyperparameter, the higher the requirement for fine-tuning the score difference between sample resources with different relative priorities. In this embodiment, the summation iterates through each resource pair recorded in the sample partial order data. For each resource pair, the loss contribution of that resource pair is zero only when the partial order score of the sample resource with higher relative priority is higher than the partial order score of the sample resource with lower relative priority and the difference reaches the partial order interval.
[0081] According to some embodiments, determining the joint loss based on the output lexical sequence and partial order score may further include (not shown in the figure): determining sample resource triples in the corresponding multiple sample resources; and determining the partial order consistency loss based on the partial order score for the sample resource triples, wherein the partial order consistency loss characterizes the degree to which the partial order prediction of the large language model violates transitivity, wherein the joint loss is determined based on the language modeling loss, the partial order prediction loss and the partial order consistency loss.
[0082] Therefore, the partial order consistency loss suppresses transitivity-violation partial order predictions, including cyclic partial orders, and improves the self-consistency of the partial order data output by the fine-tuned large language model.
[0083] In some embodiments, determining sample resource triples among corresponding multiple sample resources may include selecting three sample resources with progressively decreasing scores based on the partial order scores of the large language model. In an exemplary embodiment, resource combinations among the corresponding multiple sample resources are traversed, and resource combinations that satisfy the condition that the partial order score of the first sample resource is higher than that of the second sample resource, and the partial order score of the second sample resource is higher than that of the third sample resource, are determined as sample resource triples. Cyclic partial order refers to the situation where the relative priorities of multiple resources form a loop. When cyclic partial order exists, it is impossible to determine the order of resources based on relative priorities.
[0084] According to some embodiments, the partial order consistency loss can be determined by the following formula: L consistency = Σ (i,j,k) max(0, s(r k ) - s(r i ) + margin c ) Where (i,j,k) represents the sample resource r i The partial order score is higher than the sample resource r j And sample resources r j The partial order score is higher than the sample resource r k The sample resource triple, s(r) i ), s(rk ) respectively represent the large language model's response to sample resource r i Sample resources r k Partial order scoring, margin c As a consistency interval hyperparameter, this term is used to constrain the sample resources r at both ends of the partial order transit chain. i With r k The difference in partial order scores between them is not less than the consistency interval.
[0085] Where Σ(i,j,k) represents the summation of the sample resource triples, that is, iterating through the multiple corresponding sample resources, each satisfying the sample resource r i The partial order score is higher than the sample resource r j And sample resources r j The partial order score is higher than the sample resource r k The sample resource triples are summed to obtain the partial order consistency loss.
[0086] Therefore, by constraining the scoring difference between the sample resources at both ends of the transmission chain to be no less than the consistency interval, sufficient scoring differentiation is obtained between sample resources with relatively large priorities, thereby improving the ability of partial order scoring to characterize the differences in relative priorities.
[0087] Unlike partial order prediction loss, which only constrains resource pairs directly recorded in the sample partial order data, partial order consistency loss further constrains sample resource pairs indirectly associated through intermediate sample resources, thus providing additional supervision on resource pairs not directly recorded in the sample partial order data.
[0088] In some embodiments, the consistency interval hyperparameter can have the same value as the partial order interval hyperparameter, or it can be set independently. In the joint loss, the partial order consistency loss can be a weighted sum of the language modeling loss and the partial order prediction loss, with the weights corresponding to the partial order consistency loss being preset hyperparameters.
[0089] According to some embodiments, the multiple partial order dimensions may include at least two of the following: interest matching degree dimension, penetration potential dimension, content quality dimension, and timeliness dimension.
[0090] Therefore, by characterizing the relative priority of resources from at least two perspectives—the degree of matching between resources and user interests, the tendency of user behavior to leap to a higher level of activity, the quality of the resources themselves, and the freshness of the resources—the richness of the dimensions by which target partially ordered data characterizes user preferences is enhanced.
[0091] In some embodiments, the interest matching dimension can be used to characterize the degree of matching between resources and user interests; the penetration potential dimension can be used to characterize the tendency of resources to prompt user behavior to leap to a higher level of activity. The higher the likelihood that a user will leap from shallow behavior to deep behavior in response to a corresponding resource, the higher the relative priority of that resource in the penetration potential dimension; the content quality dimension can be used to characterize the quality of the resource itself; and the timeliness dimension can be used to characterize the freshness of the resource.
[0092] In some embodiments, sample partial order data for different partial order dimensions can be generated based on different behavioral signals. For example, sample partial order data for the interest matching dimension can be generated based on click behavior, sample partial order data for the content quality dimension can be generated based on dwell time, sample partial order data for the timeliness dimension can be generated based on the release time of the resource, and sample partial order data for the penetration potential dimension can be generated based on the jump records of user behavior levels.
[0093] Figure 4 A flowchart illustrating a process 400 for generating multiple sets of target partially ordered data according to an exemplary embodiment of the present disclosure is shown. Process 400 can be used to implement step S203 in the method 200 described above. Figure 4 As shown, process 400 may include: step S401, performing structured encoding on multi-source information of historical users to obtain user encoding information; step S402, inputting the user encoding information into a fine-tuned large language model to generate a set of potential interest domains of historical users; and step S403, using the fine-tuned large language model, based on the set of potential interest domains and multiple historical resources, to obtain multiple sets of target partial order data.
[0094] Therefore, the fine-tuned large language model first infers the set of potential interest domains based on user coding information, and then generates target partial order data based on the set of potential interest domains. This makes the generation of target partial order data based on explicitly inferred user interests, thereby improving the matching degree between target partial order data and historical user preferences.
[0095] In some embodiments, structured encoding may include organizing information from multiple sources into structured text according to a preset template to obtain user-encoded information. The set of potential interest domains includes multiple interest domains that may be inferred from historical user data.
[0096] In some embodiments, each interest domain in the set of potential interest domains may correspond to a confidence score, which represents the likelihood that a historical user is interested in that interest domain.
[0097] In some embodiments, obtaining multiple sets of target partial order data based on a set of potential interest domains and multiple historical resources using a fine-tuned large language model may include: inputting the resource information of the set of potential interest domains and multiple historical resources into the fine-tuned large language model, and having the fine-tuned large language model generate corresponding target partial order data on each partial order dimension according to the degree of relevance between each historical resource and the interest domain in the set of potential interest domains.
[0098] According to some embodiments, the multi-source information of historical users may include at least two of the following: historical user profiles, historical search query text sets, and historical user behavior sequences.
[0099] Therefore, by comprehensively utilizing the above-mentioned multi-source information, the comprehensiveness of the information on which the inference of potential interest domain sets is based is improved.
[0100] In some embodiments, historical user profiles include information describing historical user attributes. For example, a historical user profile may include at least one of gender, age, and life stage. A collection of historical search query texts includes query text entered by historical users in search scenarios. A sequence of historical user behavior includes records of historical user behavior organized chronologically. For example, a sequence of historical user behavior may include a sequence of identifiers for resources clicked by historical users.
[0101] Figure 5 A flowchart of a fusion processing procedure 500 according to an exemplary embodiment of the present disclosure is shown. Procedure 500 can be used to implement step S204 in the method 200 described above. Figure 5 As shown, process 500 may include: step S501, determining the dimension score of each of the multiple historical resources on the partial order dimension based on a set of target partial order data on each partial order dimension; step S502, performing a weighted summation of the dimension scores of the multiple historical resources based on the dimension weights of the multiple partial order dimensions to obtain the importance score of each of the multiple historical resources; and step S503, sorting the multiple historical resources based on the corresponding importance scores to obtain a unified partial order relationship.
[0102] Therefore, the target partial order data on each partial order dimension is transformed into comparable dimension scores and weighted summed. A unified partial order relationship is determined based on the magnitude of the importance scores, so that the relative priorities with inconsistent directions on different partial order dimensions are uniformly oriented according to the importance scores, thereby improving the self-consistency of the unified partial order relationship.
[0103] In some embodiments, step S501, determining the dimension score based on a set of target partial order data, may include: determining the order of multiple historical resources on the corresponding partial order dimension according to the relative priority represented by the set of target partial order data, and assigning a dimension score to each historical resource according to the order, with the historical resource ranked earlier corresponding to a higher dimension score. In other embodiments, the target partial order data carries the score output by the fine-tuned large language model, and this score can be used as the dimension score on the corresponding partial order dimension.
[0104] In some embodiments, dimensional weights can be set based on business objectives or the activity level of historical users, with different combinations of dimensional weights set for historical users with different activity levels. In an exemplary embodiment, multiple partially ordered dimensions include an interest matching dimension, a penetration potential dimension, a content quality dimension, and a timeliness dimension. The importance score is represented as the sum of the products of each dimension score and its corresponding dimensional weight; that is, the importance score equals the sum of the products of the dimensional weights and corresponding dimensional scores of the interest matching dimension, the penetration potential dimension, the content quality dimension, and the timeliness dimension.
[0105] In some embodiments, when the relative priority directions of the same resource pair are inconsistent across different partial order dimensions, the direction of the resource pair in the unified partial order relation is determined based on the magnitude relationship of the importance scores of the two historical resources in the resource pair. Since the importance score is a scalar corresponding to each historical resource, there is no cyclic partial order in the unified partial order relation obtained by sorting based on the importance score.
[0106] In other embodiments, the target partial order data can also be obtained by a fine-tuned large language model that determines the relative priority direction of each pair of historical resources. The target partial order data obtained through this pairwise determination may contain transitivity violations, including cyclic partial orders. Consistency checks can be performed on the target partial order data before fusion processing to detect cyclic partial orders and eliminate them by deleting at least one partial order record from the cycle, resulting in consistent target partial order data before fusion processing. For example, consistency checks can be performed by the fine-tuned large language model, i.e., the generated target partial order data is input back into the fine-tuned large language model, which then detects and corrects partial order records that violate transitivity.
[0107] According to some embodiments, the method may further include (not shown in the figure): constructing a partial order of behavior samples based on the behavior hierarchy of historical users on multiple historical resources, wherein the behavior hierarchy includes, from low to high, the un-scrolled display hierarchy, the scrolled but un-clicked hierarchy, the clicked shallow browsing hierarchy, and the deep viewing hierarchy, wherein the resource ranking model is jointly trained using training data and the partial order of behavior samples.
[0108] Therefore, the behavioral partial order samples provide relative priority supervision based on the hierarchical differences of real behaviors, and together with the training data constructed based on the unified partial order relation, they train the resource ranking model, thereby improving the matching degree between the predicted score of the resource ranking model and the user's real behavioral preferences.
[0109] In some embodiments, the "unswipe" level indicates that a resource is displayed but the user does not swipe; the "swipe-but-not-click" level indicates that the user swipes to the resource but does not click; the "click-and-short-view" level indicates that the user clicks on the resource but browses it only superficially; and the "deep-view" level indicates that the user engages in deep viewing of the resource. The higher the user's behavior level for a resource, the higher their satisfaction with that resource.
[0110] In some embodiments, constructing a behavioral partial order sample may include: for two historical resources in the same request, when the behavioral hierarchy of a historical user towards one historical resource is higher than that towards the other, constructing a behavioral partial order sample representing that the former has a higher relative priority than the latter. In some embodiments, the behavioral partial order sample may correspond to a partial order strength, which is determined based on the combination of the behavioral hierarchy of the two historical resources.
[0111] In some embodiments, the partial order strength of a behaviorally biased sample can be determined based on the weights corresponding to the activity group to which the historical user belongs. Specifically, historical users can be divided into multiple activity groups based on their activity level. For each activity group, a correspondence between behavioral hierarchy combinations and weights is established. The partial order strength of a behaviorally biased sample is taken as the weights corresponding to the combinations of the two behavioral levels involved in the sample within the activity group to which the historical user belongs. For different activity groups, the same behavioral hierarchy combination can correspond to different weights, thereby enabling differentiated modeling of the preference differences of historical users with different activity levels.
[0112] In some embodiments, for low-activity groups, a higher weight can be assigned to the behavioral level combination corresponding to the transition from displaying an unswipe level to swiping an unclicked level, so that the signal of low-activity historical users transitioning from shallow behavior to deeper behavior is given more importance during training.
[0113] In some embodiments, co-training may include: determining a first loss based on training data, determining a second loss based on behavioral partial order samples, and training a resource ranking model by jointly using the first and second losses. For example, the first and second losses may be weighted and summed, and the parameters of the resource ranking model may be adjusted by minimizing the result of the weighted sum.
[0114] In some embodiments, determining the second loss based on behaviorally partially ordered samples may include: for each behaviorally partially ordered sample, determining a loss term based on the difference between the estimated scores of historical resources with relatively lower and higher priorities in that sample, using the resource ranking model; weighting the loss term by the partial order strength of the sample; and summing the weighted loss terms for each behaviorally partially ordered sample to obtain the second loss. For example, the loss term may be a pairwise loss in logarithmic form, with a larger difference in estimated scores resulting in a larger loss term. By minimizing the second loss, the resource ranking model is prompted to output higher estimated scores for historical resources with higher behavioral levels, and behaviorally partially ordered samples with higher partial order strength have a greater impact on parameter updates.
[0115] In real-world recommendation scenarios, the display position of resources can influence user behavior. For example, resources displayed more prominently are more likely to elicit interaction, and the resulting partial order samples of behavior may contain biases caused by differences in display position, rather than simply reflecting the user's true preferences. In some embodiments, when constructing partial order samples of behavior, the samples can be built only for historical resources within the same display position range, ensuring that the historical resources being compared have similar display positions, thereby reducing the impact of display position differences on the partial order samples of behavior. The display position range can be obtained by dividing the display position into segments.
[0116] In other embodiments, the display position features of historical resources can be used as a bias term in joint modeling with the resource ranking model during training. Specifically, during the training phase, the display position features are input into a bias branch independent of the main structure of the resource ranking model. The output of the bias branch and the estimated score output by the main structure of the resource ranking model are used together in the loss calculation, so that the influence of display position on user behavior is borne by the bias branch. After training, when ranking candidate resources, the output of the bias branch is not used; ranking is performed only based on the estimated score output by the main structure of the resource ranking model, thereby eliminating the influence of display position bias during the ranking phase.
[0117] Figure 6 A flowchart of a resource recommendation method 600 according to an exemplary embodiment of the present disclosure is shown. Figure 6 As shown, method 600 may include: step S601, obtaining multi-source information of the target user and multiple candidate resources; step S602, using a resource ranking model, processing the multiple candidate resources based on the multi-source information of the target user to obtain the estimated scores of each of the multiple candidate resources, wherein the resource ranking model is trained according to the above-mentioned resource ranking model training method; and step S603, ranking the multiple candidate resources based on the estimated scores, and recommending resources to the target user according to the ranking results.
[0118] Therefore, by using a resource ranking model with fewer parameters than a large language model to rank candidate resources, the recommendation process does not need to call the large language model, thus reducing the computational cost of online recommendation while maintaining ranking accuracy.
[0119] In some embodiments, the meaning and composition of the target user's multi-source information can be referred to the description of the historical user's multi-source information above. Candidate resources refer to resources to be ranked in response to the target user's recommendation request. In some embodiments, multiple candidate resources can be a set of resources obtained through recall. In some embodiments, processing multiple candidate resources using a resource ranking model can include: inputting user characteristics determined based on the target user's multi-source information and the resource characteristics of each candidate resource into the resource ranking model, and having the resource ranking model output a predicted score for each candidate resource.
[0120] In some embodiments, recommending resources to a target user based on the ranking result may include selecting at least one resource that ranks highly from a plurality of candidate resources according to the ranking result, and pushing the selected resource to the terminal corresponding to the target user.
[0121] Figure 7 A flowchart of a resource recommendation method 700 according to an exemplary embodiment of the present disclosure is shown. The operations and effects of steps S701, S702, and S705 in method 700 can be referred to the description of steps S601 to S603 in method 600 above, and will not be repeated here. Figure 7 As shown, method 700 may further include: step S703, in response to determining that the number of active days of the target user does not exceed a preset threshold, extracting interest categories and confidence levels of interest categories from the target user's search behavior data using a large language model; and step S704, for candidate resources belonging to interest categories among multiple candidate resources, determining a weighting factor based on confidence level and time decay function, and adjusting the estimated score of the candidate resource using the weighting factor, wherein step S705, ranking multiple candidate resources based on the estimated score, may include: ranking multiple candidate resources based on the adjusted estimated score.
[0122] Therefore, for target users whose active days do not exceed a preset threshold, their search behavior data is used to supplement interest information and adjust the estimated scores of corresponding candidate resources. This alleviates the ranking inaccuracies caused by the scarcity of behavioral data for such users and improves the accuracy of resource ranking for such users.
[0123] Active days refer to the number of days a target user uses the recommendation service within a preset statistical period. In some embodiments, interest categories can be first-level content categories in a preset classification system. Extracting interest categories from search behavior data using a large language model can include: inputting the target user's search behavior data into the large language model, and having the large language model output a preset number of first-level content categories that the target user is most likely to be interested in, along with the confidence score for each first-level content category. The confidence score represents the probability that the target user is interested in the corresponding first-level content category.
[0124] In some embodiments, the value of the time decay function can decrease as the interval between the time the search behavior data was generated and the current time increases, so that earlier search behaviors contribute less to the weighting factor than more recent search behaviors. In an exemplary embodiment, the weighting factor can be represented as the product of the base weighting coefficient, the confidence level of the interest category to which the candidate resource belongs, and the value of the time decay function. Adjusting the estimated score of a candidate resource using the weighting factor includes adding the weighting factor to the estimated score of the candidate resource to obtain the adjusted estimated score.
[0125] According to another aspect of this disclosure, a training apparatus for a resource ranking model is provided. For example... Figure 8 As shown, the training device 800 for the resource ranking model includes: an acquisition unit 810 configured to acquire multiple sets of sample partial order data, each set of sample partial order data representing the relative priority of multiple sample resources in one of a set of preset partial order dimensions; a fine-tuning unit 820 configured to fine-tune a large language model based on multiple sets of sample partial order data; a generation unit 830 configured to use the fine-tuned large language model to process multiple sets of target partial order data for multiple historical resources based on multi-source information of historical users and multiple historical resources; a fusion unit 840 configured to fuse multiple sets of target partial order data for multiple partial order dimensions to obtain a unified partial order relationship between multiple historical resources, and to construct training data based on the unified partial order relationship; and a training unit 850 configured to train the resource ranking model using the training data, wherein the number of parameters in the resource ranking model is smaller than that in the large language model, and the resource ranking model is used to rank multiple candidate resources based on multi-source information of target users.
[0126] It is understood that the operation and effect of the acquisition unit 810 to the training unit 850 in the training device 800 of the resource ranking model can be referred to the description of steps S201 to S205 in the training method 200 of the resource ranking model above, and will not be repeated here.
[0127] According to another aspect of this disclosure, a resource recommendation device is provided. For example... Figure 9As shown, the resource recommendation device 900 includes: an information acquisition unit 910 configured to acquire multi-source information of a target user and multiple candidate resources; an estimation unit 920 configured to use a resource ranking model to process the multiple candidate resources based on the multi-source information of the target user to obtain estimated scores for each of the multiple candidate resources, wherein the resource ranking model is trained according to the training method of the resource ranking model described above; and a recommendation unit 930 configured to rank the multiple candidate resources based on the estimated scores and recommend resources to the target user according to the ranking results.
[0128] It is understood that the operation and effect of the information acquisition unit 910 to the recommendation unit 930 in the resource recommendation device 900 can be referred to the description of steps S601 to S603 in the resource recommendation method 600 above, and will not be repeated here.
[0129] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0130] According to embodiments of this disclosure, an electronic device, a readable storage medium, and a computer program product are also provided.
[0131] refer to Figure 10 The present invention describes a structural block diagram of an electronic device 1000 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0132] like Figure 10 As shown, the electronic device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. The RAM 1003 may also store various programs and data required for the operation of the electronic device 1000. The computing unit 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0133] Multiple components in electronic device 1000 are connected to I / O interface 1005, including: input unit 1006, output unit 1007, storage unit 1008, and communication unit 1009. Input unit 1006 can be any type of device capable of inputting information to electronic device 1000. Input unit 1006 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device, and may include, but is not limited to, a mouse, keyboard, touchscreen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 1007 can be any type of device capable of presenting information, and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 1008 may include, but is not limited to, a hard disk and an optical disk. The communication unit 1009 allows the electronic device 1000 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and / or chipsets, such as Bluetooth devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices and / or the like.
[0134] The computing unit 1001 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the various methods, processes, and / or processing described above. For example, in some embodiments, these methods, processes, and / or processing may be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 1000 via ROM 1002 and / or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the methods, processes, and / or processing described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to perform these methods, processes, and / or handling by any other suitable means (e.g., by means of firmware).
[0135] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0136] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0137] 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.
[0138] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0139] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.
[0140] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0141] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0142] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the invention is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.
Claims
1. A training method for a resource ranking model, comprising: Acquire multiple sets of sample partial order data, each set of sample partial order data representing the relative priority of multiple sample resources in one of the preset multiple partial order dimensions; The large language model is fine-tuned based on the aforementioned multiple sets of partially ordered sample data. Using the fine-tuned large language model, based on the multi-source information of historical users and multiple historical resources, multiple sets of target partial order data of the multiple historical resources are obtained in the multiple partial order dimensions. Multiple sets of target partial order data on the multiple partial order dimensions are fused to obtain a unified partial order relationship among the multiple historical resources, and training data is constructed based on the unified partial order relationship. as well as The resource ranking model is trained using the training data, wherein the number of parameters of the resource ranking model is smaller than that of the large language model, and the resource ranking model is used to rank multiple candidate resources based on multi-source information of the target user.
2. The method according to claim 1, wherein, Fine-tuning the large language model based on the aforementioned multiple sets of partially ordered sample data includes: For each set of sample partial order data, the large language model is used to process the multi-source information of the corresponding sample user and the corresponding multiple sample resources to generate an output word sequence. Based on the output word sequence, a partial order score is determined for the corresponding multiple sample resources; Based on the output word sequence and the partial order score, determine the joint loss; and Based on the joint loss, the large language model is fine-tuned.
3. The method according to claim 2, wherein, Based on the output word sequence and the partial order score, the joint loss is determined as follows: Based on the output word sequence, the language modeling loss is determined, and the language modeling loss characterizes the semantic understanding and generation capabilities of the large language model; Based on the partial order score and the sample partial order data, a partial order prediction loss is determined, wherein the partial order prediction loss characterizes the degree of deviation between the partial order score and the relative priority characterized by the sample partial order data; and The joint loss is determined based at least on the language modeling loss and the partial order prediction loss.
4. The method according to claim 3, wherein, The language modeling loss is determined by the following formula: L lm = - Σ t log P(y t | y <t , X) Where X represents the input prompt information of the large language model, the prompt information including the multi-source information of the corresponding sample user and the corresponding multiple sample resources, y t Let y represent the t-th target word element output by the large language model. <t This represents the sequence of output tokens preceding the t-th target token.
5. The method according to claim 3, wherein, The partial order prediction loss is determined by the following formula: L rank = S (ri>rj) max(0, s(r j ) - s(r i ) + margin) Wherein, s(r i ), s(r j ) respectively represent the large language model's response to sample resource r i Sample resources r j Partial order scoring, r i >r j The partial order data of the samples represents the sample resources r. i Its relative priority is higher than that of sample resource r j , where margin is the partial order margin hyperparameter.
6. The method according to claim 3, wherein, Based on the output word sequence and the partial order score, determining the joint loss also includes: Determine sample resource triples from the corresponding plurality of sample resources; and Based on the partial order scores for the sample resource triples, a partial order consistency loss is determined. This partial order consistency loss characterizes the degree to which the partial order predictions of the large language model violate transitivity. The joint loss is determined based on the language modeling loss, the partial order prediction loss, and the partial order consistency loss.
7. The method according to claim 6, wherein, The partial order consistency loss is determined by the following formula: L consistency = S (i,j,k) max(0, s(r k ) - s(r i ) + margin c ) Where (i,j,k) represents the sample resource r i The partial order score is higher than the sample resource r j And sample resources r j The partial order score is higher than the sample resource r k The sample resource triple, s(r) i ), s(r k ) respectively represent the large language model's response to sample resource r i Sample resources r k Partial order scoring, margin c This is the consistency interval hyperparameter.
8. The method according to any one of claims 1-7, wherein, The multiple partial order dimensions include at least two of the following: interest matching degree dimension, penetration potential dimension, content quality dimension, and timeliness dimension.
9. The method according to any one of claims 1-7, wherein, Using a fine-tuned large language model, based on multi-source information of historical users and multiple historical resources, multiple sets of target partial-order data of the multiple historical resources in the multiple partial-order dimensions are obtained, including: The multi-source information of the historical users is structured and encoded to obtain user-coded information; The user's encoded information is input into the fine-tuned large language model to generate the set of potential interest domains of the historical user; and Using the fine-tuned large language model, based on the set of potential interest areas and the multiple historical resources, the multiple sets of target partial order data are obtained.
10. The method according to claim 9, wherein, The multi-source information of historical users includes at least two of the following: historical user profiles, historical search query text sets, and historical user behavior sequences.
11. The method according to any one of claims 1-7, wherein, By fusing multiple sets of target partial order data across the multiple partial order dimensions, the unified partial order relationship among the multiple historical resources is obtained, including: Based on a set of target partial order data for each of the partial order dimensions, determine the dimension score of each of the multiple historical resources in that partial order dimension; Based on the dimensional weights of the multiple partial order dimensions, the dimensional scores of the multiple historical resources are weighted and summed to obtain the importance scores of the multiple historical resources; and The multiple historical resources are sorted based on their corresponding importance scores to obtain the unified partial order relationship.
12. The method according to any one of claims 1-7, further comprising: A partial order of behavior samples is constructed based on the historical user behavior hierarchy of the multiple historical resources. The behavior hierarchy includes, from low to high, the un-scrolled display hierarchy, the scrolled but unclicked hierarchy, the clicked shallow browsing hierarchy, and the in-depth viewing hierarchy. The resource ranking model is trained using the training data and the behavior partial order samples.
13. A resource recommendation method, comprising: Acquire multi-source information and multiple candidate resources for the target user; Using a resource ranking model, the multiple candidate resources are processed based on the multi-source information of the target user to obtain the estimated scores of each of the multiple candidate resources, wherein the resource ranking model is trained by the method according to any one of claims 1 to 12; as well as The candidate resources are ranked based on the estimated scores, and resources are recommended to the target user according to the ranking results.
14. The method of claim 13, further comprising: In response to determining that the number of active days of the target user does not exceed a preset threshold, an interest category and the confidence level of the interest category are extracted from the search behavior data of the target user using a large language model; as well as For candidate resources belonging to the interest category among the multiple candidate resources, a weighting factor is determined based on the confidence level and the time decay function, and the predicted score of the candidate resource is adjusted using the weighting factor. The process of ranking the multiple candidate resources based on the estimated scores includes: ranking the multiple candidate resources based on the adjusted estimated scores.
15. A training device for a resource ranking model, comprising: The acquisition unit is configured to acquire multiple sets of sample partial order data, each set of sample partial order data representing the relative priority of multiple sample resources in one of the preset multiple partial order dimensions. The fine-tuning unit is configured to fine-tune the large language model based on the multiple sets of sample partial order data; The generation unit is configured to use a fine-tuned large language model to process multi-source information of historical users and multiple historical resources to obtain multiple sets of target partial order data of the multiple historical resources in the multiple partial order dimensions. The fusion unit is configured to fuse multiple sets of target partial order data on the multiple partial order dimensions to obtain a unified partial order relationship between the multiple historical resources, and to construct training data based on the unified partial order relationship. as well as The training unit is configured to train a resource ranking model using the training data, wherein the resource ranking model has fewer parameters than the large language model, and the resource ranking model is used to rank multiple candidate resources based on multi-source information of the target user.
16. A resource recommendation device, comprising: The information acquisition unit is configured to acquire multi-source information and multiple candidate resources from the target user. The prediction unit is configured to use a resource ranking model to process the plurality of candidate resources based on the multi-source information of the target user, and obtain the predicted scores of the plurality of candidate resources respectively, wherein the resource ranking model is trained by the device according to claim 15. as well as The recommendation unit is configured to sort the plurality of candidate resources based on the estimated scores and recommend resources to the target user according to the sorting results.
17. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 14.
18. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, Computer instructions are used to cause a computer to perform the method according to any one of claims 1 to 14.
19. A computer program product comprising a computer program, wherein, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 14.