Data processing method and device and target question and answer model training method and device

By adjusting and differentiating the text processing results of the large language model, constructing updated text pairs and training a reference model, the problems of declining model performance and low data selection accuracy in supervised fine-tuning training are solved, achieving more efficient data processing and reasoning capabilities.

CN121599083APending Publication Date: 2026-03-03ALIBABA (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411120848.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-14
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

In existing technologies, supervised fine-tuning training of large language models results in decreased performance when processing different parts and low accuracy in data selection, failing to effectively distinguish between common, easy-to-learn patterns and unique reasoning parts.

Method used

By adjusting the processing results of the initial text pairs, an updated text pair is constructed, and the initial text processing model is trained using the updated text pair to obtain a reference text processing model. The prediction loss and reference loss of each word are calculated separately. Words are distinguished based on the loss changes, and the target loss weights are adjusted to improve the model's inference ability.

Benefits of technology

It improves the accuracy and efficiency of data processing, enhances the model's reasoning ability on specific tasks, reduces interference from irrelevant information, and improves the accuracy of data selection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121599083A_ABST
    Figure CN121599083A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device and a target question and answer model training method and device.The data processing method comprises the steps that an initial text processing result corresponding to an initial text in an initial text pair is adjusted, an updated text processing result is obtained, and an updated text pair is constructed according to the initial text and the updated text processing result; according to the updated text pair, updating the initial text processing model to obtain a reference text processing model; according to the initial text pair, utilizing an initial text processing model and a reference text processing model to respectively obtain a prediction loss result and a reference loss result corresponding to a plurality of lexical elements in an initial text processing result; determining a loss change result of each lexical element according to the prediction loss result and the reference loss result; executing a data processing task according to the loss change result of each lexical element; the lexical elements are distinguished, supervision fine tuning of emphasizing reasoning can be performed based on lexical element distinguishing, and the reasoning ability of the model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of computer technology, and in particular to a data processing method and apparatus, and a target question-answering model training method and apparatus. Background Technology

[0002] Large language models pre-trained with a large amount of data have great potential, but the large language models obtained through pre-training often cannot be directly applied to dialogue and solving various tasks such as question answering, mathematics, and tool calling. Therefore, supervised fine-tuning is needed to enable the pre-trained large language models to learn to use the pre-trained knowledge to solve various tasks.

[0003] Dialogue data used for supervised fine-tuning training typically includes multiple tasks, and the data in each task usually has a large number of common, easy-to-learn patterns, as well as unique reasoning parts for each data point. Training directly on dialogue data may cause overfitting to the easy-to-learn patterns of the data and underfitting to the reasoning parts.

[0004] Therefore, there is an urgent need for a data processing method to distinguish between the common, easily learned patterns and the unique reasoning parts of each piece of data. This would solve the problem of declining model performance caused by treating different parts of the supervised fine-tuning data equally when supervising and fine-tuning a pre-trained large language model, as well as the problem of low accuracy in data selection due to interference from irrelevant information when selecting data from supervised fine-tuning data to obtain training data for a specific task. Summary of the Invention

[0005] In view of this, embodiments of this specification provide a data processing method. One or more embodiments of this specification also relate to a data processing apparatus, a target question-answering model training method, a target question-answering model training apparatus, a model training platform, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies in the prior art where treating different parts of the supervised fine-tuning data equally leads to decreased model performance and low data selection accuracy.

[0006] According to a first aspect of the embodiments of this specification, a data processing method is provided, comprising:

[0007] Adjust the initial text processing result corresponding to the initial text in the initial text pair to obtain the updated text processing result, and construct the updated text pair based on the initial text and the updated text processing result;

[0008] Based on the updated text pairs, update the initial text processing model to obtain the reference text processing model;

[0009] Based on the initial text pair, the prediction loss result and reference loss result corresponding to multiple word units in the initial text processing result are obtained by using the initial text processing model and the reference text processing model, respectively.

[0010] Based on the predicted loss results and the reference loss results, the loss change results for each word element are determined;

[0011] Based on the loss changes of each term, perform data processing tasks.

[0012] According to a second aspect of the embodiments of this specification, a data processing apparatus is provided, comprising:

[0013] The construction module is configured to adjust the initial text processing result corresponding to the initial text in the initial text pair to obtain the updated text processing result, and construct the updated text pair based on the initial text and the updated text processing result;

[0014] The update module is configured to update the initial text processing model based on the updated text pairs to obtain a reference text processing model;

[0015] The acquisition module is configured to obtain, based on the initial text pair, the prediction loss result and the reference loss result corresponding to multiple word units in the initial text processing result using the initial text processing model and the reference text processing model, respectively.

[0016] The determination module is configured to determine the loss change result of each word element based on the predicted loss result and the reference loss result;

[0017] The execution module is configured to perform data processing tasks based on the loss changes of each term.

[0018] According to a third aspect of the embodiments of this specification, a method for training a target question-answering model is provided, comprising:

[0019] Adjust the initial answer text corresponding to the initial question text in the initial question-answer pair to obtain the updated answer text, and construct an updated question-answer pair based on the initial question text and the updated answer text;

[0020] Based on the updated question-answer pairs, update the initial question-answer model to obtain the reference question-answer model;

[0021] Based on the initial question-answer pair, the prediction loss result and reference loss result corresponding to multiple word units in the initial answer text are obtained by using the initial question-answer model and the reference question-answer model, respectively.

[0022] Based on the predicted loss results and the reference loss results, the loss change results of each word element are determined, and based on the loss change results of each word element, the target loss weight corresponding to each word element is determined.

[0023] Based on the target loss weights corresponding to each word and the predicted loss results of each word, the target loss result corresponding to the initial answer text is determined;

[0024] Based on the target loss result, the initial question-answering model is trained to obtain the target question-answering model.

[0025] According to a fourth aspect of the embodiments of this specification, a target question-answering model training apparatus is provided, comprising:

[0026] The data construction module is configured to adjust the initial answer text corresponding to the initial question text in the initial question-answer pair to obtain the updated answer text, and construct an updated question-answer pair based on the initial question text and the updated answer text;

[0027] The model update module is configured to update the initial question-answer model based on the updated question-answer pair to obtain a reference question-answer model;

[0028] The result acquisition module is configured to obtain the prediction loss result and reference loss result corresponding to multiple word units in the initial answer text based on the initial question-answer pair, using the initial question-answer model and the reference question-answer model, respectively.

[0029] The weight determination module is configured to determine the loss change result of each word element based on the predicted loss result and the reference loss result, and to determine the target loss weight corresponding to each word element based on the loss change result of each word element.

[0030] The result determination module is configured to determine the target loss result corresponding to the initial answer text based on the target loss weight corresponding to each word and the predicted loss result of each word.

[0031] The model training module is configured to train the initial question-answering model based on the target loss result to obtain the target question-answering model.

[0032] According to a fifth aspect of the embodiments of this specification, a model training platform is provided, including a request interface unit, a model training unit, and a response unit;

[0033] The request interface unit is used to receive a model training request, wherein the model training request includes model information of the initial question-answering model to be trained.

[0034] The model training unit is used to determine the initial question-answering model to be trained based on the model information, and to train the initial question-answering model to obtain the target question-answering model, wherein the target question-answering model is obtained using the above-described target question-answering model training method.

[0035] The response unit is used to output the target question-answering model.

[0036] According to a sixth aspect of the embodiments of this specification, a computing device is provided, comprising:

[0037] Memory and processor;

[0038] The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions. When the computer programs / instructions are executed by the processor, they implement the steps of the above-mentioned data processing method and target question answering model training method.

[0039] According to a seventh aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores a computer program / instructions, which, when executed by a processor, implement the steps of the above-described data processing method and target question-answering model training method.

[0040] According to an eighth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described data processing method and target question-answering model training method.

[0041] One embodiment of this specification provides a data processing method that obtains an updated text processing result by adjusting the initial text processing result corresponding to the initial text in an initial text pair. An updated text pair is then constructed using the updated initial text and the updated text processing result. In this case, the initial text processing model is updated using the updated text pair to obtain a reference text processing model. This reference text processing model can learn the common, easily learnable parts of the initial and updated text processing results, while its predictive performance for the inference part deteriorates and its loss increases. These common, easily learnable parts and the inference part are represented as lexical units in the text; that is, the common, easily learnable parts are common, easily learnable lexical units in the initial text processing result, and the inference part is inference lexical units in the initial text processing result. Therefore, using the initial text processing model and the reference text processing model, the prediction loss results corresponding to multiple lexical units in the initial text processing result can be obtained respectively. Based on the results of the initial and reference loss models, the reference text processing model reduces the loss for common, easily learnable words. Therefore, for common, easily learnable words, the reference loss of the reference text processing model is less than the predicted loss of the initial text processing model. Conversely, the reference text processing model increases the loss for inference words. Therefore, for inference words, the reference loss of the reference text processing model is greater than the predicted loss of the initial text processing model. By determining the loss changes of each word through the predicted and reference loss results, the model distinguishes between common, easily learnable words and inference words in the initial text processing results based on the loss changes of each word. Furthermore, when performing data processing tasks based on the loss changes, the model can flexibly set up data processing tasks and improve the accuracy and efficiency of data processing by utilizing the distinguished common, easily learnable words and inference words during the execution of data processing tasks. Attached Figure Description

[0042] Figure 1 This is a schematic diagram illustrating a data processing method provided in one embodiment of this specification.

[0043] Figure 2 This is a flowchart illustrating a data processing method provided in one embodiment of this specification;

[0044] Figure 3 This is a flowchart illustrating a target question-answering model training method provided in one embodiment of this specification;

[0045] Figure 4 This is a flowchart illustrating the processing procedure of a data processing method provided in one embodiment of this specification.

[0046] Figure 5 This is a framework diagram of a model training platform provided in one embodiment of this specification;

[0047] Figure 6 This is a schematic diagram of the structure of a data processing apparatus provided in one embodiment of this specification;

[0048] Figure 7 This is a schematic diagram of the structure of a target question-answering model device provided in one embodiment of this specification;

[0049] Figure 8 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0050] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0051] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0052] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0053] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0054] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0055] Token: In large language models, natural language text is segmented into tokens as processing units using a tokenizer.

