Multi-task query understanding method and device
By using a lightweight student model to uniformly output and perform field-level validation, the problems of high latency and inconsistent formatting in multi-task query understanding are solved, enabling efficient query understanding and product retrieval in retail search scenarios.
Patent Information
- Application Number
- CN202611627706.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-21
- Publication Date
- 2026-11-17
AI Technical Summary
Existing multi-task query understanding methods suffer from high online processing latency and inconsistent output formats due to the online collaborative processing of multiple independent modules, making them difficult to use directly and reliably for subsequent processing.
A lightweight student model is used to uniformly output multi-task query comprehension results online. Fields that pass the validation are retained through field-level validation. A large language model is used to generate multi-task query comprehension labels and field-level training weights offline to ensure uniform output format and reliable results.
It reduces online query comprehension latency, ensures consistent output format, and improves the reliability of output field data, making it suitable for product retrieval and sorting in retail search scenarios.
Smart Images

Figure CN123115205A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of Internet technology, and in particular relates to a multi-task query understanding method and apparatus. Background Technology
[0002] In retail search scenarios, search systems need to perform multi-task understanding of user-input queries to support subsequent product retrieval and ranking. Multi-task query understanding typically involves tasks such as query error correction, query rewriting, and intent recognition.
[0003] In related technologies, the aforementioned multi-task query understanding is usually executed online by multiple independent processing modules or rule modules, with each module processing sequentially and outputting its corresponding understanding results.
[0004] However, in the above processing method, query understanding requires multiple modules to work together online, resulting in high online processing latency and inconsistent output formats among the modules, making it difficult to directly and reliably use the query understanding results for subsequent processing. Summary of the Invention
[0005] This application provides a multi-task query understanding method and apparatus, which can reduce online query understanding latency, ensure uniform output format, and improve the reliability of fields in the output results.
[0006] The first aspect of this application provides a multi-task query understanding method, comprising: acquiring a query to be processed; inputting the query to be processed into a preset lightweight student model, wherein the lightweight student model outputs multi-task query understanding results conforming to a preset unified output format, wherein the multi-task query understanding results include at least two of query correction results, query rewriting results, and intent recognition results, wherein the lightweight student model is trained based on multi-task query understanding labels generated by a first teacher model and field-level training weights, the multi-task query understanding labels conforming to a preset unified output format, the field-level training weights being determined based on the verification results of each field in the multi-task query understanding labels, the first teacher model being a large language model with a larger number of parameters than the lightweight student model, and the first teacher model generating multi-task query understanding labels in an offline state; performing field-level verification on the multi-task query understanding results to obtain field-level verification results; and retaining the fields in the multi-task query understanding results that pass the field-level verification and ignoring the fields that fail the field-level verification.
[0007] In the technical solution of this application, at least two of the tasks of query error correction, query rewriting and intent recognition are output online by a lightweight student model, and the output results are validated at the field level, thereby reducing the latency of online query understanding, ensuring the uniformity of output format, and improving the reliability of the fields of the output results.
[0008] Optionally, in one possible implementation of the first aspect, the above-mentioned field-level validation of the multi-task query understanding results to obtain field-level validation results includes: for each field in the multi-task query understanding results, obtaining the field confidence level corresponding to the field; if the field confidence level is greater than or equal to a preset confidence threshold, determining that the field passes the field-level validation; if the field confidence level is less than the preset confidence threshold, determining that the field fails the field-level validation. Thus, by determining whether a field passes the field-level validation based on the comparison result between the field confidence level and the preset confidence threshold, the incorrect use of low-confidence fields is avoided, improving the accuracy of field-level validation.
[0009] Optionally, in another possible implementation of the first aspect, before inputting the query to be processed into a preset lightweight student model, the method further includes: obtaining a training query; generating multi-task query comprehension labels corresponding to the training query through a teacher model, wherein the teacher model includes a first teacher model and a second teacher model, the second teacher model having fewer parameters than the first teacher model but more parameters than the lightweight student model; performing label validation on the multi-task query comprehension labels to obtain validation results for each field in the multi-task query comprehension labels; determining field-level training weights based on the validation results; and training a preset initial model based on the multi-task query comprehension labels and field-level training weights to obtain the lightweight student model. Thus, by utilizing the teacher model to generate multi-task query comprehension labels offline and determining field-level training weights based on the label validation results to train the lightweight student model, the output accuracy and reliability of the lightweight student model are improved.
[0010] Optionally, in another possible implementation of the first aspect, the above-mentioned generation of multi-task query comprehension labels corresponding to the training query through the teacher model includes: obtaining the complexity of the training query; generating multi-task query comprehension labels through a first teacher model when the complexity is greater than or equal to a preset complexity threshold; and generating multi-task query comprehension labels through a second teacher model when the complexity is less than the preset complexity threshold. Thus, by selecting teacher models with different parameter scales based on the complexity of the training query to generate multi-task query comprehension labels, the labeling cost is reduced while ensuring label quality.
[0011] Optionally, in another possible implementation of the first aspect, the label validation of the multi-task query comprehension labels to obtain the validation result corresponding to each field in the multi-task query comprehension labels includes: for each field in the multi-task query comprehension labels, matching the field with preset field validation conditions; if the field matches the preset field validation conditions, determining the field's validation result as passed; if the field does not match the preset field validation conditions, determining the field's validation result as failed. Thus, by matching the label fields with preset field validation conditions, reliable label fields are selected, reducing the impact of erroneous labels on model training.
[0012] Optionally, in another possible implementation of the first aspect, the validation result corresponding to each field in the multi-task query understanding label includes the field confidence score. The determination of field-level training weights based on the validation results includes: obtaining the teacher model source corresponding to the field; determining the basic weight of the field based on the teacher model source; and adjusting the basic weight based on the field confidence score to obtain the field-level training weight. Therefore, by combining the teacher model source and the field confidence score to determine the field-level training weight, the influence of labels with different sources and confidence scores on model training can be controlled more precisely, thereby improving the model training effect.
[0013] Optionally, in another possible implementation of the first aspect, the aforementioned first teacher model is obtained through the following steps: acquiring domain data, which includes at least one of search logs, product information, category systems, brand information, and attribute information; and fine-tuning the base model, which has more parameters than the lightweight student model, based on the domain data to obtain the first teacher model. Thus, by fine-tuning the large language model using domain data to obtain the first teacher model, the teacher model's ability to generate tags for specific domain queries is improved.
[0014] Optionally, in another possible implementation of the first aspect, the method further includes: acquiring online behavioral feedback data, which includes at least one of the following: no-result rate, search modification rate, click-through rate, conversion rate, and manual evaluation results; and updating the lightweight student model and multi-task query understanding tags based on the online behavioral feedback data. Thus, by updating the lightweight student model and multi-task query understanding tags based on online behavioral feedback data, the accuracy of the model and tags is continuously optimized to adapt to changes in query distribution.
[0015] Optionally, in another possible implementation of the first aspect, the aforementioned preset unified output format includes query correction fields, query rewrite fields, intent type fields, entity fields, category fields, and attribute fields.
[0016] A second aspect of this application provides a multi-task query understanding apparatus, comprising: The query retrieval module is used to retrieve queries to be processed. The model processing module is used to input the query to be processed into a preset lightweight student model. The lightweight student model outputs multi-task query understanding results that conform to a preset unified output format. The multi-task query understanding results include at least two of the following: query correction results, query rewriting results, and intent recognition results. The lightweight student model is trained based on the multi-task query understanding labels and field-level training weights generated by the first teacher model. The multi-task query understanding labels conform to a preset unified output format. The field-level training weights are determined based on the verification results of each field in the multi-task query understanding labels. The first teacher model is a large language model with a larger number of parameters than the lightweight student model. The first teacher model generates multi-task query understanding labels in an offline state. The field validation module is used to perform field-level validation on the results of multi-task query understanding and obtain the field-level validation results. The field optimization module is used to retain fields that pass the field-level validation in the multi-task query understanding results and ignore fields that fail the field-level validation.
[0017] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the multi-task query understanding method of the first aspect described above.
[0018] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the multi-task query and understanding method of the first aspect described above.
[0019] The fifth aspect of this application provides a computer program product that, when run on an electronic device, causes the electronic device to execute the multi-task query understanding method of the first aspect described above.
[0020] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram of the architecture of a multi-task query understanding system provided in an embodiment of this application; Figure 2 This is a flowchart illustrating a multi-task query understanding method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the structure of a multi-task query understanding device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0023] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0024] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0025] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0026] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0027] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0028] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0029] It should be understood that the sequence number of each step in this embodiment does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of this application embodiment.
[0030] In related technologies, the aforementioned multi-task query understanding is typically executed online by multiple independent processing modules or rule modules, with each module processing sequentially and outputting its corresponding understanding result. However, in this processing method, query understanding requires multiple modules to collaborate online, resulting in high online processing latency and inconsistent output formats among modules, making it difficult to directly and reliably use the query understanding results for subsequent processing.
[0031] In view of this, embodiments of this application provide a multi-task query understanding method and apparatus. The method first acquires a query to be processed; then, the query is input into a preset lightweight student model, which outputs multi-task query understanding results conforming to a preset unified output format. These multi-task query understanding results include at least two of the following: query correction results, query rewriting results, and intent recognition results. The lightweight student model is trained based on multi-task query understanding labels generated by a first teacher model and field-level training weights. The multi-task query understanding labels conform to a preset unified output format, and the field-level training weights are determined based on the verification results of each field in the multi-task query understanding labels. The first teacher model is a large language model with a larger number of parameters than the lightweight student model, and it generates multi-task query understanding labels offline. Next, field-level verification is performed on the multi-task query understanding results to obtain field-level verification results. Finally, based on the field-level verification results, fields that pass the field-level verification in the multi-task query understanding results are retained, while fields that fail the field-level verification are ignored. Therefore, by having at least two of the tasks in query correction, query rewriting, and intent recognition uniformly output online using a lightweight student model, and by performing field-level validation on the output results, the latency of online query understanding is reduced, the output format is ensured to be consistent, and the reliability of the fields in the output results is improved.
[0032] The following example illustrates the application scenarios of the multi-task query understanding method provided in this application. In retail search scenarios, users often input queries containing typos or colloquial expressions, such as "no sugar sparkling water." Traditional methods require multiple independent modules to perform error correction, rewriting, and intent recognition separately. This sequential processing leads to high online latency, and the output formats of each module are inconsistent and prone to conflict. Using the method of this application, "no sugar sparkling water" is input into a preset lightweight student model. This model outputs a multi-task query understanding result in one go, including the query error correction result "sugar-free sparkling water," the query rewriting result "0 sugar sparkling beverage," and the intent recognition result "product search." Field-level validation is performed on each field, retaining only those that pass the validation. This results in a consistent and reliable multi-task query understanding result with lower online latency, facilitating direct use in subsequent product recall.
[0033] To illustrate the technical solution of this application, specific embodiments are described below.
[0034] Reference Figure 1 The diagram illustrates the architecture of a multi-task query understanding system provided in an embodiment of this application. Figure 1 As shown, the system includes a data acquisition module, a query complexity evaluation module, a domain fine-tuning module for the ultra-large base model, a teacher model construction module, a teacher annotation module, a label verification module, a sample construction module, a student model training module, an online inference module, a result verification and downgrading module, and a feedback closed-loop module.
[0035] The data acquisition module is used to obtain internal data such as search logs, product database, and category system.
[0036] The query complexity assessment module is used to determine the query complexity level.
[0037] The ultra-large pedestal model domain fine-tuning module is used to obtain the first teacher model based on the pedestal model and domain data.
[0038] The teacher model building module is used to form a hierarchical set of teachers.
[0039] The teacher annotation module is used to generate multi-task query comprehension tags.
[0040] The label validation module is used to validate each field in the multi-task query understanding label and generate field-level training weights.
[0041] The sample building module is used to build training samples.
[0042] The student model training module is used to train a preset initial model based on multi-task query understanding labels and field-level training weights to obtain a lightweight student model.
[0043] The online inference module is used to run a lightweight student model and output multi-task query comprehension results that conform to a preset unified output format.
[0044] The result validation and degradation module is used to perform field-level validation on the results of multi-task query understanding, retaining fields that pass the field-level validation and ignoring fields that fail the field-level validation.
[0045] The feedback loop module is used to update the lightweight student model and multi-task query understanding labels based on online behavior feedback data.
[0046] The specific functions and interaction processes of the above modules will be described in detail in subsequent embodiments.
[0047] exist Figure 1 Based on the system architecture shown, Figure 2 A flowchart illustrating a multi-task query understanding method provided in an embodiment of this application is shown. Figure 2 As shown, this multi-task query comprehension method may include the following steps: Step 201: Obtain the query to be processed.
[0048] In this embodiment, a pending query refers to the query information entered by a user into the search system in a retail search scenario. A pending query may include text entered by the user in the search box, speech-to-text transcription, or the current query within a multi-round search context. The multi-round search context refers to the contextual information formed by the same user entering queries multiple times consecutively within a single search session; the current query is the most recently entered query in that search session. Pending queries reflect the user's immediate search needs and are the object of subsequent query understanding and processing.
[0049] The method for obtaining the query to be processed can be as follows: after a user submits a search request, the search gateway receives the query and provides it, along with necessary contextual information and lightweight features, to the online inference module. The search gateway is the entry point component connecting the user terminal and the search backend service, used to receive user requests and perform initial forwarding. Contextual information is used to assist in understanding the semantics of the query to be processed; for example, it may include queries previously entered by the user in the same search session, records of user clicks or purchases, and sequences of products exposed by the user. Lightweight features may include information such as the text length of the query to be processed, whether it hits a preset thesaurus, historical no-result markers, and historical modified search markers. Lightweight features are used to provide a reference for field-level validation in subsequent steps.
[0050] Step 202: Input the query to be processed into the preset lightweight student model. The lightweight student model outputs the multi-task query understanding results that conform to the preset unified output format.
[0051] The multi-task query understanding results include at least two of the following: query correction results, query rewriting results, and intent recognition results. The lightweight student model is trained based on the multi-task query understanding labels generated by the first teacher model and the field-level training weights. The multi-task query understanding labels conform to a preset unified output format. The field-level training weights are determined based on the verification results of each field in the multi-task query understanding labels. The first teacher model is a large language model with a larger number of parameters than the lightweight student model. The first teacher model generates multi-task query understanding labels in an offline state.
[0052] In this embodiment, a predefined set of structured output fields is used to constrain the output structure of the lightweight student model, enabling the multi-task query understanding results to be directly read and processed by subsequent modules of the search system. The multi-task query understanding results include at least two of the following: query correction results, query rewriting results, and intent recognition results.
[0053] Among them, query correction results refer to the text obtained after correcting typos, homophones, or grammatical errors in the query to be processed. Query rewriting results refer to the candidate query text obtained after expanding, replacing, or simplifying the query to be processed without changing its core semantics. Intent recognition results refer to the category of user intent expressed by the query to be processed, determined from a preset intent set.
[0054] In some embodiments, the preset unified output format may also include more fields such as entity fields, category fields, and attribute fields, which will be discussed in detail later. By using the preset unified output format, the lightweight student model can complete multiple query comprehension tasks simultaneously in a single inference, avoiding the error accumulation and inconsistent output format problems caused by the sequential processing of multiple independent models in traditional methods.
[0055] In this embodiment, the lightweight student model is a model with fewer parameters used for online inference, smaller than that of the first teacher model. It is assumed that the lightweight student model has already been trained and does not require retraining during the online inference phase; only forward computation needs to be performed. The specific training process of the lightweight student model will be described in detail below.
[0056] In this embodiment, the lightweight student model is trained based on the multi-task query comprehension labels and field-level training weights generated by the first teacher model. The first teacher model is a large language model (LLM) with a larger number of parameters than the lightweight student model. The first teacher model generates multi-task query comprehension labels offline and does not participate in the online inference process to avoid the high latency and high resource consumption caused by online inference of the large language model. The multi-task query comprehension labels conform to a preset unified output format, and their field types correspond to the multi-task query comprehension results. The field-level training weights are determined based on the verification results of each field in the multi-task query comprehension labels and are used to differentiate the weights of different fields during training to avoid erroneous label fields having an excessive impact on model training.
[0057] In one possible implementation, the data acquisition module is responsible for acquiring standardized training data sources such as search logs, user click data, add-to-cart data, purchase data, no-result logs, search modification logs, product database data, category system data, brand terminology, and attribute terminology, providing an internal data foundation for teacher annotation and student model training.
[0058] The search log records user-input queries and corresponding search times. User click data records user clicks on exposed products. Add-to-cart and purchase data reflect further user conversion behaviors. No-result logs record queries that did not retrieve any products. Re-search logs record the process of a user re-entering a new query after not receiving satisfactory results. Product database data includes product titles, categories, brands, attributes, aliases, synonyms, and product availability. Category system data represents the hierarchical product category structure defined by the retail platform. The brand terminology is a collection of brand names and aliases maintained by the platform. The attribute terminology is a collection of attribute names and values defined by the platform. All of the above data collectively constitute the data source for subsequent teacher model domain fine-tuning, teacher annotation, label validation, and student model training.
[0059] In one possible implementation, when acquiring queries to be processed and constructing training query samples, queries can be divided into multiple types, including high-frequency head queries, low-frequency long-tail queries, misspelled queries, colloquial queries, multi-constraint queries, new product / new word queries, no-result queries, and modified search queries.
[0060] Among them, high-frequency head queries refer to common queries that occur frequently. Low-frequency long-tail queries refer to queries that occur less frequently but have clear semantics. Misspelled word queries refer to queries containing misspelled words or homophones. Colloquial queries refer to queries that use everyday spoken language. Multi-constraint queries refer to queries that contain multiple attributes or conditional constraints. New product / new term queries refer to queries that contain newly listed product names or newly appearing brand or attribute terms. No-result queries refer to queries that did not retrieve any products in the historical search. Modified search queries refer to queries that the user has modified and re-entered during the search process.
[0061] It should be noted that configuring different sampling ratios for different types of queries can prevent the training set from being overwhelmed by high-frequency simple queries when constructing training samples, thereby ensuring that long-tail queries and complex queries occupy a reasonable proportion in the training data.
[0062] In one possible implementation, the query complexity evaluation module is used to determine the complexity level of the query based on query characteristics. The inputs to the query complexity evaluation module may include query text, historical no-result rate, historical modified search rate, term hit rate, query length, and context rounds.
[0063] Among these, the historical no-result rate refers to the percentage of times the query or its similar queries failed to retrieve any products in historical searches. The historical search modification rate refers to the percentage of times a user modified their search after querying the current query. The term hit rate refers to the proportion of times the query text matches the brand terminology, attribute terminology, or category terminology. The query length refers to the number of characters or words contained in the query text. The context rounds refer to the number of queries that have occurred before this query in the current search session.
[0064] It should be noted that the query complexity assessment module can integrate the above characteristics to classify queries into different complexity levels. A higher complexity level indicates a greater difficulty in understanding the query, requiring the use of a more capable teacher model to generate multi-task query comprehension labels. A lower complexity level allows the use of lightweight or rule-based teacher signals to generate multi-task query comprehension labels.
[0065] By using the above methods, appropriate teacher strategies can be selected for queries of different complexities during the offline annotation stage, thus controlling annotation costs while ensuring label quality.
[0066] In one embodiment, the training process of the lightweight student model may specifically include the following steps: obtaining a training query; generating multi-task query comprehension labels corresponding to the training query through a teacher model, wherein the teacher model includes a first teacher model and a second teacher model, the second teacher model having fewer parameters than the first teacher model but more parameters than the lightweight student model; performing label validation on the multi-task query comprehension labels to obtain the validation result for each field in the multi-task query comprehension labels; determining field-level training weights based on the validation results; and training a preset initial model based on the multi-task query comprehension labels and field-level training weights to obtain the lightweight student model. Therefore, by utilizing the teacher model to generate multi-task query comprehension labels offline and determining field-level training weights based on the label validation results to train the lightweight student model, the output accuracy and reliability of the lightweight student model are improved.
[0067] It should be noted that in the above training process, the training queries are query samples used to train the lightweight student model, which can be derived from search logs, manually labeled samples, or teacher-labeled samples. Training queries can include various types such as high-frequency head queries, low-frequency long-tail queries, misspelled queries, colloquial queries, multi-constraint queries, new product / new word queries, no-result queries, and modified search queries. When constructing training samples, different sampling ratios are configured for different types of queries to avoid the training set being overwhelmed by high-frequency simple queries, thus ensuring that long-tail and complex queries occupy a reasonable proportion in the training data. The teacher model is used to generate multi-task query understanding labels corresponding to the training queries offline. Label verification refers to performing validation operations such as word list matching, category reliability checks, and semantic consistency checks on each field in the multi-task query understanding labels to obtain the validation result for each field. Field-level training weights are the training supervision intensity determined for each field based on the validation results. The preset initial model is a basic version of the lightweight student model to be trained, with the same number of parameters as the lightweight student model. After training, the final lightweight student model for online use is obtained.
[0068] In one embodiment, the step of generating multi-task query comprehension labels corresponding to the training query using a teacher model may specifically include: obtaining the complexity of the training query; generating multi-task query comprehension labels using a first teacher model if the complexity is greater than or equal to a preset complexity threshold; and generating multi-task query comprehension labels using a second teacher model if the complexity is less than the preset complexity threshold. Thus, by selecting teacher models with different parameter scales based on the complexity of the training query to generate multi-task query comprehension labels, the labeling cost is reduced while ensuring label quality.
[0069] It should be noted that the complexity of the training query can be determined based on at least one of the following: query length, whether it contains multiple constraints, whether it contains typos or new words, vocabulary hit rate, historical no-result rate, historical modified search rate, context rounds, and historical model error rate. A higher complexity level indicates a greater difficulty in understanding the training query, requiring a more capable teacher model to generate multi-task query comprehension labels; a lower complexity level allows for the use of a teacher model with fewer parameters or a regularized teacher signal to generate multi-task query comprehension labels.
[0070] In practical implementation, hierarchical teacher annotation can be achieved by combining modules based on preset rules with manual review. For example, for high-frequency, simple training queries, tags are generated primarily using modules based on preset rules or a second teacher model. For long-tail, multi-constraint, conversational, multi-turn context, no-result, or historically high error rates training queries, candidate tags are generated by calling the first teacher model. Samples with conflicts between teacher models or business validation conflicts are subject to manual or semi-automatic review processes. When teacher models annotate offline, the input information can include the training query itself, necessary user context, candidate product summaries, product thesaurus hints, and preset unified output format requirements. The teacher model generates multi-task query understanding candidate tags that conform to the preset unified output format in one go, instead of calling multiple task models separately.
[0071] In one embodiment, the label verification step described above may specifically include: for each field in the multi-task query understanding labels, matching the field with preset field verification conditions; if the field matches the preset field verification conditions, determining the field's verification result as passed; if the field does not match the preset field verification conditions, determining the field's verification result as failed. Thus, by matching label fields with preset field verification conditions, reliable label fields are selected, reducing the impact of erroneous labels on model training.
[0072] It should be noted that the above field validation conditions may include at least one of the following: thesaurus validation, category reliability validation, entity boundary validation, semantic consistency validation before and after error correction, rewrite recall validation, behavior feedback validation, and field confidence validation.
[0073] The validation process includes the following checks: **Dictionary Verification:** This checks if the field content exists in a predefined dictionary, such as whether the brand field exists in the brand dictionary or the attribute field exists in the attribute dictionary. **Category Reliability Verification:** This checks if the category prediction result belongs to a predefined category system. **Entity Boundary Verification:** This checks if the boundary of the entity recognition result matches the corresponding segment in the training query text. **Semantic Consistency Verification Before and After Error Correction:** This checks if the query error correction result is semantically consistent with the original training query. **Rewrite Recallability Verification:** This checks if the rewritten query result can recall a sufficient number of products in the product database. **Behavioral Feedback Verification:** This verifies the rationality of the tags by combining historical clicks, add-to-cart, and purchase data. **Field Confidence Verification:** This checks if the field confidence score is greater than or equal to a predefined tag confidence threshold.
[0074] The label validation described above can filter out incorrect or unreliable label fields generated by the teacher's model, preventing erroneous labels from entering the training data. For fields that fail validation, processing methods such as correction, setting to null, reducing weight, or sending them for manual sampling can be implemented.
[0075] In one embodiment, the validation result for each field in the multi-task query understanding tags includes the field confidence score. The steps described above for determining field-level training weights based on the validation results may specifically include: obtaining the teacher model source corresponding to the field; determining the basic weight of the field based on the teacher model source; and adjusting the basic weight based on the field confidence score to obtain the field-level training weight. Therefore, by combining the teacher model source and field confidence score to determine the field-level training weight, the impact of tags with different sources and confidence scores on model training can be controlled more precisely, thereby improving the model training effect.
[0076] It should be noted that the teacher model source mentioned above is used to distinguish the type of teacher model that generated this field, such as the first teacher model or the second teacher model. The base weights corresponding to different teacher model sources can be different; teacher model sources with a larger number of parameters and stronger domain adaptability can be assigned higher base weights. Field confidence is a quantified value of the reliability of the field obtained during the validation process. Adjusting the base weights based on field confidence can strengthen the supervisory role of high-confidence fields and weaken the supervisory role of low-confidence fields during training. For example, when a field has a high field confidence and the teacher model source is the first teacher model, the field-level training weight for this field can be higher than that for a field from the second teacher model with a lower field confidence. Therefore, high-confidence fields have a greater impact on model parameter updates during training, while the impact of low-confidence fields on model parameter updates is suppressed, thereby improving the overall training effect of the lightweight student model.
[0077] In one embodiment, the first teacher model can be obtained through the following steps: acquiring domain data, which includes at least one of search logs, product information, category systems, brand information, and attribute information; and fine-tuning a base model with a larger number of parameters than the lightweight student model based on the domain data to obtain the first teacher model. Thus, by using domain data to fine-tune a large language model to obtain the first teacher model, the teacher model's ability to generate tags for specific domain queries is improved.
[0078] It should be noted that the aforementioned domain data can also include manually labeled queries, no-result logs, search modification paths, click data, add-to-cart data, purchase data, synonyms, and aliases. The base model is a large language model with significantly more parameters than the lightweight student model. By fine-tuning the base model with domain data, the first teacher model can learn the category system, product attribute system, brand aliases, search rewriting habits, and user query expressions within the retail search domain, thereby improving the accuracy of its generation of multi-task query comprehension tags.
[0079] In one possible implementation, fine-tuning can employ efficient parameter tuning methods such as Supervised Fine-Tuning (SFT), Low-Rank Adaptation (LoRA), or Quantized Low-Rank Adaptation (QLoRA). After fine-tuning with domain data, the First Teacher model possesses semantic understanding capabilities for complex queries, long-tail queries, multi-round contextual queries, and multi-constraint queries. It is used to generate multi-task query understanding labels offline, without participating in online inference, thus avoiding the high latency and high resource consumption associated with online inference of large language models.
[0080] In one embodiment, the preset unified output format includes query correction fields, query rewrite fields, intent type fields, entity fields, category fields, attribute fields, etc.
[0081] The query correction field stores query correction results. The query rewrite field stores query rewrite results. The intent type field stores intent recognition results. The entity field stores entity recognition results, such as brand, category, and attribute information. The category field stores category prediction results. The attribute field stores attribute extraction results.
[0082] Furthermore, the preset unified output format can also include negative constraint fields, scenario fields, confidence fields, evidence fields, version fields, etc.
[0083] The negative constraint field records the conditions excluded in the query, such as "does not contain" or "do not". The scenario field records the usage scenario corresponding to the query, such as "back to school" or "outdoors". The confidence field records the confidence level of each output field. The evidence field records the evidence information supporting the output results. The version field records the model version.
[0084] It should be noted that each field can be configured with enumeration values, vocabulary mapping rules, and confidence scores.
[0085] By using the unified output format described above, the lightweight student model can output structured results for multiple query comprehension tasks in a single inference, avoiding the problems of error accumulation and inconsistent formats caused by processing multiple independent models in series.
[0086] In one embodiment, the training objective of the lightweight student model includes at least one of the following: structured output generation loss, intent classification loss, entity boundary loss, category prediction loss, attribute extraction loss, error correction rewriting loss, knowledge distillation loss, candidate rewriting ranking loss, and field-level weighted loss.
[0087] The lightweight student model is trained using the following loss structures: Structured Output Generation Loss (for generating complete, uniform output format results from input queries), Intent Classification Loss (for identifying query intent categories), Entity Boundary Loss (for identifying entity boundaries and types within queries), Category Prediction Loss (for predicting product categories), Attribute Extraction Loss (for extracting attribute information from queries), Error Correction and Rewriting Loss (for generating query error correction and rewriting results), Knowledge Distillation Loss (for transferring soft-label knowledge from the first or second teacher models to the lightweight student model), Candidate Rewriting Ranking Loss (for ranking different query rewriting results, prioritizing those more likely to generate clicks or conversions), and Field-Level Weighted Loss (for weighted fusion of the above losses based on field-level training weights, maximizing the impact of high-confidence fields on training).
[0088] It should be noted that the above training objectives can be implemented in stages: The first stage uses manual annotation and high-confidence teacher labels for supervised fine-tuning, enabling the lightweight student model to learn to output results conforming to a preset uniform output format. The second stage incorporates teacher soft labels and candidate rewrite ranking for knowledge distillation. The third stage adds a difficult example pool and online feedback samples for incremental training. The fourth stage performs quantization, compression, and latency evaluation to meet the throughput requirements of online deployment.
[0089] In one possible implementation, the training process of the lightweight student model can also include the construction of negative and hard examples. Negative examples can be constructed for easily confused brands, categories, attributes, misspellings, and homophones. For example, "banana phone" and "banana fruit" can be used as confusing negative examples for brand entities and category entities, respectively, to train the lightweight student model to distinguish entity types. Queries with no online results, successful searches after modification, inconsistent clicked categories with predicted categories, or conflicting entity recognition can be added to the hard example pool. Negative and hard examples are used to improve the robustness of the lightweight student model, enabling it to output more accurate multi-task query understanding results when faced with easily confused and complex queries.
[0090] The negative samples and hard samples mentioned above can be added at any stage of the training process. For example, hard sample pools and online feedback samples can be added in the third stage for incremental training.
[0091] For example, when the query to be processed is "sugar-free sparkling water", the multi-task query understanding results output by the lightweight student model can include: query correction result "sugar-free sparkling water"; query rewriting results "sugar-free sparkling water", "0 sugar sparkling beverage", "low-calorie sparkling water"; intent recognition result "product search"; entity fields including attribute entity "sugar-free" and category entity "sparkling water"; category field "food and beverage / beverage / sparkling water"; attribute field "sugar content = sugar-free". This multi-task query understanding result conforms to a preset unified output format. Subsequently, the search system can directly perform keyword retrieval based on the query correction and query rewriting fields, perform category filtering based on the category field, and perform product attribute filtering based on the entity and attribute fields, thereby improving search efficiency and accuracy.
[0092] In the training of the lightweight student model, the multi-task query comprehension labels corresponding to the above examples can be generated offline by the first teacher model and verified by the label verification module. For example, if the verification module confirms that "sugar-free" exists in the attribute vocabulary, "sparkling water" exists in the category vocabulary, and the query rewrite results "sugar-free sparkling water," "0-sugar sparkling beverage," and "low-calorie sparkling water" can recall a sufficient number of products in the product database, then each field in the multi-task query comprehension label can pass the verification and obtain a high field-level training weight.
[0093] In this way, the lightweight student model can learn the correct multi-task query understanding output and output reliable query understanding results for similar queries during the online inference stage.
[0094] In one embodiment, when constructing training samples, the sample construction module can also construct different types of samples for different query types.
[0095] Specifically, for high-frequency head queries, queries that appear frequently can be selected and combined with manual annotation and behavioral feedback to form high-quality anchor point samples, which can be used to ensure the basic accuracy of the lightweight student model.
[0096] For low-frequency long-tail queries, samples can be taken from low-frequency, no-result, low-click, and modified search logs. Multi-task query understanding tags can be generated through the first teacher model, and the tags can be validated using vocabulary validation and behavioral feedback validation.
[0097] For the modified search link sample, if a user enters the first query but does not click, and then enters the second query and clicks or purchases a product, the second query can be used as a candidate for rewriting the first query, but the semantic consistency between the first query and the second query needs to be verified.
[0098] For click-to-conversion verification samples, if the category predicted by the teacher model is inconsistent with the category of the product that the user ultimately clicks or purchases in the long-term statistics, the field-level training weight of the target tag of that category will be reduced, or the sample will be sent to the manual sampling queue.
[0099] For misspelled words and homophones, training samples can be constructed based on real misspelled word logs, input method adjacent keys, pinyin homophones, and brand aliases to improve the query error correction robustness of the lightweight student model.
[0100] For stratified teacher samples, different teacher models can be selected to generate labels based on the complexity of the training queries. High-frequency and simple queries are labeled by the second teacher model, while long-tail, multi-constraint, multi-round context, and historical error rate queries are labeled by the first teacher model.
[0101] For field-level weighted samples, different fields in the same training sample can have different field-level training weights. For example, the query correction field is validated by the dictionary and has a high confidence level, so it is used as a strongly supervised field. If the category prediction field conflicts with the clicked category, the field-level training weight of that category field is reduced or the field is set to empty.
[0102] The sample weights can be set comprehensively based on the source of the teacher model, the confidence level of the teacher model, the rule verification results, the strength of behavioral feedback, the source of manual annotation, and the query type. Low-confidence or conflict samples are not directly used as strongly supervised samples.
[0103] By constructing various sample types and setting sampling ratios as described above, it can be ensured that the training data meets the training requirements of lightweight student models in terms of coverage and quality.
[0104] In one embodiment, the training process of the lightweight student model may also include consistency training. Consistency training refers to applying consistency constraints to the original input, error-corrected input, rewritten input, and synonymous expression input of the same query, ensuring that the lightweight student model outputs consistent or mappable intent recognition results, entity recognition results, and category prediction results under different expressions, reducing conflicts between query error correction results and entity recognition results. For example, for the original query "no-tang sparkling water" and the error-corrected query "sugar-free sparkling water," the lightweight student model should output consistent intent recognition and category prediction results for both. Through consistency training, the stability of the lightweight student model's output results when facing different query expressions can be improved, avoiding unnecessary changes in subsequent query understanding results due to query error correction.
[0105] In one embodiment, offline evaluation and deployment gating can be performed before deploying the trained lightweight student model online. Offline evaluation assesses various metrics of the lightweight student model on an independent evaluation set, including query error correction accuracy, intent recognition F1 score, entity recognition F1 score, category prediction accuracy, attribute extraction F1 score, output format pass rate, average inference latency, no-result rate simulation metric, and query rewriting recall rate.
[0106] The output format pass rate refers to the proportion of lightweight student models whose output conforms to a preset unified output format and whose fields can be mapped to a vocabulary. The no-result rate simulation metric is used to evaluate the ability of query rewrite results to recall products in the product database. The query rewrite recall rate measures the proportion of products that can be recalled by query rewrite results in the product database. Only lightweight student models that simultaneously meet the preset effect threshold and preset latency threshold will be released in a phased manner.
[0107] By implementing the above-mentioned online gating, it can be ensured that the lightweight student model deployed to the online inference module meets the requirements of retail search scenarios in terms of both accuracy and inference speed.
[0108] The following example illustrates step 202.
[0109] In one example, the query to be processed is "sugar-free sparkling water". The multi-task query understanding results output by the lightweight student model include: query correction result "sugar-free sparkling water"; query rewriting results "sugar-free sparkling water", "0 sugar sparkling beverage", "low-calorie sparkling water"; intent recognition result "product search"; entity fields include the attribute entity "sugar-free" and the category entity "sparkling water"; the category field is "food and beverage / beverage / sparkling water"; and the attribute field is "sugar content = sugar-free". This output conforms to a preset unified output format. The subsequent search system can perform keyword recall based on the query correction and query rewriting fields, category filtering based on the category field, and product attribute filtering based on the entity and attribute fields. During the training phase, the multi-task query understanding labels corresponding to this example are generated offline by the first teacher model and verified by the label verification module. The label verification module confirms that "sugar-free" exists in the attribute vocabulary, "sparkling water" exists in the category vocabulary, and the query rewriting results can recall a sufficient number of products in the product database. Therefore, each field in the multi-task query understanding label passes the verification and obtains a high field-level training weight.
[0110] In this way, the lightweight student model can learn the correct multi-task query understanding output and output reliable query understanding results for similar queries during the online inference stage.
[0111] In another example, the query to be processed is "banana 15 phone case". This query contains the brand term "banana" and the model term "15", where "banana" can refer to either a fruit category or a phone brand. In the multi-task query understanding result output by the lightweight student model, the entity field includes the brand entity "banana / Banana", the category field is "phone accessories / phone case", and the attribute field can include "applicable model=15". This example is also used as a negative sample in training to help the lightweight student model avoid incorrectly mapping "banana" to the fresh fruit category. The tag validation module verifies the entity type and category constraints to confirm that "banana" in this query context refers to a phone brand rather than a fruit category, thus ensuring that the tag field passes validation.
[0112] In another example, a user first searched for "things for a baby to use at school" without clicking, then changed their search to "children's schoolbag for first grade" and clicked to buy a schoolbag. The query complexity assessment module identified this query as a long-tail query that is conversational, multi-constrained, and scenario-based. Therefore, it called the First Teacher Model to generate multi-task query understanding labels. The multi-task query understanding labels output by the First Teacher Model include: intent recognition result "product search"; scenario field "back to school"; entity field including the person entity "children"; category field including candidate categories such as "schoolbag", "stationery", and "name tags"; query rewrite results including "children's schoolbag for first grade" and "first grade schoolbag", etc. The subsequently successfully rewritten query "children's schoolbag for first grade" was used as a candidate rewrite ranking signal, giving the query rewrite result "children's schoolbag for first grade" a higher candidate rewrite ranking weight. After label verification and field-level training weight calculation, this sample was used to train the lightweight student model, enabling the lightweight student model to output multi-task query understanding results containing scenarios, entities, and candidate categories when encountering similar conversational, multi-constrained queries during the online inference stage.
[0113] In another example, the query to be processed is "non-heaty snacks for one-year-old babies". This query is a conversational, multi-constraint query, containing the demographic constraint "one-year-old baby" and the fuzzy constraint "non-heaty". In the multi-task query understanding tags output by the first teacher model, the entity fields include the demographic entity "one-year-old baby" and the category entity "snacks", the attribute fields include "sugar content = low sugar" and "texture = easy to chew", and the negative constraint fields include "spicy", "high salt", and "hard". The tag verification module maps "non-heaty" to candidate attributes that the platform can recognize, such as "low irritation", "low sugar", and "non-spicy", and only retains fields that exist in the product attribute system or can be mapped, avoiding directly training the lightweight student model with non-applicable tags inferred by the first teacher model.
[0114] Through the above-mentioned validation and field-level training weight control, the lightweight student model is able to learn the ability to convert fuzzy, colloquial constraints into platform-recognizable attribute constraints.
[0115] In this embodiment, the query to be processed is input into a preset lightweight student model, which outputs multi-task query understanding results conforming to a preset unified output format. This allows multiple query understanding tasks to be obtained simultaneously using only the lightweight student model during the online inference phase. The lightweight student model is trained based on multi-task query understanding labels and field-level training weights generated offline by the first teacher model. This leverages the first teacher model's semantic understanding capabilities for complex and long-tail queries while avoiding the high latency and resource consumption associated with online inference using the first teacher model. The preset unified output format ensures the structured and consistent nature of the multi-task query understanding results, while the field-level training weights improve the training effect of the lightweight student model by distinguishing the credibility of different label fields, enabling it to output accurate and reliable multi-task query understanding results during the online inference phase.
[0116] Step 203: Perform field-level validation on the multi-task query understanding results to obtain the field-level validation results.
[0117] In this embodiment, field-level validation refers to determining whether each field in the multi-task query understanding result meets preset field validation conditions, thereby determining whether the field can be used for subsequent search recall, filtering, or sorting. Compared with full result validation, field-level validation can retain other highly reliable fields even when some fields are unreliable, avoiding the discarding of the entire query understanding result due to errors in individual fields, and improving the system's fault tolerance for abnormal model output.
[0118] In one embodiment, the field-level validation steps may specifically include: for each field in the multi-task query understanding result, obtaining the field confidence score corresponding to the field; if the field confidence score is greater than or equal to a preset confidence threshold, determining that the field passes the field-level validation; if the field confidence score is less than the preset confidence threshold, determining that the field fails the field-level validation. Therefore, by determining whether a field passes the field-level validation based on the comparison result between the field confidence score and the preset confidence threshold, the incorrect use of low-confidence fields is avoided, thus improving the accuracy of field-level validation.
[0119] It should be noted that the field confidence score mentioned above is a quantitative value representing the reliability of the Lightweight Student model's output for that field. The field confidence score can be generated by the Lightweight Student model when outputting multi-task query understanding results, for example, calculated from the probability distribution or candidate ranking score of the model output. The preset confidence threshold can be a uniform threshold or set separately according to the field type. For example, the query correction field corresponds to the first confidence threshold, the category prediction field corresponds to the second confidence threshold, and the entity recognition field corresponds to the third confidence threshold. By setting different preset confidence thresholds for different field types, the differences in accuracy requirements for different fields can be accommodated. For fields with a confidence score greater than or equal to the preset confidence threshold, the field is determined to have passed field-level validation; for fields with a confidence score less than the preset confidence threshold, the field is determined to have failed field-level validation. This comparison process is applied independently to each field, therefore different fields can have different field-level validation results.
[0120] In one possible implementation, in addition to comparing field confidence with a preset confidence threshold, field-level validation can also be combined with preset field validation conditions for matching and judgment. Specifically, preset field validation conditions may include at least one of the following: thesaurus validation, category reliability validation, entity boundary validation, and field enumeration validation.
[0121] The dictionary validation checks whether the field content exists in the corresponding preset dictionary, such as whether the brand field exists in the brand dictionary or the attribute field exists in the attribute dictionary. Category reliability validation checks whether the category prediction field belongs to the category system defined by the platform. Entity boundary validation checks whether the boundaries of entities in the original query text in the entity field are consistent with the recognition results. Field enumeration validation checks whether the field content belongs to the preset enumeration value set corresponding to that field.
[0122] By combining the above field validation conditions with the field confidence threshold comparison, the reliability of a field can be judged from multiple dimensions, thereby improving the accuracy of field-level validation results.
[0123] In this embodiment, field-level validation is performed by the result validation and degradation module. The result validation and degradation module receives the multi-task query comprehension results output by the lightweight student model and validates each field according to the aforementioned field-level validation method, outputting the corresponding field-level validation result for each field, such as pass or fail. The field-level validation result can be structured data used to identify which fields in the multi-task query comprehension results passed validation and which failed. Subsequent steps, based on this field-level validation result, retain the fields that passed validation and ignore the fields that failed validation.
[0124] The following example illustrates step 203.
[0125] For example, in a scenario where the query to be processed is "Wu Tang Sparkling Water", the multi-task query understanding results output by the lightweight student model show a field confidence score of 0.97 for the query correction field, 0.93 for the category prediction field, and 0.91 for the entity recognition field. If the preset confidence thresholds are set to 0.90 for the query correction field, 0.90 for the category prediction field, and 0.90 for the entity recognition field, then all three fields pass the field-level validation. Simultaneously, the category prediction field "Food & Beverage / Beverage / Sparkling Water" matches the preset category system in the category reliability validation.
[0126] Through the above field-level validation, it can be confirmed that all fields in the multi-task query understanding results meet the reliability requirements, providing a basis for subsequent field-level retention or ignoring, thereby improving the usability of search results.
[0127] Step 204: Based on the field-level validation results, retain the fields that pass the field-level validation in the multi-task query understanding results, and ignore the fields that fail the field-level validation.
[0128] In this embodiment, step 204 is executed by the result verification and degradation module, which is used to use only the fields that pass the field-level verification when some fields fail the field-level verification, so as to avoid fields with low confidence or that do not meet the preset field verification conditions being incorrectly used for subsequent search retrieval, filtering or sorting, thereby ensuring the availability and security of online query understanding results.
[0129] It's important to note that retaining fields that pass field-level validation means using their content as valid input for subsequent search processing. For example, query correction fields might be used for keyword recall, category prediction fields for category filtering, and entity and attribute fields for product attribute filtering. Ignoring fields that fail field-level validation means not using their content as a basis for subsequent search processing; these fields will not participate in the corresponding recall, filtering, or ranking stages. Ignoring fields can be achieved by setting them to null or triggering fallback mechanisms.
[0130] Here, "setting to null" means removing the output content of this field from the multi-task query comprehension results or setting it to an empty value. "Catch-all" means that after ignoring this field, other preset methods are used to process the query comprehension task corresponding to this field. Different fields can have different ignoring strategies, and ignoring fields that fail field-level validation does not affect the continued use of other fields that pass field-level validation in subsequent processing.
[0131] By employing the aforementioned field-level retention and ignoring mechanism, the value of highly reliable fields can still be preserved even when some fields in the output of the lightweight student model are unreliable. This prevents the entire query understanding result from being discarded, thereby improving the online search system's fault tolerance for abnormal model output and its overall stability.
[0132] In one embodiment, for fields that fail field-level validation, the result validation and degradation module can trigger different adaptation logic based on the field type. For example, when a query correction field fails field-level validation, it can be ignored, and the original query can be used as the basis for keyword recall. When a query rewrite field fails field-level validation, it can be ignored, and only the original query can be used for recall, avoiding low-confidence query rewrite results that lead to no results or decreased recall quality. When a category prediction field fails field-level validation, it can be ignored, and no category filtering can be performed, avoiding incorrect category filtering that leads to missed product recall. When an entity field or attribute field fails field-level validation, the corresponding entity or attribute field can be ignored, and keyword recall can be performed only based on the query correction field and the query rewrite field. It should be understood that the above adaptation logic can be configured according to actual business needs, such as configuring degradation strategies and fallback methods corresponding to different field types.
[0133] By performing the above field-level degradation processing, we can retain the most useful information in high-confidence fields while minimizing the negative impact of low-confidence fields on search results, all while ensuring the normal operation of the search system.
[0134] The following example illustrates step 204.
[0135] In one example, in a scenario where the query to be processed is "sugar-free sparkling water", the multi-task query understanding results output by the lightweight student model include: query correction field "sugar-free sparkling water", query rewriting fields "sugar-free sparkling water", "0 sugar sparkling beverage", "low-calorie sparkling water", intent type field "product search", entity field "attribute: sugar-free; category: sparkling water", category field "food and beverage / beverage / sparkling water", and attribute field "sugar content = sugar-free". After field-level validation in step 203, the query correction field, query rewriting field, intent type field, and entity field pass the field-level validation. The category field has a confidence score of 0.93, which is greater than the preset confidence threshold of 0.90, and therefore passes the field-level validation. In step 204, the result validation and downgrade module retains the query correction field, query rewriting field, intent type field, category field, and entity field that passed the field-level validation. The subsequent search system retrieves keywords based on the query correction and query rewriting fields, filters categories based on the category field, and filters attributes based on the attribute entities and category entities in the entity field. Thus, through a field-level retention and ignoring mechanism, the online search system, assuming reliable category prediction, can fully utilize various fields for product retrieval, category filtering, and attribute filtering, improving the overall assurance of search performance based on query understanding results.
[0136] In another example, in the multi-task query understanding results of a certain type of query, the confidence score of the category field is 0.75, which is lower than the preset confidence threshold of 0.90, and therefore fails the field-level validation; while the confidence score of the query correction field is 0.96, passing the field-level validation. In step 204, the result validation and downgrade module retains the query correction field and sets the category field to empty. Subsequently, the search system only performs keyword recall based on the query correction field and does not perform category filtering. Thus, through the field-level retention and ignoring mechanism, the online search system avoids missing product recall due to low-confidence category filtering when the category field is unreliable, improving the overall guarantee of search performance from the query understanding results.
[0137] In one embodiment, if the intent type field in the multi-task query understanding result fails field-level validation, the result validation and degradation module can ignore the intent type field and use a default intent type value, such as setting the intent type to "product search," to ensure that subsequent processing logic executes normally. If the query rewrite field fails field-level validation, the original query can be used for recall without query rewrite expansion. If the query correction field fails field-level validation, the original query can be used directly without correction replacement. Through the above field-based degradation strategy, targeted processing measures can be taken when different fields exhibit low confidence, ensuring the stable operation of the online search system.
[0138] In one embodiment, the result verification and degradation module can also integrate the query understanding results after ignoring fields by combining the high-confidence fields from the original query and the multi-task query understanding results. For example, when the category field is ignored, the integrated query understanding result only includes the query correction field, query rewriting field, intent type field, and entity field, while the category field is empty. This integrated query understanding result can be provided to the recall and sorting modules of the search system in a format conforming to a preset unified output format, so that downstream modules do not need to be aware of the field-level verification and ignoring process, but only need to read the valid fields according to the preset unified output format. Through the above method, step 204 improves the reliability of the output fields while ensuring that the structure of the multi-task query understanding result remains unchanged.
[0139] In one embodiment, by retaining fields that pass the field-level validation and ignoring those that fail, field-level reliability control is achieved for the multi-task query understanding results output by the lightweight student model during the online inference phase. This step, in conjunction with step 203, independently validates and selectively uses each field in the multi-task query understanding results. In cases where some fields have low confidence or do not meet preset field validation conditions, the valid information of high-confidence fields is retained, preventing the entire query understanding result from being discarded. Simultaneously, it reduces the interference of low-confidence fields on search recall, filtering, and ranking, improving the robustness of the online search system and the usability of the query understanding results.
[0140] In one embodiment, online behavior feedback data can be further obtained, including at least one of the following: no-result rate, search modification rate, click-through rate, conversion rate, exit rate, and manual evaluation results. Based on the online behavior feedback data, the lightweight student model and multi-task query understanding tags are updated. Thus, by updating the lightweight student model and multi-task query understanding tags based on online behavior feedback data, the accuracy of the model and tags is continuously optimized to adapt to changes in query distribution. It should be understood that the above feedback closed-loop update step can be executed after step 204 is completed, or it can be executed according to a preset cycle or preset triggering conditions. This application does not limit it to being executed simultaneously with steps 201 to 204 in each online inference.
[0141] The online behavioral feedback data mentioned above originates from users' actual behavior during the search process. The no-result rate refers to the proportion of queries for which the multi-task query understanding results output by the lightweight student model fail to retrieve any products after being used for search recall. The modified search rate refers to the proportion of users who re-enter a new query after obtaining search results. The click-through rate refers to the proportion of users who click on products in the search results. The conversion rate refers to the proportion of users who further complete the purchase or add products to their cart after clicking on them. The exit rate refers to the proportion of users who leave the search session without clicking or making a purchase on the search results page. The manual evaluation results refer to the quality assessment obtained after manually sampling the online query understanding results. The above behavioral feedback data can be obtained from search logs, user behavior logs, and manual evaluation records.
[0142] It should be noted that when updating the lightweight student model and multi-task query comprehension tags based on online behavior feedback data, you can first perform statistical monitoring on the online behavior feedback data according to query dimension, field dimension, and audience / scenario dimension.
[0143] Among them, query dimension refers to a single query or a class of similar queries as the statistical unit. Field dimension refers to a single field in the multi-task query understanding results as the statistical unit. Audience dimension refers to the target user group corresponding to the query as the statistical unit. Scenario dimension refers to the user scenario or usage scenario corresponding to the query as the statistical unit.
[0144] Specifically, when the output of a certain type of query or a certain field reaches an anomaly threshold within the statistical window, the samples corresponding to that type of query or field are identified as suspected erroneous samples, triggering at least one of the following actions: re-labeling, updating validation rules, adjusting sample weights, or retraining the lightweight student model. For example, if the no-result rate corresponding to the rewritten results of a certain type of query exceeds a preset anomaly threshold for a consecutive week, the field-level training weights of the rewritten results of that type of query are reduced, and the relevant samples are added to the hard example pool for incremental training of the lightweight student model. Another example is when the proportion of clicked categories that do not match the predicted categories of a certain category prediction field reaches an anomaly threshold, triggering re-validation of the predicted labels for that category and adjustment of sample weights.
[0145] Through the above feedback loop update, the lightweight student model and multi-task query comprehension tags can be continuously optimized using online behavioral feedback data, so that the online query comprehension effect can be gradually improved as business data accumulates.
[0146] In one embodiment, field-level performance can also be recorded for each model version of the lightweight student model. When a model version falls below the previous model version in at least one of the metrics—output format pass rate, average inference latency, or key field accuracy—a rollback or traffic throttling is performed on that model version. This model version feedback mechanism prevents degraded model versions from continuously impacting online query comprehension.
[0147] In one embodiment, the aforementioned feedback loop update step may further include offline evaluation of the updated lightweight student model. After passing the offline evaluation, the updated lightweight student model is deployed to the online inference module. Offline evaluation metrics may include query error correction accuracy, intent recognition F1 score, entity recognition F1 score, category prediction accuracy, attribute extraction F1 score, output format pass rate, average inference latency, no-result rate simulation metric, and query rewriting recall rate. When the updated lightweight student model meets preset performance and latency thresholds, it is deployed online, replacing the original lightweight student model. Through this model update process, the effectiveness and inference performance of the online lightweight student model during continuous iteration can be guaranteed.
[0148] In one embodiment, after step 204, the search system can further perform subsequent search recall and ranking processes based on the retained fields. Specifically, the search recall module can perform keyword recall based on query correction and query rewriting fields, perform product attribute filtering based on entity and attribute fields, and perform category recall based on category fields; when the category field is ignored, category filtering is not performed. The ranking module can use traditional ranking models or deep ranking models to estimate the click-through rate, conversion rate, and total transaction amount of the recalled products, and combine this with inventory, fulfillment, and compliance rules for filtering. When the lightweight student model outputs low-confidence fields or fields that do not meet the preset field validation conditions, only high-confidence fields are used in the above recall and ranking process, and low-confidence fields are not processed. Through the above methods, the results of multi-task query understanding can be safely used in subsequent stages of online search.
[0149] In one embodiment, the result validation and degradation module can also combine the overall confidence of field-level validation results and multi-task query understanding results to determine whether to trigger a complete result rollback. When the number of fields passing field-level validation in the multi-task query understanding results is zero, or when all key fields fail field-level validation, the result validation and degradation module can trigger a complete result rollback, using the original query for direct keyword retrieval, or using an existing rule module or single-task model for fallback processing. When at least one field passes field-level validation, a complete result rollback is not triggered; only the fields that fail field-level validation are subject to field-level degradation processing. Through the above control strategy combining complete result rollback and field-level degradation, the basic availability of the search system can be guaranteed when the output quality of the lightweight student model is poor, while avoiding unnecessary waste of query understanding information caused by complete result rollback.
[0150] In one embodiment, the field-level training weights of the multitasking query comprehension labels can be dynamically adjusted based on the base weights and field confidence levels corresponding to the teacher model sources. For example, for high-confidence fields generated by the first teacher model, their field-level training weights can be set to a first weight value; for high-confidence fields generated by the second teacher model, their field-level training weights can be set to a second weight value, which is less than the first weight value; for fields with confidence levels lower than a preset confidence threshold, their field-level training weights can be set to a third weight value, which is less than the second weight value, or the field can be directly set to empty so that it does not participate in the training loss calculation. Through the above weight setting method, the high-quality labels generated by the first teacher model can be fully utilized when training the lightweight student model, while reducing the negative impact of the second teacher model and low-confidence labels on the training effect.
[0151] In one embodiment, the field confidence scores in both the multi-task query comprehension results and the multi-task query comprehension labels can be generated simultaneously during output by either the lightweight student model or the teacher model. Taking the lightweight student model as an example, when outputting query correction fields, it can simultaneously output the generation probability corresponding to that field, using that probability as the field confidence score. Similarly, taking the first teacher model as an example, when generating multi-task query comprehension labels, it can output the candidate distribution and ranking score for each field, using the confidence score or ranking score corresponding to the highest probability value in the candidate distribution as the field confidence score. Through this method, the field confidence scores directly originate from the model output, eliminating the need for additional confidence estimation steps and facilitating direct use in step 203 and the label verification during the training phase.
[0152] In one embodiment, the confidence field in the preset unified output format can be used to record the confidence level of each output field. For example, in the multi-task query understanding results, the confidence field can include content such as "query correction field confidence = 0.97; category prediction field confidence = 0.93; entity recognition field confidence = 0.91". By setting the confidence field in the preset unified output format, downstream modules can synchronously obtain the confidence information of each field when reading the multi-task query understanding results, which is convenient for the field-level verification in step 203 and the field-level degradation processing in step 204 to be used directly without additional queries or calculations.
[0153] The multi-task query understanding method disclosed in the above embodiments of this application first obtains the query to be processed; then, the query to be processed is input into a preset lightweight student model, and the lightweight student model outputs multi-task query understanding results conforming to a preset unified output format. The multi-task query understanding results include at least two of the following: query correction results, query rewriting results, and intent recognition results. The lightweight student model is trained based on multi-task query understanding labels generated by a first teacher model and field-level training weights. The multi-task query understanding labels conform to a preset unified output format, and the field-level training weights are determined based on the verification results of each field in the multi-task query understanding labels. The first teacher model is a large language model with a larger number of parameters than the lightweight student model, and the first teacher model generates multi-task query understanding labels offline. Next, field-level verification is performed on the multi-task query understanding results to obtain field-level verification results. Finally, based on the field-level verification results, fields in the multi-task query understanding results that pass the field-level verification are retained, and fields that fail the field-level verification are ignored. Therefore, by having at least two of the tasks in query correction, query rewriting, and intent recognition uniformly output online using a lightweight student model, and by performing field-level validation on the output results, the latency of online query understanding is reduced, the output format is ensured to be consistent, and the reliability of the fields in the output results is improved.
[0154] See Figure 3 The diagram shows a structural schematic of a multi-task query understanding device provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0155] The multi-task query understanding device may specifically include the following modules: The query retrieval module 301 is used to retrieve queries to be processed.
[0156] The model processing module 302 is used to input the query to be processed into a preset lightweight student model. The lightweight student model outputs multi-task query understanding results that conform to a preset unified output format. The multi-task query understanding results include at least two of the following: query correction results, query rewriting results, and intent recognition results. The lightweight student model is trained based on the multi-task query understanding labels and field-level training weights generated by the first teacher model. The multi-task query understanding labels conform to a preset unified output format. The field-level training weights are determined based on the verification results of each field in the multi-task query understanding labels. The first teacher model is a large language model with a larger number of parameters than the lightweight student model. The first teacher model generates multi-task query understanding labels in an offline state.
[0157] The field validation module 303 is used to perform field-level validation on the results of multi-task query understanding and obtain field-level validation results.
[0158] The field optimization module 304 is used to retain fields that pass the field-level validation in the multi-task query understanding results and ignore fields that fail the field-level validation, based on the field-level validation results.
[0159] The multi-task query understanding apparatus disclosed in the above embodiments of this application first acquires a query to be processed; then, the query to be processed is input into a preset lightweight student model, and the lightweight student model outputs multi-task query understanding results conforming to a preset unified output format. The multi-task query understanding results include at least two of the following: query correction results, query rewriting results, and intent recognition results. The lightweight student model is trained based on multi-task query understanding labels generated by a first teacher model and field-level training weights. The multi-task query understanding labels conform to a preset unified output format, and the field-level training weights are determined based on the verification results of each field in the multi-task query understanding labels. The first teacher model is a large language model with a larger number of parameters than the lightweight student model, and the first teacher model generates multi-task query understanding labels offline. Next, field-level verification is performed on the multi-task query understanding results to obtain field-level verification results. Finally, based on the field-level verification results, fields in the multi-task query understanding results that pass the field-level verification are retained, while fields that fail the field-level verification are ignored. Therefore, by having at least two of the tasks in query correction, query rewriting, and intent recognition uniformly output online using a lightweight student model, and by performing field-level validation on the output results, the latency of online query understanding is reduced, the output format is ensured to be consistent, and the reliability of the fields in the output results is improved.
[0160] Furthermore, in one possible implementation of this application embodiment, the field verification module 303 may specifically include the following units: The first acquisition unit is used to acquire the field confidence score for each field in the multi-task query understanding results.
[0161] The first determining unit is used to determine whether a field passes field-level validation if the field confidence level is greater than or equal to a preset confidence threshold.
[0162] The second determining unit is used to determine that a field has failed field-level validation if the field confidence level is less than a preset confidence threshold.
[0163] Therefore, by comparing the field confidence level with the preset confidence threshold, it is determined whether the field has passed the field-level validation, thereby avoiding the incorrect use of low-confidence fields and improving the accuracy of field-level validation.
[0164] Furthermore, in another possible implementation of this application embodiment, the above-mentioned multi-task query and understanding device may further include the following modules: The model training module is used to acquire training queries; generate multi-task query comprehension labels corresponding to the training queries through the teacher model, wherein the teacher model includes a first teacher model and a second teacher model, the second teacher model has fewer parameters than the first teacher model but more parameters than the lightweight student model; perform label validation on the multi-task query comprehension labels to obtain the validation result for each field in the multi-task query comprehension labels; determine the field-level training weights based on the validation results; and train a preset initial model based on the multi-task query comprehension labels and field-level training weights to obtain the lightweight student model.
[0165] Therefore, by using the teacher model to generate multi-task query comprehension labels offline, and determining field-level training weights based on the label verification results to train the lightweight student model, the output accuracy and reliability of the lightweight student model can be improved.
[0166] Furthermore, in another possible implementation of this application embodiment, the above-mentioned model training module may specifically include the following units: The second acquisition unit is used to acquire the complexity of the training query.
[0167] The first generation unit is used to generate multi-task query comprehension tags through the first teacher model when the complexity is greater than or equal to a preset complexity threshold.
[0168] The second generation unit is used to generate multi-task query comprehension tags through the second teacher model when the complexity is less than a preset complexity threshold.
[0169] Therefore, by selecting teacher models with different parameter scales based on the complexity of the training query to generate multi-task query understanding labels, the labeling cost can be reduced while ensuring label quality.
[0170] Furthermore, in another possible implementation of this application embodiment, the above-mentioned model training module may specifically include the following units: The first processing unit is used to match each field in the multi-task query understanding tag with preset field validation conditions.
[0171] The third determining unit is used to determine that the field's validation result is passed if the field matches the preset field validation conditions.
[0172] The fourth determining unit is used to determine that the field's validation result is unsuccessful if the field does not match the preset field validation conditions.
[0173] Therefore, by matching the label field with preset field validation conditions, reliable label fields are selected, reducing the impact of erroneous labels on model training.
[0174] Furthermore, in another possible implementation of this application embodiment, the verification result corresponding to each field in the multi-task query understanding label includes the field confidence score, and the above-mentioned model training module may specifically include the following units: The third acquisition unit is used to acquire the teacher model source corresponding to the field.
[0175] The fifth determining unit is used to determine the basic weights of fields based on the source of the teacher model.
[0176] The second processing unit is used to adjust the basic weights based on the field confidence level to obtain the field-level training weights.
[0177] Therefore, by combining the teacher's model source and field confidence to determine field-level training weights, the influence of labels from different sources and with different confidence levels on model training can be controlled more precisely, thereby improving the model training effect.
[0178] Furthermore, in another possible implementation of this application embodiment, the above-mentioned model training module can also be used to: acquire domain data, which includes at least one of search logs, product information, category system, brand information, and attribute information; and fine-tune the base model with a larger number of parameters than the lightweight student model based on the domain data to obtain the first teacher model.
[0179] Therefore, by fine-tuning the large language model using domain data, a first teacher model is obtained, thereby improving the teacher model's ability to generate labels for specific domain queries.
[0180] Furthermore, in another possible implementation of this application embodiment, the above-mentioned multi-task query and understanding device may further include the following modules: The feedback loop module is used to acquire online behavior feedback data, which includes at least one of the following: no-result rate, search modification rate, click-through rate, conversion rate, and manual evaluation results; based on the online behavior feedback data, the lightweight student model and multi-task query understanding tags are updated.
[0181] Therefore, by updating the lightweight student model and multi-task query understanding tags based on online behavior feedback data, the accuracy of the model and tags can be continuously optimized to adapt to changes in query distribution.
[0182] Furthermore, in another possible implementation of the embodiments of this application, the above-mentioned preset unified output format includes query correction field, query rewrite field, intent type field, entity field, category field and attribute field.
[0183] The multi-task query understanding device provided in this application embodiment can be applied in the foregoing method embodiment. For details, please refer to the description of the above method embodiment, which will not be repeated here.
[0184] Figure 4 This is a schematic diagram of the structure of the electronic device provided in an embodiment of this application. For example... Figure 4 As shown, the electronic device 400 of this embodiment includes: at least one processor 410 ( Figure 4 The diagram shows only one processor, a memory 420, and a computer program 421 stored in the memory 420 and executable on the at least one processor 410. When the processor 410 executes the computer program 421, it implements the steps described in the above-described multitasking query understanding method embodiment.
[0185] The electronic device 400 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. This electronic device may include, but is not limited to, a processor 410 and a memory 420. Those skilled in the art will understand that... Figure 4 This is merely an example of electronic device 400 and does not constitute a limitation on electronic device 400. It may include more or fewer components than shown in the figure, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc.
[0186] The processor 410 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0187] In some embodiments, the memory 420 may be an internal storage unit of the electronic device 400, such as a hard disk or memory of the electronic device 400. In other embodiments, the memory 420 may be an external storage device of the electronic device 400, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 400. Furthermore, the memory 420 may include both internal and external storage units of the electronic device 400. The memory 420 is used to store the operating system, applications, boot loader, data, and other programs, such as the program code of the computer program. The memory 420 can also be used to temporarily store data that has been output or will be output.
[0188] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0189] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0190] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0191] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0192] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0193] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0194] If the integrated module / unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0195] The implementation of all or part of the processes in the methods of the above embodiments can also be accomplished by a computer program product. When the computer program product is run on an electronic device, the electronic device can implement the steps in the various method embodiments described above.
[0196] The embodiments described above are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A multi-task query understanding method, characterized in that, include: Get the queries to be processed; The query to be processed is input into a preset lightweight student model. The lightweight student model outputs a multi-task query understanding result that conforms to a preset unified output format. The multi-task query understanding result includes at least two of the following: query correction result, query rewriting result, and intent recognition result. The lightweight student model is trained based on the multi-task query understanding labels and field-level training weights generated by the first teacher model. The multi-task query understanding labels conform to the preset unified output format. The field-level training weights are determined based on the verification results of each field in the multi-task query understanding labels. The first teacher model is a large language model with a larger number of parameters than the lightweight student model. The first teacher model generates the multi-task query understanding labels in an offline state. The multi-task query understanding results are validated at the field level to obtain the field-level validation results; Based on the field-level validation results, retain the fields that pass the field-level validation in the multi-task query understanding results, and ignore the fields that fail the field-level validation.
2. The method according to claim 1, characterized in that, The process of performing field-level validation on the multi-task query understanding results to obtain field-level validation results includes: For each field in the multi-task query understanding result, obtain the field confidence score corresponding to that field; If the confidence level of the field is greater than or equal to a preset confidence threshold, the field is determined to have passed field-level validation. If the confidence level of a field is less than the preset confidence threshold, the field is determined to have failed the field-level validation.
3. The method according to claim 1, characterized in that, Before inputting the query to be processed into the preset lightweight student model, the method further includes: Retrieve training query; The training query is generated by generating multi-task query comprehension labels through a teacher model, wherein the teacher model includes a first teacher model and a second teacher model, the second teacher model has fewer parameters than the first teacher model and more parameters than the lightweight student model. Perform tag validation on the multi-task query understanding tags to obtain the validation result corresponding to each field in the multi-task query understanding tags; The field-level training weights are determined based on the verification results; The lightweight student model is obtained by training a preset initial model based on the multi-task query understanding tags and the field-level training weights.
4. The method according to claim 3, characterized in that, The step of generating multi-task query comprehension labels corresponding to the training query through the teacher model includes: Obtain the complexity of the training query; When the complexity is greater than or equal to a preset complexity threshold, the multi-task query comprehension tags are generated through the first teacher model; If the complexity is less than the preset complexity threshold, the multi-task query comprehension tags are generated using the second teacher model.
5. The method according to claim 3, characterized in that, The step of performing tag validation on the multi-task query comprehension tags to obtain the validation result corresponding to each field in the multi-task query comprehension tags includes: For each field in the multi-task query understanding tag, the field is matched with preset field validation conditions; If the field matches the preset field validation conditions, the validation result of the field is determined to be passed; If the field does not match the preset field validation conditions, the validation result of the field is determined to be unsuccessful.
6. The method according to claim 3, characterized in that, The validation result for each field in the multi-task query understanding tag includes the field confidence score. Determining the field-level training weights based on the validation results includes: Obtain the teacher model source corresponding to the field; The basic weights of the fields are determined based on the source of the teacher model. The basic weights are adjusted based on the confidence level of the field to obtain the field-level training weights for that field.
7. The method according to claim 1, characterized in that, The first teacher model was obtained through the following steps: Acquire domain data, which includes at least one of search logs, product information, category system, brand information, and attribute information; The first teacher model is obtained by fine-tuning the base model with a larger number of parameters than the lightweight student model based on the domain data.
8. The method according to claim 1, characterized in that, The method further includes: Obtain online behavior feedback data, which includes at least one of the following: no results rate, search modification rate, click-through rate, conversion rate, and manual evaluation results; Based on the online behavior feedback data, update the lightweight student model and the multi-task query comprehension tags.
9. The method according to any one of claims 1-8, characterized in that, The preset unified output format includes query correction fields, query rewrite fields, intent type fields, entity fields, category fields, and attribute fields.
10. A multi-task query and understanding device, characterized in that, include: The query retrieval module is used to retrieve queries to be processed. The model processing module is used to input the query to be processed into a preset lightweight student model. The lightweight student model outputs multi-task query understanding results that conform to a preset unified output format. The multi-task query understanding results include at least two of the following: query correction results, query rewriting results, and intent recognition results. The lightweight student model is trained based on the multi-task query understanding labels and field-level training weights generated by the first teacher model. The multi-task query understanding labels conform to the preset unified output format. The field-level training weights are determined based on the verification results of each field in the multi-task query understanding labels. The first teacher model is a large language model with a larger number of parameters than the lightweight student model. The first teacher model generates the multi-task query understanding labels in an offline state. The field validation module is used to perform field-level validation on the multi-task query understanding results and obtain field-level validation results. The field optimization module is used to retain the fields that pass the field-level validation in the multi-task query understanding result and ignore the fields that fail the field-level validation, based on the field-level validation results.
