Quality authentication method combining model fine tuning and knowledge graph

By constructing a GLM model and combining it with knowledge graphs and low-rank adaptation methods, the performance limitations of pre-trained language models in the field of quality assurance are addressed, enabling efficient application of the model in quality assurance and effective integration of professional knowledge.

CN120851207APending Publication Date: 2025-10-28GUOXIN JINHONG (CHENGDU) INSPECTION & TESTING TECH RES INST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510995602.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-18
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Existing pre-trained language models are not performing well in the field of quality assessment, and their performance needs to be improved through model fine-tuning and the integration of knowledge graphs.

Method used

A GLM model was constructed, and relevant literature on quality assurance was collected for location encoding and data processing, which was then converted into an assurance professional dataset. Knowledge graph information was integrated, and a low-rank adaptation method was used for parameter fine-tuning. A baseline model and evaluation indicators were selected for optimization.

Benefits of technology

It improves the model's application effectiveness in the field of quality verification, enhances its ability to understand and generate long texts and sentences, reduces the demand for computing resources, and improves the ability to accept information technology projects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120851207A_ABST
    Figure CN120851207A_ABST
Patent Text Reader

Abstract

The invention discloses a quality authentication method combining model fine tuning and a knowledge graph, belongs to the technical field of natural language processing, and aims to solve the problem that an existing quality authentication method based on a pre-training language model is insufficient in model performance, the method comprises the following steps: firstly, constructing a GLM model, and performing parameter fine tuning on the GLM model by adopting a low-rank adaptation method; the computing resource demand in the model fine tuning process is reduced, and the model tuning efficiency is improved. Meanwhile, by adopting integration of the knowledge graph, on one hand, the understanding and generation ability of the model to long texts and sentence levels is enhanced, and on the other hand, knowledge in the professional field of quality authentication is effectively integrated into the learning process of the model, so that the model can learn general knowledge from large-scale general texts and can also learn general knowledge from the sentence level. And moreover, professional tasks can be better completed by utilizing the injected knowledge in the quality authentication field, and the application effect of the model in the quality authentication field is improved through optimization and implementation of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of natural language processing technology, specifically relating to the design of a quality verification method that combines model fine-tuning and knowledge graphs. Background Technology

[0002] With the rapid development of artificial intelligence technology, Natural Language Processing (NLP) has made significant progress in text understanding and generation. However, existing pre-trained language models still suffer from performance limitations in specific domains such as quality assessment. To improve the effectiveness of models in these areas, effective fine-tuning of the models is necessary, along with leveraging the structured information provided by knowledge graphs to further enhance their performance. Summary of the Invention

[0003] The purpose of this invention is to address the problem of insufficient model performance in existing quality verification methods based on pre-trained language models, and to propose a quality verification method that combines model fine-tuning and knowledge graphs.

[0004] The technical solution of this invention is: a quality verification method combining model fine-tuning and knowledge graphs, comprising the following steps: S1. Construct the GLM model.

[0005] S2. Collect relevant literature on quality assurance and train the GLM model to encode the location of the relevant literature on quality assurance.

[0006] S3. Perform data processing on the quality verification-related documents after location coding, and convert the quality verification-related content into a professional verification dataset.

[0007] S4. Transform the data in the forensic professional dataset into a knowledge graph, and integrate the information in the knowledge graph into the GLM model.

[0008] S5. The low-rank adaptation method is used to fine-tune the parameters of the GLM model.

[0009] S6. Select a baseline model and evaluation indicators, evaluate and optimize the GLM model after parameter fine-tuning, and conduct quality verification through the optimized GLM model.

[0010] Further, step S1 includes the following sub-steps: S11. A GLM model framework is constructed by deeply integrating multiple encoder layers, and a self-attention mechanism is designed for each encoder layer.

[0011] S12. The GLM model framework is trained using layer normalization techniques, and the GeLU activation function is used to enhance the nonlinear expressive power of the GLM model framework.

[0012] S13. In the GLM model framework, residual connection technology is used to transfer information from lower layers to higher layers, promoting the deep integration of information.

[0013] S14. The deep representations of each encoder layer in the GLM model framework are converted into the probability distribution of token prediction through a linear layer to obtain the GLM model.

[0014] Furthermore, step S2 includes the following sub-steps: S21. Collect relevant literature for quality verification.

[0015] S22. Using masking language simulation technology, randomly mask some words in quality verification-related documents to obtain the masked area.

