Training method and device of transfer learning model and recommendation model

By aligning and merging the features of the source and target domain samples, and combining this with a multi-sub-model training method, the problem of supervision bias in cross-scene transfer learning models is solved, achieving stronger cross-scene generalization ability and supervision accuracy.

CN121051468BActive Publication Date: 2026-02-10JIANGSU MANYUN LOGISTICS INFORMATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511588867.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-03
Publication Date
2026-02-10
Estimated Expiration
2045-11-03

AI Technical Summary

Technical Problem

Existing transfer learning models suffer from supervision bias and unstable model convergence in cross-scene transfer due to the shift from vague to explicit, significant differences between user groups and candidate sets, and inconsistencies between feature and label definitions.

Method used

By acquiring sample features from the source and target domains, aligning and merging them, a unified training sample format is constructed. Training labels are determined according to the target task type, multi-sub-models are used for hierarchical training, and the model is optimized by combining a joint loss function.

Benefits of technology

When the user group and candidate set differ significantly and the migration direction becomes clearer, the problem of inconsistency between features and labels is alleviated, and the cross-scenario generalization ability and supervision accuracy of the transfer learning model are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121051468B_ABST
    Figure CN121051468B_ABST
Patent Text Reader

Abstract

The application provides a kind of transfer learning model and the training method and device of recommendation model, belong to machine learning technical field.The training method of the transfer learning model is unified with the representation of target domain feature as main, auxiliary source domain feature subset, allow to complete cross-domain modeling under the condition that the coincidence degree of source domain feature and target domain feature is lower than the first threshold, reduce the dependence on the consistency of source domain and target domain, alleviate the feature caliber inconsistency problem in the direction from vague to explicit migration from the source;At the same time, at the data level, by normalizing the source domain sample into a unified training sample to participate in the learning of the same model, the effective supervision of the target domain is significantly expanded, thereby alleviating the problem of target domain data sparsity and cold start.The method provided by the application can realize stable training of the transfer learning model under the condition that the difference between user groups and candidate sets is significant, the migration direction is from vague to explicit, and the feature caliber is inconsistent.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of machine learning, in particular to a training method and device of a transfer learning model and a recommendation model. BACKGROUND

[0002] As an important branch of machine learning, transfer learning aims to transfer the learned knowledge in the source domain to the target domain to alleviate the problem of sparse data and cold start in the target domain, and to improve the generalization ability of the model in the new scene. In the search and recommendation scene, user behavior is complex and business goals are diverse, and cross-scene information sharing and multi-task joint modeling have become the key direction to improve the sorting and matching effect. Taking a network freight platform as an example, the freight list not only exists in the recommendation scene of personalized output according to user historical preferences, but also exists in the search scene of accurate recall according to user input conditions, and there are essential differences in interaction form, recall range and business constraints, which puts higher requirements on the transfer learning method.

[0003] The prior art has carried out a lot of practice in transfer learning and multi-scene fusion, such as an integrated model for multi-domain click rate prediction, a pre-training model for e-commerce global user representation, and a fusion network for multi-scene hierarchical information utilization, which have obtained certain business benefits in online experiments. However, these methods generally rely on the following premises: first, the source domain has more sufficient data and stronger prior than the target domain; second, the source domain and the target domain have high consistency in user groups, behavior patterns or action objects; third, the transfer path is mainly from larger and more explicit scenes to smaller and more ambiguous scenes. In actual business, the above premises are not always true, for example, the recommendation scene is often more ambiguous, the recommendation scene relies on intent speculation, the recall range is not limited and the traffic is higher, while the search scene is more explicit, the search scene performs full matching according to the formatted conditions, and the result space is constrained; although there is overlap between users, the differences are significant, the candidate set composition and distribution are different, and the independent iteration of the respective systems leads to inconsistent feature and label caliber. If the traditional transfer learning model is directly applied, problems such as mixed imbalance of training samples and cross-scene supervision conflict may occur, resulting in unstable convergence of the transfer learning model and prediction bias.

[0004] Therefore, in the freight search and recommendation integrated modeling of the network freight platform, the cross-scene transfer direction from ambiguous to explicit, the significant difference between user groups and candidate sets, and the supervision bias caused by inconsistent feature and label caliber have become a technical problem to be solved. SUMMARY

[0005] The present application provides a training method and device of a transfer learning model and a recommendation model to solve the problem of supervision bias caused by the cross-scene transfer direction from ambiguous to explicit, the significant difference between user groups and candidate sets, and the inconsistent feature and label caliber.

[0006] In a first aspect, the present application provides a method for training a transfer learning model, comprising: obtaining a plurality of source domain samples and source domain labels corresponding to the plurality of source domain samples respectively in a source domain scenario; wherein each source domain sample comprises a plurality of source domain features; and the source domain label corresponding to each source domain sample is used to indicate a positive result or a negative result of a target task in the source domain scenario;

[0007] obtaining a plurality of target domain samples and target domain labels corresponding to the plurality of target domain samples respectively in a target domain scenario; wherein each target domain sample comprises a plurality of target domain features; and the target domain label corresponding to each target domain sample is used to indicate a positive result or a negative result of the target task in the target domain scenario; and the coincidence degree of the plurality of target domain features and the plurality of source domain features is less than a first threshold;

[0008] performing feature alignment and merging processing on the plurality of source domain samples and the plurality of target domain samples based on the plurality of source domain features and the plurality of target domain features, to obtain a plurality of training samples; wherein each source domain sample and target domain sample corresponds to one training sample, and each training sample comprises the plurality of target domain features and a source domain feature subset related to the plurality of source domain features;

[0009] determining a training label corresponding to each training sample in the plurality of training samples;

[0010] training a transfer learning model based on the plurality of training samples and the training label corresponding to each training sample.

[0011] In a possible design, before the determination of the training label corresponding to each training sample in the plurality of training samples, the method further comprises:

[0012] determining whether to perform label fusion processing on a target training sample group in the plurality of training samples based on the type of the target task; wherein the target training sample group comprises a first training sample and a second training sample, the first training sample is obtained by performing feature alignment and merging processing on the source domain sample, the second training sample is obtained by performing feature alignment and merging processing on the target domain sample, and the content of the first training sample and the second training sample is consistent.

[0013] In a possible design, the determination of the training label corresponding to each training sample in the plurality of training samples comprises:

[0014] In a possible design, the training sample corresponding to the fusion label is determined according to the source domain label corresponding to the first training sample and the target domain label corresponding to the second training sample in the target training sample group.

[0015] In a possible design, the training sample corresponding to the fusion label is determined according to the source domain label corresponding to the first training sample and the target domain label corresponding to the second training sample in the target training sample group.

[0016] In a possible design, the training sample corresponding to the fusion label is determined according to the source domain label corresponding to the first training sample and the target domain label corresponding to the second training sample in the target training sample group.

[0017] In a possible design, the training sample corresponding to the fusion label is determined according to the source domain label corresponding to the first training sample and the target domain label corresponding to the second training sample in the target training sample group.

[0018] In a possible design, the training sample corresponding to the fusion label is determined according to the source domain label corresponding to the first training sample and the target domain label corresponding to the second training sample in the target training sample group.

[0019] In a possible design, the training sample corresponding to the fusion label is determined according to the source domain label corresponding to the first training sample and the target domain label corresponding to the second training sample in the target training sample group.

