Large model training data synthesis method, system and device and storage medium

By collecting and processing military corpus data from multi-source channels and generating multi-themed training data, the problem of insufficient data quality and adaptability in the existing technology is solved, and efficient training and optimization of large models in multi-themed tasks is achieved.

CN120409710AActive Publication Date: 2025-08-01XIAMEN YUANTING INFORMATION TECH CO LTD +1

Patent Information

Application Number
CN202510907023.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-02
Publication Date
2025-08-01
Estimated Expiration
2045-07-02

AI Technical Summary

Technical Problem

The existing technology is difficult to generate high-quality, diverse multi-theme training data that is suitable for large-scale model training needs, and cannot effectively simulate complex multi-theme application scenarios in the real world, and the quality evaluation mechanism is incomplete, so it is impossible to filter out high-quality data that truly helps model optimization.

Method used

By collecting original military corpus data from multi-source channels, cleaning and standardizing, using pre-trained language models to generate semantic vectors and performing cluster analysis, a topic ontology library is constructed, multi-theme context synthetic samples are generated based on the topic similarity matrix, and high-quality samples are screened out through multi-dimensional quality evaluation, which is finally used to train large language models.

Benefits of technology

Multi-themed training data that is highly adapted to the training requirements of large-scale models is generated, which significantly improves the accuracy, generalization and robustness of large-scale models in multi-themed task processing, enhances cross-themed processing capabilities, and optimizes the training data generation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120409710A_ABST
    Figure CN120409710A_ABST
Patent Text Reader

Abstract

The invention provides a large model training data synthesis method, system and device and a storage medium, and the method comprises the steps: carrying out the preprocessing of original military corpus data, generating a semantic vector through a pre-training language model, dividing the semantic vector into a plurality of topic clusters through clustering analysis, extracting the keyword and representative sample of each topic cluster, forming a theme ontology library; selecting associated topic pairs based on the topic similarity matrix, and generating a synthetic sample through a predefined template; controlling the language style of the synthetic sample through the cue word instruction, and generating a stylized sample; dividing difficulty grades of the stylized samples to obtain graded samples; performing multi-dimensional quality evaluation and screening on the graded samples to obtain screened samples; the screened samples are used for training a large language model, and according to the performance of the large language model in each theme task, theme weights are adjusted, a synthesis strategy is updated, and a sample structure is optimized. According to the method, high-quality and diversified training data can be provided for large model training.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of training data, and specifically relates to a method, system, device, and storage medium for synthesizing large model training data. Background Art

[0002] In the field of artificial intelligence, the training effect of large models is closely related to the quality and diversity of training data. Existing training data synthesis methods have many deficiencies and are difficult to meet the training needs of large models in multi-topic scenarios.

[0003] On the one hand, traditional methods mostly focus on data synthesis for a single topic or a few topics and cannot simulate the complex multi-topic application scenarios in the real world. This makes large models perform poorly in handling cross-topic tasks and unable to effectively adapt to diverse practical application requirements. On the other hand, the existing generation process of synthetic data considers insufficiently the training characteristics of large models, the adaptability of the structure and distribution of data to the training requirements of large models is low, and the quality evaluation mechanism is imperfect, so it is impossible to screen out high-quality data that is truly helpful for model optimization. These problems seriously restrict the improvement of the training effect of large models.

[0004] In view of this, the present invention proposes a method, system, device, and storage medium for synthesizing large model training data, which can generate multi-topic training data with high quality, diversity, and adaptability to the training requirements of large models. Summary of the Invention

[0005] In order to solve the problems that existing technologies mostly focus on data synthesis for a single topic or a few topics and cannot simulate the complex multi-topic application scenarios in the real world, and the quality evaluation mechanism is imperfect and cannot screen out high-quality data that is truly helpful for model optimization, etc., the present invention provides a method, system, device, and storage medium for synthesizing large model training data to solve the above technical defect problems.

[0006] In the first aspect, the present invention proposes a method for synthesizing large model training data, and the method includes the following steps: S1. Collect original military corpus data from multiple sources, clean, standardize, de-duplicate, and structurally transform the original military corpus data to form basic military corpus data; S2. Use a pre-trained language model to generate semantic vectors of the basic military corpus data, and divide the semantic vectors into multiple topic clusters through cluster analysis. The topic clusters include: combat command, weaponry and equipment, tactics and methods, logistics support, and electronic countermeasures. Extract keywords and representative samples of each topic cluster to form a topic ontology library; S3. Select associated topic pairs based on the topic similarity matrix of the topic ontology library, and generate synthetic samples that integrate multi-topic contexts through predefined templates; S4. Control the language style of the synthesized samples through prompt instructions to generate stylized samples, including: popular expression samples and formal command-style samples; divide the difficulty levels of the stylized samples based on text length, structural complexity, vocabulary difficulty, and the number of reasoning steps to obtain graded samples; S5. Conduct multi-dimensional quality assessment and screening on the graded samples to obtain screened samples; S6. Use the screened samples to train the large language model, and adjust the topic weights, update the synthesis strategy, and optimize the sample structure according to the performance of the large language model in each topic task.

