A domain-adaptive large-scale training method and apparatus for aerospace software

By constructing a core thesaurus in the aerospace software field, performing hybrid weighted mask pre-training, and fine-tuning the instruction set throughout the entire lifecycle, combined with multi-judge model optimization, the problems of long development cycles and security risks in aerospace software development have been solved, and high-reliability and secure large-scale aerospace software model training has been achieved.

CN122287608APending Publication Date: 2026-06-26BEIJING INST OF CONTROL ENG
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING INST OF CONTROL ENG
Filing Date
2026-04-24
Publication Date
2026-06-26

Smart Images

  • Figure CN122287608A_ABST
    Figure CN122287608A_ABST
Patent Text Reader

Abstract

This invention discloses a domain-adaptive training method and apparatus for a large-scale aerospace software model, belonging to the field of aerospace model training. The method includes: processing an aerospace-specific corpus that has undergone word segmentation and stop word filtering based on word frequency and inverse document frequency to obtain a core lexicon for the aerospace software domain; performing hybrid weighted mask sampling on the input text based on the core lexicon and the domain weight of each term in the lexicon, and training a basic model based on the sampling results to obtain a pre-trained model; performing low-rank adaptive fine-tuning updates on the pre-trained model's parameters based on structured instruction sets and enhanced thinking chain data to obtain an instruction fine-tuning model with engineering reasoning logic; and performing direct preference optimization on the instruction fine-tuning model based on high-quality preference pairs cleaned through multi-judge model collaborative voting to obtain a reliable large-scale software model that meets engineering requirements. This invention can effectively improve the reliability and security of the model output results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of aerospace model training technology, and in particular to a domain-adaptive method and apparatus for training large aerospace software models. Background Technology

[0002] With the continuous increase in the complexity of space missions, the scale of aerospace software development and the requirements for quality and reliability are experiencing explosive growth. Traditional development models, which heavily rely on manual design, coding, and static inspection, have revealed significant contradictions when dealing with large-scale control algorithms and complex logic, such as long development cycles and low knowledge reuse rates. In recent years, artificial intelligence technologies, represented by large language models, have been attempted to be applied to the field of software engineering, but they still face stringent challenges in terms of rigor and professionalism within the aerospace vertical.

[0003] In related technologies, traditional general-purpose large language models, when applied to the aerospace software field, often suffer from low reliability of output results and numerous security risks due to a lack of professional knowledge and engineering logic. There is a lack of vertical domain large language models that are deeply adapted to aerospace software development scenarios and possess high security and reliability characteristics.

[0004] Therefore, there is an urgent need for a domain-adaptive aerospace software large model training method and device to solve the above-mentioned technical problems. Summary of the Invention

[0005] This invention provides a domain-adaptive method and apparatus for training large-scale aerospace software models, which can effectively improve the reliability and security of the model output results. The technical solution is as follows: On the one hand, a domain-adaptive method for training large-scale aerospace software models is provided, the method comprising: Based on word frequency and inverse document frequency, the aerospace-specific corpus, which has undergone word segmentation and stop word filtering, is subjected to domain weight quantification calculation and sorting and screening to obtain the core lexicon of the aerospace software domain. Based on the core lexicon and the domain weight of each term in the lexicon, the input text used for pre-training is sampled using a hybrid weighted mask, and the preset general large language basic model is further pre-trained based on the sampling results to obtain a pre-trained model with aerospace underlying semantic cognition. Based on the structured instruction set covering the entire development lifecycle and the enhanced thinking chain data driven by the teacher model, the pre-trained model is updated with low-rank adaptive fine-tuning of model parameters to obtain an instruction fine-tuning model with engineering reasoning logic. Based on the high-quality preference pairs cleaned through collaborative voting by a multi-judge model, the instruction fine-tuning model is directly optimized to obtain a reliable large software model that meets engineering requirements.

[0006] On the other hand, a domain-adaptive aerospace software large model training device is provided, the device comprising: The preprocessing module is used to perform domain weight quantification calculation and sorting and filtering on the aerospace-specific corpus that has been processed by word segmentation and stop word filtering based on word frequency and inverse document frequency, so as to obtain the core vocabulary of the aerospace software field. The first training module is used to perform mixed weighted mask sampling on the input text for pre-training according to the core lexicon and the domain weight of each word in the lexicon, and to continue pre-training the preset general large language basic model according to the sampling results, so as to obtain a pre-trained model with aerospace underlying semantic cognition. The second training module is used to perform low-rank adaptive fine-tuning updates of the model parameters of the pre-trained model based on the structured instruction set covering the entire development life cycle and the enhanced thinking chain data driven by the teacher model, so as to obtain an instruction fine-tuning model with engineering reasoning logic. The third training module is used to perform direct preference optimization on the instruction fine-tuning model based on the high-quality preference pairs cleaned by multi-judge model collaborative voting, so as to obtain a reliable large software model that meets engineering requirements.

[0007] On the other hand, a computer device is provided, the computer device including a memory and a processor, the memory for storing computer programs, and the processor for executing the computer programs stored in the memory to implement the steps of the domain-adapted aerospace software large model training method described above.

[0008] On the other hand, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, the steps of the above-described field-adapted aerospace software large model training method are implemented.

[0009] On the other hand, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the domain-adapted aerospace software large model training method described above.