[0056] Large Language Model (MLM) is a super-large neural network model pre-trained on a large amount of data, which has extremely strong natural language understanding and generation capabilities.

[0057] Supervised fine-tuning involves training neural network models using labeled data. Dialogue-based data is frequently used in the supervised fine-tuning of large language models.

[0058] Data selection: To enhance the model's ability on a specific task, a subset of training data is selected, choosing training data that has a significant positive impact on the specific task or test data.

[0059] Current methods for word segmentation are based on regular expressions. However, this method requires manually constructing regular expressions for matching. Due to the diversity of natural language expressions, manually constructing regular expressions is resource-intensive and has low accuracy. Furthermore, the segmentation of regular expressions may not align with the segmentation of the word segmenter in large language models, affecting the effectiveness of model training and data selection.

[0060] The data processing method provided in the embodiments of this specification distinguishes common, easily learned patterns from unique inference components in text data by exchanging matching relationships and the difficulty of prediction. A supervised fine-tuning scheme emphasizing inference is proposed based on lexical differentiation, which can effectively improve the model's inference ability; a data selection scheme emphasizing inference is also proposed based on lexical differentiation, which can more accurately and efficiently evaluate the impact of training data on the test set.

[0061] This specification provides a data processing method, and also relates to a data processing apparatus, a target question-answering model training method, a target question-answering model training apparatus, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.

[0062] See Figure 1 , Figure 1 This diagram illustrates a scenario of a data processing method provided in one embodiment of this specification.

[0063] Specifically, the data processing method is implemented using the end-side device 102 and the server 104. The end-side device 102 is used to send text data processing requests to the server 104. For example, the text data processing request is a model training request for the initial text processing model, and the request carries the initial text pair. In practical applications, the text data processing request can also be a data selection request or other processing requests related to text data. This specification does not limit this.

[0064] The initial text pair can be adjusted in server 104 to obtain the updated text pair, or the initial text pair and the updated text pair can be included in the text data processing request; there are no restrictions on this.

[0065] The specific updated text pairs are obtained as follows: the initial text processing result corresponding to the initial text in the initial text pair is adjusted to obtain the updated text processing result, and the updated text pair is constructed based on the initial text and the updated text processing result; the initial text processing model is deployed in server 104, and the initial text processing model is updated based on the updated text pair to obtain the reference text processing model.

[0066] Based on the initial text pairs, using the initial text processing model and the reference text processing model, the predicted loss results and reference loss results corresponding to multiple words in the initial text processing results are obtained respectively; based on the predicted loss results and the reference loss results, the loss change results of each word are determined; based on the loss change results of each word, the data processing task is executed.

[0067] Taking a text data processing request as an example of a model training request for an initial text processing model, the target loss weights corresponding to each word are determined based on the loss change results of each word; the target loss result corresponding to the initial text processing result is determined based on the target loss weights corresponding to each word and the predicted loss result of each word; the initial text processing model is trained based on the target loss result to obtain the target text processing model. The model interface information of the target text processing model can be determined as the task execution result, and the task execution result is returned to the end device 102 so that the end device 102 can obtain the model interface information of the target text processing model and call the target text processing model based on the model interface information.

[0068] The edge device 102 may include a browser, an app (application), or a web application such as an H5 (Hypertext Markup Language 5) application, a lightweight application (also known as a mini-program), or a cloud application. The edge device can be developed based on a software development kit (SDK) provided by the server, such as a real-time communication (RTC) SDK. The edge device can be deployed in an electronic device and depends on the device's operation or certain apps within the device to run. The electronic device may have a display screen and support information browsing, such as a personal mobile terminal like a mobile phone, tablet, or personal computer. Various other types of applications can also be configured in the electronic device, such as human-computer interaction applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, and social media platform software.

[0069] Server 104 can be understood as a server providing various services, including physical servers and cloud servers. Examples include servers providing communication services to multiple clients, servers supporting backend training of models used on clients, and servers processing data sent by clients. It's important to note that Server 104 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. Server 104 can also be a server in a distributed system, or a server integrated with blockchain. Server 104 can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.

[0070] It is worth noting that the data processing method provided in the embodiments of this specification can be executed by the server 104. In other embodiments of this specification, the initial text processing model can be deployed in the terminal device 102, so that the terminal device 102 can also have similar functions to the server 104, thereby executing the data processing method provided in the embodiments of this specification. In other embodiments, the data processing method provided in the embodiments of this specification can also be jointly executed by the terminal device 102 and the server 104.

[0071] The data processing method provided in this specification's embodiments obtains updated text processing results by adjusting the initial text processing results corresponding to the initial text in the initial text pair. An updated text pair is then constructed using the updated initial text and the updated text processing results. In this case, the initial text processing model is updated using the updated text pair to obtain a reference text processing model. This reference text processing model can learn the common, easily learnable parts of the initial and updated text processing results, while its prediction performance for the inference part deteriorates and its loss increases. These common, easily learnable parts and the inference part are represented as lexical units in the text; that is, the common easily learnable parts are common easily learnable lexical units in the initial text processing results, and the inference part is inference lexical units in the initial text processing results. Therefore, using the initial text processing model and the reference text processing model, prediction loss results and reference loss results corresponding to multiple lexical units in the initial text processing results can be obtained respectively. The reference text processing model reduces the loss for common easily learnable lexical units, while increasing the loss for inference lexical units.

[0072] Therefore, for common, easily learnable lexical units, the reference loss of the reference text processing model is less than the predicted loss of the initial text processing model. For inference lexical units, the reference loss of the reference text processing model is greater than the predicted loss of the initial text processing model. Based on the predicted loss and reference loss, the loss change of each lexical unit can be determined. Since in the supervised training of the initial text processing model, inference lexical units in the data are considered more important than common, easily learnable lexical units, different target loss weights can be adaptively assigned to each lexical unit based on the loss change. Specifically, inference lexical units are assigned higher target loss weights than common, easily learnable lexical units, allowing the initial text processing model to learn with a focus, improving its inference ability and generation performance.

[0073] See Figure 2 , Figure 2 A flowchart of a data processing method provided in one embodiment of this specification is shown, which specifically includes the following steps.

[0074] Step 202: Adjust the initial text processing result corresponding to the initial text in the initial text pair to obtain the updated text processing result, and construct the updated text pair based on the initial text and the updated text processing result.

[0075] The application scenarios of the initial text processing model vary, resulting in different initial texts and processing results in the initial text pairs. For example, when the initial text processing model is applied to a question-and-answer scenario, the initial text in the initial text pair is the question text, and the processing result is the answer text. When the initial text processing model is applied to a summary extraction scenario, the initial text is a long text, and the processing result is the summary text. When the initial text processing model is applied to a language translation scenario, the initial text is the initial language text, and the processing result is the translated target language text.

[0076] In one or more embodiments of this specification, the initial text pairs include multiple pairs; updated text pairs are constructed by re-pairing the initial texts in the multiple initial text pairs with the initial text processing results. Specific implementation methods are described below:

[0077] The process of adjusting the initial text processing result corresponding to the initial text in the initial text pair to obtain the updated text processing result includes:

[0078] The initial text in multiple initial text pairs is re-paired with the initial text processing result, and the re-paired initial text processing result corresponding to the initial text is determined as the updated text processing result, wherein the initial text and the updated text processing result do not have a text matching relationship.

[0079] The initial text pair can be understood as the training data in the training dataset, which includes the correctly matched initial text and the initial text processing result. For example, if the training data is dialogue data, the dialogue data includes the input text and the corresponding matched output text; or if the training data is question-and-answer data, the question-and-answer data includes the question and the corresponding matched answer. That is, the initial text in the initial text pair and the initial text processing result have a correct text matching relationship.