[0007] Preferably, in step S2, use a pre-trained language model to generate semantic vectors of the basic military corpus data, divide the semantic vectors into multiple topic clusters through cluster analysis, extract the keywords and representative samples of each topic cluster, and form a topic ontology library, which specifically includes the following sub-steps: S21. Use the BERT model to encode each text s of the basic military corpus data i into a fixed-dimensional vector, and use average pooling to output the semantic vector of the entire text segment; S22. Conduct K-Means cluster analysis on the semantic vectors to obtain the clustering results; S23. Build a topic ontology library based on the clustering results, including: representing the topic semantic features with the cluster center vector; extracting the keywords of each topic cluster through the TF-IDF algorithm; selecting the N samples closest to the cluster center as representative samples, where N represents a natural number greater than 0.

[0008] Preferably, in step S2, it also includes: Semantically rewrite, sentence-structure reconstruct, or context-complete the representative samples in the topic ontology library to generate extended samples, and add the extended samples to the representative samples of the topic ontology library.

[0009] Preferably, in step S3, select associated topic pairs based on the topic similarity matrix of the topic ontology library, and generate synthetic samples that integrate multi-topic contexts through predefined templates, which specifically includes the following sub-steps: S31. Calculate the values based on the topic similarity matrix, and select the associated topic pairs with similarity higher than the set threshold; S32. Design predefined templates for structured integration for each associated topic pair. The predefined templates include: setting the intersection topic logical connection structure and constructing question templates; S33. Call the Qwen model to generate synthetic samples for the associated topic pairs by applying the predefined templates.

[0010] Preferably, in step S4, the language style of the synthesized sample is controlled by a prompt instruction to generate a stylized sample; the difficulty level of the stylized sample is divided based on the text length, structural complexity, lexical difficulty, and number of reasoning steps to obtain a graded sample, which includes the following sub-steps: S41. Call the Qwen model to generate a stylized sample from the synthesized sample according to the prompt instruction; S42. Calculate the difficulty score of the stylized sample, and the calculation expression is:

[0011] In the formula, Score(st i ) is the difficulty score; is the i-th stylized sample; w1, w2, w3, and w4 are weighting factors; Length is the text length; TreeDepth is the structural complexity; RareWordRatio is the lexical difficulty; ReasoningSteps is the number of reasoning steps; S43. Map the obtained difficulty score to a preset score interval, and divide it into multiple level difficulty labels according to the preset score interval to obtain a graded sample.

[0012] Preferably, in step S5, the graded sample is subjected to multi-dimensional quality evaluation and screening to obtain a screened sample, which specifically includes the following sub-steps: S51. Calculate the total multi-dimensional quality evaluation score of the graded sample through the following expression:

[0013] In the formula, Q(sc i ) is the total multi-dimensional quality evaluation score; sc i is the i-th graded sample; and are configurable weight coefficients; Lang is the language quality score; Sem is the semantic consistency score; Topic is the topic relevance score; S52. Sort in descending order according to the total multi-dimensional quality evaluation score, and select the top K samples as the screened samples, where K is a natural number greater than 0.

[0014] Further preferably, in step S5, the language quality score is calculated through the PPL function, and the calculation expression is:

[0015] In the formula, Lang is the language quality score, n is the number of words in the graded sample; w j is the j-th word of the graded sample; is the conditional probability prediction of the j-th word by the language model; Calculate the semantic consistency score through the following calculation expression:

[0016] In the formula, Sem is the semantic consistency score; is the standard sentence in the basic military corpus data; is the semantic vector of the hierarchical sample encoded by the BERT model; is the semantic vector of the standard sentence encoded by the BERT model; represents the cosine similarity between the hierarchical sample and the standard sentence; Calculate the topic relevance score through the following calculation expression:

[0017] In the formula, is the k-th preset topic description; is the semantic vector of the hierarchical sample encoded by the BERT model; is the semantic vector of the topic description encoded by the BERT model; is the cosine similarity between the semantic vector of the hierarchical sample and the semantic vector of the topic description.