[0010] The technical solution provided by this invention offers at least the following beneficial effects: First, by constructing a core lexicon and weighted mask pre-training, it accurately and efficiently injects the underlying professional semantics of the aerospace field into the model, solving the problem of knowledge scarcity. Second, by constructing a full lifecycle instruction set and injecting thought chain reasoning data, combined with efficient fine-tuning, the model masters the rigorous engineering logic from requirements to code, ensuring the standardization and traceability of the output process. Finally, by automatically constructing logical perturbation data and combining it with preference alignment through multi-model collaborative evaluation, it defines a safe and reliable output boundary for the model, significantly improving the credibility and compliance of its generated results. The entire solution ultimately constructs a large-scale aerospace software model that combines profound domain knowledge, rigorous engineering thinking, and highly reliable output, providing crucial underlying capability support for the intelligent development of highly safe and reliable aerospace software. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a flowchart of a domain-adaptive aerospace software large model training method provided by an embodiment of the present invention; Figure 2 This is a structural diagram of a domain-adaptive aerospace software large model training device provided in an embodiment of the present invention; Figure 3 This is a hardware architecture diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0013] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0014] Please refer to Figure 1 This invention provides a domain-adaptive aerospace software large model training method, which includes: Step 100: Based on word frequency and inverse document frequency, perform domain weight quantification calculation and sorting and filtering on the aerospace-specific corpus that has undergone word segmentation and stop word filtering to obtain the core vocabulary of the aerospace software domain. Step 102: Based on the core lexicon and the domain weight of each term in the lexicon, perform mixed weighted mask sampling on the input text used for pre-training, and continue to pre-train the preset general large language basic model based on the sampling results to obtain a pre-trained model with aerospace underlying semantic cognition. Step 104: Based on the structured instruction set covering the entire development lifecycle and the enhanced thinking chain data driven by the teacher model, the pre-trained model is updated with low-rank adaptive fine-tuning of the model parameters to obtain an instruction fine-tuning model with engineering reasoning logic. Step 106: Based on the high-quality preference pairs cleaned by multi-judge model collaborative voting, the instruction fine-tuning model is directly optimized to obtain a reliable large software model that meets engineering requirements.

[0015] In this embodiment of the invention, firstly, by constructing a core lexicon and pre-training with weighted masks, the underlying professional semantics of the aerospace field are accurately and efficiently injected into the model, solving the problem of knowledge scarcity. Secondly, by constructing a full lifecycle instruction set and injecting thought chain reasoning data, combined with efficient fine-tuning, the model masters the rigorous engineering logic from requirements to code, ensuring the standardization and traceability of the output process. Finally, by automatically constructing logical perturbation data and combining it with preference alignment through multi-model collaborative evaluation, a safe and reliable output boundary is defined for the model, significantly improving the credibility and compliance of its generated results. The entire solution ultimately constructs a large-scale aerospace software-specific model that combines deep domain knowledge, rigorous engineering thinking, and highly reliable output, providing crucial underlying capability support for the intelligent development of highly safe and reliable aerospace software.

[0016] The following description Figure 1 The execution method for each step is shown.

[0017] First, for step 100, the aerospace-specific corpus, which has undergone word segmentation and stop word filtering, is subjected to domain weight quantification calculation and sorting and screening based on word frequency and inverse document frequency to obtain the core lexicon of the aerospace software domain.

[0018] In this embodiment of the invention, the core thesaurus of aerospace software is constructed in the following manner: A standardized corpus for aerospace software was obtained by fully collecting, verifying compliance, and deduplicating the multi-source, heterogeneous aerospace software-specific working documents.

[0019] Specifically, the system collects documents throughout the entire life cycle of aerospace software development, including mission statements for model development, requirement specifications, design documents, source code, test reports, etc., and performs basic compliance verification on these documents to form a corpus, eliminating invalid, duplicate, and redundant documents in non-aerospace software fields to form a unified set of aerospace vertical domain documents, that is, a standardized corpus for the aerospace software field, denoted as .

[0020] Perform word segmentation processing adapted to aerospace professional term rules and filtering of stop words without technical connotations on the said specific corpus to obtain a standardized term set for the cleaned full corpus.

[0021] Specifically, first perform sentence-by-sentence word segmentation on all documents in the corpus, adapting to the segmentation rules of professional terms in the aerospace software field to ensure that aerospace-exclusive professional terms such as "1553B bus", "attitude quaternion", and "triple modular redundancy" are completely segmented into independent terms without term splitting errors.

[0022] Then, after completing the word segmentation, batch-filter invalid terms without technical connotations, which are divided into two categories: Basic stop words: common function words such as Chinese auxiliary words, prepositions, conjunctions, etc. (such as "de", "le", "zai", "yu", "he", etc.); Domain invalid general words: words that frequently appear in general contexts but have no specific technical connotations in the aerospace field (such as "software", "function", "system", etc.); After completing the filtering, generate a corresponding standardized term list for each aerospace document to form a term collection for the full corpus.

[0023] Perform statistics on the word frequency, inverse document frequency, and domain weight quantification calculation for each independent term in the said term collection to obtain a mapping table of aerospace domain-exclusive weights corresponding to all terms.

