Text auditing model training method and device, storage medium and equipment

CN121144848BActive Publication Date: 2026-10-27GUANGDONG UCAP INTERNET INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511320028.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-16
Publication Date
2026-10-27
Estimated Expiration
2045-09-16

AI Technical Summary

Technical Problem

[0004]本申请提供了一种文本的审核模型训练方法、装置、存储介质及设备,用于解决采用规则引擎或BERT系模型进行审核时,误报率较高,需要人工复核,采用大语言模型进行审核时,响应延迟高,运维成本高的问题

Benefits of technology

[0014]本申请提供的技术方案的有益效果至少包括:

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121144848B_ABST
    Figure CN121144848B_ABST
Patent Text Reader

Abstract

The application discloses a text auditing model training method and device, a storage medium and equipment, and belongs to the technical field of deep learning. Auditing data obtained after initial auditing of a text is acquired, and each piece of auditing data includes original text and error correction suggestions; double-channel vector extraction is performed on the auditing data, triple clustering algorithm is used to cluster the double-channel vectors, and representative auditing data is screened; the auditing data is labeled by using multiple large language models, the multiple large language models are optimized by using the labeling results, and the auditing data is labeled again by using the optimized multiple large language models; prompt words are created for the labeled auditing data, the prompt words and the auditing data are combined to form training data; and one optimal large language model is trained by using a cold start-GRPO reinforcement learning-rejection sampling training framework and the training data, so that an auditing model is obtained. The application can balance the auditing precision and processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of deep learning technology, and in particular to a method, apparatus, storage medium and device for training a text review model. Background Technology

[0002] With the widespread application of artificial intelligence technology in the monitoring field, the basic monitoring layer has become a crucial guarantee for the secure operation of various systems. However, existing basic monitoring systems generally face the technical bottleneck of high false alarm rates. Currently, internet text moderation systems mainly rely on traditional rule engines and Bidirectional Encoder Representations from Transformers (BERT) models. Rule engines, based on keyword matching and pattern recognition, are fast but lack deep semantic understanding. When faced with complex situations such as variant words, homophones, and metaphorical expressions, they generate a large number of false positives. While BERT models improve semantic understanding to some extent, their statically pre-trained models are difficult to adapt to the rapid evolution of online language, and their recognition accuracy in complex semantic scenarios such as contextual relevance and cultural differences is limited, especially in handling content from specialized vertical domains. These technical limitations lead to persistently high false alarm rates in text moderation systems, forcing companies to establish large-scale human review teams for secondary verification. Manual review not only incurs huge human resource costs, but also causes inconsistent review standards and large fluctuations in quality due to differences in the subjective judgment of reviewers, which directly affects the fairness and consistency of content governance.

[0003] The emergence of large language model technology in recent years has brought new possibilities to content moderation. These models exhibit powerful semantic understanding capabilities, contextual reasoning abilities, and broad knowledge coverage, theoretically capable of significantly reducing false positive rates. However, in practical engineering applications, large language models reveal serious resource consumption issues: on the one hand, model inference requires substantial computing resources, and the response latency of a single request often exceeds acceptable business limits; on the other hand, model deployment requires high-end graphics processing unit (GPU) clusters, resulting in high operational costs. These factors make it difficult to directly apply large language models to production environments that require real-time processing of massive amounts of content. Summary of the Invention

[0004] This application provides a method, apparatus, storage medium, and device for training a text review model, to address the problems of high false positive rates and the need for manual review when using rule engines or BERT-based models for review, and high response latency and high maintenance costs when using large language models for review. The technical solution is as follows: According to a first aspect of this application, a method for training a text review model is provided, the method comprising: Obtain multiple sets of review data after the text model performs an initial review of the text. Each set of review data includes the original text and correction suggestions. The audit data is subjected to dual-channel vector extraction, and the dual-channel vectors are clustered using a triple clustering algorithm. Representative audit data is then selected from the clustering results. The review data is labeled using multiple large language models, the labeling results are used to optimize the multiple large language models, and the optimized multiple large language models are used to label the review data again. The labeling results are used to indicate whether the error correction suggestions are accurate. Create prompt words for the labeled review data, and combine the prompt words and the review data to form training data; The GRPO reinforcement learning-rejection sampling training framework, optimized using a cold start-group relative strategy, and the training data are used to train an optimal large language model to obtain the audit model.

