A method and apparatus for data processing

CN122594868APending Publication Date: 2026-08-18SWEET POTATO TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610982051.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-02
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

但是,由于目前存储的往往是UGC的统一资源定位符(Uniform Resource Locator,URL),而用户可以对UGC随时进行修改、删除或者设为不可见等等,因此URL会失效或指向新的UGC,导致无法复现原始的UGC,从而导致验证无法执行,无法保证训练数据的准确度和真实度

Benefits of technology

[0011]根据本说明书实施例的第七方面,提供了一种计算机可读存储介质,其存储有计算机程序/指令,该计算机程序/指令被处理器执行时实现上述方法的步骤。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122594868A_ABST
    Figure CN122594868A_ABST
Patent Text Reader

Abstract

The present specification provides a data processing method and device, wherein the data processing method comprises: obtaining first query information, and obtaining first associated published content corresponding to the first query information; inputting the first query information and the first associated published content into a preset language model to obtain first reply information corresponding to the first query information; and generating and storing training data according to the first query information, the first associated published content and the first reply information. The training data not only contains the first query information and the first reply information corresponding to the first query information, but also contains the original reference basis for generating the first reply information, that is, the first associated published content information. In the case that the user subsequently modifies or deletes the original associated published content, the reference basis corresponding to the first reply information in the training data can still be obtained completely, ensuring the traceability of the training data and ensuring the accuracy and reliability of the training data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of artificial intelligence technology, and in particular to a data processing method. This specification also relates to a method for training a generative model, a method for generating responses, a data processing apparatus, a training apparatus for a generative model, a computing device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] With the rapid development of artificial intelligence technology, various pre-trained language models (PLMs) have emerged. Currently, language models can be embedded in different types of applications to provide users with intelligent services such as querying, searching, and interactive dialogue. For example, in content application platforms, there is a large amount of user-generated content (UGC). When a user enters query information in the language model's input field on the platform, the language model can generate a response based on the UGC within the application, thus assisting the user in quickly obtaining information from various UGC sources.

[0003] The data from the aforementioned process—query terms, UGC (User Generated Content), and responses—can be used as training data to train the language model embedded in the content application platform. Before using the training data for training, it is usually validated to ensure its accuracy and authenticity, thereby improving the performance of the trained language model. However, since what is currently stored is often the Uniform Resource Locator (URL) of the UGC, and users can modify, delete, or make UGC invisible at any time, the URL may become invalid or point to new UGC, making it impossible to reproduce the original UGC. This results in validation failing, and the accuracy and authenticity of the training data cannot be guaranteed. Summary of the Invention

[0004] In view of the above, embodiments of this specification provide a data processing method. This specification also relates to a method for training a generative model, a method for generating responses, a data processing apparatus, a training apparatus for a generative model, a computing device, a computer-readable storage medium, and a computer program product, to solve the aforementioned problems existing in the prior art.

[0005] According to a first aspect of the embodiments of this specification, a data processing method is provided, comprising: Obtain the first query information and the first associated published content corresponding to the first query information; Input the first query information and the first associated published content into a preset language model to obtain the first reply information corresponding to the first query information; Training data is generated and stored based on the first query information, the first associated published content, and the first reply information.

[0006] According to a second aspect of the embodiments of this specification, a method for training a generative model is provided, comprising: Acquire training data, wherein the training data includes sample first query information, sample first associated published content and tag first reply information corresponding to the sample first query information, and the training data is obtained based on the above data processing method; Input the first query information of the sample and the first associated published content of the sample into the initial generation model to obtain the predicted response information; The initial generation model is trained based on the predicted response information and the first response information of the label to obtain the target generation model.

[0007] According to a third aspect of the embodiments of this specification, a method for generating a response is provided, applied to a cloud-side device, comprising: The receiving end device sends a response generation request, wherein the response generation request carries second query information; Retrieve the second associated published content corresponding to the second query information; The second query information and the second associated published content are input into the target generation model to obtain the second response information corresponding to the second query information, wherein the target generation model is obtained based on the training method of the above-mentioned generation model; The second response information is sent to the end-side device.

[0008] According to a fourth aspect of the embodiments of this specification, a data processing apparatus is provided, comprising: The first acquisition module is configured to acquire first query information and acquire first associated published content corresponding to the first query information; The first input module is configured to input the first query information and the first associated published content into a preset language model to obtain the first reply information corresponding to the first query information; The generation module is configured to generate and store training data based on the first query information, the first associated published content, and the first reply information.

[0009] According to a fifth aspect of the embodiments of this specification, a training apparatus for a generative model is provided, comprising: The second acquisition module is configured to acquire training data, wherein the training data includes sample first query information, sample first associated published content and tag first reply information corresponding to the sample first query information, and the training data is obtained based on the above data processing method; The second input module is configured to input the first query information of the sample and the first associated published content of the sample into the initial generation model to obtain the predicted response information; The training module is configured to train the initial generation model based on the predicted response information and the first response information of the label to obtain the target generation model.

[0010] According to a sixth aspect of the embodiments of this specification, a computing device is provided, 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 above method.

[0011] According to a seventh aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.

[0012] 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 method.

[0013] The data processing method provided in this specification can obtain first query information and first associated published content corresponding to the first query information; input the first query information and the first associated published content into a preset language model to obtain first response information corresponding to the first query information; and generate training data based on the first query information, the first associated published content, and the first response information.

[0014] One embodiment of this specification implements training data that includes not only the first query information and the first reply information corresponding to the first query information, but also the original reference for generating the first reply information, namely, the first associated published content information, thereby improving the completeness and richness of the training data. Furthermore, unlike methods that store UGC content IDs or URLs, the above data processing method stores the first associated published content information itself, along with the first query information and the first reply information, as training data. Therefore, even if the user subsequently modifies or deletes the original associated published content, the reference for the first reply information in the training data can still be completely retrieved, ensuring the traceability of the training data. This guarantees the accuracy and reliability of the training data, thereby improving the performance of the target generation model trained based on the training data. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating a data processing method provided in one embodiment of this specification; Figure 2 This is a flowchart of a method for generating training data according to an embodiment of this specification; Figure 3 This is a flowchart of a training method for a generative model provided in one embodiment of this specification; Figure 4 This is a flowchart of a response generation method provided in one embodiment of this specification; Figure 5 This is an interaction diagram of a multi-terminal device provided in one embodiment of this specification; Figure 6 This is a schematic diagram of the structure of a training data generation platform provided in one embodiment of this specification; Figure 7 This is a schematic diagram of the debugging process of a prompt template provided in one embodiment of this specification; Figure 8 This is a schematic diagram of the structure of a data processing apparatus provided in one embodiment of this specification; Figure 9 This is a schematic diagram of the structure of a training device for a generative model provided in one embodiment of this specification; Figure 10 This is a schematic diagram of the structure of a recovery generation device provided in one embodiment of this specification; Figure 11 This is an architecture diagram of a data processing system provided in one embodiment of this specification; Figure 12 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0016] 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.

[0017] 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.

[0018] 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."

[0019] 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, data stored, data displayed, etc.) involved in this manual are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

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

[0021] Content Application Platform: This is an application platform that integrates various types of content. The content application platform provides users with a rich variety of multimedia content, including but not limited to live streaming, on-demand video, audio, text and image information, social interaction, shopping, etc.

[0022] Published Content: This refers to the content service provided to the content application platform. Published content consists of any content pre-published by the recommending account on the platform. For example, the published content could be a product recommendation note published by the recommending account on the platform. This product recommendation note can include product images, videos, descriptions, advantages and disadvantages, etc. The product recommendation note can be text and image content, text information, videos, etc. The content platform's server stores the published content from each recommending account and sends it to browsing accounts on the content platform through a content distribution algorithm deployed on the server.

[0023] "Responding to": "Responding to" generally refers to a reaction or response to a situation, problem, request, or event. In the technical field, it can refer to a system's reaction to input information or events. It can be understood as the system or software's perception and recognition of user input or operations, and the resulting corresponding actions or behaviors.

[0024] Triggered actions refer to actions such as clicking, swiping, or other interactive methods on content application platforms, published content, live streaming pages, and other display interfaces. These actions can trigger corresponding events and display the page or information associated with the triggered action. For example, clicking the recommendation information block on a product details page can display a list of recommended accounts.

[0025] Controls are objects in forms, reports, or data access pages used to display data, perform operations, or serve as decoration. They are integral parts of software; for example, tables, reports, and network communication elements frequently used in software can all directly utilize controls.

[0026] Token: The basic discrete unit for the model to process and measure text, which may correspond to a single character, subword, punctuation mark, or special symbol. The input text is segmented into a token sequence by a token segmenter, and the model encodes, predicts, and generates tokens at the token level. Context length, billing, and computational overhead are usually measured in terms of the number of tokens.

[0027] Transformer: A type of neural network model architecture with attention mechanism at its core, commonly used for sequence modeling tasks such as natural language processing. It models the dependencies between positions in a sequence in parallel through self-attention, and excels at capturing long-range context. A typical structure consists of multiple stacked multi-head self-attention and feedforward networks, combined with residual connections and layer normalization to stabilize training. It usually also introduces positional encoding to represent the order information of tokens.

[0028] Autoregressive Large Language Models (ALMs): A type of language model that generates text sequentially, commonly used for tasks such as dialogue, writing, and question answering. Its basic objective is to predict the next token given the generated content, outputting a sequence progressively from left to right. It typically employs a Transformer structure with causal masking constraints to ensure that the current position can only utilize preceding information, thus achieving continuous and controllable generation. The model acquires general language capabilities through pre-training on large-scale corpora and can be adapted to specific business scenarios through fine-tuning with instructions.