[0024] Specifically, for each term in the term collection , calculate its word frequency in the aerospace vertical domain document set , denoted as , that is, the frequency index of the term's appearance in the aerospace domain corpus, reflecting the frequency of use of the term in the aerospace field.

[0025] Subsequently, calculate the inverse document frequency of the said term in the general corpus and the specific corpus : In the formula, is the total number of documents in the mixed corpus; is the number of documents in the mixed corpus that contain the term ; It is worth noting that IDF must be calculated in a mixed set of general and domain-specific terms, rather than only in the aerospace domain corpus. Its core function is to amplify the weight of specialized terms that appear frequently only in the aerospace domain and rarely in the general corpus.

[0026] Next, based on the term frequency and the inverse document frequency, the term is calculated. Aerospace-specific weight : Aerospace-specific technical terms (such as 1553B and attitude quaternions) have extremely high IDF due to their high TF in the aerospace corpus and their extremely low occurrence in the general corpus, resulting in a significant amplification of their weight. On the other hand, general high-frequency meaningless words have extremely low IDF, resulting in a significant suppression of their weight. This achieves a precise quantitative distinction between core aerospace knowledge and general vocabulary.

[0027] The term set is sorted in descending order of domain weight according to the dedicated weight mapping table, and the sorting results are filtered according to preset filtering rules to obtain the core term library for pre-training.

[0028] Specifically, all terms in the term collection are first sorted in descending order according to their domain weight, with terms having higher weights ranking higher.

[0029] You can then filter in the following two ways, for example: Fixed quantity filtering: Select the top-ranked preset quantity M terms; Dynamic threshold filtering: Set a dynamic threshold for the coverage of aerospace terminology (e.g., covering 90% of the frequency of occurrence of aerospace terminology in the corpus), and automatically select the top-ranked terms that meet the threshold; After the screening is completed, the selected terms will be compiled to form the final core terminology database for the aerospace software field.

[0030] This lexicon serves as a semantic anchor for subsequent training phases, ensuring that the sampling strategy can accurately identify the core logical elements that play a crucial supporting role in the system's reliability and security. This solves the problem of low knowledge learning efficiency caused by the lack of domain feature guidance when traditional random masks are used to process texts with unevenly distributed professional knowledge.

[0031] Then, for step 102, based on the core lexicon and the domain weight of each term in the lexicon, the input text used for pre-training is sampled using a hybrid weighted mask, and the preset general large language basic model is further pre-trained based on the sampling results to obtain a pre-trained model with aerospace underlying semantic cognition.

[0032] In traditional large-scale model pre-training, a random uniform masking strategy is typically employed. However, in the aerospace vertical domain, this approach leads to low knowledge capture efficiency. For example, in aerospace software corpora, a large proportion of general vocabulary such as particles and prepositions exist, while specialized terms carrying key logic (such as "1553B" and "attitude quaternion") appear relatively infrequently. Random sampling causes the model to consume a significant amount of computational resources on reproducing domain-wide semantics, failing to effectively capture the key specialized features that determine system reliability within a limited number of steps. Therefore, to overcome the low knowledge capture efficiency problem of general masking strategies in the aerospace vertical domain, a knowledge-sensitive hybrid weighted sampling mechanism is proposed.

[0033] In this embodiment of the invention, the hybrid weighted mask sampling process includes: The input text is matched with terms based on the core lexicon, and the domain weight of the corresponding terms is determined.

[0034] Specifically, for each term in a single input text sequence First, it matches the aerospace core terminology database obtained in the previous step to determine the degree of core term affiliation, and at the same time retrieves the domain weight corresponding to the term. .

[0035] Furthermore, the final probability of a corresponding term being selected as a mask object of the input text is calculated based on the domain weights. : In the formula, Based on the probability of random sampling; Let be the domain weight of the i-th term; This is the sum of the domain weights of all terms in the input text; The complete set of words in the input text; This is the balance coefficient; Monte Carlo sampling is performed on the input text based on the final probability of each term to determine the masked terms of the input text. The selected masked terms are then masked to obtain a single training sample that meets the input requirements of the basic model. A standardized self-supervised training sample set is constructed based on the training samples of all input texts. The training samples include the corpus blocks obtained by masking, the unmasked context, and the ground truth values ​​of the masked terms.

[0036] Specifically, the selected terms are fully masked. For example, the entire term is replaced with a uniform [MASK] tag instead of splitting the word or sub-word into a mask. This avoids semantic breaks caused by splitting and masking aerospace terminology. As a result, a single training sample is obtained consisting of: the masked corpus block + the unmasked context + the truth value of the masked target term. Finally, all training samples are aggregated to obtain a self-supervised training sample set.

[0037] In this embodiment of the invention, the preset general-purpose large language foundation model is further pre-trained based on the sampling results to obtain a pre-trained model with aerospace underlying semantic cognition, including: S21. Input the corpus blocks from the training sample set into the base model whose preorder parameters are frozen, and train the base model with the unmasked context corresponding to each corpus block as a condition to obtain the predicted probability distribution of all masked terms. Specifically, this embodiment freezes the pre-training parameters of the general base model and unlocks only the parameters of the last few Transformer layers as trainable parameters, thereby maximizing the preservation of the model's general language modeling capabilities and avoiding catastrophic forgetting caused by vertical training.