[0018] In a second aspect, the present invention proposes a large model training data synthesis system, which includes: A preprocessing module, configured to collect original military corpus data from multiple sources, clean, standardize, deduplicate, and structurally transform the original military corpus data to form basic military corpus data; A topic modeling module, configured to generate semantic vectors of the basic military corpus data using a pre-trained language model, divide the semantic vectors into multiple topic clusters through cluster analysis, the topic clusters include: combat command, weaponry and equipment, tactics and methods, logistics support, and electronic countermeasures, extract keywords and representative samples of each topic cluster to form a topic ontology library; A data synthesis module, which selects associated topic pairs based on the topic similarity matrix of the topic ontology library and generates synthetic samples that integrate multi-topic contexts through a predefined template; A style control and difficulty regulation module, configured to control the language style of the synthetic samples through prompt instructions to generate stylized samples, including: popular expression samples, formal command samples; divide the difficulty levels of the stylized samples based on text length, structural complexity, vocabulary difficulty, and the number of reasoning steps to obtain hierarchical samples; A data quality assessment module, configured to perform multi-dimensional quality assessment and screening on the hierarchical samples to obtain screened samples; The training feedback optimization module is configured to use the screened samples for training a large language model, and adjust the topic weights, update the synthesis strategy, and optimize the sample structure according to the performance of the large language model in various topic tasks.

[0019] In a third aspect, the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the large model training data synthesis method as described in any one of the above are implemented.

[0020] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, characterized in that when the computer program is executed by a processor, the steps of the large model training data synthesis method as described in any one of the above are implemented.

[0021] Compared with the prior art, the beneficial effects of the present invention are as follows: (1) Highly adaptable to the training requirements of large models: The present invention closely focuses on the characteristics of large model training for data synthesis. From data augmentation, topic fusion to quality assessment, the core goal is to improve the training effect of large models, and it can generate multi-topic training data that meets the training requirements of large models, thereby significantly improving the accuracy, generalization ability, and robustness of large models in multi-topic task processing.

[0022] (2) Significantly improve data diversity and quality: Through multi-source data acquisition, deeply customized synthesis strategies, and multi-dimensional quality assessment, rich and diverse high-quality training data can be generated. This not only covers multiple topic fields, but also effectively improves the semantic rationality, knowledge accuracy, and training adaptability of the data, providing sufficient and high-quality learning materials for large models.

[0023] (3) Enhance the cross-topic processing ability of large models: The emphasis on topic fusion and knowledge transfer in the data synthesis process enables large models to learn the associations and knowledge fusion methods between different topics during training. This significantly enhances the ability of large models in cross-topic task processing, improves the generalization and practicality of the models, and enables them to better handle complex and changing actual application scenarios.

[0024] (4) Optimize the training data generation process: Introduce an interactive generation mechanism and a reinforcement learning optimization strategy to achieve dynamic adjustment and optimization of the data synthesis and evaluation process, improve the efficiency and intelligence level of data generation, and at the same time reduce the cost of manual intervention, forming an efficient and intelligent data synthesis and optimization system. Description of the Drawings

[0025] By reading the detailed description of the non-limiting embodiments with reference to the following drawings, other features, objectives, and advantages of the present application will become more apparent: Figure 1 is a flowchart of a large model training data synthesis method according to the present invention; Figure 2 is a schematic diagram of a large model training data synthesis system according to the present invention; Figure 3 is a schematic structural diagram of a computer system of an electronic device suitable for implementing the embodiments of the present invention. Detailed implementation manners

[0026] The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related invention, rather than limiting the invention. Additionally, it should be noted that for the sake of description, only parts related to the relevant invention are shown in the drawings.

[0027] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other. The present application will be described in detail below with reference to the drawings and in conjunction with the embodiments.

[0028] The present invention proposes a large model training data synthesis method, Figure 1 shows a flowchart of the large model training data synthesis method of the present invention, as Figure 1 shown, the method includes the following steps: S1. Collect original military corpus data from multiple sources, clean, standardize, deduplicate, and structurally transform the original military corpus data to form basic military corpus data.

[0029] In this embodiment, original military corpus data is collected from multiple sources such as the Internet, open source corpora (such as Wikipedia, Common Crawl), and enterprise internal data warehouses. Among them, the original military corpus data includes but is not limited to high-quality military Q&A data and manuals, etc. After collecting the original military corpus data, these original military corpus data are cleaned, and the specific operations include removing HTML tags, special characters, and non-text content, etc., and only pure text information is retained. The cleaned text is standardized, the encoding format is uniformly converted to UTF-8, and various punctuation marks are normalized to ensure the consistency and correctness of the text format.

[0030] To further improve data quality, the SimHash algorithm (Similarity-sensitive Hash) can be used to calculate the fingerprints of texts. Set the Hamming distance threshold to 3, and consider samples with a Hamming distance less than 3 as duplicate samples and remove them, so as to ensure that the texts in the dataset have high uniqueness. And segment the processed texts by paragraphs, and structurally convert them into basic corpus in JSON format for storage. In the basic corpus in JSON format, each paragraph text corresponds to a record containing three fields, namely text content (text), data source (source), and timestamp (timestamp), which is convenient for subsequent query, processing, and analysis. For example, the original text "Blood pressure ↑ needs to be vigilant!!!" collected from a medical forum is finally converted into the standardized text form "Elevated blood pressure needs to be vigilant." and stored in the basic corpus in JSON format. Through this series of data collection and preprocessing steps, it is possible to provide high-quality and structured basic corpus support for the subsequent synthesis of large model training data.