[0029] Supervised Fine-Tuning (SFT): Supervised parameter tuning of a pre-trained model using labeled training data to align with performance on a specific task.

[0030] As described in the background section, users can edit and publish content on a content application platform. The content application platform contains a massive amount of published content. When a user enters relevant query information on the content application platform, the language model built into the content application platform can generate response information based on the user's query information. In the process of generating response information, the language model often needs to rely on the published content on the content application platform. Specifically, it can obtain related published content related to the query information and use the related published content as a reference to generate response information corresponding to the query information.

[0031] However, content published on content application platforms is time-sensitive and unreliable, as it can be modified, deleted, or made invisible by users at any time. This makes it impossible to reproduce the references used to generate response information. Furthermore, currently, only the URLs associated with published content are often stored. This means that if published content is modified, deleted, or made invisible by users, the same associated published content as when the response was generated cannot be retrieved, making it impossible to reconstruct the true context of the response generation. In other words, the completeness and consistency of associated published content cannot be guaranteed.

[0032] In practical applications, without original reference content (i.e., related published content), it's impossible to verify the semantic consistency between the response information generated by the language model and the related published content it references. This leads to the possibility of fabricated or hallucinatory content being mixed into the response information. Furthermore, since the generated query information, related published content, and response information can be used as training data to train relevant models, the hallucination problem reduces the reliability of the training data. Specifically, when the model fabricates non-existent facts or generates hallucinations, the generated false response information mixed into the SFT training dataset will pollute the model's training data, resulting in poor model performance.

[0033] Furthermore, there is a lack of anchoring between the generated response information and the references, meaning it is impossible to determine the source of specific content in the generated response information. This poses a risk that the cited references (i.e., the published content) may be fabricated, as may the generated response information itself.

[0034] Based on this, the present invention provides a data processing method that can obtain first query information and first associated published content corresponding to the first query information; input the first query information and the first associated published content into a preset language model to obtain first response information corresponding to the first query information; and generate training data based on the first query information, the first associated published content and the first response information.

[0035] In one embodiment of the data processing method provided in this specification, the training data not only includes the first query information and the first reply information corresponding to the first query information, but also includes the original reference basis for generating the first reply information, namely the first associated published content information, thereby improving the completeness and richness of the training data. Furthermore, unlike the method of storing UGC content IDs or URLs, the above data processing method uses the first associated published content information itself, along with the first query information and the first reply information, as training data storage. Therefore, even if the user subsequently modifies or deletes the original associated published content, the reference basis corresponding to the first reply information in the training data can still be completely obtained, ensuring the traceability of the training data. This guarantees the accuracy and reliability of the training data, thereby improving the performance of the target generation model trained based on the training data.

[0036] The data processing method provided in one embodiment of this specification can improve the accuracy and reliability of training data, thereby improving the performance of the trained model and enhancing the traceability of the training data. That is, in the event of anomalies in the training data, the response generation process can be reproduced, such as verifying the accuracy of the responses in the training data based on the stored associated published content itself.

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

[0038] Figure 1 A flowchart of a data processing method according to an embodiment of this specification is shown, specifically including the following steps: Step 102: Obtain the first query information and obtain the first associated published content corresponding to the first query information.

[0039] It should be noted that the entity executing the data processing method provided in this specification can be any computing device with computing capabilities, such as a server, terminal, etc. In one or more embodiments of this specification, the computing device can be the content publishing platform itself, an independent server associated with the content publishing platform, or a training data generation platform. The computing device is equipped with a pre-defined language model, capable of generating training data for training the generative model based on query information and published content from the content publishing platform.

[0040] In one or more embodiments of this specification, the first query information may be text information. Of course, the first query information may also be image information, multimodal information, etc., and this specification does not impose specific limitations.

[0041] In one or more embodiments of this specification, the first query information can be user-inputted. Specifically, in the user interface of the content application platform, the user can input query text information through an electronic device such as a mobile phone in the input box of the user interface. For example, the query text information can be "coffee shop recommendations in region A". This query text information is the first query information. In response to the user's input operation, the content application platform can send the first query information to the execution body of the data processing method, thereby obtaining the first query information.

[0042] In one or more embodiments of this specification, the first query information can be obtained from a historical query information database. Specifically, the historical query behavior of each user can be recorded to construct a historical query information database. Thus, any historical query information can be obtained from the historical query information database as the first query information.

[0043] Since the published content needs to be used as a reference to generate response information corresponding to the query information, in one or more embodiments of this specification, after obtaining the first query information, the first associated published content corresponding to the first query information can also be obtained.

[0044] In one or more embodiments of this specification, the first associated published content can be understood as published content related to the first query information. The published content can be generated by the user and used to provide a reference for generating response information for the preset language model.

[0045] In one or more embodiments of this specification, the first associated published content can be obtained based on a published content retrieval service. Specifically, the first query information can be used as input to invoke the published content retrieval service of the content publishing platform. This service retrieves published content from the various published contents of the content publishing platform that has a high semantic relevance to the first query information, and the retrieval results are used as the first associated published content. The published content retrieval service can be a vector-based retrieval or a keyword retrieval.

[0046] For example, the first query information can be "coffee shop recommendations in region A". The recall service can be used to obtain the full text of at least one published content that is semantically related to the keywords "region A", "coffee shop", and "recommendation" from the content publishing platform, and can use the at least one published content as the first associated published content.

[0047] For example, obtaining the first associated published content corresponding to the first query information includes: Input the first query information into a preset feature extraction model to obtain the query information features; From the preset published content feature library, a target published content feature that matches the first query information feature is determined, and the published content corresponding to the target published content feature is taken as the first associated published content.

[0048] The preset feature extraction model can be a text encoder, which can extract the query information feature vector corresponding to the first query information. The preset published content feature database stores the published content feature vectors corresponding to each published content.

[0049] Therefore, after obtaining the query information features, for each published content, the similarity between the published content feature vector and the query information feature vector can be calculated. If the similarity is greater than the preset similarity, the published content can be regarded as the first associated published content.

[0050] It should be noted that when calculating the similarity between feature vectors, cosine similarity or Euclidean distance can be used, and this manual does not impose any specific restrictions.

[0051] It should be understood that the first associated published content can be one or more published contents related to the first queried information.

[0052] In one or more embodiments of this specification, the first associated published content can also be obtained based on preset matching rules. Specifically, matching rules for query information and published content can be preset, such as keyword matching, content category matching, topic tag matching, etc., so that when the first query information matches a specific matching rule, the first associated published content can be determined based on that specific matching rule.

[0053] In one or more embodiments of this specification, after obtaining the first associated published content and before the preset language model generates the first response information, the first query information and its corresponding first associated published content can be persistently stored in the form of a snapshot, thereby ensuring that the reference basis used in the subsequent training data generation process, namely the first associated published content, can be completely traced.

[0054] In one or more embodiments of this specification, before inputting the first query information and the first associated published content into a preset language model, the method further includes: The first query information and the first associated published content are stored in the first storage location; The first query information and the first associated published content are input into a preset language model to obtain the first response information corresponding to the first query information, including: The first query information and the first associated published content are obtained from the first storage location, and the first query information and the first associated published content are input into a preset language model to obtain the first reply information corresponding to the first query information.

[0055] The primary storage location can be determined based on actual conditions, such as a designated disk. The preset language model can be a large language model based on Transformer, and the specific selection of the large language model can be set based on actual needs. This preset language model can also be a question-answering model, etc.

[0056] In practical applications, after obtaining the first associated published content, the obtained first associated published content can be persistently stored in the database as a snapshot, forming a context snapshot bound to the first query information. This context snapshot may include, but is not limited to, a query identifier, the first query information, and the first associated published content. The query identifier can be understood as a unique identifier generated for this query, or for the first query information, used to distinguish different queries. Specifically, it can be dynamically generated when the first query information is obtained.

[0057] In one or more embodiments of this specification, after the first associated published content is obtained by calling the published content recall service, a context snapshot write operation can be triggered. The context snapshot can be persistently written to a database in the form of structured data, with database transactions ensuring the atomicity of the write, and the storage medium can be a persistent database. This ensures that the context snapshot is not lost and cannot be tampered with even if the execution entity of the data processing method, such as the training data generation platform, restarts or publishes.

[0058] In one or more embodiments of this specification, what is stored is the first associated published content itself, and the context snapshot corresponding to the first associated published content cannot be modified after it is written, thereby ensuring that even if the original published content is modified or deleted in the content application platform, the reference basis on which the training data depends can still be completely restored.

[0059] For example, the training data generation platform needs to generate training data related to "food recommendations in area A". This allows the platform to import the first query information "coffee shop recommendations in area A". The platform can then call a content retrieval service to retrieve at least one related first published content from a pool of published content. This content could include posts by user A about "coffee shops on street B in area A" or by user B about "coffee shop exploration experiences in area A". The training data generation platform can then associate and store these related first published content, such as posts by user A about "coffee shops on street B in area A" or by user B about "coffee shop exploration experiences in area A", with the first query information to provide a basis for generating subsequent training data.

[0060] The above method binds and stores query information with its related publication content, thus solidifying the reference basis and providing a data foundation for the subsequent generation of traceable and verifiable training data.

[0061] It should be noted that in one or more embodiments of this specification, the reference basis can be solidified first, that is, the first associated published content can be solidified first, and then the first reply information can be generated based on the first associated published content.

[0062] Step 104: Input the first query information and the first associated published content into a preset language model to obtain the first reply information corresponding to the first query information.

[0063] In one or more embodiments of this specification, in order to improve the accuracy of the generated first response information, context information related to the first query information can also be obtained. This context information can be understood as other query information related to the first query information and response information related to other query information. Then, the context information of the first query information, the first query information, and the first associated published content can be input into a preset language model to obtain the first response information corresponding to the first query information.