[0020] In a possible design, the training sample corresponding to the fusion label is determined according to the source domain label corresponding to the first training sample and the target domain label corresponding to the second training sample in the target training sample group.

[0021] In a possible design, the training sample corresponding to the fusion label is determined according to the source domain label corresponding to the first training sample and the target domain label corresponding to the second training sample in the target training sample group.

[0022] The plurality of training sample sets are sequentially selected to perform multiple rounds of training on the transfer learning model; wherein in each round of training, one of the plurality of training sample sets is used to train the transfer learning model.

[0023] In a possible design, the transfer learning model includes a first sub-model, a second sub-model and a third sub-model; wherein the first sub-model is used for task learning of the source domain scenario, the second sub-model is used for task learning of the target domain scenario, and the third sub-model is used for fusion task learning of the target training sample group.

[0024] In the current round of training of the transfer learning model based on the training sample set, if the training sample does not belong to the target training sample group and is obtained by feature alignment and merging processing of the source domain sample, the first sub-model is trained by using the training sample.

[0025] If the training sample does not belong to the target training sample group and is obtained by feature alignment and merging processing of the target domain sample, the second sub-model is trained by using the training sample.

[0026] If the training sample belongs to the target training sample group, the third sub-model is trained by using the training sample.

[0027] In a possible design, the method further includes:

[0028] Based on a first loss function corresponding to the first sub-model, a second loss function corresponding to the second sub-model, and a third loss function corresponding to the third sub-model, a joint loss function of the transfer learning model is determined; wherein the joint loss function is a weighted sum of the first loss function, the second loss function and the third loss function.

[0029] In a second aspect, the present application provides a training method of a recommendation model, the method comprising:

[0030] A plurality of source domain samples and source domain labels corresponding to the plurality of source domain samples in a goods source recommendation scenario are obtained; wherein the source domain sample is exposure data in a goods source recommendation scenario; each source domain sample includes a plurality of source domain features; and the source domain label corresponding to each source domain sample is used to indicate a positive result or a negative result of a target task in the goods source recommendation scenario.

[0031] obtain a plurality of target domain samples in a search scenario of a cargo source and target domain labels corresponding to the plurality of target domain samples respectively; wherein the target domain sample is exposure data in the search scenario of the cargo source; each target domain sample includes a plurality of target domain features; the target domain label corresponding to each target domain sample is used to indicate a positive result or a negative result of the target task in the search scenario of the cargo source; the coincidence degree of the plurality of target domain features and the plurality of source domain features is less than a first threshold;

[0032] perform feature alignment and merging processing on the plurality of source domain samples and the plurality of target domain samples based on the plurality of source domain features and the plurality of target domain features, to obtain a plurality of training samples; wherein each source domain sample and the target domain sample corresponds to one training sample, and each training sample includes the plurality of target domain features and a source domain feature subset related to the plurality of source domain features;

[0033] determine a training label corresponding to each training sample in the plurality of training samples;

[0034] train a recommendation model based on the plurality of training samples and the training label corresponding to each training sample.

[0035] In a third aspect, the present application provides a training device of a transfer learning model, the device comprising:

[0036] A first obtaining module is configured to obtain a plurality of source domain samples in a source domain scenario and source domain labels corresponding to the plurality of source domain samples respectively; wherein each source domain sample includes a plurality of source domain features; and the source domain label corresponding to each source domain sample is used to indicate a positive result or a negative result of a target task in the source domain scenario.

[0037] A second obtaining module is configured to obtain a plurality of target domain samples in a target domain scenario and target domain labels corresponding to the plurality of target domain samples respectively; wherein each target domain sample includes a plurality of target domain features; and the target domain label corresponding to each target domain sample is used to indicate a positive result or a negative result of the target task in the target domain scenario; and the coincidence degree of the plurality of target domain features and the plurality of source domain features is less than a first threshold.

[0038] A first processing module is configured to perform feature alignment and merging processing on the plurality of source domain samples and the plurality of target domain samples based on the plurality of source domain features and the plurality of target domain features, to obtain a plurality of training samples; wherein each source domain sample and the target domain sample corresponds to one training sample, and each training sample includes the plurality of target domain features and a source domain feature subset related to the plurality of source domain features.

[0039] The first determining module is configured to determine a training label corresponding to each training sample in the plurality of training samples.

[0040] The first training module is configured to train the transfer learning model based on the plurality of training samples and the training label corresponding to each training sample.

[0041] In a fourth aspect, the present application provides a device for training a recommendation model, the device comprising:

[0042] The third obtaining module is configured to obtain a plurality of source domain samples in a cargo source recommendation scenario and source domain labels corresponding to the plurality of source domain samples respectively; wherein the source domain sample is exposure data in the cargo source recommendation scenario; each source domain sample comprises a plurality of source domain features; and the source domain label corresponding to each source domain sample is used to indicate a positive result or a negative result of a target task in the cargo source recommendation scenario.

[0043] The fourth obtaining module is configured to obtain a plurality of target domain samples in a cargo source search scenario and target domain labels corresponding to the plurality of target domain samples respectively; wherein the target domain sample is exposure data in the cargo source search scenario; each target domain sample comprises a plurality of target domain features; and the target domain label corresponding to each target domain sample is used to indicate a positive result or a negative result of the target task in the cargo source search scenario; and a coincidence degree of the plurality of target domain features and the plurality of source domain features is less than a first threshold.

[0044] The second processing module is configured to perform feature alignment and merging processing on the plurality of source domain samples and the plurality of target domain samples based on the plurality of source domain features and the plurality of target domain features, to obtain a plurality of training samples; wherein each source domain sample and each target domain sample correspond to one training sample respectively; each training sample comprises the plurality of target domain features and a source domain feature subset related to the plurality of source domain features.

[0045] The second determining module is configured to determine a training label corresponding to each training sample in the plurality of training samples.

[0046] The second training module is configured to train the recommendation model based on the plurality of training samples and the training label corresponding to each training sample.

[0047] In a fifth aspect, the present application provides an electronic device, comprising: a memory and at least one processor.

[0048] The memory stores computer execution instructions.

[0049] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the first aspect, various possible designs of the first aspect, or the method described in the second aspect.

[0050] Sixthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed, implement the first aspect, various possible designs of the first aspect, or the method described in the second aspect.

[0051] In a seventh aspect, this application provides a computer program product, which includes computer program code that, when run on a computer, causes the computer to implement the first aspect, the various possible designs of the first aspect, or the method described in the second aspect.

[0052] Eighthly, this application provides a chip, including: an interface circuit and a logic circuit, wherein the interface circuit is used to receive signals from other chips outside the chip and transmit them to the logic circuit, or to send signals from the logic circuit to other chips outside the chip, and the logic circuit is used to implement the first aspect, various possible designs of the first aspect, or the method described in the second aspect.

[0053] This application provides a training method and apparatus for a transfer learning model and a recommendation model. In the training method of the transfer learning model, a unified training sample format is constructed mainly using target domain features and supplemented by a subset of source domain features. Cross-domain modeling can be completed even when the overlap between source domain features and target domain features is less than a first threshold, reducing the dependence on the consistency between the source domain and the target domain and alleviating the problem of inconsistent feature calibers during the transfer from fuzzy to definite directions. At the supervision level, the training samples use the labels of their source domains, avoiding cross-scenario supervision conflicts and misleading caused by directly mixing labels. While following the rules of the target domain, the source domain priors are effectively introduced, reducing supervision bias caused by differences in label calibers. At the data level, the source domain samples are standardized and included in the unified training samples to participate in the learning of the transfer learning model, increasing the amount of available supervision samples in the target domain and substantially supplementing the insufficient supervision in the target domain, thereby alleviating the problems of sparse target domain data and cold start. Therefore, the method provided in this application can achieve stable training of the transfer learning model under real business conditions where the user group and candidate set are significantly different, the transfer direction changes from vague to clear, and the feature / label caliber is inconsistent, so that the transfer learning model has a stronger cross-scenario generalization ability. Attached Figure Description

