Deep learning enhanced large language model prompting method for software vulnerability detection
Through the deep learning-enhanced large language model prompting method, combined with the local sensitive hash algorithm and a variety of small parameter models, the problems of poor detection and poor interpretability of traditional models in software vulnerability detection are solved, and efficient and accurate vulnerability detection is achieved. Detection and result interpretation improve cross-project generalization and cost-effectiveness.
Patent Information
- Application Number
- CN202410605182.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-09-06
AI Technical Summary
Traditional deep learning models have problems with poor detection performance, black-box characteristics, and poor interpretability in software vulnerability detection. They are also difficult to generalize across projects, affecting vulnerability location and repair work.
Adopting deep learning enhanced large language model prompting method, combined with local sensitive hashing algorithm, multiple small parameter models (BERT type, graph recognition type, character processing type) and question and answer pairing technology, to achieve code candidate collection, vulnerability prediction and result interpretation , improving the accuracy and interpretability of vulnerability detection.
It improves the accuracy and cost-effectiveness of vulnerability detection, provides understandable explanations to developers, reduces false positive rates and data deviations, expands the applicable scope of the model, and enhances detection performance and transparency.
Smart Images

Figure CN118607646A
Abstract
Description
Technical Field
[0001] The present application relates to the field of code vulnerability detection, and specifically to a deep learning enhanced large language model prompting method for software vulnerability detection. Background Art
[0002] With the increasing complexity of network environments and the rapid evolution of attack methods, various threats to software systems have long plagued software development organizations. Software vulnerabilities, as a key source of risk, may lead to information leakage, data tampering, and system crashes, seriously threatening system security and personal privacy. Therefore, vulnerability detection has become the cornerstone of protecting system security. It aims to discover and mitigate the impact of vulnerabilities, prevent malicious attacks, and improve the overall quality, availability, and credibility of software. Today, vulnerability detection has become an indispensable part of modern software development.
[0003] Traditionally, automated static analysis tools have been widely used for vulnerability detection, while in recent years, deep learning (DL) models have strengthened this field in research due to their superior performance compared to rule-based methods. However, applying DL models to software vulnerability detection in practice remains challenging, mainly due to the complex structure of source code, the black-box nature of DL, and the need for domain knowledge to interpret the "black-box" results of post-detection tasks. Conventional DL models are trained for specific projects, so they are good at finding vulnerabilities in these projects, but are not suitable for other projects. Their poor performance in detection directly affects subsequent tasks such as location and repair, and they do not provide the explanations that developers need to understand the detection results.
[0004] In contrast, large language models (LLMs) have made significant progress in solving the above problems through prompting technology, providing advantages. However, LLMs do not perform well in vulnerability identification and have limitations. Therefore, the present invention proposes a deep learning enhanced large language model prompting method, which combines the advantages of DL models and LLMs, overcomes their respective shortcomings, and achieves excellent vulnerability detection performance. Experimental verification shows that the present invention surpasses the current state-of-the-art prompting framework and improves accuracy, cost-effectiveness and interpretability. Summary of the invention
[0005] The purpose of the present invention is to construct a deep learning enhanced large language model prompt method. This method not only improves the accuracy of vulnerability identification, but also focuses on interpretability, assisting developers to understand the detection results, and effectively guiding subsequent verification, positioning and repair work.
[0006] like Figure 1 To achieve the above purpose, the technical solution of the present invention is to provide a deep learning enhanced large language model prompting method for software vulnerability detection, comprising the following steps:
[0007] S1. Contextual learning code candidate set: Use the local sensitive hashing algorithm in the training set to select N code segments that are most similar to the target;
[0008] S2. Integrated model: Integrate small-scale models of multiple dimensions, including BERT-like small-parameter models, image recognition-like small-parameter models, and character-level small-parameter models, and select models through comparative evaluation;
[0009] S3. Vulnerability prediction: Based on the training set, the network is trained using a small parameter model to make probability predictions on vulnerabilities.
[0010] S4. Combined question-answer pairs: Combine the candidate code with the vulnerability probability predicted by the model, and integrate the candidate code with the vulnerability prediction value generated by the small parameter model to construct a question-answer pair for further analysis.
[0011] Preferably, the main process of the local sensitive hashing algorithm in S1 includes:
[0012] Data preprocessing: feature extraction and encoding. Extracting key features from the source code repository involves converting the code into a machine-processable form, such as an abstract syntax tree, bag-of-words model, or word vector representation. These features need to be able to capture the structure and semantics of the code for subsequent similarity comparison.
[0013] Constructing a local sensitive hash table: Based on the extracted features, the LS algorithm is used to construct a hash table. LSH maps the feature space to a much smaller "bucket" or area in a specific way, ensuring that points with similar features are likely to be mapped to the same bucket, while points far away are mapped to different buckets.
[0014] Query and match: For new query code samples, LSH is also used to map them to the hash table, and the corresponding "bucket" is quickly found based on the mapping results. Due to the characteristics of LSH, the elements in the bucket have high similarity, and they are potential similar candidates for query codes.
[0015] Sorting and Verification: After obtaining the candidates, they are sorted according to their similarity with the query code (possibly by calculating cosine distance, Jaccord distance, etc.), and the most similar ones are selected as the most similar candidates. This step can further improve accuracy and reduce false positives.
[0016] Feedback loop optimization iteration. In practical applications, the LSH algorithm is optimized based on the conclusion feedback, and the hash parameters are adjusted or the hash table is updated to improve the performance of future queries.
[0017] The primary goal of using the Locality Sensitive Hashing (LSH) algorithm is to quickly identify the candidate segments that are most similar to the target code in the training dataset. Although the focus of the algorithm is limited to measuring the similarity of code segments, given that the prompt framework we are in needs to run efficiently, it is not appropriate to spend too much time on the prompt information generation process. Therefore, an intelligent sampling strategy is adopted to efficiently select multiple code segments to form a candidate set with high similarity to meet the established requirements.
[0018] Preferably, the small parameter model selection in S2 mainly includes:
[0019] BERT-like model integration: Integrate different members of the BERT family such as CodeBERT, RoBERTa, and XLNET, and use their powerful representation in natural language understanding to understand the code context. CodeBERT is specially trained to understand the code context and capture the code semantics, while RoBERTa and XLNET provide deep understanding of long sequences and enhance the diversity of the model.
[0020] Graph recognition model integration: The integration uses graph neural network models, such as devign, which converts code structure information into graph representations and uses graph structured networks to analyze dependencies and relationships between codes. This helps to understand deeper connections between codes, such as control flow and call graph representation enhancement models.
[0021] Character processing small parameter model integration: It integrates the text vectorization methods of Word2vec and FastText, and combines them with recurrent neural network models such as deep neural network (DNN), bidirectional long short-term memory network (BiLSTM), bidirectional gated recurrent unit (BiGRU) and GRU to build a powerful and multi-dimensional character-level processing small parameter model integration framework to improve the accuracy and efficiency of software vulnerability detection.
[0022] This method will select the model through comparative evaluation: the final selection is evaluated by comparing the effects of three types of small parameter models.
[0023] Preferably, the vulnerability probability prediction process in S3 mainly includes:
[0024] Data cleaning: carefully clean the original code data to remove irrelevant comments, blank characters and noise to ensure the purity of the training set.
[0025] Lightweight layer network. Choose a suitable lightweight neural network as the baseline model to facilitate fast training and serve as the basis for pre-training.
[0026] Pre-training strategy: Step-by-step learning: Perform pre-training in stages, using a large amount of unlabeled data for unsupervised learning in the initial stage, and supervised fine-tuning with a small amount of labeled data in the subsequent stages. Meta-learning: Using meta-learning strategies, the model can quickly adapt to new tasks in a series of related tasks, improving the flexibility of the model in identifying vulnerabilities in new projects.
[0027] Probabilistic evaluation: The model traverses the code to be analyzed and outputs the probability of vulnerability existence for each part to form a set of vulnerability candidates. Probabilistic threshold screening or probability density sorting is used to determine the code segment most likely to have a vulnerability and reduce the false alarm rate.
[0028] Performance evaluation: Use indicators such as Precision, Recall, F1-Score, and FPR curve to measure prediction performance and ensure the effectiveness of the model on real data.
[0029] Preferably, the combined question-answer pair process in S4 mainly includes:
[0030] Integrated information: The vulnerability probabilities predicted by the small parameter model are matched one by one with the candidate code snippets to form a comprehensive matrix including code location, code snippet, predicted probability, vulnerability type and confidence.
[0031] Dynamic sorting: Use algorithms to sort the entries in the matrix according to vulnerability severity, probability, or confidence priority, so as to quickly locate key risk points.
[0032] Compared with the prior art, the beneficial effects achieved by the present invention are: the present invention is a deep learning enhanced large language model prompt method for software vulnerability detection, which has three major advantages:
[0033] Efficiently build an accurate candidate code retrieval mechanism: In the training set, the locality-sensitive hashing algorithm (LSH) is used to quickly identify the N most similar code snippets in preparation for ICL (In-context Learning). This not only quickly focuses on the similarity of code paragraphs, but also takes efficiency into consideration in the prompt design, ensuring the diversity and efficient selection of large-scale code candidate sets.
[0034] Multi-model fusion optimization strategy: In-context Learning and Chain-of-Thought (COT) are integrated and innovatively applied to integrate different types of lightweight, customized, small-parameter models (currently covering three categories) to fine-tune the performance of large language models. This multi-modal combination not only improves the response of large models, but also provides stronger adaptability through comprehensive prediction accuracy.
[0035] Intuitive interactive augmentation hint system: The illustrations are shown in Section 2 (see Figure 2 ), how small parameter models work together Before the leading edge leads to the large model, ICL prompts are formed through carefully designed question-answer pairs (candidate code snippets and their similarities), which not only enhances the implicit fine-tuning of the large model, but also reduces false positives, false perceptions and data bias in specific projects through the auxiliary understanding of the results through intuitive prompts, thereby improving the detection performance.
[0036] In summary, this invention overcomes the limitations of traditional methods by intelligently integrating deep learning and the prompting technology of large language models, achieves excellent vulnerability detection performance, and provides understandable explanations to developers, which helps improve the repair process.
[0037] In addition to the three advantages listed above, this technical solution also has the following additional technical advantages:
[0038] Improved cross-project generalization capabilities: This technical framework can use the DLAP mechanism to enable large language models to demonstrate good vulnerability detection capabilities in different projects without being trained on a specific project. This overcomes the limitation of traditional DL models that only perform well in specific projects and expands the scope of application of the technology.
[0039] Significant cost-effectiveness: Compared to traditional deep learning models that require a lot of computing resources and time for expensive fine-tuning, the DLAP framework utilizes carefully designed prompt templates and lightweight models to significantly reduce resource consumption. This makes model fine-tuning more economical, especially in resource-limited environments, while still maintaining high performance.
[0040] Enhanced transparency and explainability: Through the integration of DL models and LLMs, the technology not only improves detection accuracy, but also improves the transparency of results. Using clear prompts to guide, LLMs output easy-to-understand reasoning paths, helping developers to intuitively understand the logic of vulnerability detection, thereby facilitating subsequent repair work. This solves the problem that traditional black box models are difficult to explain and enhances the trust of developers.
[0041] Dynamic adaptability and self-optimization: In this framework, LLMs use attention mechanisms and specially designed prompts to dynamically adjust internal mechanisms, implicitly fine-tune themselves, and adapt to different downstream tasks. This means that the model can continuously learn and optimize itself as the task changes, improve its performance in different scenarios, and enhance the robustness of the model.
[0042] Comprehensive risk assessment and prioritization: Probabilistic assessment and comprehensive risk ranking of vulnerabilities through algorithms not only reduce false positive rates, but also achieve efficient risk management. This allows the security team to quickly focus on dealing with the most urgent and serious vulnerabilities, improve response efficiency, and reduce potential security risks. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0044] Figure 1 It is a general flow chart of the present invention;
[0045] Figure 2 is a detailed flow chart of the present invention;
[0046] Figure 3 is a flow chart of step S1 of the present invention;
[0047] Figure 4 is a flow chart of step S2 of the present invention;
[0048] Figure 5 is a flow chart of step S3 of the present invention;
[0049] Figure 6 is a flow chart of step S4 of the present invention;
[0050] Figure 7 This is a sample vulnerability detection report in the embodiment. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] Embodiment 1: A deep learning enhanced large language model prompting method for software vulnerability detection, comprising the following steps:
[0053] S1. Contextual learning code candidate set: Use the local sensitive hashing algorithm in the training set to select N code segments that are most similar to the target;
[0054] S2. Integrated model: Integrate small-scale models of multiple dimensions, including BERT-like small-parameter models, image recognition-like small-parameter models, and character-level small-parameter models, and select models through comparative evaluation;
[0055] S3. Vulnerability prediction: Based on the training set, the network is trained using a small parameter model to predict the probability of vulnerabilities;
[0056] S4. Combined question-answer pairs: Combine the candidate code with the vulnerability probability predicted by the model, and integrate the candidate code with the vulnerability prediction value generated by the small parameter model to construct a question-answer pair for further analysis.
[0057] The flowchart of S1 is as follows Figure 3 As shown, the following steps are included:
[0058] S1-1: Data preprocessing: feature extraction and encoding. Extracting key features from the source code library involves converting the code into a machine-processable form, such as an abstract syntax tree, bag-of-words model, or word vector representation. These features need to be able to capture the structure and semantics of the code for subsequent similarity comparison.
[0059] S1-2: Constructing a local sensitive hash table: Based on the extracted features, the LS algorithm is used to construct a hash table. LSH maps the feature space to a much smaller "bucket" or area in a specific way, ensuring that points with similar features are likely to be mapped to the same bucket, while points far away are mapped to different buckets.
[0060] S1-3: Query and Matching: For new query code samples, LSH is also applied to map them to the hash table, and the corresponding "bucket" is quickly found based on the mapping results. Due to the characteristics of LSH, the elements in the bucket have high similarity, and they are potential similar candidates for query codes.
[0061] S1-4: Sorting and Verification: After obtaining the candidates, they are sorted according to their similarity with the query code (possibly by calculating cosine distance, Jaccord distance, etc.), and the most similar ones are selected as the most similar candidates. This step can further improve accuracy and reduce false positives.
[0062] S1-5: Feedback loop optimization iteration. In practical applications, the LSH algorithm is optimized based on the conclusion feedback, and the hash parameters are adjusted or the hash table is updated to improve the performance of future queries.
[0063] The flow chart of S2 is as follows Figure 4 As shown, the following steps are included:
[0064] S2-1: Small parameter model selection: Select the BERT model for category recognition, small parameter models for image recognition, and small parameter models at the character level.
[0065] S2-2: BERT-like model integration: Integrate different members of the BERT family such as CodeBERT, RoBERTa, and XLNET, and use their powerful representation in natural language understanding to understand the code context. CodeBERT is specially trained to understand the code context and capture the code semantics, while RoBERTa and XLNET provide deep understanding of long sequences and enhance the diversity of the model.
[0066] S2-3: Graph recognition model integration: The integration uses graph neural network models, such as devign, which converts code structure information into graph representations and uses graph structured networks to analyze dependencies and relationships between codes. This helps to understand deeper connections between codes, such as control flow and call graph representation enhancement models.
[0067] S2-4: Character processing small parameter model integration: It integrates the text vectorization methods of Word2vec and FastText, and combines them with recurrent neural network models such as deep neural network (DNN), bidirectional long short-term memory network (BiLSTM), bidirectional gated recurrent unit (BiGRU) and GRU to build a powerful and multi-dimensional character-level processing small parameter model integration framework to improve the accuracy and efficiency of software vulnerability detection.
[0068] S2-5: Model selection through comparative evaluation: Evaluate the final selection by comparing the effects of three types of small parameter models.
[0069] The flow chart of S3 is as follows Figure 5 As shown, the following steps are included:
[0070] S3-1: Data cleaning: carefully clean the original code data, remove irrelevant comments, blank characters and noise, and ensure the purity of the training set.
[0071] S3-2: Lightweight layer network. Select a suitable lightweight neural network as the baseline model to facilitate fast training and serve as the basis for pre-training.
[0072] S3-3: Pre-training strategy: Step-by-step learning: Perform pre-training in stages, using a large amount of unlabeled data for unsupervised learning in the initial stage, and supervised fine-tuning with a small amount of labeled data in the subsequent stages. Meta-learning: Use meta-learning strategies to allow the model to quickly adapt to new tasks in a series of related tasks, and improve the flexibility of the model in identifying vulnerabilities in new projects.
[0073] S3-4: Probability evaluation: The model traverses the code to be analyzed, outputs the probability of vulnerability existence for each part, and forms a set of vulnerability candidates. Probability threshold screening or probability density sorting is used to determine the code segment most likely to have a vulnerability and reduce the false alarm rate.
[0074] S3-5: Performance evaluation: Use indicators such as Precision, Recall, F1-Score, FPR curve, etc. to measure the prediction performance and ensure the effectiveness of the model on real data.
[0075] The flowchart of S4 is as follows Figure 6 As shown, the following steps are included:
[0076] S4-1: Integrated information: The vulnerability probabilities predicted by the small parameter model are matched one by one with the candidate code snippets to form a comprehensive matrix containing code location, code snippet, predicted probability, vulnerability type and confidence.
[0077] S4-2: Dynamic sorting: Use a weighted sorting algorithm to sort the entries in the matrix according to vulnerability severity, probability, or confidence priority, so as to quickly locate the most critical risk points.
[0078] The specific process of the weighted value sorting algorithm is as follows:
[0079] Define weights: First, give each sorting criterion (such as severity, probability, confidence) a weight based on business needs and security priorities.
[0080] Calculate the score: For each entry (vulnerability record) in the matrix, multiply each indicator value by the corresponding weight and add them up to get a comprehensive score.
[0081] Sorting: Use a weighted value sorting algorithm to sort all entries in the matrix according to the calculated scores. The highest score is ranked first, indicating the highest risk.
[0082] Output: Sorted matrix display, developers or security teams can intuitively see the vulnerabilities arranged by risk level and prioritize the most critical risk points.
[0083] Example 2: The method of the present invention is implemented on an existing real data set.
[0084] This example evaluates different DL models to select a DL model with better results. This example selects three representative DL models for evaluation: Sysevr, Devign, and Linevul. Each model has its own unique design logic and hyperparameter settings, corresponding to different features:
[0085] Sysevr: It focuses on code features represented by syntax, semantics, and vectors, and filters the input to the model through static analysis to ensure that the input is based on semantically and grammatically clear code slices.
[0086] Devign introduces a structured graph network structure, which enriches the vulnerability detection framework through graph neural network models and uses complex metrics of graph structures to enhance recognition patterns.
[0087] Linevul is based on a pre-trained deep learning model and uses the Transformer architecture. It is a novel system that focuses on detecting models directly based on pre-trained models rather than specific projects, showing its advantages in a broad sense.
[0088] This example refers to the best performance parameters reported in the papers of these models, and pre-sets hyperparameters within the framework to ensure the optimal performance of the reproduced model while maintaining experimental consistency.
[0089] The indicators used in this embodiment include precision, recall, F1-score, false positive rate (FPR) and Matthews correlation coefficient (MCC). The results are shown in Tables 1 to 3:
[0090] Table 1 Linevul model experimental results statistics:
[0091]
[0092]
[0093] Table 2 Statistics of Devign model experimental results:
[0094]
[0095] Table 3 Statistics of Sysevr model experimental results:
[0096]
[0097] Comparing the performance of these models on different items, Linevul shows a higher detection probability, indicating that its predictions have high confidence and can therefore more effectively inspire subsequent LMMs.
[0098] It should be noted that the above embodiments are not intended to limit the protection scope of the present invention, and equivalent changes or substitutions made on the basis of the above technical solutions all fall within the protection scope of the claims of the present invention.
Claims
1. A deep learning enhanced large language model prompting method for software vulnerability detection, characterized by: The following steps are involved: S1. Contextual learning code candidate set: Use the local sensitive hashing algorithm in the training set to select N code segments that are most similar to the target; S2. Integrated model: Integrate small-scale models of multiple dimensions, including BERT-like small-parameter models, image recognition-like small-parameter models, and character-level small-parameter models, and select models through comparative evaluation; S3. Vulnerability prediction: Based on the training set, the network is trained using a small parameter model to predict the probability of vulnerabilities; S4. Combined question-answer pairs: Combine the candidate code with the vulnerability probability predicted by the model, and integrate the candidate code with the vulnerability prediction value generated by the small parameter model to construct a question-answer pair for further analysis.
2. The deep learning enhanced large language model prompting method for software vulnerability detection according to claim 1, characterized in that: The S1 comprises the following steps: S1-1: Data preprocessing: feature extraction and encoding, extracting key features from the source code library, which involves converting the code into a machine-processable form, including abstract syntax trees, bag-of-words models, or word vector representations. These features need to be able to capture the structure and semantics of the code for subsequent similarity comparisons. S1-2: Constructing a local sensitive hash table: Based on the extracted features, the LS algorithm is used to construct a hash table. LSH maps the feature space to a much smaller "bucket" or "area" in a specific way, ensuring that points with similar features are likely to be mapped to the same bucket, while distant points are mapped to different buckets. S1-3: Query and Matching: For new query code samples, LSH is also applied to map them to the hash table. The corresponding "bucket" is quickly found based on the mapping result. Due to the characteristics of LSH, the elements in the bucket have high similarity, and potential similar candidates for the query code are selected. S1-4: Sorting and verification: After obtaining the candidates, they are sorted according to their similarity with the query code, and the most similar ones are selected as the most similar candidates. S1-5: Feedback loop optimization iteration, optimize the LSH algorithm based on the conclusion feedback, adjust the hash parameters or update the hash table to improve the performance of future queries.
3. The deep learning enhanced large language model prompting method for software vulnerability detection according to claim 1, characterized in that: The S2 comprises the following steps: S2-1: Small parameter model selection: Select the BERT model for category recognition, the small parameter model for image recognition, and the small parameter model at the character level. S2-2: BERT-like model integration: Integrate different members of the BERT family including CodeBERT, RoBERTa, and XLNET, and use their powerful representation in natural language understanding to understand the code context. CodeBERT is specially trained to understand the code context and capture the code semantics. RoBERTa and XLNET provide a deep understanding of long sequences and enhance the diversity of the model. S2-3: Graph recognition model integration: The integration uses a graph neural network model, which converts code structure information into a graph representation and uses the graph structured network to analyze the dependencies and relationships between codes. S2-4: Character processing small parameter model integration: The text vectorization methods of Word2vec and FastText are integrated with deep neural network (DNN), bidirectional long short-term memory network (BiLSTM), bidirectional gated recurrent unit (BiGRU) and GRU recurrent neural network models to build a powerful and multi-dimensional character-level processing small parameter model integration framework to improve the accuracy and efficiency of software vulnerability detection. S2-5: Model selection through comparative evaluation: Evaluate the final selection by comparing the effects of three types of small parameter models.
4. The deep learning enhanced large language model prompting method for software vulnerability detection according to claim 1, characterized in that: The S3 comprises the following steps: S3-1: Data cleaning: Carefully clean the original code data, remove irrelevant comments, blank characters and noise, and ensure the purity of the training set. S3-2: Lightweight and small-parameter network, select a suitable lightweight neural network as the baseline model, which is convenient for fast training and serves as the basis for pre-training. S3-3: Pre-training strategy: Step-by-step learning: Perform pre-training in stages. In the initial stage, a large amount of unlabeled data is used for unsupervised learning. In the subsequent stages, a small amount of labeled data is combined for supervised fine-tuning. Meta-learning: Use meta-learning strategies to allow the model to quickly adapt to new tasks in a series of related tasks, and improve the flexibility of the model in identifying vulnerabilities in new projects. S3-4: Probability evaluation: The model traverses the code to be analyzed, outputs the probability of vulnerability existence for each part, forms a vulnerability candidate set, uses probability threshold screening or probability density sorting to determine the code segment most likely to have a vulnerability, and reduces the false alarm rate. S3-5: Performance evaluation: Use Precision, Recall, F1-Score, and FPR curve indicators to measure prediction performance and ensure the effectiveness of the model on real data.
5. The deep learning enhanced large language model prompting method for software vulnerability detection according to claim 1, characterized in that: The S4 comprises the following steps: S4-1: Integrated information: The vulnerability probabilities predicted by the small parameter model are matched one by one with the candidate code snippets to form a comprehensive matrix including code location, code snippet, prediction probability, vulnerability type and confidence. S4-2: Dynamic sorting: Use a weighted sorting algorithm to sort the entries in the matrix according to vulnerability severity, probability, or confidence priority, so as to quickly locate the most critical risk points.
6. The deep learning enhanced large language model prompting method for software vulnerability detection according to claim 5 is characterized in that: The specific process of the weighted value sorting algorithm is as follows: Define weights: First, give each sorting criteria a weight based on business needs and security priorities. Calculate the score: For each entry (vulnerability record) in the matrix, multiply each indicator value by the corresponding weight, and add them up to get a comprehensive score. Sorting: Use a weighted value sorting algorithm to sort all entries in the matrix according to the calculated scores. The highest score is ranked first, indicating the highest risk. Output: Sorted matrix display, developers or security teams can intuitively see the vulnerabilities arranged by risk level and prioritize the most critical risk points.
Citation Information
Cited By
Digital engineering full life cycle management method based on unified data source
CN119338407A
Safety alarm false alarm identification method based on deep learning and text analysis
CN119341792A
A security alarm false alarm identification method based on deep learning and text analysis
CN119341792B
File detection method and device, equipment, medium and program product
CN119416214A
Code intelligent task performance improvement method based on large model
CN119621122A