[0016] S23. Dynamically adjust the number and length of the masking region according to the training objective, and predict the masked words of the masking region based on the context information using the GLM model.

[0017] S24. Use a 2D positional encoding strategy to perform positional encoding on the mask region.

[0018] Furthermore, the 2D positional encoding strategy in step S24 is as follows: the masked words predicted by the GLM model are labeled, and two positional IDs are assigned to each label. The first positional ID represents the absolute position of the label in the original quality verification related literature, and the second positional ID represents the relative position of the label in the masked area. The two positional IDs are mapped into two vectors through a learnable embedding matrix to obtain the positional encoding result.

[0019] Furthermore, the data processing in step S3 includes removing duplicate data, filling in missing data, correcting erroneous data, and expert review.

[0020] Furthermore, step S5 includes the following sub-steps: S51. Obtain the weight matrix of the linear layer of the GLM model. ,in Represents the real number field. This represents the input dimension of the linear layer. This indicates the output dimension of the linear layer.

[0021] S52. Add two low-rank decomposition trainable matrices to the GLM model space. and ,in Denotes the predefined rank, and .

[0022] S53, According to the matrix and The formula for forward propagation of a linear layer is as follows: in This represents the input of a linear layer. This represents the output of a linear layer.

[0023] S54. Train the GLM model according to the forward propagation formula, and during the training process, the weight matrix... It is frozen and does not receive gradient updates, while the matrix... and Updated, parameters fine-tuned.

[0024] Furthermore, step S6 includes the following sub-steps: S61. Select ChatGLM as the baseline model, and use BLEU, ROUGE and METEOR as evaluation indicators to evaluate the GLM model after parameter fine-tuning.

[0025] S62. Select the GLM model with the highest evaluation index value for quality verification.

[0026] Furthermore, the formula for calculating the evaluation index BLEU in step S61 is as follows: in Represents the length penalty factor. Indicates the GLM model's first... n Output text and reference text Matching value, This indicates the number of text output by the GLM model. This indicates the length of the text output by the GLM model. Indicates the length of the reference text. Indicates reference text, Indicates the output text. Represents a set of candidate texts. Indicates the reference text Model, Indicates the output text Model, This represents the match count value.

[0027] Furthermore, the formula for calculating the evaluation index ROUGE in step S61 is as follows: in Represents the original text. Represents the original text set. Indicates length ism of Model, This represents the count value in the output text. This represents the count value in the original text.

[0028] Furthermore, the formula for calculating the evaluation index METEOR in step S61 is as follows: in This represents the alignment penalty factor. The harmonic mean of precision and recall. This indicates the number of word blocks in the text output by the GLM model. This indicates the number of matched words in the output text of the GLM model. Indicates precision, Indicates recall rate, This indicates the number of matching words in the forensic professional dataset. This represents the number of words in the output text of the GLM model. Indicates the number of words in the reference text.

[0029] The beneficial effects of this invention are: (1) This invention improves the application effect of the model in the field of quality verification by constructing and fine-tuning the GLM model framework.

[0030] (2) The present invention uses the low-rank adaptation method to fine-tune the parameters of the GLM model, which reduces the computational resource requirements in the model fine-tuning process and improves the efficiency of model optimization.

[0031] (3) This invention adopts the integration of knowledge graphs, which on the one hand enhances the model’s ability to understand and generate long texts and sentences, and on the other hand effectively integrates knowledge in the professional field of quality assurance into the model’s learning process. This enables the model to not only learn general knowledge from large-scale general texts, but also to better complete professional tasks by utilizing the injected knowledge in the field of quality assurance. Through the optimization and implementation of the model, the application effect of the model in the field of quality assurance has been improved, especially in the ability to accept information technology projects. Attached Figure Description

[0032] Figure 1 The diagram shows a flowchart of a quality verification method combining model fine-tuning and knowledge graphs provided by an embodiment of the present invention.

[0033] Figure 2 The diagram shown is a schematic diagram of the masking language simulation technology provided in an embodiment of the present invention.

[0034] Figure 3 The diagram shown is a schematic of the low-rank adaptation method provided in an embodiment of the present invention. Detailed Implementation

[0035] Exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be understood that the embodiments shown and described in the drawings are merely exemplary and are intended to illustrate the principles and spirit of the invention, and are not intended to limit the scope of the invention.

[0036] This invention provides a quality verification method that combines model fine-tuning and knowledge graphs, such as... Figure 1 As shown, the process includes the following steps S1 to S6: S1. Construct the GLM model (General Language Model).

