A data filtering method for enhancing semantic stability of large model fine-tuning data

By using dual-model perplexity residual calculation and semantic stability calibration, the problems of resource waste and illusion recognition in data filtering are solved, achieving efficient and safe model fine-tuning and data filtering, and improving the model's learning effect and output accuracy.

CN122452684APending Publication Date: 2026-07-24GUANGDONG UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGDONG UNIV OF TECH
Filing Date
2026-05-06
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing technologies cannot effectively distinguish between high-value and low-value data during the data filtering process, resulting in wasted computing resources and model misguidance. Furthermore, they cannot identify the hallucination phenomenon of teacher models, affecting the model fine-tuning effect.

Method used

By employing a dual-model perplexity residual calculation and semantic stability calibration method, high-value training samples are accurately selected and redundant and illusory data are eliminated through perplexity residual scores and multidimensional perturbation tests of teacher and student models.

Benefits of technology

It significantly improves the efficiency and robustness of model fine-tuning, saves computing resources, ensures data security, and enhances the model's learning performance and output accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122452684A_ABST
    Figure CN122452684A_ABST
Patent Text Reader

Abstract

The application discloses a data filtering method for enhancing semantic stability of large model fine-tuning data, and belongs to the technical field of natural language processing, and comprises the following steps: S1, a teacher model is used to process a seed instruction set to generate initial response content; S2, according to the initial response content, a teacher model perplexity and a student model perplexity are generated; S3, according to the teacher model perplexity and the student model perplexity, a value quadrant is determined; S4, based on the initial response content, the value quadrant is screened; and S5, based on the screened value quadrant, a fine-tuning training set of the student model is generated. Through the innovative double-model perplexity residual error calculation and semantic stability calibration mechanism, the application realizes significant technical progress and good technical effects in multiple dimensions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of natural language processing technology, specifically relating to a data filtering method that enhances the semantic stability of large model fine-tuning data. Background Technology

[0002] With the rapid development of artificial intelligence (AI) technology, general AI technologies, represented by large-scale pre-trained language models (LLM), have become a core driving force for the digital transformation of society. In practical applications, due to the extremely high requirements of ultra-large-scale models for computing resources and response latency, researchers typically adopt the knowledge distillation paradigm of the "teacher-student" model. This involves using a powerful teacher model to generate high-quality synthetic data, which is then used to fine-tune or reinforce learning the lightweight student model, thereby achieving the transfer and generalization of model capabilities. This data augmentation technology has shown great potential in areas such as domain-specific private deployment, task-specific fine-tuning, and model alignment. However, data quality directly determines the upper limit of the learning effect of small models. How to accurately select samples with high educational value, high realism, and consistent with the current cognitive level of the student model from the massive, heterogeneous, and uncertain augmented data generated by the teacher model has become a core issue that urgently needs to be addressed in the field of natural language processing and model training optimization.

[0003] Among existing data filtering techniques, perplexity (PPL) is the most commonly used evaluation metric, aiming to measure the fluency and linguistic probability of text. However, traditional PPL filtering methods typically employ a static thresholding scheme using a single model, which has significant technical bottlenecks: First, a single model's PPL can only reflect the fluency of the text and cannot distinguish between "low-value simple repetitions" and "high-value complex knowledge," causing student models to waste computational power on a large amount of already mastered low-PPL redundant data; second, high PPL does not always represent noise and often contains some low-frequency but crucial peripheral knowledge, and a simple hard thresholding mechanism can lead to serious knowledge loss; most importantly, teacher models themselves suffer from the illusion problem, where some logically flawed but grammatically fluent incorrect answers often exhibit low PPL characteristics, and directly feeding them to student models can cause serious knowledge misguidance. In view of this, the present invention aims to design an innovative filtering method based on dual-model perplexity residuals and semantic stability calibration. By quantifying the knowledge gap between teacher and student models and introducing a perturbation test mechanism to identify potential illusions in the teacher model, the method selects high-value training samples in the "proximal development zone" for the student model, thereby significantly improving the efficiency and robustness of model fine-tuning.