[0031] Continue to refer to Figure 1 , a method for synthesizing large model training data proposed by the present invention further includes the following steps: S2. Generate semantic vectors of basic military corpus data using a pre-trained language model, and divide the semantic vectors into multiple topic clusters through clustering analysis. The topic clusters include: combat command, weaponry and equipment, tactics and combat methods, logistics support, and electronic countermeasures. Extract keywords and representative samples of each topic cluster to form a topic ontology library covering a multi-dimensional military knowledge structure.

[0032] In this embodiment, semantic modeling based on Bert vectorization and Kmeans clustering analysis are performed on the basic military corpus data, multiple topic labels are extracted, and a topic ontology library is constructed. The topic ontology library includes topic names, keyword sets, and representative samples. The specific implementation process is as follows: ① Input corpus processing Given a basic military corpus dataset: , where s i represents the i-th text (sentence or paragraph), the value range of i is [1, N], N is the total number of texts, and D represents a set composed of N texts.

[0033] ② Semantic vector representation (Embedding) Use the BERT model (Bidirectional Encoder Representations from Transformers, a pre-trained language model) to encode each text s i into a fixed-dimensional vector: Among them .

[0034] Output the semantic vector representation of the entire text using average pooling:

[0035] Among them is the semantic vector of the entire text, is the vector representation of the j-th word, and L is the length of the entire text to be vectorized.

[0036] ③ K-Means Clustering analysis Let be the vector set of all samples. The objective of the clustering objective function is to minimize the sum of the squared distances from the sample points to their respective cluster centers:

[0037]

[0038] Among them, K represents the number of clustering topics (which can be selected by the elbow method or the silhouette coefficient); represents the k-th cluster (topic cluster); represents the center point of the k-th cluster. ④ Construct a topic ontology library Based on the clustering results {C1, C2,..., C K}, construct a topic ontology library: Topic semantic features: Use the cluster center to represent the core semantics of the topic Keyword extraction: Use the term frequency-inverse document frequency combined with pointwise mutual information algorithm (TF-IDF+PMI, Term Frequency-Inverse Document Frequency, Pointwise Mutual Information) to extract the top N (the first N sorted) keywords for each topic cluster.

[0039] Representative samples: Select the N samples closest to the cluster center as representatives (N is a natural number greater than 0, and a typical value is 5).

[0040] Finally, construct the following topic representation : .

[0041] In a specific embodiment, in step S2, it further includes: Within a single theme, based on a small amount of seed data, semantic expansion, expression diversification, and structural reconstruction are carried out to enhance the coverage and language diversity of the theme corpus. Implementation logic: Input content selection, select several representative texts from the clustered theme corpus ; Semantic-preserving paraphrasing, using the instruction-tuned language model Qwen; Generate synonymous rewritten templatized sentence restructuring, extract the grammatical structure of the original sentence and reorganize it; Context completion, construct supplementary information through a prompt-based generation model; Generate extended samples , and add the extended samples to the representative samples in the theme ontology library.

[0042] Continue to refer to Figure 1 , A large model training data synthesis method proposed by the present invention further includes the following steps: S3. Select associated theme pairs based on the theme similarity matrix of the theme ontology library, and generate synthetic samples that integrate multi-theme contexts through predefined templates.

[0043] In the specific implementation manner, when the present invention performs data synthesis based on the theme ontology library, it first identifies associated theme pairs by calculating the theme similarity matrix. Specifically, the steps are as follows: ① Calculate the theme similarity matrix: Utilize the semantic feature vectors (i.e., clustering center vectors) of each theme in the theme ontology library to calculate the cosine similarity between each pair of themes, and construct the theme similarity matrix. For example, for the theme clusters "Combat Command" and "Weapon Equipment", calculate the cosine similarity between their semantic feature vectors.

[0044] ② Select associated theme pairs: Set a similarity threshold (e.g., 0.7), and screen out theme pairs with similarity higher than this threshold from the similarity matrix to form a list of associated theme pairs. For example, if the similarity between "Combat Command" and "Weapon Equipment" is 0.75, which is higher than the threshold of 0.7, then select them as associated theme pairs.

[0045] ③ Design predefined templates: For each associated theme pair, design a predefined template for structured integration, including an intersection topic logical connection structure and a question template. For example: Intersection topic logical connection structure: "In the context of {Combat Command}, how to effectively utilize {Weapon Equipment} to achieve combat goals?" Question template: "Considering the situation of {T_k1} ({T_k1} is a placeholder for representing a specific theme identifier), how should combat tasks be executed with the support of {T_k2}?" ④ Generate synthetic samples: Invoke the Qwen model, taking the associated topic pairs and predefined templates as inputs to generate synthetic samples that integrate multi-topic contexts. For example, with the prompt "Based on the themes of combat command and weaponry, generate a question and background description that combines both.", the Qwen model will generate samples similar to the following: Question: "Under the background of modern joint operations, how can commanders rationally allocate new weaponry according to the battlefield situation to achieve their combat intentions?" Answer: "Commanders need to comprehensively consider battlefield information, evaluate the performance of weaponry and combat requirements, and formulate precise equipment allocation plans..." Through the above steps, the present invention can effectively generate synthetic samples that integrate multi-topic contexts, enhancing the model's understanding and processing capabilities for multi-topic tasks in the military field.