[0080] Updating the text processing result can be understood as obtaining a new text processing result that is re-paired with the initial text by re-pairing the initial text with the initial text processing result. For example, if the initial text 1 in the initial text pair corresponds to the initial text processing result 1, and the initial text 1 is re-paired to the initial text processing result 2, then the initial text processing result 2 is the updated text processing result of the initial text 1. Therefore, there is no text matching relationship between the initial text and the updated text processing result. For example, if the initial text 1 is a question text, the updated text processing result after re-pairing is not the correct answer corresponding to the initial text 1.

[0081] An updated text pair can be understood as a text pair consisting of an initial text that has no text matching relationship and an updated text processing result. For example, in the example above, the text pair consisting of initial text 1 and initial text processing result 2 is an updated text pair. Of course, in practical applications, the updated text processing result can also be obtained by adjusting the words in the initial text processing result. For example, if the initial text 1 is the question text "What is the capital of country Z?", and the corresponding initial text processing result 1 is the answer text "City a is the capital of country Z", by adjusting the word "city a" in the initial text processing result 1 to "city b", the updated text processing result "city b is the capital of country Z" is obtained. In this way, the initial text and the updated text processing result also have no text matching relationship, and the updated text pair can be determined from the initial text and the updated text processing result that have no text matching relationship.

[0082] Specifically, by adjusting the initial text processing result corresponding to the initial text in the initial text pair, the initial text processing result corresponding to the initial text is updated to the updated text processing result, thereby obtaining an updated text pair consisting of the initial text and the updated text processing result. The initial text and the updated text processing result in this updated text pair do not have a text matching relationship.

[0083] For example, there are 3 pairs of initial text pairs. Initial text pair 1 includes initial text 1 and the corresponding initial text processing result 1. Initial text pair 2 includes initial text 2 and the corresponding initial text processing result 2. Initial text pair 3 includes initial text 3 and the corresponding initial text processing result 3. By re-pairing, we can construct updated text pair 1 including initial text 1 and initial text processing result 2, updated text pair 2 including initial text 2 and initial text processing result 3, and updated text pair 3 including initial text 3 and initial text processing result 1.

[0084] In practical applications, multiple updated text pairs are obtained to construct a rearranged dataset relative to the training dataset, which is then used to train a reference text processing model. By re-pairing the initial text and the initial text processing result in the initial text pairs, the initial text and the updated text processing result that do not have a text matching relationship are identified. The erroneous text matching relationship between the initial text and the updated text processing result becomes noise in the inference part. Since the easily learnable pattern part is common to data of the same type of task, the reference text processing model can easily learn and predict these parts when trained using the rearranged dataset.

[0085] The data processing method provided in the embodiments of this specification re-pairs the initial text and the initial text processing result in multiple initial text pairs to obtain an updated text pair consisting of the initial text and the updated text processing result, which provides data support for the subsequent model training of the reference text processing model and facilitates data analysis.

[0086] Step 204: Update the initial text processing model based on the updated text pair to obtain the reference text processing model.

[0087] The initial text processing model can be understood as a pre-trained large language model with natural language understanding and generation capabilities; the reference text processing model can be understood as a model obtained by training the initial text processing model using updated text pairs with erroneous mapping relationships. This reference text processing model can also predict the corresponding output text for the input text.

[0088] Because the reference text processing model is obtained by updating the initial text processing model using updated text pairs, and there is an incorrect mapping relationship between the initial text in the updated text pairs and the updated text processing results, the reference text processing model can learn the common and easy-to-learn parts of the data, but its predictive performance for the inference part of the data deteriorates.

[0089] The following example illustrates the concepts of "common, easily learnable parts of data" and "inference parts of data": For instance, in a function call task, the user's question (initial text) is "Find popular media component tools," and the corresponding answer (initial text processing result) is "Based on your request, to find popular media component tools from [multiple media component tools], you need to call function [A] to [retrieve the list of media component tools]." The updated text processing result could be "Based on your request, to find orders for product B from [multiple orders], you need to call function [C] to [retrieve the order list]." Here, the content not enclosed in square brackets represents the common, easily learnable parts of the data, while the content enclosed in square brackets represents the inference parts of the data. These common, easily learnable parts are the fixed or similar reasoning elements in the output corresponding to a given type of input, while the inference parts of the data are the unique inference information found in each piece of data.

[0090] In one or more embodiments of this specification, a reference text processing model is obtained by inputting updated text pairs into an initial text processing model and training the initial text processing model using the updated text pairs. Specific implementation methods are described below:

[0091] The step of updating the initial text processing model based on the updated text pair to obtain a reference text processing model includes:

[0092] The updated text pair is input into the initial text processing model to obtain the predicted text processing result corresponding to the initial text in the updated text pair;

[0093] Based on the predicted text processing results and the updated text processing results, the initial text processing model is trained to obtain the reference text processing model.

[0094] Specifically, when the initial text processing model is a pre-trained large language model, the updated text pair is input into the initial text processing model. The initial text processing model can perform text prediction on the initial text in the updated text pair to obtain the predicted text processing result. By calculating the loss function between the predicted text processing result and the updated text processing result in the updated text pair, the model parameters of the initial text processing model are adjusted to obtain the reference text processing model.

[0095] In practical applications, because the reference text processing model learns updated text processing results that do not match the initial text, the reference text processing model learns poorly for the inference part of each data point. Compared with the initial text processing model, the reference text processing model's prediction performance for the inference part deteriorates and the loss increases. However, for the common and easy-to-learn parts of the data, the reference text processing model reduces this loss.

[0096] The data processing method provided in the embodiments of this specification can obtain a reference text processing model by updating the text pairs during training. That is, it obtains the initial text processing model before training and the reference text processing model after training. Since the prediction performance of the reference text processing model for the inference part deteriorates, the different parts in the data can be accurately distinguished by the change in loss of the model before and after training.

[0097] In one or more embodiments of this specification, when it is necessary to train an initial text processing model using updated text pairs, the initial text processing model can be invoked through its model interface information. Specific implementation methods are as follows:

[0098] Before updating the initial text processing model based on the updated text pair to obtain the reference text processing model, the process further includes:

[0099] Determine the model interface information of the initial text processing model, and call the initial text processing model according to the model interface information.

[0100] In this context, the model interface can be understood as a specific interface that allows external systems to interact with a pre-trained machine learning or deep learning model. Through the model interface, other applications can utilize the model's capabilities. Model interface information can be understood as information such as the model's server endpoints, accepted data formats, and returned response formats. This model interface information constitutes the model's interface specification, allowing external systems to interact with the model.

[0101] Specifically, by determining the model interface information of the initial text processing model, it is possible to interact with the initial text processing model through this model interface, thereby enabling the invocation of the initial text processing model. This allows the updated text pairs to be input into the initial text processing model for model training.

[0102] In practical applications, since the initial text processing model is a large language model, and large language models have a very large number of parameters, requiring a lot of storage space and computing resources, in order to avoid occupying the storage space and computing resources of the local system, the initial text processing model deployed in the model platform can be called. Therefore, it is necessary to determine the model interface information of the initial text processing model and use the model interface information to call the initial text processing model.

[0103] The data processing method provided in the embodiments of this specification determines the model interface information of the initial text processing model and calls the initial text processing model according to the model interface information, thereby avoiding the deployment of the initial text processing model on the local system and saving the storage space and computing resources of the local system.

[0104] Step 206: Based on the initial text pair, use the initial text processing model and the reference text processing model to obtain the prediction loss result and reference loss result corresponding to multiple word units in the initial text processing result, respectively.

[0105] Specifically, the initial text pairs are input into the initial text processing model and the reference text processing model, respectively. Both the initial text processing model and the reference text processing model can predict the initial text in the initial text pairs. Thus, the prediction loss results and reference loss results corresponding to multiple words in the initial text processing results are obtained by using the initial text processing model and the reference text processing model, respectively.

[0106] Since the initial text processing model and the reference text processing model are trained on different data, their prediction performance for the initial text is different, thus yielding different prediction loss results and reference loss results.

[0107] In one or more embodiments of this specification, the initial text is predicted using an initial text processing model and a reference text processing model, respectively, to obtain predicted text processing results and reference text processing results. Based on the predicted text processing results and the initial text processing results, a prediction loss result is obtained; and based on the reference text processing results and the initial text processing results, a reference loss result is obtained. Specific implementation methods are described below:

[0108] The step of obtaining prediction loss results and reference loss results corresponding to multiple word units in the initial text processing result based on the initial text pair, using the initial text processing model and the reference text processing model, includes:

[0109] The initial text pair is input into the initial text processing model to obtain the predicted text processing result corresponding to the initial text in the initial text pair;

[0110] Based on the predicted text processing result and the initial text processing result, the prediction loss result corresponding to multiple word units in the initial text processing result is obtained;

[0111] The initial text pair is input into the reference text processing model to obtain the reference text processing result corresponding to the initial text in the initial text pair;

[0112] Based on the reference text processing result and the initial text processing result, a reference loss result corresponding to multiple lexical units in the initial text processing result is obtained.

[0113] The predicted text processing result can be understood as the predicted text obtained by predicting the initial text through the initial text processing model; the reference text processing result can be understood as the predicted text obtained by predicting the initial text through the reference text processing model.