[0004] Existing augmented data filtering techniques primarily focus on evaluating the "absolute quality" of the teacher model's output, i.e., filtering out text with disordered word order or low quality by setting a fixed perplexity level (PPL) threshold. This approach ignores the student model's current knowledge boundaries and learning status, resulting in a lack of "student-driven" learning. In this model, a large amount of common-sense data that is already "too simple (low perplexity)" or "too redundant" for the student model is repeatedly used for fine-tuning, leading to a significant waste of computational resources and failing to effectively address the student model's knowledge gaps. Furthermore, due to the lack of quantification of the knowledge gain (residual) between the student and teacher models, existing techniques struggle to accurately capture high-value samples in the "proximal development zone," making it difficult for small models to achieve breakthrough performance improvements within limited computational budgets.

[0005] Existing technologies often equate "low perplexity" with "high quality," assuming that text with fluent language and high probability values ​​is learnable correct knowledge. However, large language models commonly suffer from the illusion of "sounding like nonsense," where certain logical errors or falsified data often exhibit extremely high probability values ​​(i.e., extremely low PPL) in the teacher model's output, making them highly deceptive. Existing static, single-shot PPL filtering mechanisms cannot distinguish between "fluent correct conclusions" and "fluent false illusions," causing student models to inevitably absorb potential biases from the teacher model during fine-tuning or reinforcement learning. Due to the lack of semantic stability calibration (multidimensional perturbation testing) similar to that in this invention, existing technologies often compromise the model's inference accuracy and output robustness when facing logically complex or domain-specific data augmentation tasks by introducing high-quality "fake data." Summary of the Invention

[0006] To address the above problems, this invention proposes a data filtering method to enhance the semantic stability of large model fine-tuning data.

[0007] The technical solution of this invention is: a data filtering method for enhancing the semantic stability of large model fine-tuning data, comprising the following steps:

[0008] S1. Use the teacher model to process the seed instruction set and generate preliminary response content;

[0009] S2. Based on the initial response, generate the teacher model confusion level and the student model confusion level;

[0010] S3. Determine the value quadrant based on the teacher's model confusion level and the student's model confusion level;

[0011] S4. Based on the initial response content, filter the value quadrants;

[0012] S5. Based on the selected value quadrant, generate a fine-tuning training set for the student model.

[0013] Furthermore, S2 includes the following sub-steps:

[0014] S21. Convert the initial response content into a discrete marker sequence, and use the seed instruction set as a context prefix to obtain the complete input sequence;

[0015] S22. Input the complete input sequence into the teacher model and the student model respectively to obtain the prediction probability of the teacher model and the prediction probability of the student model.

[0016] S23. Calculate the average negative log-likelihood loss for the teacher model and the student model based on the predicted probabilities of the teacher model and the student model, respectively.

[0017] S24. Transform the average negative log-likelihood loss values ​​of the teacher model and the student model back into the probability space using an exponential function to obtain the perplexity of the teacher model and the perplexity of the student model.

[0018] Furthermore, the average negative log-likelihood loss of the teacher model The average negative log-likelihood loss of the student model The expressions are as follows:

[0019] ;

[0020] ;

[0021] in, This represents the teacher model's predicted probability. This represents the student model's predicted probability. Represents the logarithmic function. Indicates the total length of the sequence. Represents each token in the sequence, Indicates a context prefix, Indicates the seed instruction set;

[0022] Teacher model confusion and student model confusion The expressions are as follows:

[0023] ;

[0024] ;

[0025] in, Indicates an index. This represents an exponential function.

[0026] Furthermore, S3 includes the following sub-steps:

[0027] S31. Calculate the residual scores in logarithmic space based on the perplexity of the teacher model and the perplexity of the student model.

[0028] S32. Determine several value quadrants based on the residual scores in the logarithmic space.

[0029] Furthermore, the residual fractions in logarithmic space The expression is:

[0030] ;

[0031] in, Indicates the teacher's model confusion level. Indicates the student's model confusion level. Represents a logarithmic function.

[0032] Furthermore, the value quadrant includes the high-value quadrant, the redundancy quadrant, the anomaly quadrant, and the noisy quadrant;