[0046] Continue to refer to Figure 1 , a method for synthesizing large model training data proposed by the present invention further includes the following steps: S4. Control the language style of the synthetic samples through prompt instructions to generate stylized samples, including: samples with popular expressions, samples in a formal command style; Divide the difficulty levels of the stylized samples based on text length, structural complexity, vocabulary difficulty, and the number of reasoning steps to obtain graded samples.

[0047] In this embodiment, in order to enable the generated data to exhibit different language styles in terms of register, tone, vocabulary level, etc., thereby enhancing the large model's adaptability to diverse language expression forms, the present invention adopts a method that combines prompt control (Prompt Control) with the large model. The specific operation is to input specific style prompts into the generation model, such as "Please answer the following question using formal written language:..." or "Explain the following concept in the tone of an academic paper:...". According to these prompts, the generation function can adjust the language style of the output text. First, in order to enable the generated data to exhibit different language styles in terms of register, tone, vocabulary level, etc., thereby enhancing the large model's adaptability to diverse language expression forms, the present invention adopts a method that combines prompt control (Prompt Control) with the Qwen model. The specific operation is to input specific style prompts into the generation model, such as "Please answer the following question using formal written language:..." or "Explain the following concept in the tone of an academic paper:...". According to these prompts, the generation function can adjust the language style of the output text. Its generation function can be expressed as:

[0048] Among them, Output represents the output. The input of the Qwen model is the context and style prompt words. This process can ensure that the text generated by the model meets specific style requirements, such as formal style, spoken style, academic style, official document style, and expository style, etc., effectively expanding the model's ability to process different text styles.

[0049] In a specific embodiment, the present invention realizes the control of the language style of the synthetic sample through the following steps: When generating a synthetic sample, the language style can be controlled through specific prompt word instructions to generate a stylized sample that meets the requirements of a specific scenario. For example: Popular expression sample: When it is necessary to generate content for soldier training guidance, a prompt word similar to "Please write training guidance for soldiers in easy-to-understand language:..." can be input to guide the model to generate training guidance text that is easy for soldiers to understand.

[0050] Formal order sample: If the goal is to generate a combat order, the prompt word can be set as "Draft a combat order in the tone of a formal order:..." so that the generated content meets the requirements of the solemnity of the combat order.

[0051] In addition, to meet the different requirements of large models at different training stages and ability levels for the difficulty of data samples, the present invention designs a difficulty grading mechanism. The purpose of this mechanism is to generate training data samples that are gradually increasing and distributed in a progressive manner, optimizing the model training curve and generalization ability. The difficulty grading mechanism mainly evaluates the synthetic samples based on the following several indicators: Text length (Length): It can be calculated by the number of characters or words. Generally, longer texts require higher model understanding ability.

[0052] Structure complexity (TreeDepth): It is measured by analyzing the depth of the syntactic tree of the text or the length of the dependency path. The more complex the structure, the stronger the grammar processing ability required by the model.

[0053] Lexical difficulty (RareWordRatio): It counts the proportion of low-frequency words, terms, and abstract words in the text. A high proportion of difficult words increases the difficulty of text understanding.

[0054] Number of reasoning steps (ReasoningSteps): It calculates the length of the logical reasoning chain in the text. A longer reasoning chain requires the model to have stronger logical reasoning ability.

[0055] By comprehensively considering the above indicators, the difficulty score of each synthetic sample is calculated. The formula is:

[0056] In the formula, Score(st i ) is the difficulty score; is the i-th stylized sample; w1, w2, w3, and w4 are configurable weight adjustment factors, and the weight values can be adjusted according to specific training objectives; Length is the text length; TreeDepth is the structural complexity; RareWordRatio is the lexical difficulty; ReasoningSteps is the number of reasoning steps.

[0057] According to the calculated scores, the samples are divided into different difficulty levels (such as L1–L5) according to the score range, providing hierarchical data support for model training.

[0058] In addition, during the data generation process, the generation difficulty can also be controlled through task prompts. For example, use the prompt "Please generate an abstract suitable for beginners to understand." to specify the difficulty of the generated content, thereby achieving precise control of the difficulty of the training data.

[0059] Through the above steps, the present invention can generate training data with different language styles and difficulty levels, meet the requirements of the large model at different training stages, and effectively improve the performance and generalization ability of the model.