[0054] Figure 1 A flowchart illustrating a training method for a transfer learning model provided in an embodiment of this application;

[0055] Figure 2 A flowchart illustrating another training method for a transfer learning model provided in an embodiment of this application;

[0056] Figure 3 This is a schematic diagram of the structure of a transfer learning model provided in an embodiment of this application;

[0057] Figure 4 A flowchart illustrating a training method for a recommendation model provided in an embodiment of this application;

[0058] Figure 5 A schematic diagram of the structure of a training device for a transfer learning model provided in an embodiment of this application;

[0059] Figure 6 A schematic diagram of the structure of a training device for a recommendation model provided in an embodiment of this application;

[0060] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0061] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0062] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein in the specification of the application is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims and drawings of this application are intended to cover non-exclusive inclusion.

[0063] The term "embodiment" as used herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of the phrase "embodiment" in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0064] In this article, the term "and / or" simply describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists, A and B can exist simultaneously, and B exists. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0065] Furthermore, the terms "first," "second," etc., in the specification and claims of this application or in the aforementioned drawings are used to distinguish different objects rather than to describe a specific order, and may explicitly or implicitly include one or more of the features.

[0066] In the description of this application, unless otherwise stated, "multiple" and "at least two" mean two or more (including two), and similarly, "multiple groups" and "at least two groups" mean two or more (including two groups).

[0067] In the description of this application, it should be noted that, unless otherwise explicitly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, "connected" or "linked" can refer not only to a physical connection, but also to an electrical connection or a signal connection. For instance, it can be a direct connection, i.e., a physical connection, or an indirect connection through at least one intermediate component, as long as the circuit is connected. It can also refer to the internal connection between two components. A signal connection can refer not only to a signal connection through a circuit, but also to a signal connection through a medium, such as radio waves. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0068] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, different technical features in this application can be combined with each other.

[0069] Next, through some specific embodiments and accompanying drawings, we will describe in detail how this application solves the supervision bias problems caused by the cross-scenario migration direction changing from vague to clear, significant differences between user groups and candidate sets, and inconsistencies between features and labels.

[0070] Figure 1 This is a flowchart illustrating a training method for a transfer learning model provided in an embodiment of this application. Figure 1 As shown, the training method of the transfer learning model provided in this application embodiment specifically includes S101 to S105, and S101 to S105 will be described in detail below.

[0071] It should be noted that the training method for the transfer learning model provided in this application embodiment can be executed by an electronic device.

[0072] S101. Obtain multiple source domain samples and their corresponding source domain labels in the source domain scenario.

[0073] Each source domain sample includes multiple source domain features, and the source domain label corresponding to each source domain sample is used to indicate the positive or negative result of the target task in the source domain scenario.

[0074] It should be noted that the electronic device first collects multiple source domain samples in the source domain scenario and determines the source domain label corresponding to each source domain sample.

[0075] Source domain samples can be extracted from online logs, data warehouses, or streaming pipelines. The granularity can be event triples of users, candidate objects, and context, or it can be set as other keys that can uniquely identify training objects according to business needs.

[0076] Each source domain sample includes multiple source domain features, which may include, but are not limited to: user-side features (basic attributes, historical behavior statistics, etc.), candidate object features (category, attributes, quality scores, etc.), contextual features (time, geography, device, session, etc.), and cross-sample statistical features.

[0077] Source domain tags are used to indicate the positive / negative result of the target task in the source domain scenario, such as: click / not clicked, completed / not completed, favorited / not favorited, etc. The specific definition can be determined by the business.

[0078] To ensure the data quality of source domain samples, preprocessing such as anomaly removal, deduplication, time window alignment, delayed backhaul completion, and exposure consistency verification can be performed after the source domain samples are collected.

[0079] It should be noted that each source domain sample corresponds to at least one source domain label.

[0080] For example, in a source domain scenario where the source domain is for product recommendation, each source domain sample corresponds to two source domain tags: a first source domain tag and a second source domain tag. The first source domain tag indicates whether the user clicks on the product information corresponding to that source domain sample, and the second source domain tag indicates whether a transaction has been completed. Furthermore, this application is not limited to clicks / transactions; source domain tags can also include other business events such as adding to favorites, adding to interest, inquiring, making a phone call, or adding to comparisons.

[0081] S102. Obtain multiple target domain samples in the target domain scenario and the target domain labels corresponding to the multiple target domain samples respectively.

[0082] Each target domain sample includes multiple target domain features, and the target domain label corresponding to each target domain sample is used to indicate the positive or negative result of the target task in the target domain scenario.

[0083] It should be noted that the method for the electronic device to collect multiple target domain samples in the target domain scenario and determine the target domain label corresponding to each source domain sample is similar to the method shown in S101, and will not be described again in this embodiment.

[0084] Each target domain sample includes multiple target domain features, covering dimensions such as user, candidate, and context. Target domain labels are used to indicate the positive or negative result of the target task within the target domain scenario.

[0085] Among them, the overlap between multiple target domain features and multiple source domain features is less than the first threshold.

[0086] It should be noted that multiple target domain features constitute a target domain feature set, and multiple source domain features constitute a source domain feature set. The target domain feature set and the source domain feature set are mapped within a unified semantic space. A consistency index (e.g., based on Jaccard similarity after field mapping, statistical relevance threshold, or embedding similarity threshold) is calculated between the target domain feature set and the source domain feature set. This consistency index indicates the degree of overlap between the multiple target domain features and the multiple source domain features. When the consistency index between the target domain feature set and the source domain feature set is less than a first threshold, subsequent feature alignment and merging processes are triggered.

[0087] In this embodiment, the specific calculation method of the consistency index between the target domain feature set and the source domain feature set, as well as the selection of the first threshold, can be configured according to the specific implementation environment. This embodiment does not impose specific limitations on this.

[0088] For example, the first threshold is 20%.

[0089] It should be noted that each target domain sample corresponds to at least one target domain label.

[0090] In one implementation, the target domain label corresponding to a target domain sample can be set to be equal in number to the source domain label corresponding to a source domain sample and correspond one-to-one in sequence.

[0091] In other embodiments, the number and correspondence between the target domain label corresponding to a target domain sample and the source domain label corresponding to a source domain sample can also be configured according to business needs, and do not constitute a limitation on this application.

[0092] For example, in the case of a product search scenario, each product sample has two target domain labels: a first target domain label and a second target domain label. The first target domain label is used to indicate whether the user clicks on the product information corresponding to the product sample, and the second target domain label is used to indicate whether the product information corresponding to the product sample has been sold.

[0093] S103. Based on multiple source domain features and multiple target domain features, perform feature alignment and merging processing on multiple source domain samples and multiple target domain samples to obtain multiple training samples.

[0094] Each source domain sample and each target domain sample corresponds to a training sample. Each training sample includes multiple target domain features and a subset of source domain features related to multiple source domain features.