[0064] In one or more embodiments of this specification, a prompt message can also be obtained. This prompt message can be used to instruct a preset language model to generate a first response message corresponding to the first query message, referencing the first associated published content. In practical applications, the prompt message, the first query message, and the first associated published content can be concatenated and input into the preset language model to obtain the first response message corresponding to the first query message.

[0065] Step 106: Generate and store training data based on the first query information, the first associated published content, and the first reply information.

[0066] In one or more embodiments of this specification, the first query information, the first associated published content, and the first reply information can be jointly organized into training data and stored in a structured manner for use in training related models such as generative models in practical applications, or for fine-tuning training of language models.

[0067] In practical applications, training data can be stored in a structured format, such as JSON, to facilitate subsequent data retrieval and model training. Each piece of training data consists of a triplet comprising the first query information, the first associated published content, and the first response information.

[0068] In one or more embodiments of this specification, after generating training data, the training data can be persistently stored in a relevant database or file system. For example, the training data can be stored in a relational database; specifically, the training data can be written to a relational database such as MySQL in the form of structured data. Each piece of training data includes metadata fields such as first query information, first associated published content, and first reply information to facilitate subsequent retrieval, filtering, and export.

[0069] For example, training data can be stored in a file system, specifically in the form of JSON files on a local disk or a distributed file system, which is suitable for the batch export and use of large-scale training data.

[0070] For example, training data can also be stored in object storage, specifically uploaded to cloud object storage such as OSS, to facilitate data sharing and long-term archiving among multiple systems.

[0071] In one or more embodiments of this specification, a three-level association structure of task level, query execution level, and prompt information execution level can be adopted to associate and store training data with the complete link information of its generation process.

[0072] At the task level, metadata for batch tasks can be recorded, including task identifier, imported file name, creation time, and execution status, which is used to manage the import and processing of batch first query information.

[0073] At the query execution level, each first query piece of information corresponds to a query execution and record, which may include the first query information, context information, context snapshot, execution status, etc. The query execution level record can establish a permanent binding relationship between the first query information and the first associated published content, thereby ensuring that even if the original published content is subsequently modified or deleted, the generated training data can still be traced back to the original basis at the time of generation.

[0074] Specifically, regarding the execution level record of the prompt information, the response information in one or more embodiments of this specification can be generated based on the serial execution of multiple prompt information. Thus, the execution details of each prompt information step can be recorded, which may include the version identifier, execution order, execution time, input data, and output data of the prompt information.

[0075] Through the above three-level association structure, the stored training data can achieve complete end-to-end traceability. That is to say, any training data can be traced back to the original first query information, the context snapshot at the recall time, the version of the prompt information, and the input and output of each step, so as to provide a complete chain of evidence for subsequent data auditing, quality analysis and problem localization.

[0076] For example, suppose we need to generate training data related to "dietary recommendations for region A". We can import the first query information, then create and execute a data processing task. After obtaining the first associated published content, assuming it is 10 notes, we can use it as a reference to generate the first response information. This first response information can be text, image, or multimodal information; this specification does not impose specific limitations. After generating the first response information, we can organize the first query information, the first associated published content (i.e., the 10 notes), the first response information, and metadata such as time, identifier, and version during the data processing into a training data record. This training data record can be persistently stored in a specific database and form a complete association link with task-level records, query execution-level records, and prompt information execution-level records. In this way, even if one of the original notes referenced by the training data is deleted by the user, the original content (i.e., the 10 notes) on which the first response information was based can still be completely restored through the context snapshot stored in the query execution-level record, ensuring the traceability and reliability of the training data.

[0077] In one or more embodiments of this specification, cross-table queries can enable skilled personnel to view the data generation evidence chain associated with any training data on the user interface of the training data generation platform without accessing external systems or the URL of published content.

[0078] The above methods enable the structured generation and persistent storage of training data, providing a high-quality and traceable training data foundation for fine-tuning related models.

[0079] In practical applications, the first response information can be further optimized and adjusted to improve the quality and usability of the training data. Specifically, in one or more embodiments of this specification, training data is generated and stored based on the first query information, the first associated published content, and the first response information, including: The first response information is optimized and adjusted to obtain an optimized response information; Training data is generated and stored based on the optimized response information, the first associated published content, and the first query information.

[0080] In one or more embodiments of this specification, the first response information can be optimized and adjusted through manual editing. Specifically, the first response information can be sent to a manual review platform, where relevant reviewers can refine and optimize it. For example, factual corrections can be made to check the accuracy of factual statements in the response, and corrections can be made after verification with related published content. Alternatively, the logic of the first response information can be optimized to adjust its argumentative structure, making the logic of the first response information clearer. Alternatively, the style of the first response information can be adjusted to better conform to preset expression standards. Alternatively, redundancy in the first response information can be simplified by deleting repetitive statements or irrelevant information, making the first response information more concise and succinct. Alternatively, the first response information can be supplemented and improved, such as by supplementing and improving the first response information based on relevant information mentioned in the first related published content but not covered by the first response information.

[0081] For example, the first response generated by the preset language model is "According to community user recommendations, there are several coffee shops in area A." However, after manual editing and review, it was found that the first response omitted a representative coffee shop mentioned in a certain post. Therefore, the relevant information about that coffee shop can be added, and repeated statements of the same argument in different paragraphs in the first response can be streamlined and merged to obtain an optimized response. Simultaneously, during the refinement process, a contextual snapshot associated with the current training data can be obtained to ensure that all optimization adjustments are based on evidence, thereby improving the accuracy of the optimization adjustments.

[0082] In one or more embodiments of this specification, the first response information can be automatically optimized and adjusted using a preset optimization model. This preset optimization model can be a large language model, a rule-based post-processing model, or a specially trained refinement model. When optimizing the first response information using the preset optimization model, the format of the first response information can be standardized to ensure correct punctuation, reasonable paragraphing, etc. Alternatively, duplicate statements or irrelevant information in the first response information can be automatically identified and deleted to determine if the first response information is simple and concise. Alternatively, a consistency check can be performed on the first response information to check for inconsistencies or discrepancies with the first associated published content, and the first response information can be automatically corrected based on the first associated published content.

[0083] For example, a preset optimization model can be invoked to optimize and adjust the first response information. Suppose that the preset optimization model identifies a factual statement in the first response information that is inconsistent with the statement in the first associated publication based on the first related publication in the context snapshot. For example, the first response information states that the opening time of a certain coffee shop is time A, while the first associated publication states that the opening time of the coffee shop is time B. The first response information can be corrected based on the first associated publication, and a reference mark can be added to obtain optimized response information.

[0084] After obtaining the optimized response information using the above method, the optimized response information, the first query information, and the first associated published content can be persistently stored as training data in a database or file system for fine-tuning training of the relevant model. By optimizing and adjusting the first response information, the relevance between the first response information and the first associated published content can be improved, thereby enhancing the quality of the training data and making it more accurate and complete.

[0085] In one or more embodiments of this specification, after generating the first response information, a consistency check can be performed between the first response information and the first associated published content to ensure that the first response information is generated with reference to the first associated published content, thereby avoiding the publication content from referencing fabricated or illusory content.

[0086] like Figure 2 As shown, Figure 2 A flowchart illustrating a method for generating training data according to an embodiment of this specification includes the following steps: Step 2002: Use the first associated published content and the first query information as benchmark information, and determine the target matching degree between the benchmark information and the first reply information.

[0087] Step 2004: If the target matching degree is determined to meet the preset conditions, the benchmark information and the first response information are used as training data and stored in the second storage location.

[0088] Step 2006: If it is determined that the target matching degree does not meet the preset conditions, regenerate the first associated published content and the first reply information corresponding to the query information.

[0089] The preset conditions can be set based on actual needs, and this manual does not impose specific restrictions. For example, a preset condition can be that the target matching degree is greater than the preset matching degree, and the preset matching degree can be determined based on the actual situation.

[0090] In one or more embodiments of this specification, the first query information and the first associated published content can be used together as reference information. The first query information can reflect the content direction that the user wants to know, and the first associated published content can characterize the reference source on which the first response information is generated. Thus, the reference information can be used to measure whether the first response information is consistent with the content on which it was generated, or whether there is any deviation or illusion.

[0091] In one or more embodiments of this specification, the target matching degree between the benchmark information and the first response information can be determined based on semantic similarity; in other words, the target matching degree can characterize the semantic similarity between the benchmark information and the first response information. Specifically, in one or more embodiments of this specification, determining the target matching degree between the benchmark information and the first response information includes: The benchmark information and the first response information are input into a natural language reasoning model. The benchmark information is used as a premise and the first response information is used as an assumption to obtain the predictive logical relationship between the benchmark information and the first response information. Based on the predicted logical relationship, the target matching degree between the benchmark information and the first response information is determined.

[0092] Natural Language Inference (NLI) models are used to determine the logical relationship between two pieces of information, such as two sentences. NLI models typically receive two pieces of information as input: a premise and a hypothesis. A premise can be understood as background information, known facts, or a longer statement, while a hypothesis is the information whose truth value or logical relationship needs to be determined based on the premise. In practice, the premise and hypothesis are usually concatenated together with a specific separator before being input into the NLI model. The output of the NLI model is a classification prediction of the logical relationship between these two pieces of information. Logical relationships typically fall into three categories: entailment, contradiction, and neutrality. Entailment indicates that if the premise is true, the hypothesis must be true; contradiction indicates that if the premise is true, the hypothesis must be false; and neutrality indicates that the truth value of the premise cannot determine the truth value of the hypothesis, and there is no necessary logical connection between the two.

