A sample enhancement and optimization method for consistency learning

By extracting knowledge and constructing samples from unstructured text in vertical domains, generating semantically consistent positive samples and introducing misleading negative samples, and combining contrastive learning and learning rate scheduling, the training of large models is optimized. This solves the problems of insufficient knowledge coverage and noise interference in the construction of vertical domain samples, and improves the adaptability and robustness of the model.

CN120929892BActive Publication Date: 2026-01-09ZHEJIANG UNIV HIGH-END EQUIP RES INST
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511455023.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-13
Publication Date
2026-01-09
Estimated Expiration
2045-10-13

AI Technical Summary

Technical Problem

Existing technologies suffer from insufficient domain knowledge coverage, limited semantic diversity, and noise interference when constructing vertical domain samples. This results in insufficient deep understanding and robust expression of professional knowledge in the model, and the lack of dynamic optimization mechanisms during training leads to overfitting or unstable convergence.

Method used

By extracting knowledge from unstructured text, positive samples with consistent semantics but diverse forms are generated, and misleading information is introduced to construct negative samples. By combining contrastive learning and learning rate scheduling strategies, the ratio of positive to negative samples and the weight of the loss function are dynamically adjusted to optimize the training process of large models.

Benefits of technology

It improves the adaptability and robustness of large models in vertical domains, reduces the probability of irrelevant information and incorrect answers, ensures the high quality and logical integrity of training data, and enhances the model's ability to identify erroneous information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120929892B_ABST
    Figure CN120929892B_ABST
Patent Text Reader

Abstract

The application discloses a sample enhancement and optimization method for consistency learning, comprising the following steps: knowledge extraction is respectively performed on professional knowledge materials, professional vocabulary interpretation, historical practice data and expert experience set in unstructured text to obtain original question and answer pairs and obtain a professional knowledge base; the original question and answer pairs are processed through a diversification strategy to generate enhanced sample question and answer pairs which are semantically consistent but various in form, the enhanced sample question and answer pairs are expanded or simplified to obtain positive samples; interference expressions or factual errors are introduced into the enhanced sample question and answer pairs to obtain negative samples; the positive and negative sample proportions are adjusted according to the accuracy of a large model; the positive and negative samples are taken as training data, and a professional large model is obtained through parameter fine-tuning based on a pre-trained large model and the professional knowledge base. The application improves the adaptability and robustness of the large model in different scenarios and reduces the probability of occurrence of irrelevant information and incorrect answers.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence, and in particular to a sample enhancement and optimization method for consistency learning. BACKGROUND

[0002] In the application of large models in vertical fields, the construction of high-quality training samples is the core foundation for improving the adaptability of models in the field. Traditional sample construction methods often face problems such as insufficient coverage of domain knowledge, limited semantic diversity, and noise interference, which restrict the depth of the model's understanding of professional knowledge and its robust expression ability. Existing technologies mainly revolve around two types of methods: data enhancement technology and positive and negative sample optimization construction technology, but there are still significant technical bottlenecks.

[0003] (1) Data enhancement technology: generate diverse samples through text transformation to improve the generalization ability of the model. Typical methods include back-translation, syntactic structure transformation, entity replacement, etc. The advantage of this type of technology is that it can expand the dataset without modifying the model parameters, but its limitations are: ① Knowledge extraction relies on shallow rules, making it difficult to extract fine-grained term relationships and logical structures from unstructured data such as device logs and expert manuals; ② The generated samples are mostly surface-level transformations, and the semantic consistency and domain expertise are difficult to guarantee, which can easily introduce noise interference; ③ Lack of systematic design of negative samples, resulting in insufficient anti-misleading ability of the model.

[0004] (2) Positive and negative sample optimization construction technology: by constructing a combination of negative samples containing misleading information and high-consistency positive samples, the model's ability to accurately distinguish domain knowledge is strengthened. However, existing methods have the following defects: ① Positive sample generation mostly uses a single templating strategy (such as synonym replacement), resulting in rigid question-answer pair forms that are difficult to cover complex expressions in real scenarios; ② Negative sample construction relies on random interference (such as entity replacement errors), lacks targeted design based on domain knowledge conflicts, and reduces training effectiveness; ③ Lack of dynamic optimization mechanism in the training phase, fixed positive and negative sample ratio easily leads to model overfitting or unstable convergence.

[0005] In recent years, hybrid construction methods have attempted to combine knowledge enhancement and adversarial generation strategies, such as improving the professionalism of positive samples through knowledge graph injection, or generating negative samples through adversarial networks. However, such methods still have key problems: ① Knowledge base construction relies on manually annotated structured data, making it difficult to efficiently utilize implicit knowledge in unstructured text; ② The sample generation and model training processes are disjointed, without a designed collaborative optimization mechanism, resulting in low knowledge injection efficiency; ③ Training strategy is static, unable to adapt to sample difficulty distribution in stages, restricting the model's progressive learning ability for complex logical relationships.

[0006] Therefore, there is an urgent need for a sample construction method oriented to vertical fields to realize efficient extraction of unstructured knowledge, controllable semantic diversity of sample generation, and dynamic collaborative optimization of the training process, so as to break through the constraints of the prior art on field specialization, data quality, and model convergence stability. SUMMARY

[0007] In view of the deficiencies of the prior art, the present application provides a sample enhancement and optimization method oriented to consistent learning.

[0008] The specific technical solutions are as follows:

[0009] A sample enhancement and optimization method oriented to consistent learning, comprising the following steps:

[0010] S1: The professional knowledge materials, professional vocabulary interpretation, historical practice data and expert experience set in the unstructured text are respectively subjected to knowledge extraction to obtain original question and answer pairs, and a professional knowledge base for downstream tasks in the vertical field is obtained by set storage;

[0011] S2: The original question and answer pairs are processed by a diversification strategy to generate enhanced sample question and answer pairs with consistent semantics but various forms, the enhanced sample question and answer pairs are expanded or simplified to obtain positive samples, interference expressions or factual errors are introduced into the enhanced sample question and answer pairs to obtain negative samples, and the positive and negative sample proportions are adjusted according to the accuracy of a large model;

[0012] S3: The positive and negative samples are used as training data, and a professional large model is obtained by parameter fine-tuning based on a pre-trained large model and a professional knowledge base; during the fine-tuning of the large model, consistency constraints are applied to the positive samples to make the answers generated by the large model closer to the original standard answers in semantics and content, and the original standard answers are the answers in the positive samples; for the negative samples, reverse consistency constraints are applied to make the output results of the large model far away from the wrong or misleading answers, thereby enhancing the discrimination ability and robustness of the large model.

[0013] Further, in S1, the professional knowledge materials include: professional equipment structure, operation process specification, problem troubleshooting guide;

[0014] The professional vocabulary interpretation includes: technical term explanation, application scenario example, concept correlation diagram;

[0015] The historical practice data include: monitoring data, job log, customer management system record;

[0016] The expert experience set includes: problem determination rule set, logical analysis rule set.

[0017] Further, the knowledge extraction for the professional knowledge data specifically comprises: collecting associated information in the specific neighborhood professional document by using a character recognition software; constructing a semantic network by using an intelligent text analysis system, and extracting key information elements by using a feature association algorithm; performing semantic modeling by using a deep neural network based on a Transformer architecture, accurately identifying sentence units containing three core dimensions in the key information elements, and generating question and answer pairs in a structure form of "problem manifestation, evaluation method + countermeasures"; the three core dimensions are: abnormal representation, quantitative evaluation, and disposal strategy.

[0018] The knowledge extraction for the professional vocabulary interpretation specifically comprises: constructing a term analysis engine based on knowledge graph technology, systematically extracting vocabulary ontology definition, applicable context, and associated characteristics; performing deep semantic processing on the structured information extracted by the term analysis engine by using a neural network architecture driven by an attention mechanism, identifying core sentence units containing term association fault manifestations, term adaptation evaluation standards, and term specification application schemes, accurately capturing and fusing multi-dimensional semantic features thereof, and finally generating question and answer pairs in a structure form of "problem manifestation, evaluation method + countermeasures";

[0019] The knowledge extraction for the historical practice data specifically comprises: implementing a data purification process based on the structured features of the data, that is, using a pattern recognition algorithm to complete noise elimination, format specification, and abnormal symbol filtering to obtain standardized data; performing deep semantic analysis on the standardized data by using a bidirectional Transformer model, extracting technical elements containing abnormal features, detection standards, and processing schemes, and finally generating question and answer pairs in a structure form of "problem manifestation, evaluation method + countermeasures";

[0020] The knowledge extraction for the expert experience set specifically comprises: constructing a diagnostic rule base and a logical reasoning base according to the expert experience; the diagnostic rule base contains specific standards, conditions, and bases for problem determination, and the logical reasoning base contains paths, steps, and thinking logic for problem solving; integrating the diagnostic rule base and the logical reasoning base to construct a multi-level knowledge topology system; applying a graph neural network to perform representation learning on the rule levels, capturing complex associations and hierarchical structures between rules, and combining a decision tree algorithm to realize intelligent retrieval and path reasoning of knowledge nodes, and finally generating question and answer pairs in a structure form of "problem manifestation, evaluation method + countermeasures" and fusing rule base level information.

[0021] Further, the S2 is specifically implemented by the following sub-steps:

[0022] S2.1: sample enhancement is performed on each original question and answer pair in the professional knowledge base to obtain enhanced samples; the sample enhancement method comprises: back translation, syntactic structure transformation, and entity replacement;

[0023] applying the back-translation method to the original question-answer pair to generate a new question-answer pair with the same semantics but different forms, including: translating the original question-answer pair from a source language to a target language, and then translating it back to the source language;

[0024] applying the syntactic structure transformation method to the original question-answer pair to generate a new question-answer pair, including: performing syntactic analysis on the original question-answer pair to identify key components of the sentence, including: subject, predicate, and object; and reconstructing the question based on the key components of the sentence, including: adjusting the order of the sentence, introducing synonyms, converting the voice, splitting or merging the sentence;

[0025] applying the entity replacement method to the original question-answer pair to generate a new question-answer pair, including: identifying various entities in the original question-answer pair, and replacing the original entities with entities of the same category or related categories to expand the coverage and diversity of the sample while ensuring that the replaced question-answer pair is semantically reasonable and correct;

[0026] S2.2: Constructing negative samples based on the augmented samples, including: inserting incorrect diagnostic steps in the answers of the augmented samples to form logical interference type negative samples; randomly combining questions and answers in different augmented samples to establish incorrect associations to form semantic confusion type negative samples; and adjusting the standard operation flow step order of the answers of the augmented samples to form timing disorder type negative samples;

[0027] At the same time, the questions and answers in the augmented samples are expanded or simplified to obtain positive samples; wherein, expanding the question includes adding background information, detailed description or related questions; simplifying the question includes removing redundant information and non-key descriptions; expanding the answer specifically includes supplementing principles, specific cases, related information or adjusting the expression style without deviating from the core meaning, making the answer more comprehensive and concrete; simplifying the answer specifically includes focusing on retaining the core conclusion or fact, and deleting secondary explanation, redundant modification or compressing details, making the answer more direct and concise.