[0095] It should be noted that electronic devices perform feature alignment and merging processing on source domain samples and target domain samples based on multiple source domain features and multiple target domain features to form a unified format of training sample representation, which facilitates subsequent training of the transfer learning model.

[0096] Electronic devices perform feature alignment and merging processes on source domain samples and target domain samples, which may include semantic mapping, type and caliber unification, source domain feature subset selection, and feature concatenation.

[0097] Semantic mapping refers to aligning semantically equivalent or similar features in the source and target domains to a unified namespace based on feature dictionaries or mapping rules; features that exist only in a single domain are preserved and their domain affiliation is labeled.

[0098] Type and caliber unification refers to the processing of discrete / continuous features, such as encoding, normalization, missing value imputation, and caliber unification (e.g., exposure caliber, click caliber).

[0099] Source domain feature subset selection refers to selecting source domain features that are relevant to the target domain modeling from multiple source domain features to form a source domain feature subset.

[0100] Feature concatenation refers to generating a training sample for each source domain sample and each target domain sample. The training sample includes multiple target domain features and all source domain features in the source domain feature subset. Fields that cannot be aligned can be handled through placeholders or default strategies to maintain the consistency of the training sample format.

[0101] S104. Determine the training label corresponding to each training sample among multiple training samples.

[0102] In one implementation, when a training sample is obtained by processing a source domain sample through the method steps shown in S103, the source domain label corresponding to the source domain sample is used as the training label of the training sample; when a training sample is obtained by processing a target domain sample through the method steps shown in S103, the target domain label corresponding to the target domain sample is used as the training label of the training sample.

[0103] Figure 2 This is a flowchart illustrating another training method for a transfer learning model provided in an embodiment of this application. Figure 2 As shown, in another embodiment, before performing the method steps shown in S104, the training method of the transfer learning model further includes S201, which will be described in detail below.

[0104] S201. The electronic device determines whether to perform label fusion processing on the target training sample group among multiple training samples based on the type of the target task.

[0105] The target training sample group includes a first training sample and a second training sample. The first training sample is obtained by feature alignment and merging of source domain samples, and the second training sample is obtained by feature alignment and merging of target domain samples. The contents of the first training sample and the second training sample are the same.

[0106] It should be noted that the content of the first training sample and the second training sample is consistent, which means that the values ​​of multiple target domain features and source domain feature subsets included in the first training sample and the second training sample are completely consistent.

[0107] The target task can be categorized into process-based and result-based tasks according to business semantics. Process-based tasks represent intermediate user behaviors in the conversion chain (such as clicking, adding interest, inquiring, etc.), while result-based tasks represent the final result or business loop (such as placing an order / completing a transaction, successful payment, etc.).

[0108] For example, in the source domain (product recommendation), the first source domain label indicates whether the user clicks on the product information corresponding to the source domain sample, and the second source domain label indicates whether a transaction has been completed. Correspondingly, in the target domain (product search), the first target domain label indicates whether the user clicks on the product information corresponding to the target domain sample, and the second target domain label indicates whether a transaction has been completed. Therefore, the first source domain label and the first target domain label belong to the labels corresponding to process-type tasks, while the second source domain label and the second target domain label belong to the labels corresponding to result-type tasks.

[0109] Based on the above division rules, when performing label fusion on the target training sample group, only the labels corresponding to the result-type tasks are fused. That is, the second source domain label corresponding to the first training sample and the second target domain label corresponding to the second training sample are fused to obtain the fused label; while the labels corresponding to the process-type tasks do not participate in the fusion and each uses its own domain label for training.

[0110] In this embodiment, the decision to perform label fusion processing on the target training sample group is first made based on the type of the target task. For process-type tasks that are strongly influenced by domain factors such as interface, display location, and interaction path, labels are learned independently for each domain to avoid the caliber bias and negative transfer introduced by cross-domain fusion. For result-type tasks that are more semantically stable and consistent with the business loop, labels are fused after caliber alignment, so that effective positive examples in any domain can be transmitted, improving positive example coverage and supervision strength, thereby alleviating the problems of data sparsity and cold start in the target domain.

[0111] In one possible embodiment, S201 can be implemented by S2011 to S2015, which are described in detail below.

[0112] S2011. For each training sample, determine whether the training sample belongs to the target training sample group.

[0113] If the training sample belongs to the target training sample group, execute the method steps shown in S2012; if the training sample does not belong to the target training sample group, execute the method steps shown in S2013.

[0114] It should be noted that if there are two training samples with completely identical content among all training samples, the two training samples with completely identical content are considered to belong to the target training sample group.

[0115] S2012. The source domain label corresponding to the first training sample in the target training sample group and the target domain label corresponding to the second training sample are fused to obtain the fused label corresponding to the training sample, and the fused label is used as the training label of the first training sample and the second training sample in the target training sample group respectively.

[0116] Among them, the fusion processing can select different strategies according to the task type and business rules.

[0117] In one implementation, methods such as priority coverage, weighted convergence, or consistency calibration after caliber alignment can be used.

[0118] In another implementation, where the source domain label corresponding to the first training sample and / or the target domain label corresponding to the second training sample are used to indicate that the target task has a positive result, the fusion label corresponding to the training sample is used to indicate that the target task has a positive result in the training sample.

[0119] It should be noted that the labels corresponding to the same training sample may be the same or different in different domains.

[0120] Since the contents of the first and second training samples in the target training sample group are completely identical, the first and second training samples can be regarded as the same training sample. The labels of the same training sample in different domains may be the same or different.

[0121] When the label of the same training sample indicates a positive result for the target task in at least one domain, the fused label of the same training sample indicates that the target task has a positive result in the training sample. This maximizes the coverage of positive example supervision, unifies the positive example signals that were originally lost due to cross-domain exposure differences, label backhaul delays, or inconsistent standards into the training, thereby reducing false negatives, alleviating the problem of sparse positive examples in the target domain, providing more sufficient and consistent positive example gradients for the transfer learning model, accelerating convergence, and improving the generalization performance and ranking effect of cross-scene transfer.

[0122] When the labels of the same training sample in both domains indicate negative results, the fusion label corresponding to the same training sample is determined to indicate that the target task has negative results in the training sample. This achieves consistency and monotonicity in cross-domain supervision, reduces the risk of false positives and noisy labels from the source, and maintains the semantic stability of negative samples of the object in different scenarios. At the same time, it helps to maintain the class distribution and calibration characteristics of the task, thereby reducing gradient noise and improving training convergence stability and generalization reliability.

[0123] S2013. Determine whether the training samples are obtained by feature alignment and merging of source domain samples.

[0124] If the training samples are obtained by feature alignment and merging of source domain samples, execute the method steps shown in S2014; if the training samples are obtained by feature alignment and merging of target domain samples, execute the method steps shown in S2015.

[0125] S2014. Determine the source domain labels corresponding to the source domain samples as the training labels of the training samples.

[0126] When the current training sample does not belong to the target training sample group, and the training sample is obtained from source domain samples through feature alignment and merging, the electronic device directly determines the source domain label corresponding to the source domain sample as the training label of the training sample. To ensure the correctness of the reference relationship, the electronic device maintains a one-to-one mapping between the training sample and its source domain sample during the training sample construction phase.

[0127] S2015. Determine the target domain label corresponding to the target domain sample as the training label of the training sample.