[0005] In one possible implementation, the step of extracting dual-channel vectors from the audit data and clustering the dual-channel vectors using a triple clustering algorithm includes: For multiple original texts with similar error correction suggestions, the TF-IDF weighted word vectors are extracted from the multiple original texts using the TF-IDF inverse document frequency (IDF) algorithm, and the BERT sentence vectors are extracted from the multiple original texts using the transformer-based bidirectional encoder BERT model. The TF-IDF weighted word vectors are clustered using a sentence similarity matching algorithm to obtain the first clustering result; The BERT sentence vectors were clustered using the K-means clustering algorithm and the density-based noisy DBSCAN algorithm, respectively, to obtain the second and third clustering results. The first clustering result, the second clustering result, and the third clustering result are merged to obtain the final clustering result.

[0006] In one possible implementation, the step of annotating the review data using multiple large language models and optimizing the multiple large language models using the annotation results includes: For each piece of audit data selected from the clustering results, multiple large language models are used to label the audit data respectively; Filter the audited data with consistent annotation results from all large language models, and combine the audited data and the corresponding annotation results to form optimized data; The optimized data was used to optimize multiple large language models.

[0007] In one possible implementation, the step of re-annotating the review data using multiple optimized large language models includes: For each piece of audit data selected from the clustering results, the audit data is labeled again using multiple optimized large language models; If the consistency of multiple annotation results exceeds a preset threshold, the annotation result will be taken as the final annotation result of the audit data. If the consistency of multiple annotation results is lower than a preset threshold, the audit data will be manually annotated, and the manually annotated result will be used as the final annotation result of the audit data.

[0008] In one possible implementation, training an optimal large language model using the cold start-GRPO reinforcement learning-rejection sampling training framework and the training data includes: During cold-start training of the optimal large language model, the model parameters of the large language model are updated based on the training data using the low-rank adaptive LoRa fine-tuning technique.

[0009] In one possible implementation, training an optimal large language model using the cold start-GRPO reinforcement learning-rejection sampling training framework and the training data includes: When training the large language model using GRPO reinforcement learning, the large language model is used to process the audit data in each set of training data to obtain the first prediction result; The first prediction result is parsed in a format. If the parsing is successful, the first prediction result is compared with the labeled result in the training data. If the first prediction result is consistent with the annotation result, a reward score is calculated for the error correction suggestion using a preset reward function; otherwise, the reward score is set to 0. The GRPO strategy is used to update the model parameters of the large language model based on the reward score.

[0010] In one possible implementation, training an optimal large language model using the cold start-GRPO reinforcement learning-rejection sampling training framework and the training data includes: When training the large language model using rejection sampling, the large language model is used to process the audit data in each group of training data to obtain a second prediction result; Based on the annotation results, select the correct and concise second prediction results from all the second prediction results; The selected second prediction results are used to perform supervised fine-tuning SFT training on the large language model to obtain the audit model.

[0011] According to a second aspect of this application, a text review model training apparatus is provided, the apparatus comprising: The acquisition module is used to acquire multiple sets of review data obtained after the text model performs an initial review of the text. Each set of review data includes the original text and correction suggestions. The filtering module is used to extract dual-channel vectors from the audit data, cluster the dual-channel vectors using a triple clustering algorithm, and filter representative audit data from the clustering results. The annotation module is used to annotate the review data using multiple large language models, optimize the multiple large language models using the annotation results, and annotate the review data again using the optimized multiple large language models. The annotation results are used to indicate whether the error correction suggestions are accurate. A module is created to generate prompt words for the labeled review data, and the prompt words and the review data are combined to form training data. The training module is used to train an optimal large language model using the cold start-group relative strategy optimized GRPO reinforcement learning-rejection sampling training framework and the training data to obtain the audit model.

[0012] According to a third aspect of this application, a computer-readable storage medium is provided, wherein at least one instruction is stored therein, the at least one instruction being loaded and executed by a processor to implement the text review model training method as described above.

[0013] According to a fourth aspect of this application, a computer device is provided, the computer device including a training apparatus for an auditing model of the aforementioned text.

[0014] The beneficial effects of the technical solution provided in this application include at least the following: First, a text model performs an initial review of the text, then a large language model is introduced for deeper review. This approach retains the traditional text model as the first layer of filtering, fully leveraging its high throughput to quickly process obviously inappropriate content; it also allows the large language model to handle complex content that is difficult to judge at the first layer, ensuring overall processing efficiency while achieving a non-linear reduction in the false positive rate through the deep semantic understanding capabilities of the large language model. This layered review architecture effectively solves the dual dilemmas of insufficient semantic understanding in traditional solutions and excessive resource consumption of large models, providing a new technical path for content security review. Through reasonable resource allocation and technological complementarity, a balance between review accuracy and processing efficiency is achieved.