[0033] The high-value quadrant is and <ɸ, where, Represents the residual fraction in logarithmic space. ɸ represents the teacher's perplexity level, and ɸ represents the threshold.

[0034] Redundant quadrants are and <ɸ;

[0035] Abnormal quadrant :

[0036] The noise quadrant is ɸ.

[0037] Furthermore, S4 includes the following sub-steps:

[0038] S41. Based on the initial response content, construct several variant sequences using perturbation operators;

[0039] S42. Input several variant sequences into the teacher model, calculate the perplexity value corresponding to each variant sequence, and obtain the probability distribution set;

[0040] S43. Calculate the mean and standard deviation of the set of probability distributions;

[0041] S44. Calculate the coefficient of variation based on the mean and standard deviation of the probability distribution set;

[0042] S45. Determine whether the coefficient of variation is less than or equal to the stability threshold. If so, retain the abnormal quadrant; otherwise, remove the abnormal quadrant.

[0043] Furthermore, the mean of the set of probability distributions and standard deviation The expressions are as follows:

[0044] ;

[0045] ;

[0046] in, Indicates the number of variant sequences. Indicates the first A variant sequence;

[0047] coefficient of variation The expression is:

[0048] .

[0049] The beneficial effects of this invention are:

[0050] (1) This invention achieves significant technological progress and good technical results in multiple dimensions through innovative dual-model perplexity residual calculation and semantic stability calibration mechanism.

[0051] (2) In terms of training efficiency and resource saving, this invention introduces the perplexity residual perceived by the student model ( The quantization technique can accurately identify and eliminate low-value redundant data already mastered by the student model, concentrating limited computing resources and memory space on high-value samples in the "proximal development zone," significantly shortening the fine-tuning cycle and reducing storage overhead. At the same time, since the calculation of PPL only requires the log-likelihood value generated by the model's forward propagation, there is no need to call expensive external discriminant models (such as GPT-4) for scoring. This greatly saves network bandwidth and API call costs in the case of massive data screening, and avoids network resource congestion caused by large-scale cross-border data transmission.

[0052] (3) In terms of data security and privacy protection, all evaluation logic of the present invention is completed in the local model inference layer, without sending sensitive augmentation data to a third-party evaluation platform, thus eliminating the risk of training data leakage from the source and meeting the compliance requirements of stringent industries such as finance and healthcare.

[0053] (4) Regarding model reliability, this invention utilizes the coefficient of variation under multidimensional perturbations (COP). The analysis effectively solves the problem that existing technologies cannot identify the "high fluency illusion", ensuring that the knowledge learned by the student model has both the high probability logic of the teacher model and the semantic stability across scenarios, thereby significantly improving the robustness and output authenticity of the final model.

[0054] (5) The dynamic threshold mechanism of the present invention allows the system to automatically adjust the data filtering tendency according to the number of training steps, realizing an automated "course learning" paradigm, which enables the model to obtain the optimal knowledge gain in different training stages, and provides a high-efficiency and high-security standardized technical path for the lightweight deployment and continuous evolution of large language models. Attached Figure Description

[0055] Figure 1 A flowchart of a data filtering method to enhance the semantic stability of fine-tuning data in large models;

[0056] Figure 2 This is a structural diagram of the robot body;

[0057] Figure 3 A schematic diagram illustrating the robot's reasoning process. Detailed Implementation

[0058] The embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0059] like Figure 1 As shown, this invention provides a data filtering method to enhance the semantic stability of large model fine-tuning data, comprising the following steps:

[0060] S1. Use the teacher model to process the seed instruction set and generate preliminary response content;

[0061] S2. Based on the initial response, generate the teacher model confusion level and the student model confusion level;

[0062] S3. Determine the value quadrant based on the teacher's model confusion level and the student's model confusion level;

[0063] S4. Based on the initial response content, filter the value quadrants;

[0064] S5. Based on the selected value quadrant, generate a fine-tuning training set for the student model.

[0065] In S1, each set of data constitutes the original augmentation pair. .