[0038] S22. Based on the prediction results of the base model for each training sample and the ground truth value of the corresponding masked term, calculate the training loss of the base model. : In the formula, The index of the masked term; It is a set consisting of all masked terms in a single training sample; The basic model predicts the true terms at the masked positions. The conditional probability; These are the currently unfrozen trainable parameters of the base model; S23. Perform backpropagation on the training loss to calculate the gradient of the basic model parameters, and update the basic model parameters in reverse according to the gradient; wherein, the gradient is used to characterize the direction and magnitude of parameter adjustment that reduces the model loss.

[0039] Specifically, the backpropagation algorithm is used to propagate the loss back to the unlocked trainable layer, update the corresponding parameters according to the preset learning rate, guide the model to improve the prediction accuracy of core aerospace terms, and force the model to tilt its computing resources toward high-value aerospace knowledge.

[0040] S24. Repeat steps S21-S23 until the loss function of the base model satisfies the preset convergence condition, and output the pre-trained model.

[0041] Specifically, multiple iterations are performed on the training sample dataset, with each iteration completing the training and parameter updates of the entire dataset until the loss function tends to stabilize and converge without significant fluctuations or decreases, ensuring that the model is fully trained.

[0042] Next, the model's prediction accuracy for core aerospace professional terms was tested on the reserved prediction validation set to verify its improved aerospace semantic representation capability compared to the initial general basic model. After the validation was passed, all parameters of the model were frozen and solidified into the final pre-trained model for the aerospace field.

[0043] For step 104, based on the structured instruction set covering the entire development lifecycle and the enhanced thinking chain data driven by the teacher model, the pre-trained model is updated with low-rank adaptive fine-tuning of the model parameters to obtain an instruction fine-tuning model with engineering reasoning logic.

[0044] This step aims to address the issues of task execution standardization and logical alignment of the model in aerospace software development scenarios such as knowledge question answering, requirements analysis, and code generation, based on the injected domain knowledge. By constructing a structured instruction set covering the entire lifecycle of aerospace software, the model is guided from simple "knowledge representation" to "engineering logic reasoning," ensuring that its output not only conforms to general dialogue specifications but also strictly adheres to the "everything is verifiable and logic is traceable" mindset in the aerospace software development process. This achieves a deep alignment between the model's generation behavior and aerospace engineering standards (such as GJB 5000B).

[0045] In this embodiment of the invention, the instruction fine-tuning model is trained in the following manner: Based on the preset structured instruction templates and encapsulation rules, a basic instruction dataset covering the entire lifecycle of aerospace software is constructed.

[0046] Specifically, to enable the large model to grasp a global view of aerospace software development, the unstructured aerospace engineering data first needs to be transformed into a standard fine-tuning instruction format. Closely following the entire lifecycle of aerospace software development, structured instruction templates covering core development stages such as requirements analysis, code implementation, and unit testing were constructed. During data processing, natural language processing tools and regular expressions were used to extract "context-input-output" triples from the model development task book, requirements specification document, code, and test reports, and these triples were encapsulated using pre-defined task instruction prefixes (Prompt). For example, for code generation tasks, the basic instruction is constructed as a structured input containing "target function name," "hardware interface constraints," and "functional requirement description," while the output is the corresponding original code snippet. Through this full lifecycle instruction coverage, a preliminary response mechanism for the model to task specifications at different engineering stages is established.

[0047] Furthermore, the basic instruction dataset is subjected to few-sample prompt-driven thought chain injection, automated reasoning data enhancement, and quality verification processing to obtain a traceability-enhanced instruction fine-tuning corpus injected with the complete deductive logic of aerospace engineering.

[0048] Specifically, in response to the deficiency that the data extracted from the original engineering often "emphasizes results and neglects process", this embodiment proposes a reasoning data augmentation mechanism driven by the Teacher Model to complete the chain-of-thought (CoT) necessary for the development of aerospace software.

[0049] Because aerospace software has extremely high requirements for the reliability of results, the system inputs the basic instructions constructed in the aforementioned steps into the large base model with powerful reasoning capabilities. Using the few-shot prompting technique, the model is forced to explicitly output intermediate reasoning steps before generating the final answer.

[0050] For example, data augmentation algorithms require that the generated responses include a "logical derivation process," namely, four core steps: target function name analysis, hardware interface constraint decomposition, functional requirement description parsing, and development specification compliance verification, before finally outputting specific code or document solutions. Through this automated logical expansion and data cleaning, a large amount of high-quality "source-enhanced" instruction data is generated, such as "instruction-thought chain-final output," explicitly transforming the expert's development deduction logic into fine-tuned corpus.

[0051] By eliminating invalid samples with missing reasoning steps, logical gaps, or those that do not conform to aerospace engineering standards, a high-quality source-tracing enhanced instruction fine-tuning corpus is ultimately formed, enabling large models to learn this paradigm.

[0052] Based on the preset low-rank degradation matrix, a low-rank degradation bypass is constructed in the linear projection layer of the pre-trained model after all main intervention training parameters are frozen.