[0015] By extracting dual-channel vectors from the audit data and using a triple clustering algorithm to cluster the dual-channel vectors, representative audit data is selected from the clustering results, thereby achieving data cleaning through deduplication.

[0016] The review data is labeled using multiple large language models. The labeling results are then used to optimize the multiple large language models. The optimized large language models are then used to label the review data again. Prompt words are created for the labeled review data. The prompt words and review data are combined to form training data. In this way, the autoregressive labeling driven by swarm intelligence and the game equilibrium of multi-model collaborative labeling can approximate the Bayesian optimal solution of the labeling task, thus constructing a high-quality training set covering the decision space.

[0017] By employing a cold-start-GRPO reinforcement learning-rejection sampling training framework and training data, an optimal large language model is trained to obtain an auditing model. This model, through a three-stage progressive training paradigm, achieves knowledge distillation and inference optimization in vertical domains, meeting the dual requirements of lightweight models and real-time response in edge computing scenarios. Specifically, reward function-guided GRPO reinforcement learning effectively aligns the model's inference path with human thought patterns, while rejection sampling optimization achieves Pareto optimal allocation of computational resources through probability space compression. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a flowchart of a text review model training method provided in one embodiment of this application; Figure 2 This is a flowchart of a text review model training method provided in one embodiment of this application; Figure 3 This is a training diagram of GRPO reinforcement learning provided in one embodiment of this application; Figure 4 This is a training diagram illustrating rejection sampling provided in one embodiment of this application; Figure 5 This is a schematic diagram of the training process of the audit model provided in one embodiment of this application; Figure 6 This is a structural block diagram of a text review model training device provided in one embodiment of this application. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0021] like Figure 1 The diagram illustrates a flowchart of a text review model training method according to an embodiment of this application. This text review model training method can be applied to a computer device. The text review model training method may include: Step 101: Obtain multiple sets of review data after the text model performs an initial review of the text. Each set of review data includes the original text and correction suggestions.

[0022] The text model in this embodiment can be the text review system mentioned above. Its text review process can be referred to the description in related technologies, which will not be repeated here.

[0023] The original text of the audited data contained erroneous sensitive words, and the correction suggestion is to modify the erroneous sensitive words. For example, the original text is "The address of Qimen Dunjia Naming Hall is located at No. xx, Taiqing Palace Street, Zhujianlu Street", and the correction suggestion is "The use of Qimen Dunjia is prohibited".

[0024] Step 102: Extract dual-channel vectors from the audit data, cluster the dual-channel vectors using a triple clustering algorithm, and select representative audit data from the clustering results.

[0025] The dual-channel vectors include word vectors and sentence vectors. In one example, the word vectors can be term frequency-inverse document frequency (TF-IDF) weighted word vectors, and the sentence vectors can be sentence vectors based on a bidirectional encoder representation from transformers (BERT).

[0026] Triple clustering algorithms are three types of clustering algorithms, including but not limited to: K-means clustering, Density-Based Spatial Clustering of Applications with Noise (DBSCAN), and sentence similarity matching algorithms. Sentence similarity matching algorithms can employ various matching algorithms, such as the SimHash algorithm.

[0027] When using the triple clustering algorithm to cluster dual-channel vectors, multiple original texts with similar error correction suggestions can be clustered from different perspectives. Then, representative review data can be selected from the clustering results. This can remove semantically similar scenarios with the same word, sentence structure similar scenarios with the same word, and scenarios with similar error causes with different words, thereby achieving the goal of cleaning data by selecting typical data from massive amounts of data.

[0028] In practical applications, the amount of audit data can be reduced from 50 million to 30,000, which greatly reduces the amount of data that needs to be audited again and improves audit efficiency.

[0029] Step 103: Use multiple large language models to annotate the audit data, use the annotation results to optimize the multiple large language models, and use the optimized multiple large language models to annotate the audit data again. The annotation results are used to indicate whether the error correction suggestions are accurate.

[0030] In this embodiment, multiple Large Language Models (LLMs) can be combined to form an expert committee, which automatically labels the review data using a show of hands. The consistently labeled review data is retained as training data to train the members of the expert committee, which are then used to form a new expert committee. After multiple iterations, high-quality training data is obtained. Review data that has generated objections in each iteration round is then compiled into a difficult dataset, which is then manually labeled. Throughout the entire iteration process, the amount of data manually labeled is less than one-tenth of the total data.

[0031] Step 104: Create prompt words for the labeled review data, and combine the prompt words and review data to form training data.