[0128] When the current training sample does not belong to the target training sample group, and the training sample is obtained by feature alignment and merging of the target domain sample, the electronic device directly determines the target domain label corresponding to the target domain sample as the training label of the training sample.

[0129] S105. Train the transfer learning model based on multiple training samples and the training labels corresponding to each training sample.

[0130] When an electronic device trains a transfer learning model based on multiple training samples and their corresponding training labels, the training process may include the following steps: Data partitioning and loading: Divide the training / validation / test sets according to time or other stable criteria to prevent information leakage; Building a data loader: Support batch reading and random shuffling; Optimization settings: Select appropriate loss functions (such as log loss for classification tasks, mean squared error for regression tasks, etc.) and optimization algorithms, and configure hyperparameters such as learning rate, batch size, and number of rounds.

[0131] In another alternative implementation, the losses of multiple tasks can be jointly optimized in a weighted sum form, with the weights either preset or adaptively learned. Simultaneously, the model parameters are continuously optimized in multiple iterations, and early stopping or hyperparameter tuning is performed based on the validation set. Evaluation metrics matching the target task are output on the test set to verify the model's generalization ability to new scenarios.

[0132] The above training process is not limited to specific network structures and hardware platforms. It can be implemented in a single-machine, single-card environment or in a distributed cluster environment, and both fall within the protection scope of this application.

[0133] This application provides a training method for a transfer learning model. It constructs a unified training sample format primarily using target domain features, supplemented by a subset of source domain features. Cross-domain modeling can be completed even when the overlap between source and target domain features is below a first threshold, reducing reliance on consistency between the source and target domains and mitigating the problem of inconsistent feature definitions during the transfer from vague to explicit directions. At the supervision level, training samples retain the labels from their source domains, avoiding cross-scenario supervision conflicts and misleading results caused by directly mixing labels. While adhering to target domain rules, it effectively introduces source domain priors, reducing supervision bias caused by label differences. At the data level, source domain samples are standardized and incorporated into the unified training samples for the transfer learning model, increasing the amount of available supervision samples in the target domain and substantially supplementing insufficient target domain supervision, thereby alleviating the problems of target domain data sparsity and cold start. Therefore, the method provided in this application can achieve stable training of the transfer learning model under real-world business conditions where user groups and candidate sets differ significantly, the transfer direction changes from vague to explicit, and feature / label definitions are inconsistent, resulting in a transfer learning model with stronger cross-scenario generalization capabilities.

[0134] In the above embodiments, the electronic device needs to train the transfer learning model based on multiple training samples and the training labels corresponding to each training sample. Next, the specific process of training the transfer learning model based on multiple training samples and the training labels corresponding to each training sample will be described in detail.

[0135] In one possible embodiment, the method steps shown in S105 can be implemented by S1051 and S1052, which are described in detail below.

[0136] S1051. Based on the scene and data source date corresponding to each training sample, perform stratification and random processing on multiple training samples to divide multiple training samples into multiple training sample sets.

[0137] In each training sample set, the proportion of training samples from each data source date and scene combination is the same.

[0138] In one implementation, the electronic device first stratifies and randomly processes the training samples based on the scene identifier and data source date carried by each training sample to form several training sample sets for subsequent training rounds. Each training sample set includes a portion of the training samples from multiple training samples.

[0139] Specifically, electronic devices can use existing shuffle methods to stratify and randomly process multiple training samples, dividing the multiple training samples into multiple training sample sets.

[0140] In this embodiment, by ensuring that each training sample set has the same sample weight in terms of data source date and scene dimension, it is possible to reduce batch distribution drift and improve the training stability and convergence consistency of the transfer learning model.

[0141] S1052. Select multiple training sample sets in sequence to train the transfer learning model in multiple rounds.

[0142] In each round of training, the transfer learning model is trained using one training sample set from multiple training sample sets.

[0143] It should be noted that the training process is divided into I rounds. In the i-th round, only the i-th training sample set is used for forward and backward updates to ensure stable data distribution within a single round and complete coverage across rounds. i and I are both positive integers greater than 1, and 0 < i < I.

[0144] To avoid the slight bias that a fixed order might introduce, the order in which the training sample set is used can be randomly arranged at the beginning of each training cycle.

[0145] In a distributed or multi-threaded environment, an independent data loader and cache can be allocated to each training sample set. Combined with checkpointing and retry mechanisms, this ensures data consistency and fault tolerance in a single round of training.

[0146] In this embodiment, the training process achieves proportional coverage and independent optimization of all source dates and scene dimensions at the round scale, making the distribution within each round stable and the coverage across rounds complete. This reduces the variance between batches and the long-range correlation across rounds, accelerates convergence, and improves cross-scene generalization performance. At the same time, round-based training with the training sample set as the granularity facilitates indicator tracking and rollback, enhancing engineering controllability and reproducibility.

[0147] In one possible embodiment, the transfer learning model includes a first sub-model, a second sub-model, and a third sub-model.

[0148] The first sub-model is used for task learning in the source domain scene, the second sub-model is used for task learning in the target domain scene, and the third sub-model is used for task learning of the fusion of target training sample groups.

[0149] It should be noted that the first sub-model receives training samples formed by feature alignment and merging of source domain samples; the second sub-model receives training samples formed by feature alignment and merging of target domain samples; and the third sub-model receives the first training sample and its fused label from the target training sample group, as well as the second training sample and its fused label from the target training sample group.

[0150] When a training sample does not belong to the target training sample group, and the training sample is obtained from source domain samples through feature alignment and merging, the electronic device routes the training sample to the first sub-model for forward and backward updates, using its corresponding source domain label. This path ensures that source domain supervision learns independently within the source domain branch, avoiding supervision conflicts caused by cross-domain label mixing.

[0151] When a training sample does not belong to the target training sample group, and the training sample is obtained from the target domain sample through feature alignment and merging, the electronic device routes the training sample to the second sub-model for forward and backward updates, using its corresponding target domain label. This path ensures that target domain supervision takes effect directly within the target domain branch, thereby steadily improving target domain performance.

[0152] When a training sample belongs to the target training sample group (i.e., two training samples from the source domain and the target domain correspond to the same object), the electronic device routes the training sample to the third sub-model for forward and backward updates, using the fused label corresponding to that training sample. The third sub-model gathers cross-domain supervision information under a unified task caliber for learning, which helps to mitigate the negative transfer caused by the sparsity of the target domain and the inconsistency of the caliber.

[0153] It should be noted that the first, second, and third sub-models can employ a shared base encoder, as well as a scene / task-specific tower network structure. The shared base encoder is used for general feature representation learning; the first sub-model tower focuses on a subset of source domain features and their associated contextual interactions; the second sub-model tower focuses on fine-grained modeling of target domain features; and the third sub-model tower is used for fusion task learning.

[0154] In one possible embodiment, when training the transfer learning model, the electronic device determines the joint loss function of the transfer learning model based on the first loss function corresponding to the first sub-model, the second loss function corresponding to the second sub-model, and the third loss function corresponding to the third sub-model.

[0155] The joint loss function is a weighted sum of the first loss function, the second loss function, and the third loss function.

[0156] It should be noted that the weights of the first, second, and third loss functions are used to adjust the contribution of each sub-model to the overall optimization objective.

[0157] Weights can be preset by the configuration center or training script before training starts, or they can be adaptively adjusted during training. For example, they can be dynamically updated according to validation set metrics, or balanced according to the gradient norm / loss magnitude of each sub-model to reduce gradient conflicts between multiple tasks.