[0066] In this embodiment of the invention, S2 includes the following sub-steps:

[0067] S21. Convert the initial response content into a discrete marker sequence, and use the seed instruction set as a context prefix to obtain the complete input sequence;

[0068] S22. Input the complete input sequence into the teacher model and the student model respectively to obtain the prediction probability of the teacher model and the prediction probability of the student model.

[0069] S23. Calculate the average negative log-likelihood loss for the teacher model and the student model based on the predicted probabilities of the teacher model and the student model, respectively.

[0070] S24. Transform the average negative log-likelihood loss values ​​of the teacher model and the student model back into the probability space using an exponential function to obtain the perplexity of the teacher model and the perplexity of the student model.

[0071] The response text generated by the teacher model Transformed into discrete token sequences according to a specific tokenizer. ,in, This represents the total length of the sequence. Simultaneously, the original instructions... The complete input sequence is constructed using a context prefix. This sequence is then fed into the teacher model. and student model During the forward pass of the model, each position is extracted. The conditional probability distribution on.

[0072] In this embodiment of the invention, the average negative log-likelihood loss of the teacher model is... The average negative log-likelihood loss of the student model The expressions are as follows:

[0073] ;

[0074] ;

[0075] in, This represents the teacher model's predicted probability. This represents the student model's predicted probability. Represents the logarithmic function. Indicates the total length of the sequence. Represents each token in the sequence, Indicates a context prefix, Indicates the seed instruction set;

[0076] The loss value in logarithmic space is transformed back into probability space using an exponential function to obtain the final perplexity metric. Perplexity essentially represents the average number of choice branches the model faces when predicting the next label.

[0077] Teacher model confusion and student model confusion The expressions are as follows:

[0078] ;

[0079] ;

[0080] in, Indicates an index. This represents an exponential function.

[0081] In this embodiment of the invention, S3 includes the following sub-steps:

[0082] S31. Calculate the residual scores in logarithmic space based on the perplexity of the teacher model and the perplexity of the student model.

[0083] S32. Determine several value quadrants based on the residual scores in the logarithmic space.

[0084] In this embodiment of the invention, in order to eliminate the numerical instability caused by the exponential fluctuations of perplexity (PPL) in the probability space, the invention employs residual scores in logarithmic space. The Residual Score is the core evaluation metric. It is defined as the difference between the student model loss and the teacher model loss.

[0085] Residual fractions in logarithmic space The expression is:

[0086] ;

[0087] in, Indicates the teacher's model confusion level. Indicates the student's model confusion level. Represents a logarithmic function.

[0088] According to the properties of logarithmic operations, this formula is equivalent to:

[0089] ;

[0090] in, and These are the calculated mean negative log-likelihoods (NLL) of the student and teacher models, respectively. This score represents the average negative log-likelihood under the same instructions. In this case, the student model is better than the teacher model at predicting the target sequence. The "information gap" at that time.

[0091] according to Given the value distribution, this invention divides the enhanced data into four value quadrants to guide subsequent selection strategies, and here a threshold ɸ is introduced.

[0092] In this embodiment of the invention, the value quadrant includes a high-value quadrant, a redundant quadrant, an anomaly quadrant, and a noisy quadrant;

[0093] The high-value quadrant is and <ɸ, where, Represents the residual fraction in logarithmic space. ɸ represents the teacher's perplexity level, and ɸ represents the threshold.

[0094] Redundant quadrants are and <ɸ;

[0095] Abnormal quadrant :

[0096] The noise quadrant is ɸ.

[0097] High-value quadrant: Teachers are extremely confident in their models (knowledge is correct and expression is fluent), but students are highly confused. The "zone of proximal development" in the student model represents the most urgently needed knowledge reinforcement samples during the fine-tuning phase.

[0098] Redundancy quadrant: Both teacher and student models can easily predict this sequence. Common-sense data already mastered by students contributes very little to improving their abilities; therefore, it should be significantly downsampled during training to save computational resources.