[0032] Specifically, a prompt word engineering approach is used to obtain a prompt word template library. From this library, prompt word templates are retrieved for each type of error correction suggestion. For example, one prompt word template corresponds to each type of date and time error correction suggestion, and another corresponds to each type of common typos error correction suggestion. Then, prompt words are generated for the corresponding category of review data based on the prompt word templates. The review data and the prompt words are then combined to form training data.

[0033] The input for each training data set includes the audit data and prompt words, and the output includes the analysis process and annotation results.

[0034] Step 105: Train an optimal large language model using the cold start-GRPO reinforcement learning-rejection sampling training framework and training data to obtain the audit model.

[0035] In this embodiment, a large language model is selected from multiple optimized large language models, and a three-stage training framework and training data are used to train this large language model. The trained large language model is referred to as the review model. The first stage performs cold start training on the large language model, the second stage performs Group Relative Policy Optimization (GRPO) reinforcement learning training on the training results of the first stage, and the third stage performs rejection sampling training on the training results of the second stage.

[0036] In summary, the text review model training method provided in this application first performs an initial review of the text using a text model, and then introduces a large language model for deep review. This retains the traditional text model as the first layer of filtering, fully leveraging its high throughput to quickly process obviously inappropriate content; it also uses the large language model to handle complex content that is difficult to judge at the first layer, ensuring overall processing efficiency while achieving a non-linear reduction in the false positive rate through the deep semantic understanding capabilities of the large language model. This layered review architecture effectively solves the dual dilemmas of insufficient semantic understanding in traditional solutions and excessive resource consumption of large models, providing a new technical path for content security review. Through reasonable resource allocation and technological complementarity, a balance between review accuracy and processing efficiency is achieved.

[0037] like Figure 2 The diagram illustrates a flowchart of a text review model training method according to an embodiment of this application. This text review model training method can be applied to a computer device. The text review model training method may include: Step 201: Obtain multiple sets of review data after the text model performs an initial review of the text. Each set of review data includes the original text and correction suggestions.

[0038] The text model in this embodiment can be the text review system mentioned above. Its text review process can be referred to the description in related technologies, which will not be repeated here.

[0039] Step 202: Extract dual-channel vectors from the audit data, cluster the dual-channel vectors using a triple clustering algorithm, and select representative audit data from the clustering results.

[0040] Assuming the dual-channel vectors include TF-IDF weighted word vectors and BERT sentence vectors, and the triple clustering algorithms include K-means, DBSCAN, and sentence similarity matching, then extracting dual-channel vectors from the audit data and clustering them using triple clustering algorithms can include: (1) For multiple original texts with similar error correction suggestions, the TF-IDF algorithm is used to extract TF-IDF weighted word vectors from multiple original texts, and the BERT model is used to extract BERT sentence vectors from multiple original texts.

[0041] In this embodiment, error correction suggestions can be categorized. For example, suggestions including date and time can be grouped into one category, suggestions including common typos can be grouped into another category, and so on. For each category of error correction suggestions, the original text corresponding to each suggestion is obtained. TF-IDF weighted word vectors are extracted from these original texts using the TF-IDF algorithm, and BERT sentence vectors are extracted from these original texts using the BERT model. The extraction process will not be elaborated here.

[0042] (2) Cluster the TF-IDF weighted word vectors using the sentence similarity matching algorithm to obtain the first clustering result.

[0043] (3) Use the K-means algorithm and the DBSCAN algorithm to cluster the BERT sentence vectors respectively to obtain the second clustering result and the third clustering result.

[0044] (4) The first clustering result, the second clustering result and the third clustering result are merged to obtain the final clustering result.

[0045] When merging the results of the first, second, and third clustering, multiple clusters containing the same original text can be merged. For example, if an original text is located in both the first cluster and the second cluster, the first and second clusters can be merged.

[0046] After obtaining the clustering results, a small number of representative audit data can be selected from each cluster. The number of audit data to be selected can be set according to business needs, and there is no limit here.

[0047] Step 203: For each piece of audit data selected from the clustering results, the audit data is labeled using multiple large language models; the audit data with consistent labeling results from all large language models is selected, and the audit data and the corresponding labeling results are combined to form optimized data; the optimized data is used to optimize multiple large language models.

[0048] In this embodiment, multiple large language models can be combined into an expert committee, which will automatically annotate the reviewed data using a show of hands. The annotation results are used to indicate whether the error correction suggestions are accurate.