[0114] In practical applications, both the initial text processing model and the reference text processing model are large language models. Large language models typically process the lexical units obtained from text segmentation. That is, the initial text is segmented into individual lexical units to obtain the corresponding lexical unit sequence. The lexical unit sequence is then input into the large language model, where each lexical unit in the sequence is processed one by one, and a prediction is made for each lexical unit to obtain the prediction result for each lexical unit. For each lexical unit prediction result, the large language model compares it with the true label (the lexical unit of the initial text processing result) and calculates the corresponding prediction loss.

[0115] Therefore, the predicted text processing result in the above embodiments includes multiple predicted lexical units obtained by predicting the initial text using the initial text processing model; the step of obtaining the prediction loss result corresponding to multiple lexical units in the initial text processing result based on the predicted text processing result and the initial text processing result includes:

[0116] Determine multiple predicted terms for the predicted text processing result, and determine multiple terms for the initial text processing result; based on the multiple predicted terms and the multiple terms, obtain the prediction loss result corresponding to the multiple terms in the initial text processing result.

[0117] The reference text processing result includes multiple predicted reference terms obtained by predicting the initial text using the reference text processing model; the step of obtaining the reference loss result corresponding to multiple terms in the initial text processing result based on the reference text processing result and the initial text processing result includes:

[0118] Determine multiple predicted reference terms for the reference text processing result, and determine multiple terms for the initial text processing result; based on the multiple predicted reference terms and the multiple terms, obtain reference loss results corresponding to the multiple terms in the initial text processing result.

[0119] In this context, predicted lexical units can be understood as the prediction results of each lexical unit output by the initial text processing model; predicted reference lexical units can be understood as the prediction results of each lexical unit output by the reference text processing model.

[0120] The prediction loss for multiple specific terms can be obtained using the following formula:

[0121] L base (x i )=-log P(x i |x <i)

[0122] Among them, L base x refers to the loss function of the initial text processing model. i Let P represent the i-th word in the initial text processing result, and let P(x) represent the probability given the condition. i |x<i) is a conditional probability, representing the probability that, given the sequence x<i (where x is lowercase, i.e., x1, x2, ..., xn), a condition is met. i-1 Given the condition, the next element is x. i The probability of -logP(x) i |x<i) is the negative logarithmic probability (also known as cross-entropy loss), used to measure the difference between the predicted probability distribution and the true probability distribution.

[0123] The reference loss result for multiple specific terms can be obtained using the following formula:

[0124] L rer (x i )=-log P(x i |x <i)

[0125] Among them, L ref This refers to the loss function of the reference text processing model; other parameters can be found in the above embodiments.

[0126] The data processing method provided in the embodiments of this specification obtains the prediction loss results of multiple word units corresponding to the initial text processing model and the reference loss results of multiple word units corresponding to the reference text processing model by inputting the same initial text pair into different initial text processing models and reference loss models, respectively. This facilitates accurate differentiation of word units by using the change values ​​between the prediction loss results and reference loss results of multiple word units.

[0127] Step 208: Determine the loss change result of each word based on the predicted loss result and the reference loss result.

[0128] The loss change result can be understood as the loss change radio (lc), which is used to obtain the loss change of each word element through the initial text processing model and the trained reference text processing model.

[0129] The specific loss variation of each word can be obtained using the following formula:

[0130]

[0131] In practical applications, lexical units can be divided into three categories: format lexical units, reasoning format lexical units, and reasoning lexical units.

[0132] Regarding formatted words: These words are fixed in the output corresponding to a certain type of input. Although the reference text processing model is trained using updated text pairs, the formatted words in the initial text pairs are consistent with those in the updated text pairs. Therefore, after training, the loss of the reference text processing model after training on these words can be reduced to almost zero. That is, the lexical unit with lc=1 is the format lexical unit;

[0133] For inference template terms: Since these terms have different expressions for different inputs but the inference path is common, referencing text processing models can reduce the loss on these terms to some extent during training. ref Less than Lbase therefore That is, the lexical units of lc∈[0,1) are the inference template lexical units;

[0134] Regarding inference terms: As mentioned above, since the reference text processing model learns to update the text processing results, it learns poorly for the inference part of the data. Therefore, the predictions for the inference part in the reference text processing results output by the reference text processing model are very inaccurate, increasing the loss. ref Greater than L base ,therefore, That is, lexical units where lc < 0 are inference lexical units.

[0135] Step 210: Execute data processing tasks based on the loss changes of each word.

[0136] Specifically, by calculating the loss change magnitude of each word, the loss change result of each word is determined, thereby distinguishing each word and applying it based on word distinction. For example, different weights can be applied during training according to different word types, or common and easy-to-learn pattern words can be masked when selecting data, making the data selection inference-specific.

[0137] In one or more embodiments of this specification, the data processing task is a model training task for the initial text processing model; specifically, supervised fine-tuning of the initial text processing model based on lexical discrimination is performed. Specific implementation methods are as follows:

[0138] The step of performing data processing tasks based on the loss changes of each word element includes:

[0139] Based on the loss change results of each word element, determine the target loss weight corresponding to each word element;

[0140] Based on the target loss weights corresponding to each word and the predicted loss results of each word, the target loss result corresponding to the initial text processing result is determined;

[0141] Based on the target loss result, the initial text processing model is trained to obtain the target text processing model.

[0142] Generally, training large language models involves calculating the loss per word and then averaging it to obtain the text-level loss. However, treating different parts of the text equally can lead to a decline in model performance, causing overfitting in easily learned patterns and underfitting in the inference part. In the embodiments of this specification, by analyzing the loss changes of each word, words can be distinguished, and different training weights can be assigned to each distinguished word. Thus, when the initial text processing model is supervised and fine-tuned using words with different training weights, the initial text processing model focuses on learning the inference part, thereby improving the inference ability of the target text processing model.

[0143] Specifically, the overall loss function between the predicted text processing result and the initial text processing result is obtained by weighting the prediction loss corresponding to each word. Different weights can be applied to each word using the following formula:

[0144]

[0145] Among them, w i This represents the weight corresponding to the i-th word element. The weights of different word elements are adaptively allocated based on the lc calculated above. The lower the lc, the higher the weight. To prevent outliers from having too much influence, an upper limit of 10 is set (where the upper limit can be set according to the actual situation). The training weights are adaptively allocated according to the magnitude of the loss change of different word elements. Word elements with increased loss receive higher weights but with an upper limit, while word elements with decreased loss are given lower weights.

[0146] As can be seen from the above embodiments, the lower the lc value, the more the corresponding word unit is biased towards inference word units. In the supervised fine-tuning of large language models, the inference part of the data is considered more important than common and easy-to-learn patterns. Therefore, more weight is assigned to inference word units.

[0147] After assigning different weights to each word, the predicted loss results of each word are weighted according to their corresponding weights to determine the target loss result corresponding to the initial text processing result, that is, to obtain the training loss function of the initial text processing model:

[0148]

[0149] Among them, L WLM θ is the training loss function for the initial text processing model, θ is the model parameter, and N is the total number of tokens in the training data, i.e., the total number of tokens in the initial text processing result.

[0150] The initial text processing model is tuned using a weighted training loss function to obtain the target text processing model.

[0151] The data processing method provided in the embodiments of this specification performs supervised fine-tuning of the initial text processing model based on word segment differentiation, focusing on reasoning, so that the trained target text processing model has better reasoning ability and improves the accuracy of predicted text.

[0152] In one or more embodiments of this specification, the data processing task is a task of determining the word type of words corresponding to each lexical unit in the initial text processing result; the word type of words in the text is determined by the lexical unit type of each lexical unit. Specific implementation methods are as follows:

[0153] The step of performing data processing tasks based on the loss changes of each word element includes:

[0154] Based on the loss change results of each word, the word type of each word is determined, and based on the word type of each word, the word type of the corresponding word is determined.

[0155] Specifically, since there is a correspondence between lexical units and words in the text, the lexical unit type can be determined by the loss change result of the lexical units. Thus, the word type of the corresponding word can be determined based on the lexical unit type. For example, the word type corresponds to the lexical unit type in the above embodiment. The word type includes format words, inference template words, and inference words. Format words are common words in each initial text processing result. Inference template words are words with the same inference logic when performing model inference in each initial text processing result. Inference words are the unique parts in each initial text processing result.

[0156] In practical applications, classifying words based on their word types allows for their application across multiple domains. For instance, in recommendation systems, identifying inference words related to inference terms can reduce interference from irrelevant information and enable precise personalized recommendations. Similarly, in generative models that require input prompt text, if the model's output is unsatisfactory, adjusting the inference words within the prompt text can improve the model's performance. Adjusting only the common, easily learned parts of the prompt text doesn't significantly alter the model's output and wastes resources during the generation process.

[0157] The data processing method provided in the embodiments of this specification determines the lexical type of each lexical through the loss change results of each lexical, and can determine the word type of the corresponding word by the lexical type of each lexical, thereby distinguishing words in the text based on word type. The distinguished words can be applied to multiple fields, improving the efficiency of information processing.