[0028] Further, in the back-translation method, multiple translation models are selected to perform back-translation operations on the same original question-answer pair to obtain question-answer pairs with the same semantics and multiple forms.

[0029] Further, in S2, the proportion of positive and negative samples is adjusted according to the accuracy of the large model, specifically:

[0030] According to the task requirement, the accuracy of the large model on the verification set is monitored in real time, when the accuracy does not reach the first preset threshold, the initial proportion of the positive sample is kept higher than that of the negative sample, so as to preferentially cultivate the correct understanding of the core knowledge and the basic reasoning ability of the large model; when the accuracy reaches the first preset threshold, the proportion of the negative sample is gradually increased by a preset step until the target proportion is reached, and the diversity index is verified to ensure that the adjusted training data can still balance the coverage of the task scene, so as to dynamically adapt the large model training stage and the task characteristics; the diversity index includes sample semantic coverage and expression type distribution.

[0031] Further, in S3, in the large model fine-tuning process, a contrast learning strategy is adopted, and the contrast loss is set as: minimizing the representation distance of the original question and answer pair and the positive sample in the hidden space, and maximizing the representation difference between the original question and answer pair and the negative sample;

[0032] At the same time, the cross-entropy is used to optimize the question and answer generation task, and the task loss includes positive sample constraint loss and negative sample constraint loss; the positive sample constraint loss is to minimize the deviation degree of the output obtained by inputting the positive sample into the large model and the answer in the positive sample, and the negative sample constraint loss is to maximize the deviation degree of the output obtained by inputting the negative sample into the large model and the answer in the negative sample;

[0033] According to the training accuracy, the weights of the contrast loss and the task loss are dynamically adjusted: when the model accuracy does not reach the preset threshold during the large model training, the weights of the task loss and the contrast loss are kept as the initial weight value; when the basic accuracy reaches the preset threshold, the weight of the contrast loss is gradually increased until the target weight is reached.

[0034] Further, in S3, in the initial stage of the large model training, the accuracy of the large model on the verification set does not reach the second preset threshold, the weights of the task loss and the contrast loss are kept as the initial weight value, and the weight of the task loss is higher than that of the contrast loss; this stage focuses on the stability of the basic performance of the large model, taking the accuracy and generalization ability of the large model on the basic task as the optimization target, to ensure that the large model can correctly output the core task under the standard input condition, and the core task output includes: understanding fault phenomenon, reasoning fault reason, and generating maintenance scheme; in this stage, the consistency learning is introduced in the form of low-intensity regularization, and the consistency constraint set for the positive sample can not only make the output of the large model stable and close to the original standard answer, but also avoid the interference of the over-strong consistency requirement on the convergence path of the model; a moderate learning rate scheduling strategy is adopted in the training process to ensure the gradual convergence of the parameters of the large model; the moderate learning rate scheduling strategy includes linear preheating and slow decay.

[0035] When the base accuracy on the validation set reaches the second preset threshold for multiple rounds in succession, the training enters the later stage, and the weight of the contrast loss is gradually increased by a preset step until the target weight is reached, guiding the large model to strengthen the semantic consistency and discrimination ability of the representation space; at the same time, the reasoning consistency of the large model is strengthened in the later stage of the large model fine-tuning: in this stage, the consistency learning is taken as the optimization target, the weight of the positive sample consistency constraint is increased, and the negative sample misleading information is introduced to impose a reverse consistency constraint on the large model output, so that the large model can still maintain the correct reasoning track when encountering disturbance information; gradient clipping and learning rate scheduling strategies are adopted, and the balance coefficient of the contrast loss and the task loss in the loss function is dynamically adjusted to avoid overfitting of the consistency target and cause the base performance to decline.

[0036] A sample enhancement and optimization device for consistency learning, comprising a memory and one or more processors, the memory storing executable code, and the one or more processors executing the executable code to implement the sample enhancement and optimization method for consistency learning.

[0037] A computer-readable storage medium having a program stored thereon, the program being executed by a processor to implement the sample enhancement and optimization method for consistency learning.

[0038] The beneficial effects of the present application are:

[0039] The present application ensures the high quality and logical integrity of the training data through the designed positive and negative sample generation strategy; in the positive sample construction, diversified text transformation techniques are used to generate semantically equivalent but formally diverse question and answer pairs, effectively enriching the input and output modes of the model; in the negative sample construction, the recognition ability of the model to incorrect information is enhanced by introducing misleading information and logical errors. The present application not only improves the adaptability and robustness of the large model in different scenarios, but also significantly reduces the probability of occurrence of irrelevant information and incorrect answers. BRIEF DESCRIPTION OF DRAWINGS

[0040] Figure 1 is a flowchart of the sample enhancement and optimization method for consistency learning in the embodiments of the present application.

[0041] Figure 2 is a flowchart of the method for constructing positive and negative samples in the embodiments of the present application.

[0042] Figure 3 is a structural schematic diagram of the sample enhancement and optimization device for consistency learning in the embodiments of the present application. DETAILED DESCRIPTION

[0043] The present application will be described in further detail below with reference to the drawings and preferred embodiments, the objects and effects of the present application will become more apparent. It should be understood that the specific embodiments described herein are merely intended to explain the present application and are not intended to limit the present application.

[0044] Before the embodiments of the present application are further described, the terms and phrases involved in the embodiments of the present application are explained, and the terms and phrases involved in the embodiments of the present application are applicable to the following explanations.