[0093] In one or more embodiments of this specification, the baseline information and the first response information can be concatenated and input into a natural language inference model. The natural language inference model uses the baseline information as a premise and the key content of the first response information as an assumption. This key content can be determined based on actual needs; it can be the entire first response information or a portion thereof, such as core statements or key arguments. The natural language inference model can output the predicted logical relationship between the premise and the assumption, thereby verifying whether the first response information truly receives semantic support from the first associated published content, preventing the published content from referencing fabricated or misleading content.

[0094] In one or more embodiments of this specification, a predefined correspondence between logical relationship categories and matching degrees can be established, allowing the target matching degree corresponding to the predicted logical relationship to be obtained by querying from the correspondence. For example, suppose the correspondence is: implied corresponds to matching degree A, neutral corresponds to matching degree B, contradictory corresponds to matching degree C, matching degree A is greater than matching degree B, and matching degree B is greater than matching degree C. Therefore, when the predicted logical relationship is determined to be implied, the target matching degree between the baseline information and the first response information can be determined to be matching degree A. When the predicted logical relationship is determined to be neutral, the target matching degree between the baseline information and the first response information can be determined to be matching degree B. When the predicted logical relationship is determined to be contradictory, the target matching degree between the baseline information and the first response information can be determined to be matching degree C. For example, suppose the first associated post in the baseline information contains a note titled "Recommendation of Coffee Shops in Area A", which explicitly states that "the latte at Coffee Shop B is very delicious". Suppose the first reply contains the statement "Coffee Shop B has many positive reviews". The NLI model can determine that the statement in the first reply has an implication relationship with the note in the first associated post, and thus can determine the target matching degree between the two as matching degree A based on the correspondence.

[0095] In one or more embodiments of this specification, the target matching degree can be determined based on keyword matching. Specifically, a first keyword can be extracted from the first query information and the first associated published content, such as location, category, attribute, etc. Then, the number of times the first keyword is contained in the first reply information can be determined, and the target matching degree is determined based on the number. The number is positively correlated with the target matching degree, that is, the larger the number of the first keyword contained in the first reply information, the higher the target matching degree between the baseline information and the first reply information.

[0096] In one or more embodiments of this specification, the preset condition can be that the target matching degree is greater than the preset matching degree. Therefore, when it is determined that the target matching degree is greater than the preset matching degree, it can be determined that the matching degree between the benchmark information (the first query information and the first associated published content) and the first response information is high, or that the first response information is semantically supported by the benchmark information. Therefore, it can be determined that the first response information is accurate, and the benchmark information and the first response information can be used together as training data and stored in the second storage location.

[0097] Correspondingly, in one or more embodiments of this specification, if the target matching degree is determined to be less than or equal to a preset matching degree, it can be determined that the matching degree between the baseline information (first query information and first associated published content) and the first response information is low, or that the first response information is not semantically supported by the baseline information. Therefore, it can be determined that the first response information is inaccurate, and thus the baseline information and the first response information cannot be used as training data and stored. However, if it is determined that the target matching degree does not meet the preset conditions, the first associated published content and the first response information corresponding to the query information can be regenerated until the target matching degree between the regenerated query information and the first associated published content and the first response information is greater than the preset matching degree.

[0098] The second storage location is used to store the training data that has passed the consistency check. The second storage location can be determined based on the specific circumstances; for example, it could be a database table for storing formal training data, a file directory for storing high-quality SFT training data, or object storage space for storing publishable training data, etc.

[0099] It should be noted that when regenerating the first associated published content and the first response information corresponding to the query information, the associated published content can be retrieved again, and then the response can be regenerated. For example, if 10 notes were previously recalled, but NLI verification found that the generated first response information contained multiple statements inconsistent with the content of those 10 notes, meaning the target matching degree did not meet the preset conditions, then 20 notes can be recalled again to broaden the scope of reference, so as to retrieve the first associated published content again and regenerate the first response information based on the new first associated published content. Alternatively, manual intervention can be used to regenerate the response.

[0100] Through the above matching degree verification, only the first response information that is highly consistent with the benchmark information can be used as training data storage. This can ensure the accuracy and credibility of the training data. Furthermore, the matching degree verification can remove training data that contradicts the reference basis, i.e., the first associated published content, thus avoiding the inclusion of fraudulent or illusory content in the training dataset and preventing pollution of the training dataset to ensure its purity.

[0101] As mentioned earlier, content application platforms contain a large amount of user-generated content (UGC). When a user enters a query in the language model input field of the content application platform, the language model can generate a response based on the user-generated content within the application, thus assisting the user in quickly obtaining information from various user-generated content. The query terms, UGC, and responses are used as training data to train the language model built into the content application platform. Before using the training data to perform training, it is usually possible to validate the training data to ensure its accuracy and authenticity, thereby improving the performance of the trained language model. However, since what is currently stored is often the UGC's Uniform Resource Locator (URL), and users can modify, delete, or make UGC invisible at any time, the URL may become invalid or point to new UGC, making it impossible to reproduce the original UGC. This results in validation failing, and the accuracy and authenticity of the training data cannot be guaranteed.

[0102] The data processing method provided in one or more embodiments of this specification can obtain first query information and obtain first associated published content corresponding to the first query information; input the first query information and the first associated published content into a preset language model to obtain first response information corresponding to the first query information; and generate training data based on the first query information, the first associated published content, and the first response information.

[0103] One embodiment of this specification implements training data that includes not only the first query information and the first reply information corresponding to the first query information, but also the original reference for generating the first reply information, namely, the first associated published content information, thereby improving the completeness and richness of the training data. Furthermore, unlike methods that store UGC content identifiers (IDs) or URLs, the above data processing method stores the first associated published content information itself, along with the first query information and the first reply information, as training data. Therefore, even if the user subsequently modifies or deletes the original associated published content, the reference for the first reply information in the training data can still be completely retrieved, ensuring the traceability of the training data. This guarantees the accuracy and reliability of the training data, thereby improving the performance of the target generation model trained based on the training data.

[0104] As mentioned above, the entity executing the data processing method described in this specification can be a training data generation platform. This platform generates training data, which includes query information, published content, and response information. The training data generation platform can support generating training data based on user-imported query information and obtaining related distributed content by calling an external published content retrieval service. It can also generate training data based on prompt information. Specifically, the prompt information can be chained, meaning that each subsequent prompt information requires the output of the previous prompt information as input to form a complete generation chain.

[0105] In one or more embodiments of this specification, the training data generation platform can process the first query information in batches. Therefore, the training data generation platform has the ability to support asynchronous execution and interruption recovery, ensuring that it can continue execution from the breakpoint in scenarios such as the release and restart of the training data generation platform, avoiding repeated calculations and data loss.

[0106] In one or more embodiments of this specification, the training data generation platform requires a complete version control system for prompt messages to support the creation, editing, debugging, comparison, and version release of prompt messages. It can also compare the differences in the effects of different versions of prompt messages under the same input, providing data support for the optimization of prompt messages.

[0107] In one or more embodiments of this specification, the training data generation platform can distribute the final generated training data to different technicians or preset optimization models for manual verification and improvement, and can also support preview rendering of the training data.

[0108] In one or more embodiments of this specification, the training data generation platform can completely save all data in the entire data processing chain, including but not limited to the first query information, the first associated published content, the prompt information and its version at each step, intermediate results, and the first reply information, etc., to support subsequent data backtracking and analysis needs.

[0109] like Figure 3 As shown, Figure 3 The flowchart illustrates a training method for a generative model according to an embodiment of this specification, which specifically includes the following steps: Step 302: Obtain training data, wherein the training data includes sample first query information, sample first associated published content and tag first reply information corresponding to the sample first query information, and the training data is obtained based on the above data processing method.

[0110] In one or more embodiments of this specification, training data for training an initial generative model can first be obtained. The training data includes sample first query information, sample first associated published content corresponding to the sample first query information, and tag first reply information. The training data is obtained based on the aforementioned data processing method.

[0111] As mentioned earlier, after generating training data, the data processing method described above can store the training data in a second storage location. Therefore, when training the generative model, the training data can be retrieved from the second storage location. The first query information of the sample can serve as the input question for the training sample, and can be any first query information from the training data in the second storage location. Correspondingly, the first associated published content of the sample is the published content bound to the first query information of the sample, and the first reply information of the tag is the first reply information bound to the first query information of the sample.

[0112] In one or more embodiments of this specification, multiple training data points can be read in batches from a second storage location to form a training dataset. This training dataset can be further divided into a training set and a validation set, used for model training and performance evaluation, respectively.

[0113] Step 304: Input the first query information of the sample and the first associated published content of the sample into the initial generation model to obtain the predicted response information.

[0114] In one or more embodiments of this specification, the sample first query information and sample first associated publication content in the training data obtained in step 302 can be jointly input into the initial generation model, and the model generates predicted response information.

[0115] It should be noted that the generative model can be the aforementioned preset language model. That is, during the actual response generation process of the preset language model, the generated responses can be used as training data to fine-tune its own training and improve its performance. Alternatively, the generative model can be a different model than the preset language model. Based on this training data, the generative model can learn to generate responses corresponding to the query information while using the published content as a reference.

[0116] For example, the generative model can be a pre-trained language model, which has the ability to generate corresponding outputs based on input text. In one or more embodiments of this specification, the input to the model is the first sample query information and the first sample associated published content, and the output is the predicted response information generated by the model based on the input.

[0117] For example, the first sample query information, such as "Recommended coffee shops in area A", and the corresponding first sample related published content, such as 10 notes, can be input into the initial generation model. After internal inference calculation, the initial generation model can output predicted response information, such as "According to the notes published by user A, coffee shops in area A...".