[0158] In one or more embodiments of this specification, the initial text pairs include multiple pairs, and the data processing task is a text pair filtering task for multiple initial text pairs; by using the loss change results of lexical units, the target reference lexical unit in each initial text pair and the target test lexical unit in the test text pair are determined, and the target text pair is determined from multiple initial text pairs based on the similarity between the target reference lexical unit and the target test lexical unit.

[0159] The step of performing data processing tasks based on the loss changes of each word element includes:

[0160] Based on the loss change results of each word, the word type of each word is determined, and based on the word type of each word, a target reference word is determined from the multiple words.

[0161] Determine the test text pairs and the test text processing results corresponding to the test texts in the test text pairs, and determine the loss change results of multiple test words in the test text processing results;

[0162] Based on the loss change results of each test word, the word type of each test word is determined, and based on the word type of each test word, the target test word is determined from the plurality of test words;

[0163] Based on the target reference lexicon and the target test lexicon, a target text pair is determined from the plurality of initial text pairs.

[0164] Among them, the word type includes, but is not limited to, format type, reasoning template type, and reasoning type. The word type of format type is the format word type in the above embodiments, the word type of reasoning template type is the reasoning template word type in the above embodiments, and the word type of reasoning type is the reasoning word type in the above embodiments.

[0165] Target reference terms can be understood as inference terms in each initial text pair; test text pairs can be understood as test data in the test dataset, including the test text and its corresponding processing result, used to evaluate model performance. Target test terms can be understood as inference terms in the test text pair. Target text pairs can be understood as text pairs selected from the initial text pairs that have a higher similarity to the test text pairs compared to other initial text pairs.

[0166] Specifically, the text pair filtering task aims to select text pairs similar to test text pairs from multiple initial text pairs. When calculating the similarity between the initial text pairs and the test text pairs, since the inference words are unique parts of the data, the similarity between the inference words in the initial text pairs and the inference words in the test text pairs can be calculated instead of calculating the overall similarity between the initial text pairs and the test text pairs. In other words, if the unique parts of the two data pairs are similar, then the two data pairs can be determined to be similar.

[0167] For example, if both the initial text pair and the test text pair are question-and-answer pairs, and the initial text processing result in the initial text pair and the test text processing result in the test text pair are both answer texts about the capital of a country, then the initial text processing result could be "City A is the capital of Country B", and the test text processing result could be "City C is the capital of Country D". In this case, the inference terms in the initial text processing result are "City A" and "Country B", and the test text processing result is "City C" and "Country D". The similarity between the initial text pair and the test text pair is determined by calculating the similarity between the inference terms in the initial text pair and the inference terms in the test text pair.

[0168] In practical applications, each lexical unit can be classified based on its loss change results to obtain the inference lexical unit (target reference lexical unit) of the inference type in each initial text pair. For the test text pair, the loss change results of multiple test lexical units in the test text processing result are obtained in a similar manner. Based on the loss change results of each test lexical unit, the inference lexical unit (target test lexical unit) of the inference type in the test text pair can be determined. Thus, the target text pair can be determined from multiple initial text pairs based on the target reference lexical unit and the target test lexical unit.

[0169] The data processing method provided in the embodiments of this specification can distinguish each word based on the loss change results of each word when filtering multiple initial text pairs, thereby using the distinguished inference words to determine the similarity between data and improving the efficiency of text pair filtering.

[0170] In one or more embodiments of this specification, determining the loss change results of multiple test terms in the test text processing result includes:

[0171] Based on the test text pair, using the initial text processing model and the reference text processing model, the prediction loss result and reference loss result corresponding to multiple test words in the test text processing result are obtained;

[0172] Based on the predicted loss result and the reference loss result corresponding to each test word, the loss change result of each test word is determined.

[0173] Specifically, the implementation of obtaining the loss change results of each test word in the test text pair is similar to the implementation of obtaining the loss change results of each word in the initial text pair.

[0174] For specific implementation details, please refer to the above embodiments, which will not be repeated here.

[0175] In one or more embodiments of this specification, by calculating the lexical similarity between the target reference lexical and the target test lexical, similar reference lexicals are determined from the target reference lexicals, thereby identifying the initial text pairs corresponding to the similar reference lexicals as target text pairs. Specific implementation methods are described below:

[0176] The step of determining the target text pair from the plurality of initial text pairs based on the target reference lexical and the target test lexical includes:

[0177] Calculate the word similarity between the target reference word and the target test word, and determine similar reference words from the target reference words based on the word similarity.

[0178] From the plurality of initial text pairs, the initial text pairs corresponding to the similar reference words are determined as the target text pairs.

[0179] The methods for calculating word similarity include, but are not limited to, similarity calculation methods based on path length and similarity calculation methods based on word vectors corresponding to words.

[0180] Similar reference words can be understood as words that are sorted from largest to smallest in terms of similarity, and the top preset proportion of word similarity and corresponding target reference words are selected from the sorted word similarity. For example, the preset proportion can be set to 5% according to the actual situation.

[0181] Specifically, the word similarity between each target reference word and the target test word is calculated, and the obtained word similarities are sorted in descending order. The top 5% of word similarities are selected from the sorted word similarities, and the target reference words corresponding to these top 5% word similarities are determined as similar reference words. From multiple initial text pairs, the initial text pairs corresponding to the similar reference words are selected, and the selected text pairs are the target text pairs.

[0182] The data processing method provided in the embodiments of this specification calculates the lexical similarity between the target reference lexical and the target test lexical, that is, calculates the lexical similarity between the inferred lexicals of the two data, and directly determines the target text pair from multiple initial text pairs by the lexical similarity of the inferred lexicals.

[0183] In one or more embodiments of this specification, conventional gradient-based data selection (text pair screening in this embodiment) calculates the gradient of the input based on all output content, and then evaluates the similarity between the training data and the test data based on the cosine similarity of the gradients of the training data and the test data to the model. To make data selection more specific to the inference part, this embodiment masks format lexical units and inference template lexical units when calculating the gradient, and calculates the gradient of the inference lexical units relative to the input. Specific implementation methods are described below:

[0184] The step of determining the target text pair from the plurality of initial text pairs based on the target reference lexical and the target test lexical includes:

[0185] Determine the reference gradient vector corresponding to the target reference word and the test gradient vector corresponding to the target test word;

[0186] Based on the reference gradient vector and the test gradient vector, the text similarity between the plurality of initial text pairs and the test text pair is calculated, and the target text pair is determined from the plurality of initial text pairs based on the text similarity.

[0187] Here, the gradient is a vector that points in the direction of the fastest ascent of the function at a certain point. Traditionally, the data distribution of training and test data is determined by the cosine similarity of the gradients of the training and test data with respect to the model. This cosine similarity can be used to evaluate the similarity between the training and test data. For example, when the test data generation effect does not meet expectations, the cosine similarity of the gradients of the training and test data with respect to the model can be calculated to identify the training data related to that test data and determine the reason why the test data generation effect did not meet expectations.

[0188] To make data selection more specific to the inference part, format lexical units and inference template lexical units are masked when calculating the gradient, thereby obtaining the reference gradient vector corresponding to the target reference lexical unit (i.e., the inference lexical unit). Similarly, the test gradient vector corresponding to the target test lexical unit is obtained, that is, the gradient vector of the inference lexical unit relative to the input is calculated. Then, based on the cosine similarity between the reference gradient vector and the test gradient vector, the text similarity between the initial text pair and the test text pair is obtained. Based on the text similarity, the target text pair is determined from multiple initial text pairs.

[0189] The data processing methods provided in the embodiments of this specification offer a variety of ways to determine the target text pair from multiple initial text pairs, so that in practical applications, an appropriate method can be selected according to the actual situation to efficiently and accurately determine the target text pair from the initial text pairs.

[0190] In one or more embodiments of this specification, the test text pair is a text pair related to the target text processing task; therefore, the purpose of obtaining target text pairs similar to the test text pairs through the above steps is to obtain training data related to the target text processing task, thereby obtaining a target task text processing model for implementing the target text processing task when training an initial text processing model using the target text pairs. Specific implementation methods are as follows:

[0191] After determining the target text pair from the plurality of initial text pairs, the method further includes:

[0192] The initial text processing model is trained using the target text pair to obtain the target task text processing model, wherein the target task text processing model is used to implement the target text processing task.

[0193] In practical applications, when the test text pairs are text pairs related to the target text processing task, in order to enhance the relevance of the initial text processing model to the target text processing task, target text pairs with high similarity to the test text pairs are selected from the initial text pairs contained in the training dataset. The target text pairs are training data that have a significant positive impact on the target text processing task.

[0194] By training the initial text processing model with target text pairs, the trained target task text processing model can have better processing capabilities on the target text processing task.

[0195] The data processing method provided in the embodiments of this specification can obtain target text pairs related to the target text processing task before training the initial text processing model by text pair filtering, thereby using the target text pairs to train the initial text processing model and obtaining a target task text processing model for implementing the target text processing task, thus achieving accurate training of the model.