[0045] (1) Contrastive learning strategy: Contrastive learning is a feature representation learning method based on sample relationship modeling, which guides large language models to learn discriminative feature representations in embedding space by constructing contrastive relationships between positive and negative samples. The core mechanism of this method is to apply vector space distance compression constraints to semantically similar instances (positive sample pairs), while applying vector space distance expansion constraints to unrelated instances (negative sample pairs), thereby forming a feature distribution structure with high discriminability.

[0046] (2) Learning rate scheduling strategy: Learning rate scheduling is a core control mechanism in the training process of deep learning models, which dynamically adjusts the parameter update step to achieve fine control of the training process. This strategy designs a differentiated learning rate adjustment scheme based on the characteristics of the training phase: a higher learning rate is used in the early stage to accelerate model convergence, a gradual decay is used in the middle stage to balance exploration and development, and a slight adjustment is implemented in the later stage to achieve fine tuning.

[0047] (3) Gradient clipping: In the training process of deep learning models, gradient clipping is a key means to deal with gradient explosion and ensure training stability. Unlike the situation where free growth of gradients may lead to excessive parameter update and difficulty in model convergence, gradient clipping limits the gradient by setting a reasonable threshold. When the calculated gradient norm exceeds the preset threshold, the gradient is scaled by a certain percentage to control it within the threshold range before being used for parameter update, achieving a balance between gradient size and training stability. However, gradient clipping also has certain limitations. On the one hand, if the threshold is not properly set, it may excessively suppress effective gradient information, affecting the convergence speed and learning effect of the model; on the other hand, for different model structures and task scenarios, the threshold parameter needs to be repeatedly adjusted to achieve the best effect, which to some extent increases the tuning cost in the training process.

[0048] (4) Latent Space: refers to a low-dimensional continuous vector space that a deep learning model maps the original high-dimensional data to through a nonlinear transformation, where each point (vector) represents a compressed representation of data features. This concept is the core of deep learning generative models (such as GAN, VAE, autoencoder, etc.), and its essence is to realize efficient data representation, generation, and manipulation through data compression and feature decoupling.

[0049] Based on the above architecture, the embodiment of the present application proposes a sample enhancement and optimization method for consistent learning, as shown in Figure 1 The method comprises the following steps:

[0050] S1: Constructing a professional knowledge base: extract and integrate key information of various types, form various question and answer pairs (question + answer), and store them as original question and answer pairs (i.e. initial samples) in the professional knowledge base. Key information categories include: professional knowledge materials, professional vocabulary interpretation, historical practice data, and expert experience collection. Use natural language processing (Natural Language Processing, hereinafter referred to as NLP) and knowledge engineering comprehensive technology to collect key information in unstructured text, analyze it through a deep learning model (such as BERT, GPT, etc. Text processing model), filter and refine the core points, and generate question and answer pairs for archiving. This process aims to ensure the high quality and logicality of the information, and at the same time improve the clarity and reliability of the question and answer.

[0051] The specific content and knowledge extraction operation of various key information is as follows:

[0052] Professional knowledge materials, i.e. knowledge documents related to specific fields, including: professional equipment structure, operation process specification, problem troubleshooting guide. The operation of knowledge extraction for professional knowledge materials is as follows: first, use the character recognition software to collect the associated information in the professional documents of the specific domain; then, use the intelligent text analysis system to construct the semantic network, and extract the key information elements through the feature association algorithm. Further, use the deep neural network based on the Transformer architecture to model the semantics, accurately identify the sentence units containing the three core dimensions (abnormal representation, quantitative evaluation, and disposal strategy) in the key information elements, and finally generate question and answer pairs in the structure of "problem performance, evaluation method + response measures".

[0053] Professional vocabulary interpretation, which is the systematic explanation of professional terms and concepts in the field, includes: technical term explanation, application scenario example, concept correlation diagram. The operation of knowledge extraction for professional vocabulary interpretation is: based on the knowledge graph technology, a term analysis engine is constructed to systematically extract the ontology definition, application context and correlation characteristics of the vocabulary. Through the attention mechanism driven neural network architecture (such as Transformer-based model), the structured information extracted by the term analysis engine is subjected to deep semantic processing, accurately identifying the core sentence units containing term correlation fault performance, term adaptation evaluation standard and term specification application scheme, accurately capturing and fusing the multi-dimensional semantic features, and finally generating the question and answer pairs in the structure of "problem performance, evaluation method + response measures".

[0054] Historical practice data, which is the retention of multiple types of information data during business operation and maintenance, includes: monitoring data, job logs, customer management system records, etc. The operation of knowledge extraction for historical practice data is: based on the structured features of the data, a data purification process is implemented, that is, noise elimination, format specification and abnormal symbol filtering are completed using pattern recognition algorithms to obtain standardized data. The standardized data is subjected to deep semantic analysis using a bidirectional Transformer model (such as BERT and its variants) to extract technical elements containing abnormal features, detection standards and processing schemes, and finally generate question and answer pairs in the structure of "problem performance, evaluation method + response measures".

[0055] Expert experience set, which is the problem diagnosis and solution experience accumulated by domain experts in long-term practice, includes: problem determination rule set, logical analysis rule set. The operation of knowledge extraction for expert experience set is: constructing a diagnosis rule base and a logical reasoning base according to expert experience; the diagnosis rule base contains specific standards, conditions and basis for problem determination, and the logical reasoning base contains paths, steps and thinking logic for problem solving. Integrate the diagnosis rule base and the logical reasoning base to build a multi-level knowledge topology system. Apply graph neural networks to represent and learn the rule hierarchy, capture the complex associations and hierarchical structure between rules, and combine decision tree algorithms to realize intelligent retrieval and path reasoning of knowledge nodes, finally generate question and answer pairs in the structure of "problem performance, evaluation method + response measures" and fuse the rule base level information.