[0118] It should be noted that the initial generative model can be understood as the generative model to be trained, or as the generative model at any intermediate training epoch. Since the model parameters of the initial generative model have not yet been updated based on the training data of this epoch, there is a discrepancy between its output predicted response information and the first response information of the label. Therefore, it is necessary to train based on both to reduce the discrepancy.

[0119] Step 306: Train the initial generation model based on the predicted response information and the first response information of the label to obtain the target generation model.

[0120] In one or more embodiments of this specification, a loss value can be calculated based on the difference between the predicted response information obtained in step 304 and the first label response information obtained in step 302, and the parameters of the initial generative model can be updated based on the loss value until the preset model training stopping condition is reached, so as to obtain the target generative model.

[0121] In one or more embodiments of this specification, the predicted response information can be compared with the first response information labeled, and the difference between the two can be calculated using a preset loss function. The preset loss function can be a cross-entropy loss function, a contrastive loss function, etc.

[0122] In one or more embodiments of this specification, after the loss value is calculated, the gradients of each parameter of the initial generator model can be calculated using the backpropagation algorithm, and the parameters of the initial generator model can be updated using an optimizer, so that the initial generator model can generate prediction results that are closer to the first response information of the label in subsequent inference.

[0123] In practical applications, the training dataset can be divided into multiple batches, each batch containing at least one training data point. Then, the average loss can be calculated based on all the training data in that batch, and a parameter update can be performed to improve training efficiency.

[0124] In one or more embodiments of this specification, the preset model training stopping condition may be that the calculated loss value is less than a preset loss threshold. Alternatively, the preset model training stopping condition may be that the amount of training data used reaches a preset number threshold. Alternatively, the preset model training stopping condition may be that the number of iterative training epochs reaches a preset epoch threshold, and so on. The specific method can be determined based on actual needs, and this specification does not impose specific limitations.

[0125] In one or more embodiments of this specification, a target generative model can be obtained after a preset model training stopping condition is met. This target generative model is capable of generating accurate and verifiable response information based on given query information and relevant published content.

[0126] In practical applications, this target generation model can be deployed on content application platforms to provide users with intelligent query response services based on published content.

[0127] In the training method of the above-mentioned generative model, since the training data includes the first related published content of the sample corresponding to the first query information of the sample as a reference, the initial generative model can learn the ability to generate a response based on the reference, which helps to improve the response accuracy and credibility of the trained target generative model and reduce the model illusion phenomenon.

[0128] Furthermore, after obtaining the target generation model, a response generation task can be performed based on the target generation model. When it is determined that the response generated based on the target generation model is abnormal, the first associated publication content of the sample in the training data can be traced and analyzed to locate the root cause of the problem. Is it that the original basis information is wrong, that is, the first associated publication content of the sample is wrong, or is there a deviation in the reasoning process of the target generation model? In this way, the training data or model training strategy can be optimized in a targeted manner to ensure the accuracy of the training data and improve the performance of the trained target generation model.

[0129] like Figure 4 As shown, Figure 4 A flowchart of a response generation method provided in an embodiment of this specification is shown, which specifically includes the following steps: Step 402: Receive a response generation request sent by the receiving end device, wherein the response generation request carries second query information.

[0130] It should be noted that this response generation method is applied to cloud-side devices, which can be understood as any computing device with computing capabilities that deploys the target generation model. Specifically, it can be a content application platform server, which can receive response generation requests sent by the edge device, wherein the response generation request carries second query information.

[0131] The term "device-side device" refers to the electronic device used by the user, including but not limited to smartphones, tablets, personal computers, and smart wearable devices. In practical applications, users can enter second query information in the input field through the user interface of the content application platform APP installed on the device-side device. The device-side device can then generate a response request carrying this second query information and send it to the content application platform server.

[0132] It should be noted that the second query information can be text information, specifically natural language query content entered by the user in the user interface of the terminal device. For example, the natural language query content can be a question, such as "What coffee shops are worth visiting in area A?", a combination of keywords, such as "Recommendations for coffee shops in area A", or a command statement, such as "Recommend coffee shops in area A".

[0133] For example, after a user enters the query text "What coffee shops are worth visiting in area A?" in the search box of a content application platform app, they can click the send button in the user interface. The client device can respond to the click of the send button by generating a reply request carrying the query text "What coffee shops are worth visiting in area A?", and can send it to the content application platform server via HTTP protocol or other means.

[0134] In one or more embodiments of this specification, when the terminal device obtains the second query information input by the user, it can also obtain context information corresponding to the second query information and generate a response generation request carrying the second query information and context information. The context information includes, but is not limited to, historical dialogue information, user's current geographical location information, user's historical browsing preference information, etc.

[0135] Step 404: Obtain the second associated published content corresponding to the second query information.

[0136] In one or more embodiments of this specification, the content application platform server may, in response to a received response generation request, obtain the second associated published content corresponding to the second query information. This second associated published content can be understood as user-generated content within the content application platform, including but not limited to notes, posts, comments, and guides.

[0137] In one or more embodiments of this specification, the second associated published content can be obtained by invoking a published content recall service. Specifically, the content publishing platform server can invoke the published content recall service to take the second query information as input, retrieve published content with a high semantic relevance to the second query information from the published content, and use it as the second associated published content. For example, if the second query information is "What coffee shops are worth visiting in area A?", the content publishing platform server can invoke the published content recall service to retrieve at least one published content that is semantically most relevant to "What coffee shops are worth visiting in area A?" from the published content library of the content publishing platform and use it as the second associated published content.

[0138] In one or more embodiments of this specification, the second associated published content can be obtained through preset matching rules. Specifically, matching rules between query information and published content (such as keyword matching, topic tag matching, category matching, etc.) can be preset, and these matching rules can be stored in the content publishing platform server. Thus, when the content publishing platform server determines that the second query information matches a specific rule, it can determine the second associated published content corresponding to the query information based on that specific rule.

[0139] In one or more embodiments of this specification, retrieval can also be based on caching. Specifically, if the second associated published content corresponding to the second query information has already been recalled and cached in previous processing, the content publishing platform server can directly read the second associated published content from the cache, thereby avoiding repeated retrieval and improving response speed. For example, if the second query information is "Which coffee shops in region A are worth visiting?" and is searched by a large number of users in a short period of time, the content publishing platform server can cache the second associated published content itself that was initially recalled, so that when subsequent requests are received, the cached results can be returned directly without repeatedly calling the published content recall service.

[0140] Step 406: Input the second query information and the second associated published content into the target generation model to obtain the second response information corresponding to the second query information, wherein the target generation model is obtained based on the training method of the above-mentioned generation model.

[0141] In one or more embodiments of this specification, the second query information obtained in step 402 and the second associated published content obtained in step 404 can be concatenated and input into the target generation model to obtain the second response information output by the target generation model corresponding to the second query information.

[0142] In one or more embodiments of this specification, the target generation model is a target generation model trained based on the aforementioned training method, namely the training method described in steps 302 to 306 above. It can be seen that the target generation model, after obtaining high-quality training data, has the ability to understand the semantics and intent of the second query information, the ability to extract key information from the second related published content, and the ability to generate accurate and verifiable response text based on the extracted information.

[0143] It should be noted that, since the target generation model has learned a pattern of generating response information corresponding to the query information based on references, i.e., published content, during the aforementioned training phase, the generated second response information in step 406 is accurate and verifiable in content, rather than fabricated. Therefore, this target generation model can generate verifiable response information, that is, it can generate response information with high accuracy and reliability.

[0144] Step 408: Send the second response information to the end-side device.

[0145] In one or more embodiments of this specification, the content publishing platform server can send the second response information generated in step 406 to the client device for user viewing. Specifically, the content application platform server can encapsulate the second response information into a response message and return it to the client device via HTTP or WebSocket protocol. The client device can receive the response message and, upon receiving it, can display the second response information in the dialog area of ​​the user interface of the content application platform on the client device.

[0146] In one or more embodiments of this specification, the content publishing platform server may also send the source information on which each statement in the second response information is based. For example, it may send the second associated published content itself. When the terminal device displays the second response information, it may also display the second associated published content itself, thereby characterizing the reliability of the source of the second response information and enabling the traceability verification of the second response information.

[0147] In one or more embodiments of this specification, when the second reply information is long or contains rich text content (such as lists, paragraphs, bolding, etc.), the content publishing platform server can send the second reply information to the terminal device in a structured format such as Markdown or HTML. The terminal device can then render and display the information according to the corresponding format to improve the user's reading experience.

[0148] The response generation method based on the target generation model described above, because the target generation model is fine-tuned based on high-quality training data, ensures that the generated second response is accurate and well-founded, rather than a vague and generic response, thus generating highly accurate second response information. Furthermore, the generated second response information can include source citations for key content, allowing users to view the related second-related publications upon which the key content is based, enhancing the credibility of the second response information.

[0149] like Figure 5 As shown, Figure 5 This specification illustrates an interaction diagram of a multi-terminal device according to an embodiment, specifically including the following steps: Step 5002: The terminal device responds to the user's input operation, obtains the second query information, and generates a response generation request based on the second query information.

[0150] Step 5004: Send the response generation request to the cloud-side device.

[0151] Step 5006: The cloud-side device receives the response generation request and parses the response generation request to obtain the second query information.

[0152] Step 5008: The cloud-side device calls the published content recall service to determine the second associated published content corresponding to the second query information.

[0153] Step 5010: The cloud-side device inputs the second associated published content and the second query information into the target generation model. The target generation model, taking the second associated published content as a reference, generates second response information corresponding to the second query information.