[0196] In one or more embodiments of this specification, when testing a trained model using test data, if the model's generated result does not meet expectations, the test data is identified as a test text pair. Through the aforementioned text pair filtering steps, target text pairs similar to the test text pair are identified, and the training data that caused the test text pair's generation result is traced. Subsequently, the identified training data can be removed, and the model can be updated and trained using the removed training data. Specific implementation methods are as follows:

[0197] Before determining the test text pair, the process also includes:

[0198] Multiple initial test text pairs are determined, and the multiple initial test text pairs are respectively input into the initial text processing model to obtain multiple initial test text processing results;

[0199] An abnormal test text processing result is determined from the plurality of initial test text processing results, and the initial test text pair corresponding to the abnormal test text processing result is determined as the test text pair;

[0200] After determining the target text pair from the plurality of initial text pairs, the method further includes:

[0201] Based on the plurality of initial text pairs and the target text pair, a filter text pair is determined, wherein the filter text pair is a text pair other than the target text pair among the plurality of initial text pairs;

[0202] The initial text processing model is trained using the selected text pairs to obtain the updated text processing model.

[0203] The initial test text pairs can be understood as test data used to test the performance of the initial text processing model. Abnormal test text processing results can be understood as test text processing results that did not achieve the expected generation effect.

[0204] Specifically, by inputting multiple initial test text pairs into the initial text processing model, and using the initial text processing model to output multiple initial test text processing results, the test text processing results that do not achieve the expected generation effect are identified as abnormal test text processing results. In order to trace which training data caused the abnormal test text processing results, the initial test text pairs corresponding to the abnormal test text processing results can be identified as test text pairs, given that the initial text processing model is trained using initial text pairs.

[0205] Using the steps in the above embodiments, target text pairs similar to the test text pairs are determined. That is, the target text pairs are the training data that cause the initial text processing model to output abnormal test text processing results. In order to avoid the initial text processing model still outputting abnormal test text processing results, the target text pairs are removed from multiple initial text pairs. The text pairs other than the target text pairs in the multiple initial text pairs are determined as the filtered text pairs. The filtered text pairs are used to update the training initial text processing results to obtain an updated text processing model. The updated text processing model can output test text processing results that achieve the expected effect on the test data.

[0206] The data processing method provided in the embodiments of this specification, which is a text pair filtering task based on word segmentation, can not only filter training data before model training to obtain a target text processing model for achieving the target text processing task, but also evaluate the impact of training data on the test dataset more accurately and efficiently when testing the trained initial text processing model using the test dataset.

[0207] In one or more embodiments of this specification, before adjusting the initial text processing result corresponding to the initial text in the initial text pair to obtain the updated text processing result, the method further includes:

[0208] In response to a text data processing request sent by a client, determine the initial text pair carried in the text data processing request;

[0209] After performing the data processing task based on the loss changes of each lexical unit, the process further includes:

[0210] The task execution result obtained from executing the data processing task will be returned to the client.

[0211] Specifically, when the data processing task is a model training task for the initial text processing model, the task execution result can be the model interface information of the target text processing model; when the data processing task is a task to determine the word type of each word corresponding to each word in the initial text processing result, the task execution result can be the word type corresponding to each word; when the data processing task is a text pair filtering task for multiple initial text pairs, the task execution result can be the filtered target text pair.

[0212] Specifically, by responding to the text data processing request sent by the client, the initial text pair to be processed is determined by parsing the text data processing request. In practical applications, the text data processing request can also contain other parameters (such as processing type, model selection, etc.). For example, the text data processing request can carry information about the model to be selected as the initial text processing model, so as to avoid selecting an unreasonable other model for text processing when multiple models are deployed on the server.

[0213] When a task execution result is obtained by performing a data processing task, the task execution result is returned to the client so that the client can display the task execution result or perform subsequent operations based on the task execution result.

[0214] The data processing method provided in the embodiments of this specification can achieve convenient and efficient text data processing through interaction with the client, and the interactive design allows users to interact with the system intuitively through the interface, which helps to improve the user experience.

[0215] The data processing method provided in the embodiments of this specification constructs updated text pairs and uses these updated text pairs to train an initial text processing model to obtain a reference text processing model. It can distinguish different types of lexical units based on the loss change of the reference text processing model relative to the initial text processing model, identifying common, easily learnable patterns and inference components in the training data. Based on these distinguished lexical units, it effectively applies them to model training and data selection, achieving good model training results and more accurate and efficient evaluation of the impact of training data on the test dataset. That is, when the data processing task is a model training task targeting the initial text processing model, it can, according to each... The loss transformation results of each lexical unit can be used to assign different training weights to each lexical unit. This allows each lexical unit with different training weights to train the initial text processing model, enabling the initial text processing model to focus on learning each lexical unit, thereby improving the reasoning ability and generation effect of the initial text processing model. Alternatively, in data processing tasks such as text pair selection based on multiple initial text pairs, the loss transformation results of each lexical unit can be used to distinguish each lexical unit. The distinguished reasoning lexical units can then be used to determine the similarity between data points. This reduces interference from other information when selecting data based on similarity, thereby improving the accuracy and efficiency of data selection.

[0216] See Figure 3 , Figure 3 A flowchart of a target question-answering model training method provided in one embodiment of this specification is shown, which specifically includes the following steps.

[0217] Step 302: Adjust the initial answer text corresponding to the initial question text in the initial question-answer pair to obtain the updated answer text, and construct an updated question-answer pair based on the initial question text and the updated answer text.

[0218] Step 304: Update the initial question-answering model based on the updated question-answering pair to obtain the reference question-answering model.

[0219] Step 306: Based on the initial question-answer pair, use the initial question-answer model and the reference question-answer model to obtain the prediction loss result and reference loss result corresponding to multiple word units in the initial answer text, respectively.

[0220] Step 308: Based on the predicted loss result and the reference loss result, determine the loss change result of each word element, and based on the loss change result of each word element, determine the target loss weight corresponding to each word element.

[0221] Step 310: Determine the target loss result corresponding to the initial answer text based on the target loss weight corresponding to each word and the predicted loss result of each word.

[0222] Step 312: Based on the target loss result, train the initial question answering model to obtain the target question answering model.

[0223] For specific implementation details, please refer to the above embodiments, which will not be repeated here.

[0224] The target question-answering model training method provided in the embodiments of this specification can adaptively assign different training weights to the distinguished words based on word segment discrimination when supervising the initial question-answering model. This enables supervised fine-tuning of the initial question-answering model with a focus on reasoning, thereby giving the trained target question-answering model better reasoning ability and improving the accuracy of predicting the answer text.

[0225] See Figure 4 , Figure 4 A flowchart illustrating the processing procedure of a data processing method according to an embodiment of this specification is shown, specifically including the following steps.

[0226] Step 402: Construct a reference dataset.

[0227] The reference dataset is the rearranged dataset in the above embodiments.

[0228] Common, easy-to-learn patterns and inference components in the training data have different prediction difficulties. When the training data is dialogue data, the input and output in the dialogue data are recombined and reconstructed. By recombining the input and output in the dialogue data, the incorrect mapping relationship between the input and output becomes noise in the inference component. Since the easy-to-learn patterns are common to data of the same type of task, the model can easily learn and predict these components. In practical applications, the data in the training dataset includes various types of tasks. In the embodiments of this specification, 1% of the data can be sampled for each type of task to reduce training costs.

[0229] A rearranged dataset is obtained by downsampling the training dataset and scrambling the input and output.

[0230] Step 404: Train the reference model.

[0231] The basic model is the initial text processing model in the above embodiments, and the reference model is the reference text processing model in the above embodiments.

[0232] After obtaining the rearranged dataset, a large language model with fewer parameters is trained using the rearranged dataset; since the output part of the data is recombined with the input, the reference model can only learn the common and easy-to-learn parts of the data, while the predictive performance of the inference part deteriorates.

[0233] Step 406: Distinguish different types of lexical units based on the loss change of the reference model relative to the base model.

[0234] After obtaining the reference model, the prediction loss is calculated for each word in the training data using both the base model and the reference model. The magnitude of the change in loss is calculated based on the loss before and after training (i.e., the prediction loss obtained using the base model and the prediction loss obtained using the reference model). Based on the magnitude of the change in loss, the words can be divided into three categories: format words, inference template words, and inference words.

[0235] For specific implementation details, please refer to the above embodiments, which will not be repeated here.

[0236] Steps 402 to 406 are the specific steps for word segmentation, and steps 408 to 410 are the application implementation based on word segmentation (i.e., the part that performs data processing tasks in the above embodiments).

[0237] Step 408: Lexical weighted training.

[0238] After distinguishing the lexical units, different weights can be applied during training according to the different types of lexical units, so as to achieve lexical-based reasoning supervision and fine-tuning.

[0239] Specifically, in supervised fine-tuning of large language models, the inference part of the data is considered more important than the common pattern. Training weights can be adaptively assigned to each word based on the magnitude of the loss change of different words. Words with increasing loss in the reference model are given higher weights but with an upper limit, while words with decreasing loss are given lower weights.

[0240] Step 410: Mask word metadata selection.

[0241] When selecting data, masking is performed on common, easy-to-learn pattern lexical units (format lexical units, inference template lexical units) to make the data selection inference-specific.