[0056] S2: Construct positive and negative samples as training data for subsequent large model training. Specifically, process the original question and answer pairs in the professional knowledge base through diversification strategies to generate positive samples with consistent semantics but various forms, optimize the problem statement while ensuring the correctness of the answer; set negative samples to contain misleading information.

[0057] Further, the proportion of positive and negative samples is dynamically adjusted. Specifically, according to the task requirements, it is monitored in real time whether the accuracy of the large model on the validation set reaches a first preset threshold (an index threshold for judging whether the large model masters the core knowledge base, and the proportion of negative samples can be increased, the core of which is to guide the composition of training data), when the accuracy does not reach the first preset threshold, the initial proportion of positive samples is automatically maintained to be higher than that of negative samples (such as positive:negative = 5:1), to preferentially cultivate the large model's correct understanding of the core knowledge and basic reasoning ability; when the accuracy reaches the first preset threshold, the proportion of negative samples is gradually increased by a preset step until it reaches the target proportion (such as increasing the proportion of negative samples by 10% in each training, until the target proportion of positive:negative = 2:1 is adjusted), while checking the diversity indexes such as semantic coverage and expression type distribution of the sample, to ensure that the adjusted training data can still balance the coverage of the task scene, so as to dynamically adapt the large model training stage and the task characteristics, flexibly adjust the proportion of positive and negative samples, and ensure the diversity and balance of the training data, thereby providing high-quality and expressive data support for large model training.

[0058] As shown in Figure 2 , the construction of positive and negative samples is specifically implemented through the following sub-steps:

[0059] S2.1: Through any one of the following three ways, the initial samples in the professional knowledge base are enhanced to obtain enhanced samples:

[0060] (1) The original question and answer pair is enhanced by using back-translation technology. Specifically, the original question and answer pair is first translated from the source language to the target language by a translation model, and then translated back to the source language, thereby generating a question and answer pair with consistent semantics but different forms. Further, different translation models are used to obtain more question and answer pairs with the same semantics and multiple forms. By selecting multiple translation models and question and answer pair combinations, the sample expression form can be enriched and the diversity of training data can be improved.

[0061] (2) The original question and answer pair is enhanced by using syntactic structure transformation. Specifically, first, syntactic analysis is performed on the original question and answer pair to accurately identify the subject, predicate, object and other key components of the sentence. Second, the problem is reconstructed by adjusting the sentence order, introducing synonym replacement, converting the voice, splitting or merging the sentence, etc. to generate new question and answer pairs, thereby improving the large model's understanding ability of different expression forms.

[0062] (3) The original question and answer pair is enhanced by using entity replacement technology. Specifically, first, various entities in the original question and answer pair are accurately identified, and then entities of the same category or related categories are used to replace the original entities, thereby generating new question and answer pairs, so as to expand the coverage and diversity of the samples, while ensuring that the replaced question and answer pairs are reasonable and correct in semantics.

[0063] S2.2: Construct negative samples based on augmented samples, and use multiple generation methods for negative sample construction, including: inserting incorrect diagnostic steps in the answers of augmented samples to form negative samples of logical interference type; randomly combining different questions and answers to establish incorrect associations between questions and answers, forming negative samples of semantic confusion type; and swapping the standard operation process step order of the answers of augmented samples to form negative samples of timing disorder type.

[0064] At the same time, by expanding or simplifying the questions and answers in the augmented samples, positive samples are obtained. Specifically, for the questions, they can be expanded, i.e., by adding background information, detailed descriptions, or related questions to enrich their specificity and information content; or they can be simplified, i.e., by removing redundant information and non-critical descriptions to make the questions more concise and clear. As for the answers, similar logic processing can be applied: when expanding, the principle explanation, specific cases, related information, or adjustment of expression style can be supplemented without deviating from the core meaning, making the answers more comprehensive and concrete; when simplifying, the core conclusions or facts are focused on, and secondary explanations, redundant modifications, or details are deleted or compressed, making the answers more direct and concise. By using this combination of expansion and simplification for both questions and answers, question and answer pairs of different lengths and complexities can be generated, thereby enriching the expression forms of the samples and effectively improving the coverage, diversity, and applicability of the dataset.