[0049] For each piece of review data, the data is input into each large language model within the expert committee. Each model processes the data and generates a labeling result indicating whether the correction suggestion is accurate. Then, the labeling results from each large language model in the expert committee are statistically analyzed. If all large language models indicate the correction suggestion is accurate, or if all models indicate it is incorrect, the review data and its labeling results are considered as a set of optimized data. If some large language models indicate the correction suggestion is accurate and others indicate it is incorrect, the review data is not considered optimized data.

[0050] All optimization data was compiled and used to optimize each large language model in the expert committee. Specifically, the review data from the optimization data can be used as input, and the labeled results can be used as ground truth to train each large language model.

[0051] Step 204: For each piece of audit data selected from the clustering results, the audit data is annotated again using multiple optimized large language models. If the consistency of the multiple annotation results is higher than the preset threshold, the annotation result is taken as the final annotation result of the audit data. If the consistency of the multiple annotation results is lower than the preset threshold, the audit data is manually annotated, and the manually annotated result is taken as the final annotation result of the audit data.

[0052] For each set of review data, the data is input into each large language model within the optimized expert committee. Each large language model then processes the data again, generating a labeling result indicating whether the correction suggestion is accurate. Next, the labeling results for each set of review data are compared to determine if they are identical. If both labels for a set of review data indicate the correction suggestion is accurate, or if both labels indicate the correction suggestion is incorrect, then the labeling result is considered accurate. If one labeling result indicates the correction suggestion is accurate and the other indicates it is incorrect, then the labeling result is considered inaccurate.

[0053] If each execution of steps 203-204 is considered a round of annotation, then steps 203-204 can be executed repeatedly to achieve multiple rounds of annotation. During each round of annotation, the results of two consecutive annotations are compared. If the consistency of multiple annotation results is higher than a preset threshold, then that annotation result can be used as the final annotation result for the review data; if the consistency of multiple annotation results is lower than the preset threshold, then it can be provided to the user for manual annotation. The preset threshold can be set according to business needs and is not limited here.

[0054] In this embodiment, manually annotated review data and annotation results can be combined into a test set to verify the performance of the trained review model.

[0055] Step 205: Create prompt words for the labeled review data, and combine the prompt words and review data to form training data.

[0056] Specifically, a prompt word engineering approach is used to obtain a prompt word template library. From this library, prompt word templates are retrieved for each type of error correction suggestion. For example, one prompt word template corresponds to each type of date and time error correction suggestion, and another corresponds to each type of common typos error correction suggestion. Then, prompt words are generated for the corresponding category of review data based on the prompt word templates. The review data and the prompt words are then combined to form training data.

[0057] The input for each training data set includes the audit data and prompt words, and the output includes the analysis process and annotation results.

[0058] Step 206: Use the cold start-GRPO reinforcement learning-rejection sampling training framework and training data to train an optimal large language model to obtain the audit model.

[0059] In this embodiment, an optimal large language model is selected from multiple optimized large language models. A three-stage training framework and training data are used to train this large language model, which is then referred to as the "audit model." The first stage involves cold-start training of the large language model; the second stage uses the training results from the first stage for GRPO reinforcement learning training; and the third stage uses the training results from the second stage for rejection sampling training.

[0060] (1) First stage When performing cold-start training on the optimal large language model, the low-rank adaptation of large language models (Lora) fine-tuning technique is used to update the model parameters of the large language model based on the training data.

[0061] By using LoRa fine-tuning technology to achieve domain transfer, the accuracy of the large language model on the vertical domain test set was improved from 67.3% to 81.2%.

[0062] (2) Second stage When training a large language model using GRPO reinforcement learning, the large language model processes the review data in each training set to obtain the first prediction result. The first prediction result is then parsed. If the parsing is successful, the first prediction result is compared with the labeled result in the training data. If the first prediction result matches the labeled result, a reward score is calculated for the error correction suggestion using a preset reward function. Otherwise, the reward score is set to 0. The GRPO strategy is then used to update the model parameters of the large language model based on the reward score.

[0063] After analyzing the first prediction result, the following analysis results can be obtained: { Analysis: Specific case analysis Result: Correct or False Alarm } like Figure 3 As shown, if the first prediction result matches the annotation result, a reward score can be calculated for the error correction suggestion based on logical coherence, rule completeness, and factual consistency using a preset reward function; if the first prediction result does not match the annotation result, the reward score is directly set to 0. Finally, the GRPO strategy is used to update the model parameters of the large language model based on the reward score.

[0064] (3) Third stage When training a large language model using rejection sampling, the large language model is used to process the review data in each training data set to obtain a second prediction result. Based on the annotation results, the correct and concise second prediction results are selected from all the second prediction results. The selected second prediction results are then used to train the large language model using supervised fine-tuning (SFT) to obtain the review model.