[0037] Step S1 includes the following sub-steps S11 to S14: S11. A GLM model framework is constructed by deeply integrating multiple encoder layers, and a self-attention mechanism is designed for each encoder layer.

[0038] In this embodiment of the invention, multiple encoder layers are used to capture complex language structures and semantic information, and a self-attention mechanism is used to understand the relationship between each word and other words in the input sequence.

[0039] S12. The GLM model framework is trained using layer normalization techniques, and the GeLU activation function is used to enhance the nonlinear expressive power of the GLM model framework.

[0040] In this embodiment of the invention, the GeLUs activation function is expressed as: in This represents the input to the GLM model framework.

[0041] S13. In the GLM model framework, residual connection technology is used to transfer information from lower layers to higher layers, promoting the deep integration of information.

[0042] S14. The deep representations of each encoder layer in the GLM model framework are converted into the probability distribution of token prediction through a linear layer to obtain the GLM model.

[0043] The GLM model obtained in this embodiment of the invention can demonstrate strong predictive ability and flexibility when performing natural language processing tasks, such as text generation and language understanding.

[0044] S2. Collect relevant literature on quality assurance and train the GLM model to encode the location of the relevant literature on quality assurance.

[0045] Step S2 includes the following sub-steps S21 to S24: S21. Collect relevant literature for quality verification.

[0046] In this embodiment of the invention, relevant literature on quality verification is obtained through various means such as user input, data import, web crawling, professional forums, academic papers, and industry standards.

[0047] S22. Using masking language simulation technology, randomly mask some words in quality verification-related documents to obtain the masked area.

[0048] S23. Dynamically adjust the number and length of the masked regions according to the training objective (e.g., conditional and unconditional text generation), and predict the masked words of the masked regions based on the context information using the GLM model.

[0049] The GLM model is a pre-training framework based on autoregressive fill-in. Its working principle is to randomly select consecutive labeled ranges from the input text, and then train the model to reconstruct these ranges according to the autoregressive pre-training sequence. Figure 2 As shown, the flexibility of the GLM model enables it to demonstrate outstanding performance in both natural language understanding and conditional and unconditional text generation tasks within a single model framework.

[0050] S24. Use a 2D positional encoding strategy to perform positional encoding on the mask region.

[0051] In this embodiment of the invention, the 2D positional encoding strategy specifically involves: labeling the masked words predicted by the GLM model and assigning two positional IDs to each label. The first positional ID represents the absolute position of the label in the original quality assurance-related literature, and the second positional ID represents the relative position of the label within the masked region. These two positional IDs are then mapped to two vectors using a learnable embedding matrix to obtain the positional encoding result. This design not only preserves the global positional information of the text but also accurately captures the relative positional relationships of the labels within the masked region, greatly enhancing the model's ability to process texts with complex structures.

[0052] S3. Perform data processing on the quality verification-related documents after location coding, and convert the quality verification-related content into a professional verification dataset.

[0053] In this embodiment of the invention, data processing includes removing duplicate data, filling in missing data, correcting erroneous data, and expert review. Expert review is a crucial step, enabling the selection of keywords closely related to the project content, materials used, quality standards, and processes. This process incorporates natural language processing-based keyword extraction algorithms to assist in the selection, requiring reviewers to possess strong industry knowledge and the ability to accurately identify keywords reflecting the core quality elements of the project.

[0054] S4. Transform the data in the forensic professional dataset into a knowledge graph, and integrate the information in the knowledge graph into the GLM model.

[0055] Because knowledge graphs contain a large number of entities and relationships, they provide a rich source of knowledge for GLM models. Furthermore, the structured information within knowledge graphs allows GLM models to better understand and learn this information. The information in knowledge graphs is also manually filtered and verified, making it more accurate and improving the accuracy and reliability of the model's output. As domain knowledge is continuously updated, both the knowledge graph and the model are dynamically updated in sync to maintain the model's timeliness and accuracy.

[0056] S5. The low-rank adaptation method is used to fine-tune the parameters of the GLM model.

[0057] Due to the unique nature of quality assurance, such as the widespread use of technical terms and the complexity of terminology, using traditional fine-tuning to adapt to these characteristics can lead to overfitting and requires significant computational resources. To address these issues, this invention employs the Low-Rank Adaptation (LORA) method to fine-tune the parameters of the GLM model. LORA effectively adjusts the model's parameters by adding two trainable matrices of low-rank decomposition to the model's parameter space without requiring substantial computational resources.