[0065] S3: Using the training data, a professional large model is obtained by fine-tuning the pre-trained large model and the professional knowledge base, realizing the deep injection of large models in specific domain knowledge. During parameter fine-tuning, a contrast learning strategy is adopted to minimize the representation distance of the original question and answer pair and the positive sample question and answer pair in the hidden space (to make the large model maintain semantic consistency in the feature space by representing tightness), and to maximize the representation difference between the original question and answer pair and the negative sample question and answer pair (to improve the large model's ability to identify and distinguish tampered or incorrect information, and to ensure that the large model forms a clear positive and negative sample discrimination boundary in the feature space), taking these two as the contrast loss.

[0066] At the same time, the cross-entropy is used to optimize the question and answer generation task, and the task loss includes positive sample constraint loss and negative sample constraint loss. For positive samples, the original standard answer (i.e., the answer in the positive sample) is taken as the target, and the cross-entropy is used to quantify the deviation of the output obtained by inputting the question of the positive sample into the large model from the original standard answer - the closer the output is to the original answer, the smaller the task loss (specifically, the positive sample constraint loss), thereby forcing the large model to maintain consistent reasoning under different expressions. For negative samples, the cross-entropy is also used for constraint. If the output obtained by inputting the question of the negative sample into the large model is close to the incorrect answer (i.e., the answer in the negative sample), it will significantly differ from the original standard answer, resulting in a sharp increase in the task loss (specifically, the negative sample constraint loss), thereby forcing the large model to avoid being misled by incorrect information.

[0067] In the early stage of large model training, the basic accuracy on the validation set does not reach the second preset threshold, the weights of the task loss and the contrast loss are maintained, both are initial weight values, and the weight of the task loss is higher than that of the contrast loss, which prioritizes the accuracy of the large model output in this stage; when the basic accuracy on the validation set reaches the second preset threshold stably for many rounds in succession, the training enters the later stage, the weight of the contrast loss is gradually increased by a preset step until it reaches the target weight, guiding the large model to strengthen the semantic consistency and discrimination ability of the representation space. The second preset threshold is an index threshold for judging whether the large model has basic output accuracy and can be turned to strengthen semantic consistency. The core design is to guide the weight distribution of the loss function.

[0068] In the consistency aspect, the early stage of training focuses on the stability of the basic performance of the large model: in this stage, the accuracy and generalization ability of the large model on the basic task are the main optimization targets, and the core task outputs such as the ability of the large model to correctly understand fault phenomena, reason fault causes, and generate maintenance plans under standard input conditions are mainly guaranteed. In this stage, consistency learning is introduced in the form of low-intensity regularization, only a weak consistency constraint (less than 0.2 in this embodiment) is set for positive samples, prompting the large model output to be stable and close to the original standard answer, while avoiding the interference of too strong consistency requirements on the model convergence path. During the training process, a small weight of the consistency constraint is used for positive samples, and a moderate learning rate scheduling strategy (i.e. linear preheating + slow decay) is used to ensure that the parameters of the large model gradually converge and lay a solid foundation for the basic performance.

[0069] The later stage of training strengthens the reasoning consistency of the large model: the later stage of fine-tuning turns to strengthen the consistent reasoning ability of the large model under non-standard conditions such as input disturbance and expression change. At this time, consistency learning becomes the main optimization target, by increasing the weight of the consistency constraint for positive samples and introducing misleading information for negative samples, the loss value (i.e. penalty) is increased for the behavior of outputting wrong answers for negative samples, forcing the large model to move away from the wrong answers, prompting the large model to maintain the correct reasoning track when encountering disturbance information, and enhancing the discrimination ability and robustness of the large model. During training, the difficulty of the samples is simultaneously improved, and strategies such as synonym rewriting, information default, and sequence disturbance are introduced for input problems to enhance the diversity of training data, so that the large model can maintain consistent reasoning for "core correct but various effective inputs", and positively guide the large model to adapt to the diversity of effective inputs. In order to ensure the stability of the training in the strengthening stage, gradient clipping (limiting the maximum gradient norm) and learning rate scheduling strategy are used, and the balance coefficient of the contrast loss and the task loss in the loss function is dynamically adjusted to avoid overfitting to the consistency target and causing the basic performance to decline.

[0070] On the basis of the sample enhancement and optimization method for consistency learning, the application further provides a sample enhancement and optimization device for consistency learning. Figure 3 As shown in the figure, the device comprises a memory and one or more processors, the memory stores executable code, and the one or more processors execute the executable code to implement the sample enhancement and optimization method for consistency learning in the above embodiments.

[0071] The sample enhancement and optimization device for consistency learning can be applied to any device with data processing capability, which can be a device such as a computer or the like. The sample enhancement and optimization device for consistency learning can be realized by software, or by hardware or a combination of software and hardware. Taking software realization as an example, as a logical device, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory for running by the processor of the device with data processing capability. Figure 3 As shown in the figure, it is a hardware structure diagram of the device with data processing capability where the sample enhancement and optimization device for consistency learning is located, in addition to the processor, the memory, the network interface, and the non-volatile memory shown in the figure, the device with data processing capability where the system of the embodiment is located usually comprises other hardware according to the actual functions of the device with data processing capability, and details are not described herein. Figure 3 As shown in the figure, it is a hardware structure diagram of the device with data processing capability where the sample enhancement and optimization device for consistency learning is located, in addition to the processor, the memory, the network interface, and the non-volatile memory shown in the figure, the device with data processing capability where the system of the embodiment is located usually comprises other hardware according to the actual functions of the device with data processing capability, and details are not described herein.

[0072] The implementation process of the functions and roles of each unit in the above device is specifically described in the implementation process of the corresponding steps in the above method, and details are not described herein.

[0073] For the device embodiment, since it basically corresponds to the method embodiment, the related parts are described in the part of the method embodiment. The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or distributed on multiple network units. According to actual needs, part or all of the modules can be selected to achieve the purpose of the application scheme. Those skilled in the art can understand and implement without creative labor.

[0074] The embodiment of the application further provides a computer readable storage medium, which stores a program, and the program is executed by a processor to implement the sample enhancement and optimization method for consistency learning in the above embodiments.

[0075] The computer readable storage medium can be an internal storage unit of any data processing capable device of any of the preceding embodiments, such as a hard disk or a memory. The computer readable storage medium can also be an external storage device of any data processing capable device, such as a plug-in hard disk, a Smart Media Card (SMC), an SD card, a Flash Card, etc. equipped on the device. Further, the computer readable storage medium can include both an internal storage unit and an external storage device of any data processing capable device. The computer readable storage medium is used to store computer programs and other programs and data required by any data processing capable device, and can also be used to temporarily store data that has been output or will be output.

[0076] The application designs positive and negative sample construction strategies, generates semantically consistent but formally diverse positive sample question and answer pairs by using diversified text transformation technology, introduces misleading information and logical errors to construct negative samples, ensures the high quality and logical integrity of the training data, and improves the question and answer accuracy of the large model. Secondly, combined with the contrast learning strategy and the learning rate scheduling strategy, the accuracy, stability and adaptability of the large model in the task are improved.

[0077] It should be noted that in this paper, the term "includes", "contains" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the sentence "includes a" does not exclude the presence of another identical element in the process, method, article or device including the element.

[0078] The above only describes the preferred embodiments of the present application, which enables those skilled in the art to understand or implement the present application, and is not intended to limit the present application. For those skilled in the art, the present application can have various changes and variations, and various modifications of the embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A sample augmentation and optimization method for consistency learning, characterized in that, Includes the following steps: S1: Extract knowledge from unstructured texts containing professional knowledge materials, interpretations of professional terms, historical practice data, and expert experience sets to obtain original question-answer pairs. Store these pairs to obtain a professional knowledge base for downstream tasks in vertical domains. S2: Process the original question-answer pairs using diversified strategies to generate semantically consistent but diverse augmented sample question-answer pairs. Expand or simplify the augmented sample question-answer pairs to obtain positive samples. Introduce interfering statements or factual errors into the augmented sample question-answer pairs to obtain negative samples. Adjust the ratio of positive to negative samples based on the accuracy of the large model. S3: The positive and negative samples are used as training data, and the parameters are fine-tuned based on the pre-trained large model and the professional knowledge base to obtain a professional large model; during the fine-tuning of the large model, a consistency constraint is applied to the positive samples to make the answers generated by the large model closer to the original standard answers in terms of semantics and content, and the original standard answers are the answers in the positive samples; for the negative samples, a reverse consistency constraint is applied to make the output results of the large model far away from incorrect or misleading answers, thereby enhancing the discrimination ability and robustness of the large model; In S2, the ratio of positive to negative samples is adjusted according to the accuracy of the large model, specifically as follows: Based on task requirements, the accuracy of the large model on the validation set is monitored in real time. When the accuracy does not reach the first preset threshold, the proportion of positive samples is kept higher than the initial proportion of negative samples to prioritize the training of the large model's correct understanding of core knowledge and basic reasoning ability. When the accuracy reaches the first preset threshold, the proportion of negative samples is gradually increased according to a preset step size until the target proportion is reached. At the same time, diversity indicators are checked to ensure that the adjusted training data can still evenly cover the task scenario, so as to dynamically adapt to the training stage of the large model and the characteristics of the task. The diversity indicators include sample semantic coverage and expression type distribution.

2. The sample augmentation and optimization method for consistency learning according to claim 1, characterized in that, In S1, the professional knowledge information includes: professional equipment structure, operating procedure specifications, and troubleshooting guidelines; The explanation of the technical terms includes: technical terminology explanations, application scenario examples, and conceptual association diagrams; The historical practice data includes: monitoring data, work logs, and customer management system records; The set of expert experience includes: a set of problem-determination rules and a set of logical analysis rules.

3. The sample augmentation and optimization method for consistency learning according to claim 2, characterized in that, The specific steps for knowledge extraction from the aforementioned professional knowledge materials are as follows: Using text recognition software to collect relevant information within professional documents in a specific field; constructing a semantic network using an intelligent text parsing system and extracting key information elements through feature association algorithms; and performing semantic modeling using a deep neural network based on the Transformer architecture to accurately identify sentence units containing three core dimensions within the key information elements, generating question-answer pairs that conform to the structure of "problem manifestation, evaluation method + countermeasures"; the three core dimensions are: anomaly representation, quantitative evaluation, and handling strategy. The specific steps for knowledge extraction for the interpretation of the professional terms are as follows: A terminology parsing engine is constructed based on knowledge graph technology to systematically extract the terminology ontology definition, applicable context, and related characteristics; through an attention-driven neural network architecture, the structured information extracted by the terminology parsing engine undergoes deep semantic processing to identify core sentence units containing terminology association failure manifestations, terminology adaptation evaluation standards, and terminology standard application schemes, thereby achieving accurate capture and fusion of its multi-dimensional semantic features, and ultimately generating question-answer pairs conforming to the structure of "problem manifestation, evaluation method + countermeasures"; The specific steps for knowledge extraction from the historical practice data are as follows: Based on the structured features of the data, a data purification process is implemented, namely, using pattern recognition algorithms to complete noise elimination, format reduction, and abnormal symbol filtering to obtain standardized data; a bidirectional Transformer model is used to perform deep semantic parsing on the standardized data to extract technical elements that simultaneously contain abnormal features, detection standards, and processing solutions, and finally generate question-answer pairs that conform to the structure of "problem manifestation, evaluation method + countermeasures"; The specific steps for knowledge extraction from the expert experience set are as follows: A diagnostic rule base and a logical reasoning base are constructed based on expert experience. The diagnostic rule base contains specific standards, conditions, and bases for problem judgment, while the logical reasoning base contains the problem-solving path, steps, and logical thinking. The diagnostic rule base and the logical reasoning base are integrated to construct a multi-level knowledge topology system. A graph neural network is applied to perform representation learning on the rule hierarchy, capturing the complex relationships and hierarchical structure between rules. A decision tree algorithm is then combined to achieve intelligent retrieval and path reasoning of knowledge nodes, ultimately generating question-answer pairs that conform to the structure of "problem presentation, evaluation method + countermeasures" and integrate hierarchical information from the rule base.

4. The sample augmentation and optimization method for consistency learning according to claim 1, characterized in that, S2 is specifically implemented through the following sub-steps: S2.1: Perform sample enhancement on each original question-answer pair in the professional knowledge base to obtain enhanced samples; the sample enhancement methods include: back translation, syntactic structure transformation, and entity substitution; The original question-and-answer pairs are enhanced using the back-translation method described above: the original question-and-answer pairs are translated from the source language to the target language through a translation model, and then translated back to the source language to generate question-and-answer pairs that are semantically consistent but have different forms. The original question-answer pairs are enhanced using the syntactic structure transformation method described above: syntactic analysis is performed on the original question-answer pairs to identify key components of the sentences; the key components include: subject, predicate, and object; the questions are reconstructed based on the key components of the sentences to generate new question-answer pairs; the methods of reconstructing the questions include: adjusting the word order of the sentences, introducing synonyms for substitution, changing the voice, splitting or merging sentences; The original question-and-answer pairs are enhanced by using the entity replacement method: identifying various entities in the original question-and-answer pairs, replacing the original entities with entities of the same or related categories, generating new question-and-answer pairs, thereby expanding the coverage and diversity of the samples, while ensuring that the replaced question-and-answer pairs remain semantically reasonable and correct. S2.2: Construct negative samples based on augmented samples. The construction methods include: inserting incorrect diagnostic steps into the answers of augmented samples to form logical interference type negative samples; randomly combining questions and answers from different augmented samples to establish question-answer pairs with incorrect associations to form semantic confusion type negative samples; and rearranging the order of standard operation process steps in the answers of augmented samples to form temporally disordered type negative samples. Simultaneously, the questions and answers in the enhanced samples are expanded or simplified to obtain positive samples. Expanding the questions includes adding background information, detailed descriptions, or related questions; simplifying the questions includes removing redundant information and non-critical descriptions; expanding the answers specifically involves supplementing explanations of principles, specific examples, related information, or adjusting the style of expression without deviating from the core meaning, making the answers more comprehensive and concrete; simplifying the answers specifically involves focusing on retaining core conclusions or facts, deleting secondary explanations, redundant embellishments, or compressing details, making the answers more direct and concise.

5. The sample augmentation and optimization method for consistency learning according to claim 4, characterized in that, In the back-translation method, multiple translation models are selected to perform back-translation operations on the same original question-answer pair, resulting in question-answer pairs with the same semantics but in multiple forms.

6. The sample augmentation and optimization method for consistency learning according to claim 1, characterized in that, In S3, during the fine-tuning of the large model, a contrastive learning strategy is adopted, and the contrastive loss is set as follows: minimizing the representation distance between the original question-answer pair and the positive sample in the latent space, and maximizing the representation difference between the original question-answer pair and the negative sample; Meanwhile, the question-answering generation task is optimized through cross-entropy, and the task loss is set to include positive sample constraint loss and negative sample constraint loss. The positive sample constraint loss is to minimize the deviation between the output obtained by the large model with positive sample input and the answer in the positive sample, and the negative sample constraint loss is to maximize the deviation between the output obtained by the large model with negative sample input and the answer in the negative sample. The weights of contrastive loss and task loss are dynamically adjusted based on the training accuracy: When training a large model, if the model accuracy does not reach the preset threshold, the weights of task loss and contrastive loss are kept at the initial weight values; when the basic accuracy reaches the preset threshold, the weight of contrastive loss is gradually increased until the target weight is reached.

7. The sample augmentation and optimization method for consistency learning according to claim 6, characterized in that, In S3, during the initial training phase of the large model, when the model's accuracy on the validation set has not reached the second preset threshold, the weights of the task loss and the contrastive loss are maintained at their initial values, with the task loss weight higher than the contrastive loss weight. This stage focuses on stabilizing the large model's basic performance, optimizing its accuracy and generalization ability for basic tasks. It ensures the large model can correctly output core tasks under standard input conditions, including understanding fault phenomena, reasoning about fault causes, and generating repair solutions. In this stage, consistency learning is introduced with low-intensity regularization. The consistency constraints set on positive samples ensure that the large model's output stably approximates the original standard answer while avoiding excessive consistency requirements from interfering with the model's convergence path. A gentle learning rate scheduling strategy is employed during training to ensure the large model's parameters gradually converge. This gentle learning rate scheduling strategy includes linear warm-up and slow decay. Once the baseline accuracy on the validation set has consistently reached the second preset threshold for multiple rounds, training enters the later stage. The weight of the contrastive loss is gradually increased by a preset step size until the target weight is reached, guiding the large model to strengthen the semantic consistency and discriminative ability of the representation space. Simultaneously, in the later stage of large model fine-tuning, the inference consistency of the large model is strengthened: this stage aims at consistency learning, by increasing the weight of positive sample consistency constraints and introducing misleading information from negative samples to impose reverse consistency constraints on the output of the large model, enabling the large model to maintain the correct inference trajectory when encountering perturbation information. Gradient pruning and learning rate scheduling strategies are adopted, and the balance coefficients of contrastive loss and task loss are dynamically adjusted in the loss function to avoid overfitting the consistency target and causing a decline in basic performance.

8. A sample augmentation and optimization device for consistency learning, characterized in that, The device includes a memory and one or more processors, wherein the memory stores executable code, and the one or more processors execute the executable code to implement the sample augmentation and optimization method for consistency learning as described in any one of claims 1-7.

9. A computer-readable storage medium, characterized in that, It stores a program that, when executed by a processor, implements the sample augmentation and optimization method for consistency-oriented learning as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Chaotic engineering fault drilling scene generation method and device, equipment and storage medium

    CN115828103A

  • Large language model knowledge correction method based on adaptive comparative learning

    CN119808952A

  • Knowledge enhancement large model development method for high-end equipment fault diagnosis

    CN120448483A