[0099] Anomaly / Challenge Quadrant: The student model's prediction probability for this sequence is higher than that of the teacher model. This usually suggests that the samples generated by the teacher model may contain logical jumps, obscure expressions, or potential errors, or it may be a misconception of the student model. It needs to be carefully reviewed in conjunction with stability testing.

[0100] Noise quadrant: The teacher model itself is confused about the sequence. This is judged as invalid augmented data or severe model illusion.

[0101] The data located in the high-value quadrant are the most suitable for fine-tuning the student model.

[0102] In this embodiment of the invention, S4 includes the following sub-steps:

[0103] S41. Based on the initial response content, construct several variant sequences using perturbation operators;

[0104] S42. Input several variant sequences into the teacher model, calculate the perplexity value corresponding to each variant sequence, and obtain the probability distribution set;

[0105] S43. Calculate the mean and standard deviation of the set of probability distributions;

[0106] S44. Calculate the coefficient of variation based on the mean and standard deviation of the probability distribution set;

[0107] S45. Determine whether the coefficient of variation is less than or equal to the stability threshold. If so, retain the abnormal quadrant; otherwise, remove the abnormal quadrant.

[0108] This step achieves precise interception of implicit hallucination samples by performing multidimensional perturbation on the original response generated by the teacher and calculating the degree of dispersion of its perplexity distribution.

[0109] For teacher models The generated raw response Using perturbation operators structure A semantically equivalent but differently expressed variant sequence The perturbation methods include, but are not limited to:

[0110] Synonym replacement: Replace using a preset vocabulary list Non-core verbs or adjectives in the text.

[0111] Back-translation: Translate to an intermediate language (such as French or German) and then translate back to the original language.

[0112] Prompt: Changes the original instruction The tone or format (e.g., changing "Please answer in detail..." to "Explain from a professional perspective...") can induce differences in expression in the model.

[0113] The generated The variant sequence is then input into the teacher model. Following the method described in step two, calculate the perplexity value corresponding to each variant. ,in This yields a set of probability distributions that reflect the consistency of the model's representation of this knowledge point. .

[0114] This invention introduces the Coefficient of Variation (CV) as a core indicator for measuring the determinism of the teacher model.

[0115] Set a predefined stability threshold (usually based on the experimental setup) (between). The filtering logic is as follows: If This indicates that the teacher model exhibits high consistency and extremely low surprise across different representations, thus determining the response. As the output is based on reliable real knowledge, it is approved. If This indicates that the teacher model exhibits significant variability in its representation of this knowledge point, even in the original... The value is very low, and it is also judged as "smooth hallucination," so the data sample will be forcibly removed.

[0116] This step mainly targets the abnormal / challenging quadrant and screening. The teacher model's answers in the abnormal / challenging quadrant have high consistency and very low surprise, which is generally due to the student model's misconception. This part of the data helps to correct the student model's cognition.

[0117] In this embodiment of the invention, the mean of the probability distribution set and standard deviation The expressions are as follows:

[0118] ;

[0119] ;

[0120] in, Indicates the number of variant sequences. Indicates the first A variant sequence;

[0121] coefficient of variation The expression is:

[0122] .

[0123] In this embodiment of the invention, in step S5, data from the high-value quadrant and filtered corrective data from the abnormal / challenging quadrant are selected and combined to form a fine-tuning training set for the student model.