[0058] Step S5 includes the following sub-steps S51 to S54: S51. Obtain the weight matrix of the linear layer of the GLM model. ,in Represents the real number field. This represents the input dimension of the linear layer. This indicates the output dimension of the linear layer.

[0059] S52. Add two low-rank decomposition trainable matrices to the GLM model space. and ,in Denotes the predefined rank, and .

[0060] S53, According to the matrix and The formula for forward propagation of a linear layer is as follows: in This represents the input of a linear layer. This represents the output of a linear layer.

[0061] S54. Train the GLM model according to the forward propagation formula, and during the training process, the weight matrix... It is frozen and does not receive gradient updates, while the matrix... and Updated, such as Figure 3 As shown, parameter fine-tuning is completed. Here, q, k, and v represent the query, key, and value of self-attention.

[0062] In this embodiment of the invention, r Set to 8, by selecting This reduces memory consumption because it eliminates the need to store the optimizer state in a large frozen matrix. Therefore, by using LORA, the GLM model can be fine-tuned more efficiently while reducing overfitting and computational demands. Furthermore, initializing the GLM model's detectors using 8-bit integer format (int8) and keeping them fixed during training reduces GPU memory consumption and accelerates training.

[0063] S6. Select a baseline model and evaluation indicators, evaluate and optimize the GLM model after parameter fine-tuning, and conduct quality verification through the optimized GLM model.

[0064] Step S6 includes the following sub-steps S61~S62: S61. Select ChatGLM as the baseline model, and use BLEU, ROUGE and METEOR as evaluation indicators to evaluate the GLM model after parameter fine-tuning.

[0065] Since many open-source models, such as Llama and Vicuna, are primarily trained on English content, their performance on Chinese needs improvement, and their ability to answer questions in relevant professional fields is even weaker. Therefore, ChatGLM, which is trained on Chinese data, was selected as the baseline model, and it was further trained using Chinese data to enhance its understanding and answering capabilities in Chinese.

[0066] Evaluation metrics are used to assess the model's ability to produce accurate forensic evidence. Forensic materials are crucial in the identification process; each chain of evidence is a product of the integration of theory and practice, reflecting the unique perspective and methodology of forensic analysis in revealing the truth. When generating evidence-based questions and answers, only the forensic information generated by the model is retained for ease of measurement and calculation.

[0067] Therefore, in this embodiment of the invention, BLEU, ROUGE, and METEOR are selected as evaluation indicators.

[0068] The formula for calculating the evaluation indicator BLEU is: in Represents the length penalty factor. Indicates the GLM model's first... n Output text and reference text Matching value, This indicates the number of text output by the GLM model. This indicates the length of the text output by the GLM model. Indicates the length of the reference text. Indicates reference text, Indicates the output text. Represents a set of candidate texts. Indicates the reference text Model, Indicates the output text Model, This represents the match count value.

[0069] The evaluation metric ROUGE is used to calculate the similarity between the output text of the GLM model and the original text, primarily focusing on evaluating the model's recall ability. Its calculation formula is as follows: in Represents the original text. Represents the original text set. Indicates length is m of Model, This represents the count value in the output text. This represents the count value in the original text.

[0070] The evaluation metric METEOR is used to approximate human assessments in terms of accuracy and fluency, and its calculation formula is as follows: in This represents the alignment penalty factor. The harmonic mean of precision and recall. This indicates the number of word blocks in the text output by the GLM model. This indicates the number of matched words in the output text of the GLM model. Indicates precision, Indicates recall rate, This indicates the number of matching words in the forensic professional dataset. This represents the number of words in the output text of the GLM model. Indicates the number of words in the reference text.

[0071] In this embodiment of the invention, the output text of the GLM model is the quality verification result output by the GLM model, the original text is the content of quality verification-related literature in the verification professional dataset, and the reference text is the quality verification result in the verification professional dataset.

[0072] S62. Select the GLM model with the highest evaluation index value for quality verification.

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

Claims

1. A quality verification method combining model fine-tuning and knowledge graphs, characterized in that, Includes the following steps: S1. Construct the GLM model; S2. Collect relevant literature on quality assurance and train the GLM model to encode the location of the relevant literature on quality assurance. S3. Perform data processing on the quality verification-related documents after location coding, and convert the quality verification-related content into a professional verification dataset. S4. Transform the data in the forensic professional dataset into a knowledge graph, and integrate the information in the knowledge graph into the GLM model; S5. Use the low-rank adaptation method to fine-tune the parameters of the GLM model; S6. Select a baseline model and evaluation indicators, evaluate and optimize the GLM model after parameter fine-tuning, and conduct quality verification through the optimized GLM model.