[0065] like Figure 4 As shown, when performing the correct / incorrect filtering, the second prediction result that is consistent with the annotation result can be selected from multiple second prediction results; when performing the length filtering, the shortest second prediction result can be selected from multiple second prediction results; the second prediction result that meets both filtering conditions is used to train the large language model using SFT to obtain the final review model.

[0066] like Figure 5 As shown, assuming the review data is the original error-sensitive report data, it can be cleaned using algorithms such as K-means, DBScan, and sentence similarity to obtain the data to be labeled. Multiple LLMs from the expert committee are used to label the data to be labeled. Based on the labeling results, these LLMs are iteratively optimized, and then the optimized LLMs are used to perform secondary labeling. Consistent data with consistency exceeding a preset threshold is selected, and prompt words are generated from these data to form the training data. Difficult data with consistency below a preset threshold is selected, and these data are manually labeled to form the test set for model validation. The training data is used to train an optimal LLM using cold start-GRPO reinforcement learning-rejection sampling to obtain the final review model.

[0067] Below is a comparison of the parameters of the audit model with other models: Compared with models with the same number of parameters: the trained model scored 91.5 on the test set, which is 35.82% higher than the baseline model's 67.3, verifying the effectiveness of the data loop augmentation strategy and training reward function; in the final training stage, the model improved by about 13 points in the cold start stage, about 10 points in the GRPO stage, and the model response time in the rejection stage was 42% of that before training.

[0068] Cross-parameter model comparison: With only 1 / 10 of the parameters of Qwen2.5-72B-Instruct (72 billion parameters), its performance surpasses it by 12.34% (91 vs 81), breaking the "large model performance barrier" and setting a benchmark for lightweight vertical domain capabilities; Human-machine review comparison: The model scored 91, which is 28.17% higher than the average score of human annotation (71 points), demonstrating the significant advantage of large models in understanding complex semantics.

[0069] Inference resource consumption: The number of model parameters is reduced to 1 / 10 of the original, and the inference latency is reduced by 95% (72B→7B model). The model can support single-card deployment and is suitable for edge computing scenarios.

[0070] In summary, the text review model training method provided in this application first performs an initial review of the text using a text model, and then introduces a large language model for deep review. This retains the traditional text model as the first layer of filtering, fully leveraging its high throughput to quickly process obviously inappropriate content; it also uses the large language model to handle complex content that is difficult to judge at the first layer, ensuring overall processing efficiency while achieving a non-linear reduction in the false positive rate through the deep semantic understanding capabilities of the large language model. This layered review architecture effectively solves the dual dilemmas of insufficient semantic understanding in traditional solutions and excessive resource consumption of large models, providing a new technical path for content security review. Through reasonable resource allocation and technological complementarity, a balance between review accuracy and processing efficiency is achieved.

[0071] like Figure 6 The diagram illustrates a structural block diagram of a text review model training apparatus according to an embodiment of this application. This text review model training apparatus can be applied to a computer device, and the apparatus includes: The acquisition module 610 is used to acquire multiple sets of review data obtained after the text model performs an initial review of the text. Each set of review data includes the original text and correction suggestions. The filtering module 620 is used to extract dual-channel vectors from the audit data, cluster the dual-channel vectors using a triple clustering algorithm, and filter representative audit data from the clustering results. The annotation module 630 is used to annotate the audit data using multiple large language models, optimize the multiple large language models using the annotation results, and annotate the audit data again using the optimized multiple large language models. The annotation results are used to indicate whether the error correction suggestions are accurate. Create module 640 to create prompt words for the labeled review data, and combine the prompt words and review data to form training data; Training module 650 is used to train an optimal large language model using a cold start-group relative strategy optimized GRPO reinforcement learning-rejection sampling training framework and training data to obtain the audit model.

[0072] In an optional embodiment, the filtering module 620 is further configured to: For multiple original texts with similar error correction suggestions, the TF-IDF weighted word vectors are extracted from the multiple original texts using the TF-IDF algorithm, and the BERT sentence vectors are extracted from the multiple original texts using the transformer-based bidirectional encoder BERT model. The TF-IDF weighted word vectors are clustered using a sentence similarity matching algorithm to obtain the first clustering result; The K-means clustering algorithm and the density-based noisy DBSCAN algorithm were used to cluster the BERT sentence vectors to obtain the second and third clustering results, respectively. The first, second, and third clustering results are merged to obtain the final clustering result.