[0124] After the above process, the system outputs a carefully selected high-value training dataset. This dataset has low redundancy (what students have already mastered has been removed), high educational value (focusing on students' blind spots), and high realism (illusions have been filtered out through stability calibration).

[0125] The following description is based on specific embodiments.

[0126] In modern high-end manufacturing (such as precision electronics assembly and automotive parts assembly), such as Figure 2The dual-arm collaborative robots shown are gradually replacing humans in performing complex process assembly tasks. These tasks typically involve flexible operations in unstructured environments, such as "identifying specific gear types in a jumbled parts bin and performing force-controlled assembly" or "handling sudden jamming anomalies during assembly." To endow robots with the cognitive ability to handle such complex tasks, large-scale pre-trained models (teacher models, such as GPT-4 or Claude 3 Opus) are typically used to generate a large amount of thought chain (CoT) data and operational strategy code. However, industrial scenarios impose three core constraints on control systems: Accuracy: Assembly instructions must strictly conform to physical laws and process specifications; any erroneous instructions caused by "illusions" (such as incorrect torque parameters) could lead to costly equipment damage or product scrap. Real-time performance: Robot control loops require millisecond-level response speeds; relying on large cloud-based model APIs for inference introduces unacceptable network latency and fails to meet data privacy requirements. Economy: Deploying expensive GPU clusters at the edge of the production line to run large models with hundreds of billions of parameters is too costly; lightweight, small-scale models (student models, such as Llama-3-8B or Qwen-7B) must be used for local inference.

[0127] In this embodiment, to address the conflict between limited computing power and knowledge requirements faced by industrial dual-arm robots when deployed locally, the patented technology first constructs an instruction set and preliminary response generation mechanism oriented towards industrial assembly processes. The system collects real-world task descriptions covering complex scenarios such as precision assembly and anomaly handling from actual production lines, forming a seed instruction set. Subsequently, it utilizes a large-scale teacher model deployed in the cloud (such as GPT-4 or Claude 3 Opus) to perform deep reasoning on these instructions, generating response text containing detailed thought chains (CoT) and execution code. This step aims to leverage the powerful generalization capabilities of large models to provide rich potential learning materials for local small models, solving the problem of scarce high-quality labeled data in industrial scenarios.

[0128] After acquiring initial augmentation data, the system enters the dual-model perplexity parallel computation and residual analysis stage. To meet the real-time requirements of industrial sites, a lightweight student model (such as a dedicated model with 7B parameters) is deployed on the local server. The system concatenates the instructions and responses generated by the teacher and inputs them into the teacher model and student model respectively for forward propagation, calculating their respective average negative log-likelihood losses and converting them into perplexity indices. Based on this, the system calculates the perplexity residual score in log space to quantify the "cognitive gap" between the student model and the teacher model. By setting dynamic thresholds, the system automatically divides the data into four value quadrants: data that the teacher model is certain of but the student model is perplexed is identified as high-value samples in the "proximal development zone," representing key process knowledge that the student model has not yet mastered (such as specific force control compensation algorithms); while data that both models can easily predict is judged as redundant common sense (such as basic action instructions) and is discarded to save training computing power at the edge.

[0129] To address the extremely high safety requirements of industrial scenarios, this process specifically introduces a semantic stability calibration mechanism to accurately intercept potential logical illusions. In the initial screening, some data may exhibit anomalies where the student model's predicted probability is higher than the teacher model's, or the teacher model may generate seemingly fluent but actually erroneous instructions. To verify the reliability of this data, the system performs multi-dimensional semantic perturbations on the original response text, including replacing "torque" with synonyms such as "force torque," and back-translating using rigorous industrial terminology such as German. The system then calculates the perplexity variation coefficient of these perturbation variants under the teacher model. If the variation coefficient is below a preset threshold, it indicates that the teacher model maintains a highly consistent low perplexity across different expressions, and the data is determined to be reliable corrective knowledge. Conversely, if the variation coefficient is high, it indicates that the teacher model's expression of the knowledge point is unstable, and it is highly likely to be a probabilistic illusion of "serious nonsense." This data will be forcibly removed, thus preventing erroneous assembly strategies from entering the training set at the source.

[0130] Through the rigorous screening and calibration processes described above, the system ultimately constructs a fine-tuned dataset that combines high educational value with high realism. This dataset eliminates a large amount of redundant basic operational data, focuses on the knowledge gaps in the student models, and effectively filters out illusory data that could lead to equipment damage or process failure. Figure 3 As shown, fine-tuning a small model of the local dual-arm robot control system using this selected dataset not only significantly improved the model's success rate in complex assembly tasks but also ensured that the inference process conformed to strict industrial physical laws. Ultimately, this technical approach enables lightweight models to handle complex processes without relying on high-performance cloud computing, perfectly balancing the triple requirements of accuracy, real-time performance, and economy in industrial applications.

[0131] Those skilled in the art will recognize that the embodiments described herein are intended to help the reader understand the principles of the invention, and should be understood that the scope of protection of the invention is not limited to such specific statements and embodiments. Those skilled in the art can make various other specific modifications and combinations based on the technical teachings disclosed in this invention without departing from the spirit of the invention, and these modifications and combinations are still within the scope of protection of this invention.

Claims

1. A data filtering method for enhancing the semantic stability of fine-tuning data in large models, characterized in that, Includes the following steps: S1. Use the teacher model to process the seed instruction set and generate preliminary response content; S2. Based on the initial response, generate the teacher model confusion level and the student model confusion level; S3. Determine the value quadrant based on the teacher's model confusion level and the student's model confusion level; S4. Based on the initial response content, filter the value quadrants; S5. Based on the selected value quadrant, generate a fine-tuning training set for the student model.

2. The data filtering method for enhancing the semantic stability of large model fine-tuning data according to claim 1, characterized in that, S2 includes the following sub-steps: S21. Convert the initial response content into a discrete marker sequence, and use the seed instruction set as a context prefix to obtain the complete input sequence; S22. Input the complete input sequence into the teacher model and the student model respectively to obtain the prediction probability of the teacher model and the prediction probability of the student model. S23. Calculate the average negative log-likelihood loss for the teacher model and the student model based on the predicted probabilities of the teacher model and the student model, respectively. S24. Transform the average negative log-likelihood loss values ​​of the teacher model and the student model back into the probability space using an exponential function to obtain the perplexity of the teacher model and the perplexity of the student model.

3. The data filtering method for enhancing the semantic stability of large model fine-tuning data according to claim 2, characterized in that, The average negative log-likelihood loss of the teacher model The average negative log-likelihood loss of the student model The expressions are as follows: ; ; in, This represents the teacher model's predicted probability. This represents the student model's predicted probability. Represents the logarithmic function. Indicates the total length of the sequence. Represents each token in the sequence, Indicates a context prefix, Indicates the seed instruction set; The teacher model's perplexity and student model confusion The expressions are as follows: ; ; in, Indicates an index. This represents an exponential function.

4. The data filtering method for enhancing the semantic stability of large model fine-tuning data according to claim 1, characterized in that, S3 includes the following sub-steps: S31. Calculate the residual scores in logarithmic space based on the perplexity of the teacher model and the perplexity of the student model. S32. Determine several value quadrants based on the residual scores in the logarithmic space.

5. The data filtering method for enhancing the semantic stability of large model fine-tuning data according to claim 4, characterized in that, The residual fraction in logarithmic space The expression is: ; in, Indicates the teacher's model confusion level. Indicates the student's model confusion level. Represents a logarithmic function.

6. The data filtering method for enhancing the semantic stability of large model fine-tuning data according to claim 4, characterized in that, The value quadrant includes the high-value quadrant, the redundant quadrant, the abnormal quadrant, and the noisy quadrant; The high-value quadrant is and <ɸ, where, Represents the residual fraction in logarithmic space. ɸ represents the teacher's perplexity level, and ɸ represents the threshold. The redundant quadrant is and <ɸ; The abnormal quadrant is : The noise quadrant is ɸ.

7. The data filtering method for enhancing the semantic stability of large model fine-tuning data according to claim 1, characterized in that, S4 includes the following sub-steps: S41. Based on the initial response content, construct several variant sequences using perturbation operators; S42. Input several variant sequences into the teacher model, calculate the perplexity value corresponding to each variant sequence, and obtain the probability distribution set; S43. Calculate the mean and standard deviation of the set of probability distributions; S44. Calculate the coefficient of variation based on the mean and standard deviation of the probability distribution set; S45. Determine whether the coefficient of variation is less than or equal to the stability threshold. If so, retain the abnormal quadrant; otherwise, remove the abnormal quadrant.

8. The data filtering method for enhancing the semantic stability of large model fine-tuning data according to claim 7, characterized in that, The mean of the set of probability distributions and standard deviation The expressions are as follows: ; ; in, Indicates the number of variant sequences. Indicates the first A variant sequence; The coefficient of variation The expression is: 。