[0060] Continue to refer to Figure 1 , a method for synthesizing large model training data proposed by the present invention further includes the following steps: S5. Conduct multi-dimensional quality evaluation and screening on the graded samples to obtain screened samples.

[0061] S6. Use the screened samples to train the large language model, and adjust the topic weights, update the synthesis strategy, and optimize the sample structure according to the performance of the large language model in each topic task. Preferably, feedback the model performance evaluation results to step S3 to dynamically update the threshold of the topic similarity matrix and the template design.

[0062] In the specific implementation process, the method for synthesizing large model training data proposed by the present invention realizes multi-dimensional quality evaluation and screening of the graded samples, as well as model feedback and iterative optimization based on the evaluation results through the following steps: ① Calculate the total score of multi-dimensional quality evaluation: For each graded sample, use the following formula to calculate its quality evaluation total score, comprehensively considering three key dimensions of language quality, semantic consistency, and topic relevance. The scores of each dimension are multiplied by the corresponding weight coefficients and then summed to obtain the final quality evaluation total score.

[0063]

[0064] In the formula, Q(sc i ) is the total score of multi-dimensional quality evaluation; sc i is the i-th graded sample; and is a configurable weight coefficient; Lang is the language quality score; Sem is the semantic consistency score; Topic is the topic relevance score; Among them, the language quality score (Lang) is calculated by means of the PPL (Perplexity) function, which reflects the fluency of the text. The formula is as follows:

[0065] In the formula, Lang is the language quality score, n is the number of words in the grading sample; w j is the j-th word in the grading sample; is the conditional probability prediction of the language model for the j-th word; the lower the PPL value, the more natural the text grammar and the more appropriate the word usage.

[0066] Semantic consistency score (Sem): By means of the BERT model to encode the semantic vectors of the text and the standard sentence, calculate the cosine similarity between the two. The formula is:

[0067] In the formula, Sem is the semantic consistency score, and this score measures the consistency between the sample and the standard expression; is the standard sentence in the basic military corpus data; is the semantic vector of the grading sample encoded by the BERT model; is the semantic vector of the standard sentence encoded by the BERT model; represents the cosine similarity between the grading sample and the standard sentence; Topic relevance score (Topic): This score ensures that the sample closely follows the theme. It is also based on the BERT model encoding, converting the grading sample and the theme description into semantic vectors, and calculating the cosine similarity between the two:

[0068] In the formula, is the k-th preset theme description; is the semantic vector of the grading sample encoded by the BERT model; is the semantic vector of the theme description encoded by the BERT model; is the cosine similarity between the semantic vector of the grading sample and the semantic vector of the theme description.

[0069] ② Sample screening: According to the calculated total multi-dimensional quality evaluation score Q(sc i ), sort all the grading samples in descending order. Select the top K samples (K is a natural number greater than 0) as the high-quality screening samples to ensure the quality of the training data.

[0070] ③Train the large language model and evaluate: Input the selected high-quality samples into the training of the large language model (LLM). After training, evaluate the performance of the model on tasks related to each topic, with a focus on metrics such as the accuracy, recall, and F1 score of the model.

[0071] ④Adjust and optimize: Dynamically adjust the topic weights according to the actual performance of the large language model. For example, if the F1 score of the large language model on a certain topic drops, then correspondingly increase the sample weight of that topic and increase its proportion in subsequent training. At the same time, based on the common errors and deficiencies in model training, update the synthesis strategy, such as optimizing predefined templates and adding new prompt words to generate data samples that better meet the requirements. In addition, optimize the sample structure, such as adjusting the text length and enriching the vocabulary, to better meet the needs of different training stages of the model.

[0072] Through this closed-loop feedback and optimization mechanism, the present invention can continuously improve the quality of training data, thereby enhancing the performance of the large language model in multi-topic tasks and improving its generalization ability and adaptability.

[0073] For further reference Figure 2 As an implementation of the above method, in a second aspect, the present invention provides an embodiment of the structure diagram of a large model training data synthesis system 200, which can be specifically applied to various electronic devices. The large model training data synthesis system 200 includes the following modules: A preprocessing module 210, configured to collect original military corpus data from multiple sources, clean, standardize, deduplicate, and structurally transform the original military corpus data to form basic military corpus data; A topic modeling module 220, configured to generate semantic vectors of the basic military corpus data using a pre-trained language model, divide the semantic vectors into multiple topic clusters through clustering analysis, where the topic clusters include: combat command, weaponry, tactics and battle methods, logistics support, and electronic countermeasures, extract keywords and representative samples of each topic cluster to form a topic ontology library; A data synthesis module 230, which selects associated topic pairs based on the topic similarity matrix of the topic ontology library and generates synthetic samples that integrate multi-topic contexts through predefined templates; A style control and difficulty regulation module 240, configured to control the language style of the synthetic samples through prompt instructions to generate stylized samples, including: popular expression samples, formal command style samples; divide the difficulty levels of the stylized samples based on text length, structural complexity, vocabulary difficulty, and the number of reasoning steps to obtain graded samples; A data quality evaluation module 250, configured to perform multi-dimensional quality evaluation and screening on the graded samples to obtain screened samples; The training feedback optimization module 260 is configured to use the screened samples for training a large language model, and adjust the topic weights, update the synthesis strategy, and optimize the sample structure according to the performance of the large language model in each topic task.