[0053] Specifically, similar to the aforementioned model training process, in order to retain the deep vertical domain knowledge injected during the CPT phase to the greatest extent possible (preventing catastrophic forgetting) while accurately activating the model's command compliance capability in space missions, this embodiment employs a low-rank adaptive (LoRA) fine-tuning algorithm to update the base model's parameters. That is, when constructing the low-rank degradation bypass, all original master intervention training parameters of the pre-trained model are completely frozen. Only the bypass trainable interface of the core linear projection layer (Query and Value projection matrices) of the Transformer architecture is retained to ensure that the underlying vertical domain knowledge injected in the previous step is not tampered with, thus avoiding catastrophic forgetting at the source.

[0054] Next, trainable low-rank degradation matrices A and B are injected into the frozen core linear projection layer bypass. For the input vector during the forward propagation process... The final output of its linear layer The calculation formula is as follows: in, The original backbone weights of the frozen model. For the trainable incremental output of the LoRA bypass; matrix Initialized using a random Gaussian distribution, the matrix Zero-matrix initialization is used to ensure that the bypass does not cause perturbations during the initial training phase, and the rank... This reduces the number of fine-tuning parameters by several orders of magnitude, enabling efficient parameter fine-tuning.

[0055] The parameters of the low-rank degradation bypass are iteratively trained and updated based on the instruction fine-tuning corpus, and the updated low-rank matrix parameters are merged with the frozen main intervention training parameters to obtain an instruction fine-tuning model with engineering reasoning logic.

[0056] Specifically, the source-tracing enhanced instruction fine-tuning corpus is loaded into the fine-tuning architecture according to a preset batch size, and the model input is defined as standardized instructions, while the training objective is the full-link output containing the complete thought chain reasoning process.

[0057] Next, the model is forward propagated. The training loss is calculated using the following cross-entropy loss function to determine the optimization objective. Perform gradient updates on the LoRA module: in, For command input, The output includes thought chain reasoning instructions. Representatives include only and The set of trainable parameters for a matrix.

[0058] By using the backpropagation algorithm, the loss is propagated back to the low-rank matrix of the LoRA bypass, and only the parameters of matrices A and B are updated with gradients. The frozen core parameters of the model are not changed at all. While preserving the underlying vertical domain knowledge, the engineering reasoning ability of the model is precisely activated.

[0059] Multiple rounds of iterative training are performed on the training set. After each round of training, the model's instruction compliance, inference logic integrity, and engineering specification compliance are tested on the validation set until the loss function converges stably and the validation metrics are met. After training, the LoRA low-rank matrix parameters are merged with the frozen model backbone parameters, or the LoRA weight file adapted to mainstream inference frameworks is retained, and all parameters are frozen to solidify the final instruction fine-tuning model.

[0060] For step 106, based on the high-quality preference pairs cleaned by multi-judge model collaborative voting, the instruction fine-tuning model is directly optimized to obtain a reliable large software model that meets engineering requirements.

[0061] To address the issues of logical determinism and compliance with development criteria in scenario-based tasks, and considering potential logical illusions, inconsistencies, and violations of common engineering sense that may occur when large models handle complex aerospace missions (such as requirements analysis, question answering, and code generation), this embodiment designs a preference optimization mechanism based on a "development criteria discriminator." By automatically constructing comparative data pairs of "compliant" and "violated" data, the model is forced to maintain extremely high logical rigor and knowledge consistency across all scenario outputs.

[0062] In this embodiment of the invention, when constructing the preference alignment dataset, for different scenarios such as natural language question answering, requirement analysis, code generation, and unit testing, the output of the instruction fine-tuning model is filtered to obtain high-quality results that fully comply with aerospace engineering specifications, are logically complete, and have accurate indicators, which serve as the winning positive samples in preference comparison. Perform purposeful logical perturbations, corresponding to the instruction input. Simultaneously, differentiated logical perturbations are executed for different scenarios, automatically generating hard negative samples that are "syntactically correct and seemingly compliant, but have implicit logical defects or do not conform to specifications," which serve as losing negative samples. ).

[0063] For example, in requirements analysis scenarios, negative samples are constructed by deliberately deleting constraints or introducing contradictory parameters; in natural language question answering scenarios, negative samples are constructed by replacing key technical indicators or obfuscating development phase concepts; in code generation scenarios, negative samples are constructed by introducing nondeterministic logic structures; and in unit testing scenarios, negative samples that are "syntactically correct but logically insufficient" are constructed by deliberately removing physical boundary value checks, reducing complex branch coverage paths, and weakening assertions of key performance indicators.

[0064] This adversarial construction method, based on the characteristics of tasks across all scenarios, generates preference comparison pairs. It can cover all kinds of typical logical errors in aerospace software development, from document description to code implementation.

[0065] Furthermore, to ensure that the criteria for judging preference data are objective in the aerospace field, this solution employs an automated screening mechanism based on a large language model as the discriminator, replacing the single manual scoring method.

[0066] This mechanism drives the model to evaluate and screen the positive and negative sample pairs generated in the first step through a multi-dimensional process by constructing a structured evaluation scale (Evaluation Rubrics) that includes aerospace development criteria. The specific process is as follows.

[0067] First, a set of evaluation dimensions covering the entire aerospace software development scenario was predefined, including: accuracy of technical indicators, coherence of logical deduction, and compliance with development specifications. These dimensions were then transformed into explicit judgment instructions (Prompting), requiring the judging model not only to provide scores but also to offer specific reasoning for the judgment, thereby achieving a deep analysis of sample quality. Then, the judging model evaluated the winning samples... Compared with the losing sample Scoring was done separately, and the difference between the two scores was calculated. : like If the confidence level exceeds the preset threshold, the sample pair is considered to provide a clear and high-quality preference signal; if the difference is too small, it means that the interference of the negative sample is not enough to affect the logical judgment, and the data pair will be automatically removed.