[0073] In an optional embodiment, the annotation module 630 is further configured to: For each piece of audit data selected from the clustering results, multiple large language models are used to label the audit data separately; Filter the audited data with consistent annotation results from all large language models, and combine the audited data and the corresponding annotation results to form optimized data; Optimize multiple large language models using optimized data.

[0074] In an optional embodiment, the annotation module 630 is further configured to: For each piece of audit data selected from the clustering results, the audit data is re-annotated using multiple optimized large language models; If the consistency of multiple annotation results exceeds a preset threshold, the annotation result will be used as the final annotation result for the audited data. If the consistency of multiple annotation results is lower than the preset threshold, the audit data will be manually annotated, and the manually annotated results will be used as the final annotation results of the audit data.

[0075] In an optional embodiment, the training module 650 is further configured to: When performing cold-start training on the optimal large language model, the low-rank adaptive LoRa fine-tuning technique is used to update the model parameters of the large language model based on the training data.

[0076] In an optional embodiment, the training module 650 is further configured to: When training a large language model using GRPO reinforcement learning, the large language model is used to process the audit data in each training set to obtain the first prediction result. The format of the first prediction result is parsed. If the parsing is successful, the first prediction result is compared with the labeled result in the training data. If the first prediction result is consistent with the labeled result, the reward score for the error correction suggestion is calculated using the preset reward function; otherwise, the reward score is set to 0. The GRPO strategy is used to update the model parameters of a large language model based on reward scores.

[0077] In an optional embodiment, the training module 650 is further configured to: When training a large language model using rejection sampling, the large language model is used to process the audit data in each training data set to obtain a second prediction result. Based on the annotation results, select the correct and concise second prediction results from all the second prediction results; The selected second prediction results are used to perform supervised fine-tuning SFT training on the large language model to obtain the audit model.

[0078] In summary, the text review model training device provided in this application first performs an initial review of the text using a text model, and then introduces a large language model for in-depth review. This retains the traditional text model as the first layer of filtering, fully leveraging its high throughput to quickly process obviously inappropriate content; it also uses the large language model to handle complex content that is difficult to judge at the first layer, ensuring overall processing efficiency while achieving a non-linear reduction in the false positive rate through the deep semantic understanding capabilities of the large language model. This layered review architecture effectively solves the dual dilemmas of insufficient semantic understanding in traditional solutions and excessive resource consumption by large models, providing a new technical path for content security review. Through reasonable resource allocation and technological complementarity, a balance between review accuracy and processing efficiency is achieved.

[0079] One embodiment of this application provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to implement the text review model training method described above.

[0080] One embodiment of this application provides a computer device, which includes a training apparatus for an auditing model of any of the above-described texts.

[0081] It should be noted that the text review model training device provided in the above embodiments is only illustrated by the division of the above functional modules when training the text review model. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the text review model training device can be divided into different functional modules to complete all or part of the functions described above. In addition, the text review model training device and the text review model training method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0082] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0083] The above description is not intended to limit the embodiments of this application. Any adjustments, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of the embodiments of this application.

Claims

1. A method for training a text review model, characterized in that, The method includes: Obtain multiple sets of review data after the text model performs an initial review of the text. Each set of review data includes the original text and correction suggestions. The audit data is subjected to dual-channel vector extraction, and the dual-channel vectors are clustered using a triple clustering algorithm. Representative audit data is then selected from the clustering results. The review data is labeled using multiple large language models, the labeling results are used to optimize the multiple large language models, and the optimized multiple large language models are used to label the review data again. The labeling results are used to indicate whether the error correction suggestions are accurate. Create prompt words for the labeled review data, and combine the prompt words and the review data to form training data; The GRPO reinforcement learning-rejection sampling training framework, optimized using a cold start-group relative strategy, and the training data are used to train an optimal large language model to obtain the audit model. The process of extracting dual-channel vectors from the audit data and clustering the dual-channel vectors using a triple clustering algorithm includes: for multiple original texts with similar error correction suggestions, extracting TF-IDF weighted word vectors from the multiple original texts using the TF-IDF inverse document frequency (IDF) algorithm, and extracting BERT sentence vectors from the multiple original texts using the transformer-based bidirectional encoder BERT model; clustering the TF-IDF weighted word vectors using a sentence similarity matching algorithm to obtain a first clustering result; clustering the BERT sentence vectors using the K-means clustering algorithm and the density-based noisy clustering DBSCAN algorithm respectively to obtain a second clustering result and a third clustering result; and merging the first clustering result, the second clustering result, and the third clustering result to obtain the final clustering result. The step of using multiple large language models to annotate the review data and using the annotation results to optimize the multiple large language models includes: for each piece of review data selected from the clustering results, annotating the review data using multiple large language models respectively; selecting review data whose annotation results are consistent across all large language models, and combining the review data and the corresponding annotation results to form optimized data; and using the optimized data to optimize the multiple large language models. The step of re-annotating the review data using multiple optimized large language models includes: for each piece of review data selected from the clustering results, re-annotating the review data using multiple optimized large language models respectively; if the consistency of multiple annotation results is higher than a preset threshold, then the annotation result is taken as the final annotation result of the review data; if the consistency of multiple annotation results is lower than the preset threshold, then the review data is manually annotated, and the manually annotated result is taken as the final annotation result of the review data.