[0154] Step 5012: The cloud-side device sends the second response information to the end-side device.

[0155] Step 5014: The terminal device receives the second response information and renders and displays it to the user for the user to view.

[0156] For example, the edge device can be an electronic device that carries the content publishing platform client or the content publishing platform client itself, while the cloud device can be the content publishing platform server.

[0157] First, users can open the content publishing platform APP on their electronic devices, enter the query "Recommended cafes in area A" in the search input box of the user interface, and then click the send button.

[0158] Then, the content publishing platform client can generate a response request carrying the query information "Recommended coffee shops in area A", and send the response request to the content publishing platform server.

[0159] Next, the content publishing platform server can receive the response generation request and call the published content recall service to retrieve related published content, such as 10 full-text notes, that are semantically related to the query information "Recommended coffee shops in region A".

[0160] Afterwards, the content publishing platform server can input the query information "Recommended coffee shops in area A" and the full text of 10 related published notes into the target generation model. Based on the evidence-based generation capabilities learned during the training phase, the target generation model can generate response information, such as coffee shop name, address, reasons for recommendation, and citation tags.

[0161] Furthermore, the content publishing platform server can encapsulate the generated reply information, including the coffee shop name, address, reasons for recommendation, and citation tags, into a response message and send the response message to the user's content publishing platform client.

[0162] Finally, the content publishing platform client can receive the response message, parse it to obtain the reply information, and render and display the reply information in the user interface, so that users can see the generated reply information in the user interface of the content publishing platform client.

[0163] Furthermore, the system can also display the details of 10 related posts referenced when generating the response information, for users to view.

[0164] Using the above method, since the target generation model is fine-tuned based on high-quality training data, the generated second response content is accurate and verifiable, rather than an empty or generic response, thus generating highly accurate second response information. Furthermore, the generated second response information can include source citations corresponding to key content, allowing users to view the related second-related publications on which the key content is based, enhancing the credibility of the second response information.

[0165] As mentioned above, the entity executing the data processing method provided in this specification can be a training data generation platform. Correspondingly, one embodiment of this specification provides a schematic diagram of the structure of a training data generation platform, as shown below. Figure 6 As shown, the training data generation platform may include a data import unit, a prompt management unit, a task scheduling engine, a debugging and comparison unit, a data backtracking unit, an execution engine, a data editing unit, external dependency services, and a storage layer.

[0166] In one or more embodiments of this specification, the training data generation platform can be used to generate training data for SFT of a large model based on published content. The training data generation platform ensures the traceability and authenticity of the training data based on a context snapshot mechanism.

[0167] The data import unit is used to obtain the first query information, such as the query term "Query" and its corresponding context information, to create training data generation tasks. Specifically, in practical applications, the data import unit can provide a data import control. Users can upload Excel or Word files through this control in the user interface. This file can contain at least one query term and its corresponding context information (such as region restrictions, user information, scene tags, etc.). Responding to user actions on the data import control, the data import unit performs format validation and content parsing on the imported file, extracting the first query information—the query term list and its corresponding context information—to generate batch training data tasks. The task information for each training data task can be persistently stored in a task table of a relevant database, such as a MySQL database.

[0168] The prompt management unit can be used to manage prompt templates in a versioned manner to support the execution of prompt chains and the tracking of prompt versions. Specifically, in practical applications, the prompt management unit can provide functions for creating, editing, version management, and publishing prompt templates. Each prompt template can be assigned a unique version identifier and metadata such as creation time, modifier, and version description can be recorded. The prompt template can contain instruction text, output format requirements, and citation specifications to guide the generation of training data by a pre-defined language model, so that the prompt information in the aforementioned data processing methods can be pre-generated based on the prompt template.

[0169] In one or more embodiments of this specification, the prompt template may include three versions: a first prompt template, a second prompt template, and a third prompt template, which can be executed sequentially to generate training data. The first prompt template is used to generate a draft response based on the first query information and the first associated published content. This draft response needs to include key information mentioned in the first associated published content. The second prompt template can be used to verify and supplement the draft response. Specifically, based on the first associated published content, it can verify the accuracy of factual statements in the draft response and supplement any missing information. It can also add superscript citations to each key piece of information to identify the source of each key piece of information in the response. The third prompt template can be used to adjust the language style of the response information generated by the second prompt template so that the generated response information conforms to preset expression standards, thereby obtaining the final first response information.

[0170] In practical applications, the version identifiers and contents of each Prompt template can be uniformly stored and managed through the prompt management unit. When a prompt template needs iterative optimization, a new version can be created while retaining historical versions, ensuring that the version information of the specific prompt template used when each training data was generated can be traced later.

[0171] The task scheduling engine is used to schedule and manage the asynchronous execution of training data generation tasks. In one or more embodiments of this specification, the task scheduling engine can employ a scheduling mechanism that periodically scans relevant databases, such as the aforementioned MySQL database, to monitor the status of training data generation tasks. This enables concurrent processing of large batches of initial query information and supports interruption recovery after a training data generation platform failure.

[0172] In one or more embodiments of this specification, the task scheduling engine may include a task splitting subunit and a task execution subunit. Specifically, the task splitting subunit can be used to split the batch training data generation task created by the data import unit into multiple subtasks according to the granularity of query information. For example, each first query information can be specified to correspond to a subtask QueryExecution, and the subtask status can be initialized to a pending execution state. The task execution subunit can periodically scan the subtasks in the pending execution state and call the execution engine to perform training data generation processing. For example, assuming that the batch training data generation task is a batch task corresponding to 100 first query information, the task scheduling engine can split the batch task into 100 subtasks, scan and call the execution engine to process each first query information in sequence. When a subtask QueryExecution is completed, its status can be updated to an execution success state or an execution failure state, and the task scheduling engine can continue to scan the next pending subtask.

[0173] In one or more embodiments of this specification, the task scheduling engine can also maintain a two-level state machine: task-level and query execution-level. The task-level state can track the overall progress of the entire batch of tasks, such as pending execution, in-process execution, completed execution, and failed execution. The query execution-level state can accurately track the snapshot status of each first query, such as pending recall, snapshot already saved, Prompt in progress, completed execution, and verification failed execution, to ensure that the timing constraint of recalling first, then writing the snapshot, and finally executing the Prompt can still be successfully implemented in abnormal scenarios.

[0174] The debugging and comparison unit is used to compare and analyze training data generated under different Prompt versions, different model parameters, or different recall strategies for the same first query. Since the prompt information includes multiple versions, it can be understood that the generated response information also includes multiple versions. Therefore, specifically, the debugging and comparison unit can provide a side-by-side comparison view, simultaneously displaying multiple training data generation results for the same first query information (such as outputs from different Prompt versions, outputs under different recall numbers, etc.) on the user interface, allowing relevant technical personnel to evaluate the effectiveness of the response information and select appropriate solutions.

[0175] The execution engine is the core processing unit of the training data generation platform. It can be used to connect the entire process of training data generation, which can include recalling the first associated published content, anchoring the context snapshot, executing the Prompt chain, and verifying consistency.

[0176] Specifically, after receiving the first query information assigned by the task scheduling engine, the execution engine can first call the externally dependent published content recall service to retrieve the full-text content of the Top-N notes related to the current first query information, i.e., the first associated published content. Then, before the Prompt execution begins, the recalled first associated published content, along with the first query information, and possibly the context information corresponding to the first query information, can be persistently stored in a MySQL database to form context snapshot information. This context snapshot information is not modified once written, thus ensuring the validity of the reference content. Next, after the context snapshot is solidified, the corresponding Prompt template can be read from the prompt management unit with the first associated published content in the context snapshot information as a reference, and multiple Prompts can be executed serially to gradually generate and refine training data. The input data, output data, and Prompt version identifier used in each step can all be associated with the subtask QueryExecution corresponding to the context snapshot information and stored in the MySQL database. After the data for "I Want to Love You" is generated and before the training data is stored in the database, the execution engine can call the NLI model to perform consistency verification to determine whether the first reply information has obtained semantic support from the first related published content in the context snapshot information. If there is a contradiction, the first reply information will be rejected and marked as a verification failure. If the verification passes, it can be stored in the database, or it can enter the manual review queue and be stored in the database after review.

[0177] The data editing unit allows technical personnel to manually refine and optimize the training data generated by the execution engine. Specifically, the data editing unit provides a user interface for online text editing, where technical personnel can view the specific content of the generated training data and modify, supplement, or delete it. After editing, technical personnel can submit the changes, and the data editing unit can organize the modified and optimized first response information, first query information, and first associated published content into training data and store it in the database.

[0178] In one or more embodiments of this specification, the data editing unit may include an integrated data backtracking unit. During the refinement process, the editor can click the "View Evidence Package" button at any time to view the original snapshot content (including Query, context and full text of all reference notes) on which the current corpus is based in the interface sidebar, without having to jump to an external system or access the original URL, ensuring that every modification is based on evidence.

[0179] The data backtracking unit allows technical personnel to view the complete evidence package, or context snapshot information, associated with any training data, thus enabling end-to-end data traceability. Specifically, the data backtracking unit provides retrieval entry points based on multiple dimensions, such as the first query information, training task identifier, and QueryExecution identifier. This allows users to retrieve and view the context snapshot information associated with any training data stored in the database by performing a cross-table JOIN query.

[0180] In practical applications, when user complaints arise from responses generated by the target generation model, technical personnel can retrieve the corresponding training data in the data backtracking unit using either the identifier of the response or the identifier of the training task corresponding to the target generation model. This training task identifier represents the identifier of the training task of the generation model. Furthermore, they can trace back to the context snapshot information (the first associated published content) referenced when the training data was generated to confirm whether the response from the target generation model is indeed supported by the first associated published content, thus determining whether the target generation model is exhibiting hallucinations. Alternatively, if technical personnel have doubts about the quality of a piece of training data, they can view its corresponding context snapshot through the data backtracking unit to determine whether the first associated published content contains factual errors or whether the target model's generation process suffers from hallucinations.