[0158] Optionally, to improve numerical stability, the electronic device can perform scale alignment / normalization on the loss of each sub-model before weighting (e.g., standardize according to historical moving mean and variance, or normalize according to the number of valid samples), and use pruning or robust loss on extreme gradients to suppress the perturbation of outlier samples.

[0159] In another alternative implementation, the weights can be set in stages: for example, the weights of the third sub-model (fusion task) can be increased in the early stages of training to accelerate cross-domain alignment, and the weights of the target domain sub-model can be gradually increased in the middle and later stages to consolidate the target domain performance; different weights can also be used for different data splits to achieve a phased trade-off between convergence speed and generalization ability.

[0160] In this embodiment, by combining the loss functions of the first, second, and third sub-models into a unified joint loss function through a weighted sum, a single and adjustable optimization objective is provided for the training process. On the one hand, the weights act as a balancing knob, allocating gradient contributions according to task / scenario importance, avoiding gradient conflicts and negative transfer caused by a particular scenario or task dominating training. On the other hand, the three losses converge collaboratively under the same objective, reducing oscillations caused by switching between multiple objectives, making training more stable and convergence smoother, and achieving a controllable trade-off between performance and stability under conditions of uneven sample distribution or significant differences across scenarios. Therefore, this joint loss helps to maintain source domain performance while improving the ranking / matching metrics in the target domain, thus enhancing the overall cross-scenario generalization ability and engineering controllability of the model.

[0161] Specifically, transfer learning models often encounter problems during actual training, such as the training loss decreasing and then increasing, and ultimately poor convergence, which directly affects the final transfer performance. In this application, the exponential decay method of the learning rate in the prior art is replaced with a warm-up and cosine annealing decay method to dynamically adjust the optimizer learning rate.

[0162] The cosine annealing decay algorithm causes the learning rate to decay smoothly over time according to a cosine curve. Its purpose is to prevent the transfer learning model from deviating from the correct parameter distribution range due to learning fluctuations as the number of training epochs increases, thus ensuring better convergence of the loss function. The formula is as follows: .

[0163] Figure 3 This is a schematic diagram illustrating the structure of a transfer learning model provided in an embodiment of this application. Figure 3As shown, when the source domain scenario is a product recommendation scenario and the target domain scenario is a product search scenario, the transfer learning model is a recommendation model. The recommendation model includes, from bottom to top, a scenario information extraction layer, a task information extraction layer (click-through rate (CTR) domain and conversion rate (CVR) domain), and a masked multi-task loss. During training, the joint loss is used for end-to-end optimization.

[0164] The training samples obtained by the method steps shown in S103 above are used as the input of the recommendation model. They first enter the scene information extraction layer to obtain the output of the shared base encoder.