[0242] Specifically, to make the data selection more specific to the inference part, this embodiment masks the format lexical units and inference template lexical units when calculating the gradient, and only calculates the gradient of the inference lexical units relative to the input, thereby using the test data to determine the target data from the training data. The target data is the target text pair in the above embodiment.

[0243] The data processing method provided in the embodiments of this specification can perform supervised fine-tuning of reasoning based on word segment differentiation by distinguishing word segments, thereby improving the reasoning ability of the model. Furthermore, the data selection based on word segment differentiation for reasoning can more accurately and efficiently evaluate the impact of training data on the test set.

[0244] Corresponding to the above method embodiments, this specification also provides embodiments of a model training platform. Figure 5A framework diagram of a model training platform provided in one embodiment of this specification is shown. Figure 5 As shown, the model training platform 500 includes:

[0245] The request interface unit 502 is used to receive a model training request, wherein the model training request includes model information of the initial question-answering model to be trained;

[0246] The model training unit 504 is used to determine the initial question-answering model to be trained based on the model information, and to train the initial question-answering model to obtain the target question-answering model, wherein the target question-answering model is obtained using the above-described target question-answering model training method.

[0247] The response unit 506 is used to output the target question-answering model.

[0248] The model training platform provided in the embodiments of this specification can determine the initial question-answering model to be trained in the model training platform, and perform model training on the initial question-answering model to be trained to obtain the target question-answering model. The model training platform can provide powerful computing power and storage resources, thereby greatly improving the training efficiency of the model.

[0249] Corresponding to the above method embodiments, this specification also provides data processing apparatus embodiments. Figure 6 A schematic diagram of the structure of a data processing apparatus according to one embodiment of this specification is shown. Figure 6 As shown, the device includes:

[0250] The construction module 602 is configured to adjust the initial text processing result corresponding to the initial text in the initial text pair to obtain the updated text processing result, and construct the updated text pair based on the initial text and the updated text processing result;

[0251] Update module 604 is configured to update the initial text processing model based on the updated text pair to obtain a reference text processing model;

[0252] The module 606 is configured to obtain, based on the initial text pair, the prediction loss result and the reference loss result corresponding to multiple word units in the initial text processing result using the initial text processing model and the reference text processing model, respectively.

[0253] The determination module 608 is configured to determine the loss change result of each word element based on the predicted loss result and the reference loss result;

[0254] The execution module 610 is configured to perform data processing tasks based on the loss change results of each word.

[0255] Optionally, the execution module 610 is further configured as follows:

[0256] Based on the loss change results of each word element, determine the target loss weight corresponding to each word element;

[0257] Based on the target loss weights corresponding to each word and the predicted loss results of each word, the target loss result corresponding to the initial text processing result is determined;

[0258] Based on the target loss result, the initial text processing model is trained to obtain the target text processing model.

[0259] Optionally, the obtaining module 606 is further configured as follows:

[0260] The initial text pair is input into the initial text processing model to obtain the predicted text processing result corresponding to the initial text in the initial text pair;

[0261] Based on the predicted text processing result and the initial text processing result, the prediction loss result corresponding to multiple word units in the initial text processing result is obtained;

[0262] The initial text pair is input into the reference text processing model to obtain the reference text processing result corresponding to the initial text in the initial text pair;

[0263] Based on the reference text processing result and the initial text processing result, a reference loss result corresponding to multiple lexical units in the initial text processing result is obtained.

[0264] Optionally, the execution module 610 is further configured as follows:

[0265] Based on the loss change results of each word, the word type of each word is determined, and based on the word type of each word, the word type of the corresponding word is determined.

[0266] Optionally, the execution module 610 is further configured as follows:

[0267] Based on the loss change results of each word, the word type of each word is determined, and based on the word type of each word, a target reference word is determined from the multiple words.

[0268] Determine the test text pairs and the test text processing results corresponding to the test texts in the test text pairs, and determine the loss change results of multiple test words in the test text processing results;

[0269] Based on the loss change results of each test word, the word type of each test word is determined, and based on the word type of each test word, the target test word is determined from the plurality of test words;

[0270] Based on the target reference lexicon and the target test lexicon, a target text pair is determined from the plurality of initial text pairs.

[0271] Optionally, the execution module 610 is further configured as follows:

[0272] Based on the test text pair, using the initial text processing model and the reference text processing model, the prediction loss result and reference loss result corresponding to multiple test words in the test text processing result are obtained;

[0273] Based on the predicted loss result and the reference loss result corresponding to each test word, the loss change result of each test word is determined.

[0274] Optionally, the construction module 602 is further configured as follows:

[0275] The initial text in multiple initial text pairs is re-matched with the initial text processing result, and the re-matched initial text processing result corresponding to the initial text is determined as the updated text processing result.

[0276] Optionally, the update module 604 is further configured as follows:

[0277] The updated text pair is input into the initial text processing model to obtain the predicted text processing result corresponding to the initial text in the updated text pair;

[0278] Based on the predicted text processing results and the updated text processing results, the initial text processing model is trained to obtain the reference text processing model.

[0279] The device further includes:

[0280] The calling module is configured to determine the model interface information of the initial text processing model and call the initial text processing model according to the model interface information.

[0281] The device further includes:

[0282] The interaction module is configured to respond to a text data processing request sent by the client, determine the initial text pair carried in the text data processing request, and return the task execution result obtained by executing the data processing task to the client.

[0283] The data processing apparatus provided in the embodiments of this specification can perform supervised fine-tuning of reasoning based on word segment differentiation by distinguishing word segments, thereby improving the reasoning ability of the model. Furthermore, the data selection based on word segment differentiation for reasoning can more accurately and efficiently evaluate the impact of training data on the test set.

[0284] The above is an illustrative scheme of a data processing apparatus according to this embodiment. It should be noted that the technical solution of this data processing apparatus and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the data processing apparatus, please refer to the description of the technical solution of the data processing method described above.

[0285] Corresponding to the above method embodiments, this specification also provides embodiments of a target question-answering model device. Figure 7 A schematic diagram of a target question-answering model device according to one embodiment of this specification is shown. Figure 7 As shown, the device includes:

[0286] The data construction module 702 is configured to adjust the initial answer text corresponding to the initial question text in the initial question-answer pair to obtain the updated answer text, and construct an updated question-answer pair based on the initial question text and the updated answer text;

[0287] The model update module 704 is configured to update the initial question-answer model based on the updated question-answer pair to obtain a reference question-answer model;

[0288] The result acquisition module 706 is configured to obtain the prediction loss result and the reference loss result corresponding to multiple word units in the initial answer text based on the initial question-answer pair, using the initial question-answer model and the reference question-answer model, respectively.

[0289] The weight determination module 708 is configured to determine the loss change result of each word element based on the predicted loss result and the reference loss result, and to determine the target loss weight corresponding to each word element based on the loss change result of each word element.

[0290] The result determination module 710 is configured to determine the target loss result corresponding to the initial answer text based on the target loss weight corresponding to each word and the predicted loss result of each word.

[0291] The model training module 712 is configured to train the initial question-answering model based on the target loss result to obtain the target question-answering model.

[0292] The target question-answering model training device provided in the embodiments of this specification can adaptively assign different training weights to the distinguished words based on word segmentation when supervising the fine-tuning of the initial question-answering model. This enables the initial question-answering model to be supervised and fine-tuned with an emphasis on reasoning, thereby giving the trained target question-answering model better reasoning ability and improving the accuracy of predicting the answer text.

[0293] The above is an illustrative scheme of a target question-answering model device according to this embodiment. It should be noted that the technical solution of this target question-answering model device and the technical solution of the target question-answering model method described above belong to the same concept. For details not described in detail in the technical solution of the target question-answering model device, please refer to the description of the technical solution of the target question-answering model method described above.

[0294] Figure 8 A structural block diagram of a computing device 800 according to one embodiment of this specification is shown. The components of the computing device 800 include, but are not limited to, a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.

[0295] The computing device 800 also includes an access device 840, which enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 840 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0296] In one embodiment of this specification, the above-described components of the computing device 800 and Figure 8Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 8 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0297] The computing device 800 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 800 can also be a mobile or stationary server.

[0298] The processor 820 is used to execute the following computer program / instruction, which, when executed by the processor, implements the steps of the above-mentioned data processing method and target question answering model training method.

[0299] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, the computing device embodiments are basically similar to the data processing method and the target question-answering model training method embodiments, so the description is relatively simple. Relevant parts can be referred to the descriptions of the data processing method and the target question-answering model training method embodiments.

[0300] An embodiment of this specification also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the above-described data processing method and target question-answering model training method.

[0301] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, the computer-readable storage medium embodiment is described simply because it is substantially similar to the data processing method and the target question-answering model training method embodiment. Relevant parts can be referred to the descriptions of the data processing method and the target question-answering model training method embodiments.

[0302] An embodiment of this specification also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the steps of the above-described data processing method and target question-answering model training method.

[0303] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product belongs to the same concept as the technical solutions of the data processing method and the target question answering model training method described above. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solutions of the data processing method and the target question answering model training method described above.