[0181] The external dependency services may include a content retrieval service, which can retrieve the full text of notes semantically related to the first query information from the massive amount of published content on the content publishing platform, i.e., the first associated published content. The execution engine can call this service before the context snapshot anchoring step. The external dependency services may also include a large model service, which can be a pre-defined language model service. This large model service can execute each Prompt step in the Prompt chain to generate training data content. It can provide a standard API interface, allowing the execution engine to send the Prompt template and input data as request parameters. The large model service then returns the generated results. Finally, the external dependency services may include a rendering service, which can render the first associated published content into a readable rich text format such as HTML in the data editing and debugging comparison units, facilitating viewing and editing by technical personnel in the user interface. It can also support parsing and rendering of various formats such as Markdown and JSON.

[0182] The storage layer can use a MySQL database as the persistent storage medium to store all structured data in the training data generation platform, including but not limited to task-level records, query execution-level records, context snapshot information records, prompt execution-level records, prompt version records, training data records, and manual editing records. In practical applications, context snapshot information can store the complete full-text content of the first associated published content in JSON format, and database transactions are used to ensure the atomicity of writes. The tables storing context snapshot information can be linked through foreign keys to form a complete data association chain, which can be used to support multi-table JOIN queries in the aforementioned data backtracking unit.

[0183] In one or more embodiments of this specification, the training data generation platform may also provide a Prompt debugging process to support iterative optimization and version updates of the Prompt template. Figure 7 As shown, Figure 7 This is a schematic diagram illustrating the debugging process of a prompt template provided in one embodiment of this specification.

[0184] In practical applications, the prompt management unit can display a full list of prompt versions. Each version's information can include a version identifier, version description, creation time, release status, and other details. Users can select one version as the baseline version for the debugging process based on their actual needs, allowing for modifications and optimizations based on this base version.

[0185] After selecting a baseline Prompt version, you can trigger the creation of a draft. Specifically, you can completely copy the content of the baseline Prompt template to generate a draft copy. This draft copy can be marked as a draft and will not affect the published baseline version. The draft copy can inherit all the content of the baseline version, so that subsequent modifications to the draft copy will not affect the normal use of the baseline version.

[0186] Then, the Prompt template content in the draft copy can be edited to optimize the Prompt strategy. Specifically, the data editing unit can provide an online text editing user interface for the Prompt template, allowing modification of the instruction text, output format requirements, citation specifications, constraints, and other content in the draft copy based on this user interface. In response to the modification operation, the specific content of the draft copy is updated, and information such as the modification time and the person who modified the updated draft copy can be recorded.

[0187] After editing the draft copy, users can select test query information for comparison and evaluation between the baseline version and the draft copy. Specifically, the debug comparison unit provides a test query information selection interface, allowing users to choose one or more queries from the first query information imported in the data import unit, or manually enter new queries. This test query information can be used simultaneously for the prompt execution of both the baseline version and the draft copy.

[0188] Next, the task scheduling engine can synchronously execute the baseline version chain and the draft copy chain based on the test query information. Specifically, it can obtain the test-related release content from the test query information, call the large model service to execute the Prompt chain corresponding to the baseline version, generate baseline response information based on the test query information and the test-related release content, and simultaneously call the large model service to execute the Prompt chain corresponding to the draft copy, generate draft response information based on the test query information and the test-related release content. It can also store the baseline response information and the draft response information for subsequent comparison.

[0189] Next, the debugging and comparison unit can display the two versions of the generated results side-by-side: the baseline response information and the draft response information, for relevant technical personnel to compare and evaluate. For example, the debugging and comparison unit can provide a split-screen comparison view, such as displaying the baseline response information on the left and the draft response information on the right.

[0190] Furthermore, based on the comparison results, it can be determined whether the draft response has achieved the expected effect. If it is determined that the draft response has achieved the expected effect, the publishing process can proceed. If it is determined that the draft response has not achieved the expected effect, the process can return to the step of modifying the draft copy using the data editing unit to continue adjusting and optimizing the draft copy, and then re-execute the comparison process until the draft response generated based on the modified draft copy achieves the expected effect.

[0191] It should be noted that the expected results can be determined based on actual needs, and this manual does not impose specific limitations.

[0192] Finally, if the draft response information meets the expected results, the new version release process can begin. In other words, if the draft response information is satisfactory, the Prompt chain corresponding to the draft copy, i.e. the prompt template chain, can be released as a new prompt version. This new version of the prompt template can then be used to generate prompt information based on the new version of the prompt template during the actual generation of training data, and thus be used to generate training data.

[0193] By using the above-described Prompt debugging process, the efficiency of prompt message iteration can be improved, and the accuracy of the generated training data can also be increased.

[0194] Corresponding to the above method embodiments, this specification also provides an embodiment of a data processing apparatus. Figure 8 A schematic diagram of the structure of a data processing apparatus according to an embodiment of this specification is shown. Figure 8 As shown, the device includes: The first acquisition module 802 is configured to acquire first query information and acquire first associated published content corresponding to the first query information; The first input module 804 is configured to input the first query information and the first associated published content into a preset language model to obtain the first reply information corresponding to the first query information; The generation module 806 is configured to generate and store training data based on the first query information, the first associated published content, and the first reply information.

[0195] Optionally, the first input module 804 is further configured to store the first query information and the first associated published content in a first storage location before inputting the first query information and the first associated published content into a preset language model; The first input module 804 is further configured to obtain the first query information and the first associated published content from the first storage location, and input the first query information and the first associated published content into a preset language model to obtain the first reply information corresponding to the first query information.

[0196] Optionally, the first acquisition module 802 is further configured to input the first query information into a preset feature extraction model to obtain query information features; determine the target published content features that match the first query information features from a preset published content feature library, and take the published content corresponding to the target published content features as the first associated published content.

[0197] Optionally, the generation module 806 is further configured to optimize and adjust the first response information to obtain optimized response information; and to generate and store training data based on the optimized response information, the first associated published content, and the first query information.

[0198] Optionally, the generation module 806 is further configured to use the first associated published content and the first query information as benchmark information, and determine the target matching degree between the benchmark information and the first reply information; if the target matching degree meets the preset conditions, the benchmark information and the first reply information are used as training data and stored in the second storage location.

[0199] Optionally, the generation module 806 is further configured to regenerate the first associated published content and the first reply information corresponding to the query information if it is determined that the target matching degree does not meet the preset conditions.

[0200] Optionally, the generation module 806 is further configured to input the benchmark information and the first response information into a natural language inference model, using the benchmark information as a premise and the first response information as an assumption, to obtain a predictive logical relationship between the benchmark information and the first response information; and to determine the target matching degree between the benchmark information and the first response information based on the predictive logical relationship.

[0201] The data processing apparatus provided in this specification can acquire first query information and acquire first associated published content corresponding to the first query information; input the first query information and the first associated published content into a preset language model to obtain first response information corresponding to the first query information; and generate training data based on the first query information, the first associated published content, and the first response information.

[0202] One embodiment of this specification implements training data that includes not only the first query information and the first response information corresponding to the first query information, but also the original reference for generating the first response information, namely, the first associated published content information, thus improving the completeness and richness of the training data. Furthermore, unlike methods that store the ID or URL of UGC content, this embodiment stores the first associated published content information itself, along with the first query information and the first response information, as training data. Therefore, even if the user subsequently modifies or deletes the original associated published content, the reference for the first response information in the training data can still be fully retrieved, ensuring the traceability of the training data. This guarantees the accuracy and reliability of the training data, thereby improving the performance of the target generation model trained based on the training data.

[0203] 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.

[0204] Corresponding to the above method embodiments, this specification also provides an embodiment of a training device for generating models. Figure 9 A schematic diagram of a training apparatus for a generative model according to an embodiment of this specification is shown. Figure 9 As shown, the device includes: The second acquisition module 902 is configured to acquire training data, wherein the training data includes sample first query information, sample first associated published content and tag first reply information corresponding to the sample first query information, and the training data is obtained based on the above data processing method; The second input module 904 is configured to input the first query information of the sample and the first associated published content of the sample into the initial generation model to obtain the predicted response information; Training module 906 is configured to train the initial generation model based on the predicted response information and the first response information of the label to obtain the target generation model.

[0205] Through the training device of the above-mentioned generative model, since the training data contains the first associated published content of the sample corresponding to the first query information of the sample as a reference, the initial generative model can learn the ability to generate a response based on the reference, which helps to improve the response accuracy and credibility of the trained target generative model and reduce the model illusion phenomenon.

[0206] Furthermore, after obtaining the target generation model, a response generation task can be performed based on the target generation model. When it is determined that the response generated based on the target generation model is abnormal, the first associated publication content of the sample in the training data can be traced and analyzed to locate the root cause of the problem. Is it that the original basis information is wrong, that is, the first associated publication content of the sample is wrong, or is there a deviation in the reasoning process of the target generation model? In this way, the training data or model training strategy can be optimized in a targeted manner to ensure the accuracy of the training data and improve the performance of the trained target generation model.

[0207] The above is a schematic scheme of a generative model training device according to this embodiment. It should be noted that the technical solution of this generative model training device and the technical solution of the generative model training method described above belong to the same concept. For details not described in detail in the technical solution of the generative model training device, please refer to the description of the technical solution of the generative model training method described above.