2. The quality verification method combining model fine-tuning and knowledge graphs according to claim 1, characterized in that, Step S1 includes the following sub-steps: S11. A GLM model framework is constructed by deeply integrating multiple encoder layers, and a self-attention mechanism is designed for each encoder layer. S12. The GLM model framework is trained using layer normalization techniques, and the GeLU activation function is used to enhance the nonlinear expressive power of the GLM model framework. S13. In the GLM model framework, residual connection technology is used to transfer information from lower layers to higher layers, promoting the deep integration of information. S14. The deep representations of each encoder layer in the GLM model framework are converted into the probability distribution of token prediction through a linear layer to obtain the GLM model.

3. The quality verification method combining model fine-tuning and knowledge graphs according to claim 1, characterized in that, Step S2 includes the following sub-steps: S21. Collect relevant literature on quality verification; S22. Using masking language simulation technology, randomly mask some words in quality verification-related documents to obtain the masked area; S23. Dynamically adjust the number and length of the masking region according to the training objective, and predict the masked words of the masking region based on the context information using the GLM model; S24. Use a 2D positional encoding strategy to perform positional encoding on the mask region.

4. The quality verification method combining model fine-tuning and knowledge graphs according to claim 3, characterized in that, The 2D positional encoding strategy in step S24 is as follows: the masked words predicted by the GLM model are labeled, and two positional IDs are assigned to each label. The first positional ID represents the absolute position of the label in the original quality assurance related literature, and the second positional ID represents the relative position of the label in the masked area. The two positional IDs are mapped into two vectors through a learnable embedding matrix to obtain the positional encoding result.

5. The quality verification method combining model fine-tuning and knowledge graphs according to claim 1, characterized in that, The data processing in step S3 includes removing duplicate data, filling in missing data, correcting erroneous data, and expert review.

6. The quality verification method combining model fine-tuning and knowledge graphs according to claim 1, characterized in that, Step S5 includes the following sub-steps: S51. Obtain the weight matrix of the linear layer of the GLM model. ,in Represents the real number field. This represents the input dimension of the linear layer. This indicates the output dimension of the linear layer; S52. Add two low-rank decomposition trainable matrices to the GLM model space. and ,in Denotes the predefined rank, and ; S53, According to the matrix and The formula for forward propagation of a linear layer is as follows: in This represents the input of a linear layer. This represents the output of a linear layer; S54. Train the GLM model according to the forward propagation formula, and during the training process, the weight matrix... It is frozen and does not receive gradient updates, while the matrix... and Updated, parameters fine-tuned.

7. The quality verification method combining model fine-tuning and knowledge graphs according to claim 1, characterized in that, Step S6 includes the following sub-steps: S61. Select ChatGLM as the baseline model, and BLEU, ROUGE and METEOR as evaluation indicators to evaluate the GLM model after parameter fine-tuning. S62. Select the GLM model with the highest evaluation index value for quality verification.

8. The quality verification method combining model fine-tuning and knowledge graphs according to claim 7, characterized in that, The formula for calculating the evaluation index BLEU in step S61 is as follows: in Represents the length penalty factor. Indicates the GLM model's first... n Output text and reference text Matching value, This indicates the number of text output by the GLM model. This indicates the length of the text output by the GLM model. Indicates the length of the reference text. Indicates reference text, Indicates the output text. Represents a set of candidate texts. Indicates the reference text Model, Indicates the output text Model, This represents the match count value.

9. The quality verification method combining model fine-tuning and knowledge graphs according to claim 7, characterized in that, The formula for calculating the evaluation index ROUGE in step S61 is as follows: in Represents the original text. Represents the original text set. Indicates length is m of Model, This represents the count value in the output text. This represents the count value in the original text.

10. The quality verification method combining model fine-tuning and knowledge graphs according to claim 7, characterized in that, The formula for calculating the evaluation index METEOR in step S61 is as follows: in This represents the alignment penalty factor. The harmonic mean of precision and recall. This indicates the number of word blocks in the text output by the GLM model. This indicates the number of matched words in the output text of the GLM model. Indicates precision, Indicates recall rate, This indicates the number of matching words in the forensic professional dataset. This represents the number of words in the output text of the GLM model. Indicates the number of words in the reference text.