2. The text review model training method according to claim 1, characterized in that, The training of an optimal large language model using the cold start-GRPO reinforcement learning-rejection sampling training framework and the training data includes: During cold-start training of the optimal large language model, the model parameters of the large language model are updated based on the training data using the low-rank adaptive LoRa fine-tuning technique.

3. The text review model training method according to claim 2, characterized in that, The training of an optimal large language model using the cold start-GRPO reinforcement learning-rejection sampling training framework and the training data includes: When training the large language model using GRPO reinforcement learning, the large language model is used to process the audit data in each set of training data to obtain the first prediction result; The first prediction result is parsed in a format. If the parsing is successful, the first prediction result is compared with the labeled result in the training data. If the first prediction result is consistent with the annotation result, a reward score is calculated for the error correction suggestion using a preset reward function; otherwise, the reward score is set to 0. The GRPO strategy is used to update the model parameters of the large language model based on the reward score.

4. The text review model training method according to claim 2, characterized in that, The training of an optimal large language model using the cold start-GRPO reinforcement learning-rejection sampling training framework and the training data includes: When training the large language model using rejection sampling, the large language model is used to process the audit data in each group of training data to obtain a second prediction result; Based on the annotation results, select the correct and concise second prediction results from all the second prediction results; The selected second prediction results are used to perform supervised fine-tuning SFT training on the large language model to obtain the audit model.

5. A text review model training device, characterized in that, The device includes: The acquisition module is used to acquire multiple sets of review data obtained after the text model performs an initial review of the text. Each set of review data includes the original text and correction suggestions. The filtering module is used to extract dual-channel vectors from the audit data, cluster the dual-channel vectors using a triple clustering algorithm, and filter representative audit data from the clustering results. The annotation module is used to annotate the review data using multiple large language models, optimize the multiple large language models using the annotation results, and annotate the review data again using the optimized multiple large language models. The annotation results are used to indicate whether the error correction suggestions are accurate. A module is created to generate prompt words for the labeled review data, and the prompt words and the review data are combined to form training data. The training module is used to train an optimal large language model using the cold start-group relative strategy to optimize the GRPO reinforcement learning-rejection sampling training framework and the training data, thereby obtaining the audit model; The filtering module is further configured to: for multiple original texts with similar error correction suggestions, extract TF-IDF weighted word vectors from the multiple original texts using the TF-IDF algorithm, and extract BERT sentence vectors from the multiple original texts using the transformer-based bidirectional encoder BERT model; cluster the TF-IDF weighted word vectors using a sentence similarity matching algorithm to obtain a first clustering result; cluster the BERT sentence vectors using the K-means clustering algorithm and the density-based noisy clustering DBSCAN algorithm respectively to obtain a second clustering result and a third clustering result; and merge the first clustering result, the second clustering result, and the third clustering result to obtain the final clustering result. The annotation module is further configured to: annotate each piece of audit data selected from the clustering results using multiple large language models; filter audit data whose annotation results are consistent across all large language models, and combine the audit data and the corresponding annotation results into optimized data; and optimize multiple large language models using the optimized data. The annotation module is further configured to: for each piece of audit data selected from the clustering results, use multiple optimized large language models to annotate the audit data again; if the consistency of multiple annotation results is higher than a preset threshold, then the annotation result is used as the final annotation result of the audit data; if the consistency of multiple annotation results is lower than the preset threshold, then the audit data is manually annotated, and the manually annotated result is used as the final annotation result of the audit data.

6. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, which is loaded and executed by a processor to implement the text review model training method as described in any one of claims 1 to 4.

7. A computer device, characterized in that, The computer device includes: the text review model training device as described in claim 5.

Citation Information

Patent Citations

  • Intelligent data auditing method and system based on large language model fine tuning

    CN119398034A

  • Verifying and correcting training data for text classification

    US20200034482A1