[0074] In a third aspect, the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the large model training data synthesis method as described in any one of the above are implemented.

[0075] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, characterized in that when the computer program is executed by a processor, the steps of the large model training data synthesis method as described in any one of the above are implemented.

[0076] Next, refer to Figure 3 , which shows a schematic structural diagram of a computer system 300 suitable for implementing the terminal device or server of the embodiments of the present application. Figure 3 The shown terminal device or server is merely an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.

[0077] As Figure 3 shown, the computer system 300 includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage section 308 into the random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the computer system 300 are also stored. The CPU 301, ROM 302, and RAM 303 are connected to each other via a bus 304. The input / output (I / O) interface 305 is also connected to the bus 304.

[0078] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a liquid crystal display (LCD), etc. and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as required. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as required, so that the computer program read from it can be installed into the storage section 308 as required.

[0079] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes program code for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 309 and / or installed from the removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, the above functions defined in the methods of the present application are performed. It should be noted that the computer-readable medium described in the present application can be a computer-readable signal medium or a computer-readable medium or any combination of the two. The computer-readable medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable medium can include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. And in the present application, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0080] Computer program code for performing the operations of this application can be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as C language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0081] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the boxes can occur in a different order than that marked in the accompanying drawings. For example, two consecutive boxes shown can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as combinations of boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0082] The above description is only a preferred embodiment of this application and an explanation of the technical principles applied. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, technical solutions formed by mutually replacing the above features with (but not limited to) technical features having similar functions disclosed in this application.

Claims

1. A method for synthesizing large model training data, characterized in that, It includes the following steps: S1. Collect original military corpus data from multiple sources, clean, standardize, deduplicate, and structurally transform the original military corpus data to form basic military corpus data; S2. Use a pre-trained language model to generate semantic vectors of the basic military corpus data, divide the semantic vectors into multiple topic clusters through cluster analysis. The topic clusters include: combat command, weaponry and equipment, tactics and strategies, logistics support, and electronic countermeasures. Extract keywords and representative samples of each topic cluster to form a topic ontology library; S3. Select associated topic pairs based on the topic similarity matrix of the topic ontology library, and generate synthetic samples that integrate multi-topic contexts through predefined templates; S4. Control the language style of the synthetic samples through prompt instructions to generate stylized samples, including: popular expression samples, formal command-style samples; divide the difficulty levels of the stylized samples based on text length, structural complexity, vocabulary difficulty, and the number of reasoning steps to obtain graded samples; S5. Conduct multi-dimensional quality assessment and screening on the graded samples to obtain screened samples; S6. Use the screened samples to train a large language model, and adjust the topic weights, update the synthesis strategy, and optimize the sample structure according to the performance of the large language model in each topic task.

2. The method for synthesizing large model training data according to claim 1, wherein, In step S2, using a pre-trained language model to generate semantic vectors of the basic military corpus data, dividing the semantic vectors into multiple topic clusters through cluster analysis, and extracting keywords and representative samples of each topic cluster to form a topic ontology library, specifically including the following sub-steps: S21. Use the BERT model to encode each text s of the basic military corpus data into a fixed-dimensional vector, and use average pooling to output the semantic vector of the entire text; i Encode it into a fixed-dimensional vector, and use average pooling to output the semantic vector of the entire text; S22. Conduct K-Means cluster analysis on the semantic vectors to obtain a clustering result; S23. Construct the topic ontology library based on the clustering result, including: representing the topic semantic features with the cluster center vector; extracting keywords of each topic cluster through the TF-IDF algorithm; selecting the N samples closest to the cluster center as representative samples, where N represents a natural number greater than 0.

3. The method for synthesizing large model training data according to claim 1, wherein In step S2, it also includes: Semantically rewrite, sentence structure reconstruct, or context complement the representative samples in the topic ontology library to generate extended samples, and add the extended samples to the representative samples of the topic ontology library.

4. The large model training data synthesis method according to claim 1, characterized in that In step S3, select associated topic pairs based on the topic similarity matrix of the topic ontology library, and generate synthetic samples that integrate multi-topic contexts through predefined templates, specifically including the following sub-steps: S31. Calculate values based on the topic similarity matrix and select associated topic pairs with similarity higher than the set threshold; S32. Design predefined templates for structured integration for each associated topic pair. The predefined templates include: setting an intersection topic logical connection structure and constructing a question template; S33. Call the Qwen model to apply the predefined template to the associated topic pairs to generate synthetic samples.