[0068] To eliminate the potential bias of a single discriminant model, this embodiment employs multiple referee models with different parameter scales to score in parallel, and uses majority voting or weighted averaging to obtain the final discriminant result. The cleaned high-quality sample pairs are divided into training and validation sets to form the final preference-aligned training dataset.

[0069] Furthermore, in the model strategy optimization stage, this embodiment adopts the Direct Preference Optimization (DPO) algorithm to directly update parameters on the aforementioned multi-scenario comparison dataset.

[0070] By introducing a reference model (That is, the instruction fine-tuning model after step 104, with all parameters frozen as a baseline), the target model to be optimized. (That is, the instruction fine-tuning model with the same weights as the reference model is the only trainable object, and the backbone parameters are not frozen throughout the process to achieve end-to-end preference optimization).

[0071] When performing inference, its core optimization objective is to maximize the difference in implicit reward between winning samples and losing samples. Through probability offset calculation, negative penalties are imposed on generation behaviors that deviate from the aerospace development logic, while simultaneously increasing the output probability that conforms to aerospace standards.

[0072] This embodiment uses the following loss function: Among them, temperature coefficient Used to adjust the model's sensitivity to preference features.

[0073] In this embodiment of the invention, a dual-model forward propagation is first performed to calculate the log probabilities of the target model and the reference model for winning and losing samples, respectively, and then calculate the log probabilities of both.

[0074] The training loss is then calculated using the aforementioned loss function, and the loss is propagated back to the target model via the backpropagation algorithm. Only the full set of parameters of the target model is updated, thereby achieving negative punishment for erroneous generation behavior and positive incentive for compliant generation behavior.

[0075] Multiple rounds of iterative training are performed on the preference alignment training dataset. After each round of training, the model's technical metrics, accuracy, logical compliance, and specification compliance are tested on the validation set until the loss function converges stably and the core validation metrics meet the standards. After the training meets the standards, all parameters of the target model are frozen and solidified into a reliable large-scale software model that meets engineering requirements and is enhanced by domain knowledge.

[0076] It is worth noting that through gradient backpropagation of this loss function, the algorithm applies a negative penalty to erroneous behavior across all task scenarios, while simultaneously increasing the probability of outputs that align with aerospace development principles. This mechanism essentially sets a unified logical red line for the application of large models across all scenarios, ensuring that the model output, whether textual descriptions or logical code, meets the extreme rigor and high consistency required by aerospace engineering.

[0077] Please refer to Figure 2 This invention provides a domain-adaptive aerospace software large model training device, which includes: The preprocessing module 200 is used to perform domain weight quantification calculation and sorting and filtering on the aerospace-specific corpus that has been processed by word segmentation and stop word filtering based on word frequency and inverse document frequency, so as to obtain the core vocabulary of the aerospace software field. The first training module 202 is used to perform mixed weighted mask sampling on the input text for pre-training according to the core lexicon and the domain weight of each word in the lexicon, and to continue pre-training the preset general large language basic model according to the sampling results, so as to obtain a pre-trained model with aerospace underlying semantic cognition. The second training module 204 is used to perform low-rank adaptive fine-tuning updates of the model parameters of the pre-trained model based on the structured instruction set covering the entire development life cycle and the enhanced thinking chain data driven by the teacher model, so as to obtain an instruction fine-tuning model with engineering reasoning logic. The third training module 206 is used to perform direct preference optimization on the instruction fine-tuning model based on the high-quality preference pairs after collaborative voting and cleaning by the multi-judge model, so as to obtain a reliable large software model that meets engineering requirements.

[0078] In this embodiment of the invention, the process of performing domain weight quantification calculation and sorting and filtering on the aerospace-specific corpus, which has undergone word segmentation and stop word filtering, based on word frequency and inverse document frequency, to obtain a core lexicon for the aerospace software domain includes: A standardized corpus for aerospace software was obtained by fully collecting, verifying compliance, and deduplicating multi-source heterogeneous aerospace software-specific working documents. The dedicated corpus is subjected to word segmentation processing adapted to aerospace professional terminology rules and stop word filtering without technical connotation to obtain a cleaned standardized term set of the entire corpus; For each independent term in the term set, perform term frequency and inverse document frequency statistics and domain weight quantification calculation to obtain an aerospace domain-specific weight mapping table corresponding to all terms; The term set is sorted in descending order of domain weight according to the dedicated weight mapping table, and the sorting results are filtered according to preset filtering rules to obtain the core term library for pre-training.

[0079] In this embodiment of the invention, the step of performing word frequency and inverse document frequency statistics and domain weight quantization calculations on each independent term in the term set includes: Calculate the inverse document frequency of the term in a general corpus and a special corpus. : In the formula, This represents the total number of documents in the mixed corpus. For mixed corpora containing terms The number of documents; The terms are calculated based on the term frequency and the inverse document frequency. Aerospace-specific weight : In the formula, For terms In the dedicated corpus Word frequency in.