[0304] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0305] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, 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 may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0306] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0307] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0308] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A data processing method, comprising: Adjust the initial text processing result corresponding to the initial text in the initial text pair to obtain the updated text processing result, and construct the updated text pair based on the initial text and the updated text processing result; Based on the updated text pairs, update the initial text processing model to obtain the reference text processing model; Based on the initial text pair, the prediction loss result and reference loss result corresponding to multiple word units in the initial text processing result are obtained by using the initial text processing model and the reference text processing model, respectively. Based on the predicted loss results and the reference loss results, the loss change results for each word element are determined; Based on the loss changes of each term, perform data processing tasks.

2. The data processing method according to claim 1, wherein the data processing task is a model training task for the initial text processing model; The step of performing data processing tasks based on the loss changes of each word element includes: Based on the loss change results of each word element, determine the target loss weight corresponding to each word element; Based on the target loss weights corresponding to each word and the predicted loss results of each word, the target loss result corresponding to the initial text processing result is determined; Based on the target loss result, the initial text processing model is trained to obtain the target text processing model.

3. The data processing method according to claim 1, wherein the step of obtaining the prediction loss result and reference loss result corresponding to multiple word units in the initial text processing result based on the initial text pair using the initial text processing model and the reference text processing model respectively includes: The initial text pair is input into the initial text processing model to obtain the predicted text processing result corresponding to the initial text in the initial text pair; Based on the predicted text processing result and the initial text processing result, the prediction loss result corresponding to multiple word units in the initial text processing result is obtained; The initial text pair is input into the reference text processing model to obtain the reference text processing result corresponding to the initial text in the initial text pair; Based on the reference text processing result and the initial text processing result, a reference loss result corresponding to multiple lexical units in the initial text processing result is obtained.

4. The data processing method according to claim 1, wherein the data processing task is a task of determining the word type of each word corresponding to each word element in the initial text processing result; The step of performing data processing tasks based on the loss changes of each word element includes: Based on the loss change results of each word, the word type of each word is determined, and based on the word type of each word, the word type of the corresponding word is determined.

5. The data processing method according to claim 1, wherein the initial text pair includes multiple initial text pairs, and the data processing task is a text pair filtering task for multiple initial text pairs; The step of performing data processing tasks based on the loss changes of each word element includes: Based on the loss change results of each word, the word type of each word is determined, and based on the word type of each word, a target reference word is determined from the multiple words. Determine the test text pairs and the test text processing results corresponding to the test texts in the test text pairs, and determine the loss change results of multiple test words in the test text processing results; Based on the loss change results of each test word, the word type of each test word is determined, and based on the word type of each test word, the target test word is determined from the plurality of test words; Based on the target reference lexicon and the target test lexicon, a target text pair is determined from the plurality of initial text pairs.

6. The data processing method according to claim 5, wherein determining the loss change results of multiple test words in the test text processing result includes: Based on the test text pair, using the initial text processing model and the reference text processing model, the prediction loss result and reference loss result corresponding to multiple test words in the test text processing result are obtained; Based on the predicted loss result and the reference loss result corresponding to each test word, the loss change result of each test word is determined.

7. The data processing method according to claim 5, wherein determining the target text pair from the plurality of initial text pairs based on the target reference lexical and the target test lexical includes: Calculate the lexical similarity between the target reference lexical and the target test lexical; Based on the word similarity, similar reference words are determined from the target reference words; From the plurality of initial text pairs, the initial text pairs corresponding to the similar reference words are determined as the target text pairs.

8. The data processing method according to claim 5, wherein determining the target text pair from the plurality of initial text pairs based on the target reference lexical and the target test lexical includes: Determine the reference gradient vector corresponding to the target reference word and the test gradient vector corresponding to the target test word; Based on the reference gradient vector and the test gradient vector, calculate the text similarity between the plurality of initial text pairs and the test text pair; The target text pair is determined from the plurality of initial text pairs based on the text similarity.

9. The data processing method according to any one of claims 5-8, wherein the test text pair is a text pair related to the target text processing task; After determining the target text pair from the plurality of initial text pairs, the method further includes: The initial text processing model is trained using the target text pair to obtain the target task text processing model, wherein the target task text processing model is used to implement the target text processing task.

10. The data processing method according to any one of claims 5-8, further comprising, before determining the test text pair: Multiple initial test text pairs are determined, and the multiple initial test text pairs are respectively input into the initial text processing model to obtain multiple initial test text processing results; An abnormal test text processing result is determined from the plurality of initial test text processing results, and the initial test text pair corresponding to the abnormal test text processing result is determined as the test text pair; After determining the target text pair from the plurality of initial text pairs, the method further includes: Based on the plurality of initial text pairs and the target text pair, a filter text pair is determined, wherein the filter text pair is a text pair other than the target text pair among the plurality of initial text pairs; The initial text processing model is trained using the selected text pairs to obtain the updated text processing model.

11. The data processing method according to claim 1, wherein the initial text pair comprises a plurality of initial text pairs; The process of adjusting the initial text processing result corresponding to the initial text in the initial text pair to obtain the updated text processing result includes: The initial text in multiple initial text pairs is re-paired with the initial text processing result, and the re-paired initial text processing result corresponding to the initial text is determined as the updated text processing result, wherein the initial text and the updated text processing result do not have a text matching relationship.

12. The data processing method according to claim 1, wherein updating the initial text processing model based on the updated text pair to obtain a reference text processing model comprises: The updated text pair is input into the initial text processing model to obtain the predicted text processing result corresponding to the initial text in the updated text pair; Based on the predicted text processing results and the updated text processing results, the initial text processing model is trained to obtain the reference text processing model.

13. The data processing method according to claim 1 or 12, before updating the initial text processing model based on the updated text pair to obtain the reference text processing model, further comprising: Determine the model interface information of the initial text processing model, and call the initial text processing model according to the model interface information.

14. The data processing method according to claim 1, before adjusting the initial text processing result corresponding to the initial text in the initial text pair to obtain the updated text processing result, further comprising: In response to a text data processing request sent by a client, determine the initial text pair carried in the text data processing request; After performing the data processing task based on the loss changes of each lexical unit, the process further includes: The task execution result obtained from executing the data processing task will be returned to the client.

15. A method for training a target question-answering model, comprising: Adjust the initial answer text corresponding to the initial question text in the initial question-answer pair to obtain the updated answer text, and construct an updated question-answer pair based on the initial question text and the updated answer text; Based on the updated question-answer pairs, update the initial question-answer model to obtain the reference question-answer model; Based on the initial question-answer pair, the prediction loss result and reference loss result corresponding to multiple word units in the initial answer text are obtained by using the initial question-answer model and the reference question-answer model, respectively. Based on the predicted loss results and the reference loss results, the loss change results of each word element are determined, and based on the loss change results of each word element, the target loss weight corresponding to each word element is determined. Based on the target loss weights corresponding to each word and the predicted loss results of each word, the target loss result corresponding to the initial answer text is determined; Based on the target loss result, the initial question-answering model is trained to obtain the target question-answering model.

16. A model training platform, comprising a request interface unit, a model training unit, and a response unit; The request interface unit is used to receive a model training request, wherein the model training request includes model information of the initial question-answering model to be trained. The model training unit is used to determine the initial question-answering model to be trained based on the model information, and to train the initial question-answering model to obtain the target question-answering model, wherein the target question-answering model is obtained using the target question-answering model training method of claim 15. The response unit is used to output the target question-answering model.

17. A data processing apparatus, comprising: The construction module is configured to adjust the initial text processing result corresponding to the initial text in the initial text pair to obtain the updated text processing result, and construct the updated text pair based on the initial text and the updated text processing result; The update module is configured to update the initial text processing model based on the updated text pairs to obtain a reference text processing model; The acquisition module is configured to obtain, based on the initial text pair, the prediction loss result and the reference loss result corresponding to multiple word units in the initial text processing result using the initial text processing model and the reference text processing model, respectively. The determination module is configured to determine the loss change result of each word element based on the predicted loss result and the reference loss result; The execution module is configured to perform data processing tasks based on the loss changes of each term.

18. A target question-answering model training device, comprising: The data construction module is configured to adjust the initial answer text corresponding to the initial question text in the initial question-answer pair to obtain the updated answer text, and construct an updated question-answer pair based on the initial question text and the updated answer text; The model update module is configured to update the initial question-answer model based on the updated question-answer pair to obtain a reference question-answer model; The result acquisition module is configured to obtain the prediction loss result and reference loss result corresponding to multiple word units in the initial answer text based on the initial question-answer pair, using the initial question-answer model and the reference question-answer model, respectively. The weight determination module is configured to determine the loss change result of each word element based on the predicted loss result and the reference loss result, and to determine the target loss weight corresponding to each word element based on the loss change result of each word element. The result determination module is configured to determine the target loss result corresponding to the initial answer text based on the target loss weight corresponding to each word and the predicted loss result of each word. The model training module is configured to train the initial question-answering model based on the target loss result to obtain the target question-answering model.

19. A computing device, comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 15.

20. A computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 15.

21. A computer program product comprising a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 15.