[0208] Corresponding to the above method embodiments, this specification also provides an embodiment of a device for generating a response. Figure 10 A schematic diagram of a recovery generation apparatus according to an embodiment of this specification is shown. Figure 10 As shown, the device includes: The receiving module 1002 is configured to receive a response generation request sent by the end-side device, wherein the response generation request carries second query information; The third acquisition module 1004 is configured to acquire the second associated published content corresponding to the second query information; The third input module 1006 is configured to input the second query information and the second associated published content into the target generation model to obtain the second response information corresponding to the second query information, wherein the target generation model is obtained based on the training method of the above-mentioned generation model; The sending module 1008 is configured to send the second reply information to the end-side device.

[0209] Because the target generation model is fine-tuned based on high-quality training data, the generated second response is accurate and reliable, rather than a vague and generic response, thus generating highly accurate second response information. Furthermore, the second response can be accompanied by source citations for key content, allowing users to view the related publications upon which the key content is based, enhancing the credibility of the second response.

[0210] The above is an illustrative scheme of a response generation apparatus according to this embodiment. It should be noted that the technical solution of this response generation apparatus and the technical solution of the above-described response generation method belong to the same concept. Details not described in detail in the technical solution of the response generation apparatus can be found in the description of the technical solution of the above-described response generation method.

[0211] See Figure 11 , Figure 11 This specification illustrates an architecture diagram of a data processing system according to one embodiment of the present specification. The data processing system may include a client 100 and a server 200. Client 100 is used to send a data processing request to server 200, wherein the data processing request carries first query information; Server 200 is configured to receive the data processing request, parse the data processing request to obtain first query information, and obtain first associated published content corresponding to the first query information; input the first query information and the first associated published content into a preset language model to obtain first response information corresponding to the first query information; generate and store training data based on the first query information, the first associated published content, and the first response information; and send the training data to client 100. Client 100 is also used to receive training data sent by server 200.

[0212] The data processing system provided in this specification can obtain first query information and first associated published content corresponding to the first query information; input the first query information and the first associated published content into a preset language model to obtain first response information corresponding to the first query information; and generate training data based on the first query information, the first associated published content, and the first response information.

[0213] One embodiment of this specification implements training data that includes not only the first query information and the first response information corresponding to the first query information, but also the original reference for generating the first response information, namely, the first associated published content information, thus improving the completeness and richness of the training data. Furthermore, unlike methods that store the ID or URL of UGC content, this embodiment stores the first associated published content information itself, along with the first query information and the first response information, as training data. Therefore, even if the user subsequently modifies or deletes the original associated published content, the reference for the first response information in the training data can still be fully retrieved, ensuring the traceability of the training data. This guarantees the accuracy and reliability of the training data, thereby improving the performance of the target generation model trained based on the training data.

[0214] The data processing system may include multiple clients 100 and a server 200. Clients 100 can be referred to as edge devices, and server 200 can be referred to as cloud devices. Multiple clients 100 can establish communication connections through server 200. In the data processing scenario, server 200 is used to provide data processing services between multiple clients 100. Each client 100 can act as a sender or receiver, communicating through server 200.

[0215] Users can interact with server 200 through client 100 to receive data sent by other clients 100, or send data to other clients 100, etc. In data processing scenarios, users can publish data streams to server 200 through client 100, server 200 can generate training data based on the data stream, and push the training data to other clients that have established communication.

[0216] In this system, client 100 and server 200 establish a connection via a network. The network provides the medium for communication between client 100 and server 200. The network can include various connection types, such as wired or wireless communication links or fiber optic cables. Data transmitted by client 100 may need to undergo encoding, transcoding, compression, or other processing before being published to server 200.

[0217] Client 100 can be a browser, an app (application), 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. Client 100 can be developed based on the software development kit (SDK) of the corresponding service provided by server 200, such as a real-time communication (RTC) SDK. Client 100 can be deployed on a computing device and depends on the device or certain apps on the device to run. The computing 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 on the computing 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.

[0218] Server 200 may include servers providing various services, such as servers providing communication services to multiple clients, servers supporting backend training of models used on clients, and servers processing data sent by clients. It should be noted that server 200 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. The server can also be a server in a distributed system, or a server integrated with blockchain. The server 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.

[0219] It is worth noting that the data processing methods and generative model training methods provided in the embodiments of this specification are generally executed by the server. However, in other embodiments of this specification, the client may also have similar functions to the server, thereby executing the data processing methods and generative model training methods provided in the embodiments of this specification. In other embodiments, the data processing methods and generative model training methods provided in the embodiments of this specification may also be executed jointly by the client and the server.

[0220] Figure 12 A structural block diagram of a computing device 1200 according to an embodiment of this specification is shown. The components of the computing device 1200 include, but are not limited to, a memory 1210 and a processor 1220. The processor 1220 is connected to the memory 1210 via a bus 1230, and a database 1250 is used to store data.

[0221] The computing device 1200 also includes an access device 1240, which enables the computing device 1200 to communicate via one or more networks 1260. 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 1240 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.

[0222] In one embodiment of this specification, the aforementioned components of the computing device 1200 and Figure 12 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 12 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.

[0223] The computing device 1200 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 1200 can also be a mobile or stationary server.

[0224] The processor 1220 is used to execute the following computer program / instructions, which, when executed by the processor, implement the steps of the above-mentioned data processing method and the training method of the generative model.

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

[0226] 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 the training method for the generative model.

[0227] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the technical solutions of the data processing method and the generative model training method described above. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solutions of the data processing method and the generative model training method described above.

[0228] An embodiment of this specification also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described data processing method and the training method for generating a model.

[0229] 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 generative 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 generative model training method described above.

[0230] 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.

[0231] 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.

[0232] 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 this specification is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this specification. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this specification.

[0233] 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 in other embodiments.

[0234] 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 content of this specification. These embodiments have been selected and specifically described in this specification to better explain the principles and practical applications of this specification, 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, characterized in that, include: Obtain the first query information and the first associated published content corresponding to the first query information; Input the first query information and the first associated published content into a preset language model to obtain the first reply information corresponding to the first query information; Training data is generated and stored based on the first query information, the first associated published content, and the first reply information.

2. The method as described in claim 1, characterized in that, Before inputting the first query information and the first associated published content into the preset language model, the method further includes: The first query information and the first associated published content are stored in the first storage location; The first query information and the first associated published content are input into a preset language model to obtain the first response information corresponding to the first query information, including: The first query information and the first associated published content are obtained from the first storage location, and the first query information and the first associated published content are input into a preset language model to obtain the first reply information corresponding to the first query information.

3. The method as described in claim 1, characterized in that, Retrieving the first associated published content corresponding to the first query information includes: Input the first query information into a preset feature extraction model to obtain the query information features; From the preset published content feature library, a target published content feature that matches the first query information feature is determined, and the published content corresponding to the target published content feature is taken as the first associated published content.

4. The method as described in claim 1, characterized in that, Training data is generated and stored based on the first query information, the first associated published content, and the first reply information, including: The first response information is optimized and adjusted to obtain an optimized response information; Training data is generated and stored based on the optimized response information, the first associated published content, and the first query information.

5. The method according to any one of claims 1 to 4, characterized in that, Training data is generated and stored based on the first query information, the first associated published content, and the first reply information, including: The first associated published content and the first query information are used as benchmark information, and the target matching degree between the benchmark information and the first reply information is determined. If the target matching degree is determined to meet the preset conditions, the benchmark information and the first response information are used as training data and stored in the second storage location.

6. The method as described in claim 5, characterized in that, The method further includes: If it is determined that the target matching degree does not meet the preset conditions, the first associated published content and the first reply information corresponding to the query information are regenerated.

7. The method as described in claim 5, characterized in that, Determining the target matching degree between the benchmark information and the first response information includes: The baseline information and the first response information are input into a natural language reasoning model. The baseline information is used as a premise and the first response information is used as an assumption to obtain the predictive logical relationship between the baseline information and the first response information. Based on the predicted logical relationship, the target matching degree between the benchmark information and the first response information is determined.

8. A method for training a generative model, characterized in that, include: Acquire training data, wherein the training data includes sample first query information, sample first associated published content and tag first reply information corresponding to the sample first query information, and the training data is obtained based on any one of the methods of claims 1 to 7 above; Input the first query information of the sample and the first associated published content of the sample into the initial generation model to obtain the predicted response information; The initial generation model is trained based on the predicted response information and the first response information of the label to obtain the target generation model.

9. A method for generating responses, applied to cloud-side devices, characterized in that, include: The receiving end device sends a response generation request, wherein the response generation request carries second query information; Retrieve the second associated published content corresponding to the second query information; The second query information and the second associated published content are input into the target generation model to obtain the second response information corresponding to the second query information, wherein the target generation model is obtained based on the training method of claim 8 above; The second response information is sent to the end-side device.

10. A data processing apparatus, characterized in that, include: The first acquisition module is configured to acquire first query information and acquire first associated published content corresponding to the first query information; The first input module is configured to input the first query information and the first associated published content into a preset language model to obtain the first reply information corresponding to the first query information; The generation module is configured to generate and store training data based on the first query information, the first associated published content, and the first reply information.

11. A training apparatus for a generative model, characterized in that, include: The second acquisition module is configured to acquire training data, wherein the training data includes sample first query information, sample first associated publication content and tag first reply information corresponding to the sample first query information, and the training data is obtained based on any one of the methods of claims 1 to 7 above; The second input module is configured to input the first query information of the sample and the first associated published content of the sample into the initial generation model to obtain the predicted response information; The training module is configured to train the initial generation model based on the predicted response information and the first response information of the label to obtain the target generation model.

12. A computing device, characterized in that, include: 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 9.

13. A computer-readable storage medium storing a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 9.

14. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 9.