[0080] In this embodiment of the invention, the step of performing hybrid weighted mask sampling on the input text used for pre-training based on the core lexicon and the domain weight of each term in the lexicon includes: The input text is matched with terms based on the core vocabulary, and the domain weight of the corresponding terms is determined. The final probability of a corresponding term being selected as a mask object of the input text is calculated based on the domain weights. : In the formula, Based on the probability of random sampling; Let be the domain weight of the i-th term; This is the sum of the domain weights of all terms in the input text; The complete set of words in the input text; This is the balance coefficient; Monte Carlo sampling is performed on the input text based on the final probability of each term to determine the mask terms of the input text; The selected masked terms are masked to obtain a single training sample that meets the input requirements of the basic model. A standardized self-supervised training sample set is constructed based on the training samples of all input texts. The training samples include the corpus blocks obtained by masking, the unmasked context, and the ground truth of the masked terms.

[0081] In this embodiment of the invention, the step of further pre-training a preset general-purpose large language basic model based on the sampling results to obtain a pre-trained model with aerospace underlying semantic cognition includes: S21. Input the corpus blocks in the training sample set into the basic model whose preceding parameters are frozen, and train the basic model with the unmasked context corresponding to each corpus block as a condition to obtain the predicted probability distribution of all masked terms. S22. Based on the prediction results of the base model for each training sample and the ground truth value of the corresponding masked term, calculate the training loss of the base model. : In the formula, The index of the masked term; It is a set consisting of all masked terms in a single training sample; The basic model predicts the true terms at the masked positions. The conditional probability; These are the currently unfrozen trainable parameters of the base model; S23. Perform backpropagation on the training loss to calculate the gradient of the basic model parameters, and update the basic model parameters in reverse according to the gradient; wherein, the gradient is used to characterize the direction and magnitude of parameter adjustment that reduces the model loss; S24. Repeat steps S21-S23 until the loss function of the base model satisfies the preset convergence condition, and output the pre-trained model.

[0082] In this embodiment of the invention, the step of performing low-rank adaptive fine-tuning updates on the model parameters of the domain pre-trained model to obtain an instruction fine-tuning model with engineering reasoning logic includes: Based on the preset structured instruction templates and encapsulation rules, a basic instruction dataset covering the entire lifecycle of aerospace software is constructed. The basic instruction dataset is subjected to few-sample prompt-driven thought chain injection, automated reasoning data enhancement, and quality verification processing to obtain a traceability-enhanced instruction fine-tuning corpus injected with the complete deduction logic of aerospace engineering. A low-rank degradation bypass is constructed in the linear projection layer of the pre-trained model after all main intervention training parameters are frozen, based on the preset low-rank degradation matrix. The parameters of the low-rank degradation bypass are iteratively trained and updated based on the instruction fine-tuning corpus, and the updated low-rank matrix parameters are merged with the frozen main intervention training parameters to obtain an instruction fine-tuning model with engineering reasoning logic.

[0083] It should be noted that the domain-adaptive aerospace software large model training device provided in the above embodiments is only an example of the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the domain-adaptive aerospace software large model training device and the domain-adaptive aerospace software large model training method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0084] Embodiments of this application also provide a computer device, please refer to... Figure 3 The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, code set or instruction set, the at least one instruction, at least one program, code set or instruction set being loaded and executed by the processor to implement the domain-adaptive aerospace software large model training method provided in the above method embodiments.

[0085] Embodiments of this application also provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the domain-adaptive aerospace software large model training method provided in the above-described method embodiments.

[0086] Embodiments of this application also provide a computer program product, which includes a computer program. A processor of a computer device reads the computer program from a computer-readable storage medium and executes the computer program, causing the computer device to perform any of the domain-adapted aerospace software large model training methods described in the above embodiments.

[0087] For ease of description, the above systems or devices are described separately as various modules or units based on their functions. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware components.

[0088] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0089] Finally, it should be noted that in this document, relational terms such as first, second, third, and fourth are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0090] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A domain-adaptive method for training large-scale aerospace software models, characterized in that, The method includes: Based on word frequency and inverse document frequency, the aerospace-specific corpus, which has undergone word segmentation and stop word filtering, is subjected to domain weight quantification calculation and sorting and screening to obtain the core lexicon of the aerospace software domain. Based on the core lexicon and the domain weight of each term in the lexicon, the input text used for pre-training is sampled using a hybrid weighted mask, and the preset general large language basic model is further pre-trained based on the sampling results to obtain a pre-trained model with aerospace underlying semantic cognition. Based on the structured instruction set covering the entire development lifecycle and the enhanced thinking chain data driven by the teacher model, the pre-trained model is updated with low-rank adaptive fine-tuning of model parameters to obtain an instruction fine-tuning model with engineering reasoning logic. Based on the high-quality preference pairs cleaned through collaborative voting by a multi-judge model, the instruction fine-tuning model is directly optimized to obtain a reliable large software model that meets engineering requirements.