5. The method for synthesizing large model training data according to claim 1, wherein In step S4, control the language style of the synthetic samples through prompt instructions to generate stylized samples; divide the difficulty levels of the stylized samples based on text length, structural complexity, vocabulary difficulty, and the number of reasoning steps to obtain graded samples, which specifically includes the following sub-steps: S41. Invoke the Qwen model to generate a stylized sample from the synthetic sample according to the prompt instruction; S42. Calculate the difficulty score of the stylized sample, and the calculation expression is: where Score(st i ) is the difficulty score; is the i-th stylized sample; w1, w2, w3, and w4 are weight adjustment factors; Length is the text length; TreeDepth is the structural complexity; RareWordRatio is the lexical difficulty; ReasoningSteps is the number of reasoning steps; S43. Map the obtained difficulty score to a preset score range, divide it into multiple level difficulty labels according to the preset score range, and obtain a classified sample.

6. The method for synthesizing large model training data according to claim 1, wherein, In step S5, perform multi-dimensional quality evaluation and screening on the classified sample to obtain a screened sample, which specifically includes the following sub-steps: S51. Calculate the total multi-dimensional quality evaluation score of the classified sample through the following expression: Where, Q(sc i ) is the total score of multi-dimensional quality assessment; sc i is the i-th graded sample; and are configurable weight coefficients; Lang is the language quality score; Sem is the semantic consistency score; Topic is the topic relevance score; S52. Sort in descending order according to the total multi-dimensional quality evaluation score, and select the top K samples as the screened samples, where K is a natural number greater than 0.

7. The method for synthesizing large model training data according to claim 6, wherein In step S5, calculate the language quality score through the PPL function, and the calculation expression is: where Lang is the language quality score, n is the number of words in the grading sample; w j is the j-th word of the grading sample; is the conditional probability prediction of the language model for the j-th word; Calculate the semantic consistency score through the following calculation expression: Where Sem is the semantic consistency score; is the standard sentence in the basic military corpus data; is the semantic vector of the classified sample encoded by the BERT model; is the semantic vector of the standard sentence encoded by the BERT model; represents the cosine similarity between the classified sample and the standard sentence; Calculate the topic relevance score through the following calculation expression: wherein, is the k-th preset topic description; is the semantic vector of the hierarchical sample encoded by the BERT model; is the semantic vector of the topic description encoded by the BERT model; is the cosine similarity between the semantic vector of the hierarchical sample and the semantic vector of the topic description.

8. A large model training data synthesis system, characterized in that, The system includes: A preprocessing module configured to collect raw military corpus data from multiple sources, clean, standardize, de-duplicate, and structurally transform the raw military corpus data to form basic military corpus data; A topic modeling module configured to generate semantic vectors of the basic military corpus data using a pre-trained language model, divide the semantic vectors into multiple topic clusters through cluster analysis, and the topic clusters include: combat command, weaponry and equipment, tactics and combat methods, logistics support, and electronic countermeasures, extract keywords and representative samples of each topic cluster to form a topic ontology library; A data synthesis module configured to select associated topic pairs based on the topic similarity matrix of the topic ontology library and generate synthetic samples that integrate multi-topic contexts through predefined templates; A style control and difficulty regulation module configured to control the language style of the synthetic sample through prompt instructions to generate stylized samples, including: popular expression samples, formal command samples; divide the difficulty levels of the stylized samples based on text length, structural complexity, vocabulary difficulty, and the number of reasoning steps to obtain classified samples; A data quality evaluation module configured to perform multi-dimensional quality evaluation and screening on the classified sample to obtain a screened sample; A training feedback optimization module configured to use the screened sample to train a large language model, and adjust the topic weights, update the synthesis strategy, and optimize the sample structure according to the performance of the large language model in each topic task.

9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the large model training data synthesis method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the large model training data synthesis method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • KGQG method for data enhancement based on dynamic prompt large model

    CN118446301A

  • Intelligent question answering system construction method and system based on LLM large language model

    CN119691140A

  • Cross-platform social media abstract generation method based on large language model self-iteration

    CN119739853A

  • Cross-theme composition scoring method and device based on interpretable knowledge capture and medium

    CN119918541A

  • Method for generating text training sample based on large model, and electronic device

    US20250117714A1

Cited By

  • Hybrid expert multi-model task processing method and system based on AI Agent scene

    CN120653404A

  • Advanced mathematics problem solving model reasoning strengthening method based on hierarchical thinking chain

    CN120654837A

  • Higher mathematics problem solving model reasoning reinforcement method based on hierarchical thinking chain

    CN120654837B

  • Data generation method and device, equipment and storage medium

    CN120763308A

  • Confrontation sample processing method, confrontation test method of preset model, and equipment

    CN121031759A