[0165] The recommendation model sets the search click branch in the click domain ( Figure 3 The search CTR and recommended click branches shown are shown. Figure 3 The recommended CTR shown above allows you to set up a search for transaction branches in the transaction domain. Figure 3 The search CVR and recommended transaction branches shown are shown. Figure 3 The recommended CVR shown is configured, and a shared sub-tower is set up ( Figure 3 The shared CTR, shared CVR, and global shared domains shown are used to carry information that can be transferred across scenarios. Among them, the click domain is used for process-type tasks that learn whether a click has occurred; the transaction domain is used for result-type tasks that learn whether a transaction has been completed.

[0166] It should be noted that information selection and fusion between the sub-towers of each scenario and the shared sub-tower are carried out through a gating mechanism; the general representation generated by the shared sub-tower is selectively fed into the search or recommendation CTR and CVR sub-towers through gating.

[0167] During the training of the recommendation model, if a user only sees and converts a certain item in the item recommendation scenario (e.g., clicks and completes a transaction), but never sees the same item in the item search scenario, setting the first and second target domain labels of that item in the item search scenario to 0 is equivalent to assuming the user sees the item but doesn't click or convert. However, the user actually has no opportunity to see the item in the item search scenario. This will cause the recommendation model to incorrectly treat the unexposed training samples in the item search scenario as true negative examples, resulting in prediction bias.

[0168] To address the aforementioned issues, this application designs an exposure mask mechanism, which sets a mask based on the scene to which the current training sample belongs, calculates gradients only on the loss function of the scene to which the current training sample belongs, and updates the weights of the task information extraction layer and scene information extraction layer of the scene to which the current training sample belongs through normal backpropagation. The loss of other scenes is 0, and no parameters are updated.

[0169] In this embodiment, the final loss function of the recommendation model is: , The calculation formula is as follows: .

[0170] in, This represents the loss function corresponding to the recommendation click task in the product recommendation scenario (first recommendation CTRLoss). This represents the loss function (First Recommendation CVR Loss) for the recommendation and transaction task in the product recommendation scenario. This represents the loss function corresponding to the search click task in the product sourcing scenario (second recommendation: CTR Loss). This represents the loss function corresponding to the search and transaction task in the product sourcing scenario (CVR Loss is the first recommendation). This represents the loss function corresponding to the merged transaction task.

[0171] This application also provides a method for training a recommendation model. Figure 4 This is a flowchart illustrating a training method for a recommendation model provided in an embodiment of this application. Figure 4 As shown, the training method of the recommendation model provided in this application embodiment specifically includes S401 to S405, which will be described in detail below.

[0172] S401. Obtain multiple source domain samples and their corresponding source domain labels in the product recommendation scenario.

[0173] Among them, the source domain sample is the exposure data in the product recommendation scenario; each source domain sample includes multiple source domain features; the source domain label corresponding to each source domain sample is used to indicate the positive or negative result of the target task in the product recommendation scenario.

[0174] S402. Obtain multiple target domain samples and their corresponding target domain labels in the product sourcing scenario.

[0175] Among them, the target domain sample is the exposure data in the product search scenario; each target domain sample includes multiple target domain features; the target domain label corresponding to each target domain sample is used to indicate the positive or negative result of the target task in the product search scenario; the overlap between multiple target domain features and multiple source domain features is less than the first threshold.

[0176] S403. Based on multiple source domain features and multiple target domain features, perform feature alignment and merging processing on multiple source domain samples and multiple target domain samples to obtain multiple training samples.

[0177] Each source domain sample and each target domain sample corresponds to a training sample. Each training sample includes multiple target domain features and a subset of source domain features related to multiple source domain features.

[0178] S404. Determine the training label corresponding to each training sample among multiple training samples.

[0179] S405. Train the transfer learning model based on multiple training samples and the training labels corresponding to each training sample.

[0180] In the training method of the recommendation model provided in this application, the cargo recommendation scenario is the source domain scenario, and the source domain samples come from the exposure logs in the cargo recommendation scenario (e.g., cargo exposure records passively seen by drivers in the recommendation stream).

[0181] The cargo search scenario is the target domain scenario, and the target domain samples come from the exposure logs in the cargo search scenario (e.g., the exposure records of the results page returned after the driver enters the formatted conditions).

[0182] Figure 5 This is a schematic diagram of the structure of a training device for a transfer learning model provided in an embodiment of this application. Figure 5 As shown, the training device 500 for the transfer learning model provided in this embodiment includes a first acquisition module 501, a second acquisition module 502, a first processing module 503, a first determination module 504, and a first training module 505.

[0183] The first acquisition module 501 is used to acquire multiple source domain samples in the source domain scene and the source domain labels corresponding to the multiple source domain samples respectively; wherein, each source domain sample includes multiple source domain features; the source domain label corresponding to each source domain sample is used to indicate the positive or negative result of the target task in the source domain scene.

[0184] The second acquisition module 502 is used to acquire multiple target domain samples and target domain labels corresponding to the multiple target domain samples in the target domain scenario; wherein, each target domain sample includes multiple target domain features; the target domain label corresponding to each target domain sample is used to indicate the positive or negative result of the target task in the target domain scenario; the overlap between the multiple target domain features and the multiple source domain features is less than a first threshold.

[0185] The first processing module 503 is used to perform feature alignment and merging processing on multiple source domain samples and multiple target domain samples based on multiple source domain features and multiple target domain features to obtain multiple training samples; wherein each source domain sample and each target domain sample corresponds to a training sample, and each training sample includes multiple target domain features and a subset of source domain features related to multiple source domain features.

[0186] The first determining module 504 is used to determine the training label corresponding to each training sample among multiple training samples.

[0187] The first training module 505 is used to train the transfer learning model based on multiple training samples and the training labels corresponding to each training sample.

[0188] It should be understood that the corresponding processes performed by each module have been described in detail in the above method embodiments, and will not be repeated here for the sake of brevity.

[0189] Figure 6 This is a schematic diagram of the structure of a training device for a recommendation model provided in an embodiment of this application. Figure 6 As shown, the training device 600 for the recommendation model provided in this embodiment includes a third acquisition module 601, a fourth acquisition module 602, a second processing module 603, a second determination module 604, and a second training module 605.

[0190] The third acquisition module 601 is used to acquire multiple source domain samples and source domain labels corresponding to the multiple source domain samples in the source domain scenario; wherein, the source domain samples are exposure data in the product recommendation scenario; each source domain sample includes multiple source domain features; the source domain label corresponding to each source domain sample is used to indicate the positive or negative result of the target task in the source domain scenario.

[0191] The fourth acquisition module 602 is used to acquire multiple target domain samples and target domain labels corresponding to the multiple target domain samples in the target domain scenario; wherein, the target domain samples are exposure data in the source search scenario; each target domain sample includes multiple target domain features; the target domain label corresponding to each target domain sample is used to indicate the positive or negative result of the target task in the target domain scenario; the overlap between the multiple target domain features and the multiple source domain features is less than a first threshold.

[0192] The second processing module 603 is used to perform feature alignment and merging processing on multiple source domain samples and multiple target domain samples based on multiple source domain features and multiple target domain features to obtain multiple training samples; wherein, each source domain sample and each target domain sample corresponds to a training sample, and each training sample includes multiple target domain features and a subset of source domain features related to multiple source domain features;

[0193] The second determining module 604 is used to determine the training label corresponding to each training sample among multiple training samples;

[0194] The second training module 605 is used to train the transfer learning model based on multiple training samples and the training labels corresponding to each training sample.

[0195] It should be understood that the corresponding processes performed by each module have been described in detail in the above method embodiments, and will not be repeated here for the sake of brevity.

[0196] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device 700 provided in this embodiment includes a memory 701 and a processor 702.

[0197] The memory 701 can be a separate physical unit, connected to the processor 702 via a bus 703. Alternatively, the memory 701 and processor 702 can be integrated and implemented in hardware. The memory 701 stores program instructions, which the processor 702 calls to execute the operations performed by the electronic device in any of the above method embodiments.

[0198] Optionally, when some or all of the methods in the above embodiments are implemented by software, the electronic device 700 may also include only the processor 702. A memory 701 for storing programs is located outside the electronic device 700, and the processor 702 is connected to the memory via circuits / wires to read and execute the programs stored in the memory. The processor 702 may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP. The processor 702 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0199] The memory 701 may include volatile memory, such as random-access memory (RAM); the memory may also include non-volatile memory, such as flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory may also include a combination of the above types of memory.

[0200] For example, this application provides a chip including: an interface circuit and a logic circuit. The interface circuit is used to receive signals from other chips outside the chip and transmit them to the logic circuit, or to send signals from the logic circuit to other chips outside the chip. The logic circuit is used to perform the operations performed by the electronic device in the above method embodiments.

[0201] For example, this application provides a computer-readable storage medium having computer program instructions stored thereon, which are executed by the processor of an electronic device to cause the electronic device to perform the operations performed by the electronic device in the above method embodiments.

[0202] For example, this application provides a computer program product that, when run on an electronic device, causes the electronic device to perform the operations performed by the electronic device in the above method embodiments.

[0203] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for training a transfer learning model, characterized in that, The method includes: Obtain multiple source domain samples and corresponding source domain labels for each source domain sample in the source domain scenario; wherein, each source domain sample includes multiple source domain features; the source domain label corresponding to each source domain sample is used to indicate the positive or negative result of the target task in the source domain scenario; Obtain multiple target domain samples and corresponding target domain labels for each target domain sample in the target domain scenario; wherein, each target domain sample includes multiple target domain features; the target domain label corresponding to each target domain sample is used to indicate the positive or negative result of the target task in the target domain scenario; the overlap between the multiple target domain features and the multiple source domain features is less than a first threshold; Based on the multiple source domain features and the multiple target domain features, feature alignment and merging processes are performed on the multiple source domain samples and the multiple target domain samples to obtain multiple training samples with target domain features as the main feature and source domain feature subsets as the auxiliary feature. The feature alignment and merging processes include semantic mapping, type and caliber unification, source domain feature subset selection, and feature concatenation. Each source domain sample and each target domain sample corresponds to one training sample, and each training sample includes the multiple target domain features and a source domain feature subset related to the multiple source domain features. Determine the training label corresponding to each training sample among the plurality of training samples; The transfer learning model is trained based on the plurality of training samples and the training label corresponding to each training sample; Before determining the training label corresponding to each training sample among the plurality of training samples, the method further includes: Based on the type of the target task, determine whether to perform label fusion processing on the target training sample group among the multiple training samples; wherein, the target training sample group includes a first training sample and a second training sample, the first training sample is obtained by feature alignment and merging processing of the source domain sample, the second training sample is obtained by feature alignment and merging processing of the target domain sample, and the content of the first training sample and the second training sample is the same.

2. The method according to claim 1, characterized in that, Determining the training label corresponding to each training sample among the plurality of training samples includes: For each training sample, if the training sample belongs to the target training sample group, the source domain label corresponding to the first training sample in the target training sample group and the target domain label corresponding to the second training sample in the target training sample group are fused to obtain the fused label corresponding to the training sample, and the fused label is used as the training label of the first training sample and the second training sample in the target training sample group respectively. If the training sample does not belong to the target training sample group, and the training sample is obtained by feature alignment and merging of the source domain sample, the source domain label corresponding to the source domain sample is determined as the training label of the training sample. If the training sample does not belong to the target training sample group, and the training sample is obtained by feature alignment and merging of the target domain sample, the target domain label corresponding to the target domain sample is determined as the training label of the training sample.

3. The method according to claim 2, characterized in that, The step of fusing the source domain label corresponding to the first training sample in the target training sample group with the target domain label corresponding to the second training sample to obtain a fused label includes: When the source domain label corresponding to the first training sample and / or the target domain label corresponding to the second training sample are used to indicate that the target task has a positive result, the fusion label corresponding to the training sample is used to indicate that the target task has a positive result in the training sample; When both the source domain label corresponding to the first training sample and the target domain label corresponding to the second training sample are used to indicate that the target task has a negative result, the fusion label corresponding to the training sample is used to indicate that the target task has a negative result in the training sample.

4. The method according to claim 1, characterized in that, The step of training the transfer learning model based on the plurality of training samples and the training label corresponding to each training sample includes: Based on the scene and data source date corresponding to each training sample, the multiple training samples are stratified and randomly processed to divide the multiple training samples into multiple training sample sets; wherein, the proportion of each training sample in each training sample set that combines data source date and scene is the same; The transfer learning model is trained in multiple rounds by sequentially selecting the plurality of training sample sets; wherein, in each round of training, one of the training sample sets in the plurality of training sample sets is used to train the transfer learning model.

5. The method according to claim 4, characterized in that, The transfer learning model includes a first sub-model, a second sub-model, and a third sub-model; wherein, the first sub-model is used for task learning in the source domain scenario, the second sub-model is used for task learning in the target domain scenario, and the third sub-model is used for fusion task learning of the target training sample group; When training the transfer learning model in the current round based on the training sample set, if the training sample does not belong to the target training sample group, and the training sample is obtained by feature alignment and merging of the source domain sample, the first sub-model is trained using the training sample. If the training sample does not belong to the target training sample group, and the training sample is obtained by feature alignment and merging of the target domain sample, the second sub-model is trained using the training sample; If the training sample belongs to the target training sample group, the third sub-model is trained using the training sample.

6. The method according to claim 5, characterized in that, The method further includes: Based on the first loss function corresponding to the first sub-model, the second loss function corresponding to the second sub-model, and the third loss function corresponding to the third sub-model, the joint loss function of the transfer learning model is determined; wherein, the joint loss function is a weighted sum of the first loss function, the second loss function, and the third loss function.

7. A method for training a recommendation model, characterized in that, The method includes: Obtain multiple source domain samples and their corresponding source domain labels in the product recommendation scenario; wherein, the source domain samples are exposure data in the product recommendation scenario; each source domain sample includes multiple source domain features; the source domain label corresponding to each source domain sample is used to indicate the positive or negative result of the target task in the product recommendation scenario; Obtain multiple target domain samples and corresponding target domain labels for each of the multiple target domain samples in a product sourcing scenario; wherein, the target domain samples are exposure data in the product sourcing scenario; each target domain sample includes multiple target domain features; the target domain label corresponding to each target domain sample is used to indicate the positive or negative result of the target task in the product sourcing scenario; the overlap between the multiple target domain features and the multiple source domain features is less than a first threshold; Based on the multiple source domain features and the multiple target domain features, feature alignment and merging processes are performed on the multiple source domain samples and the multiple target domain samples to obtain multiple training samples with target domain features as the main feature and source domain feature subsets as the auxiliary feature. The feature alignment and merging processes include semantic mapping, type and caliber unification, source domain feature subset selection, and feature concatenation. Each source domain sample and each target domain sample corresponds to one training sample, and each training sample includes the multiple target domain features and a source domain feature subset related to the multiple source domain features. Determine the training label corresponding to each training sample among the plurality of training samples; The recommendation model is trained based on the plurality of training samples and the training label corresponding to each training sample; Before determining the training label corresponding to each training sample among the plurality of training samples, the method further includes: Based on the type of the target task, determine whether to perform label fusion processing on the target training sample group among the multiple training samples; wherein, the target training sample group includes a first training sample and a second training sample, the first training sample is obtained by feature alignment and merging processing of the source domain sample, the second training sample is obtained by feature alignment and merging processing of the target domain sample, and the content of the first training sample and the second training sample is the same.

8. A training device for a transfer learning model, characterized in that, The device includes: The first acquisition module is used to acquire multiple source domain samples in the source domain scenario and source domain labels corresponding to the multiple source domain samples respectively; wherein, each source domain sample includes multiple source domain features; the source domain label corresponding to each source domain sample is used to indicate the positive or negative result of the target task in the source domain scenario; The second acquisition module is used to acquire multiple target domain samples in the target domain scenario and target domain labels corresponding to the multiple target domain samples respectively; wherein, each target domain sample includes multiple target domain features; the target domain label corresponding to each target domain sample is used to indicate the positive or negative result of the target task in the target domain scenario; the overlap between the multiple target domain features and the multiple source domain features is less than a first threshold; The first processing module is used to perform feature alignment and merging processing on the multiple source domain features and the multiple target domain features to obtain multiple training samples with target domain features as the main feature and source domain feature subsets as the auxiliary feature. The feature alignment and merging processing includes semantic mapping, type and caliber unification, source domain feature subset selection, and feature concatenation. Each source domain sample and each target domain sample corresponds to one training sample, and each training sample includes the multiple target domain features and a source domain feature subset related to the multiple source domain features. The first determining module is used to determine the training label corresponding to each training sample among the plurality of training samples; The first training module is used to train the transfer learning model based on the plurality of training samples and the training label corresponding to each training sample; The first determining module is further configured to determine, based on the type of the target task, whether to perform label fusion processing on the target training sample group among the plurality of training samples; wherein, the target training sample group includes a first training sample and a second training sample, the first training sample is obtained by feature alignment and merging processing of the source domain sample, the second training sample is obtained by feature alignment and merging processing of the target domain sample, and the content of the first training sample and the second training sample is consistent.

9. A training device for a recommendation model, characterized in that, The device includes: The third acquisition module is used to acquire multiple source domain samples and source domain labels corresponding to the multiple source domain samples in the product recommendation scenario; wherein, the source domain samples are exposure data in the product recommendation scenario; each source domain sample includes multiple source domain features; the source domain label corresponding to each source domain sample is used to indicate the positive or negative result of the target task in the product recommendation scenario; The fourth acquisition module is used to acquire multiple target domain samples and target domain labels corresponding to the multiple target domain samples in the product search scenario; wherein, the target domain samples are exposure data in the product search scenario; each target domain sample includes multiple target domain features; the target domain label corresponding to each target domain sample is used to indicate the positive or negative result of the target task in the product search scenario; the overlap between the multiple target domain features and the multiple source domain features is less than a first threshold. The second processing module is used to perform feature alignment and merging processing on the multiple source domain features and the multiple target domain features to obtain multiple training samples with target domain features as the main feature and source domain feature subsets as the auxiliary feature. The feature alignment and merging processing includes semantic mapping, type and caliber unification, source domain feature subset selection, and feature concatenation. Each source domain sample and each target domain sample corresponds to one training sample, and each training sample includes the multiple target domain features and a source domain feature subset related to the multiple source domain features. The second determining module is used to determine the training label corresponding to each training sample among the plurality of training samples; The second training module is used to train the recommendation model based on the plurality of training samples and the training label corresponding to each training sample; The second determining module is further configured to determine, based on the type of the target task, whether to perform label fusion processing on the target training sample group among the plurality of training samples; wherein, the target training sample group includes a first training sample and a second training sample, the first training sample is obtained by feature alignment and merging processing of the source domain sample, the second training sample is obtained by feature alignment and merging processing of the target domain sample, and the content of the first training sample and the second training sample is consistent.

Citation Information

Patent Citations

  • Data processing method and related equipment

    CN118114037A

  • Cross-domain recommendation and model training method and device

    CN120876017A