2. The method as described in claim 1, characterized in that, The process involves performing domain weight quantification calculations and ranking screening on the aerospace-specific corpus, which has undergone word segmentation and stop word filtering, based on word frequency and inverse document frequency, to obtain a core thesaurus for the aerospace software domain, including: A standardized corpus for aerospace software was obtained by fully collecting, verifying compliance, and deduplicating multi-source heterogeneous aerospace software-specific working documents. The dedicated corpus is subjected to word segmentation processing adapted to aerospace professional terminology rules and stop word filtering without technical connotation to obtain a cleaned standardized term set of the entire corpus; For each independent term in the term set, perform term frequency and inverse document frequency statistics and domain weight quantification calculation to obtain an aerospace domain-specific weight mapping table corresponding to all terms; The term set is sorted in descending order of domain weight according to the dedicated weight mapping table, and the sorting results are filtered according to preset filtering rules to obtain the core term library for pre-training.

3. The method as described in claim 2, characterized in that, The step of performing term frequency and inverse document frequency statistics and domain weight quantification calculations on each independent term in the term set includes: Calculate the inverse document frequency of the term in a general corpus and a special corpus. : In the formula, This represents the total number of documents in the mixed corpus. For mixed corpora containing terms The number of documents; The terms are calculated based on the term frequency and the inverse document frequency. Aerospace-specific weight : In the formula, For terms In the dedicated corpus Word frequency in.

4. The method as described in claim 1, characterized in that, The step of performing hybrid weighted mask sampling on the input text used for pre-training based on the core lexicon and the domain weight of each term in the lexicon includes: The input text is matched with terms based on the core vocabulary, and the domain weight of the corresponding terms is determined. The final probability of a corresponding term being selected as a mask object of the input text is calculated based on the domain weights. : In the formula, Based on the probability of random sampling; Let be the domain weight of the i-th term; This is the sum of the domain weights of all terms in the input text; The complete set of words in the input text; This is the balance coefficient; Monte Carlo sampling is performed on the input text based on the final probability of each term to determine the mask terms of the input text; The selected masked terms are masked to obtain a single training sample that meets the input requirements of the basic model. A standardized self-supervised training sample set is constructed based on the training samples of all input texts. The training samples include the corpus blocks obtained by masking, the unmasked context, and the ground truth of the masked terms.

5. The method as described in claim 4, characterized in that, The step of further pre-training the preset general-purpose large language basic model based on the sampling results to obtain a pre-trained model with aerospace underlying semantic cognition includes: S21. Input the corpus blocks in the training sample set into the basic model whose preceding parameters are frozen, and train the basic model with the unmasked context corresponding to each corpus block as a condition to obtain the predicted probability distribution of all masked terms. S22. Based on the prediction results of the base model for each training sample and the ground truth value of the corresponding masked term, calculate the training loss of the base model. : In the formula, The index of the masked term; It is a set consisting of all masked terms in a single training sample; The basic model predicts the true terms at the masked positions. The conditional probability; These are the currently unfrozen trainable parameters of the base model; S23. Perform backpropagation on the training loss to calculate the gradient of the basic model parameters, and update the basic model parameters in reverse according to the gradient; wherein, the gradient is used to characterize the direction and magnitude of parameter adjustment that reduces the model loss; S24. Repeat steps S21-S23 until the loss function of the base model satisfies the preset convergence condition, and output the pre-trained model.

6. The method as described in claim 1, characterized in that, The step of performing low-rank adaptive fine-tuning of the model parameters of the domain pre-trained model to obtain an instruction fine-tuning model with engineering reasoning logic includes: Based on the preset structured instruction templates and encapsulation rules, a basic instruction dataset covering the entire lifecycle of aerospace software is constructed. The basic instruction dataset is subjected to few-sample prompt-driven thought chain injection, automated reasoning data enhancement, and quality verification processing to obtain a traceability-enhanced instruction fine-tuning corpus injected with the complete deduction logic of aerospace engineering. A low-rank degradation bypass is constructed in the linear projection layer of the pre-trained model after all main intervention training parameters are frozen, based on the preset low-rank degradation matrix. The parameters of the low-rank degradation bypass are iteratively trained and updated based on the instruction fine-tuning corpus, and the updated low-rank matrix parameters are merged with the frozen main intervention training parameters to obtain an instruction fine-tuning model with engineering reasoning logic.

7. A domain-adaptive aerospace software large-scale model training device, characterized in that, The device includes: The preprocessing module is used to perform domain weight quantification calculation and sorting and filtering on the aerospace-specific corpus that has been processed by word segmentation and stop word filtering based on word frequency and inverse document frequency, so as to obtain the core vocabulary of the aerospace software field. The first training module is used to perform mixed weighted mask sampling on the input text for pre-training according to the core lexicon and the domain weight of each word in the lexicon, and to continue pre-training the preset general large language basic model according to the sampling results, so as to obtain a pre-trained model with aerospace underlying semantic cognition. The second training module is used to perform low-rank adaptive fine-tuning updates of the model parameters of the pre-trained model based on the structured instruction set covering the entire development life cycle and the enhanced thinking chain data driven by the teacher model, so as to obtain an instruction fine-tuning model with engineering reasoning logic. The third training module is used to perform direct preference optimization on the instruction fine-tuning model based on the high-quality preference pairs cleaned by multi-judge model collaborative voting, so as to obtain a reliable large software model that meets engineering requirements.

8. A computer device, characterized in that, The computer device includes a memory and a processor. The memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory to implement the steps of the method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in any one of claims 1-6.

10. A computer program product, characterized in that, Includes a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1-6.