Semantic contribution recognition method and system using self-described prompt and integrated gradient
By combining self-reported prompts and integrated gradient technology, the key semantic contributions in decision-making of large language models are solved, and a more comprehensive and accurate interpretation of model behavior is achieved.
Patent Information
- Application Number
- CN202411808989.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-05-13
AI Technical Summary
The existing large language model behavior interpretation methods have limitations and it is difficult to fully and accurately identify key semantic contributions in model decisions.
The combination of self-reported prompts and integrated gradients is adopted. By obtaining input data and writing specific problem prompts, it is input multiple times to a large language model to generate a collection of keyword proposals, and a semantic contribution list is calculated based on the integrated gradient, and integrated analysis is performed to determine vocabulary that has a significant impact on model decisions.
It improves the comprehensiveness and accuracy of model interpretation, can effectively identify the core corpus that affects model decisions, reduces dependence on manual annotation, and improves the efficiency and reliability of automated processing.
Smart Images

Figure CN119990134A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of large language model training, and in particular to a semantic contribution recognition method and system using self-description prompts and integrated gradients. Background Art
[0002] Large language models (LLMs) such as GPT and BERT perform well in a variety of natural language processing tasks, but their decision-making process often lacks transparency. This "black box" nature makes it difficult for end users to understand how and why the model makes a specific prediction. In high-risk and high-liability application scenarios such as medical diagnosis, financial services decisions, and legal advice, user trust in the model is critical. Only when users can understand the working principles and logic of the model are they more likely to trust and rely on these technologies. Therefore, providing interpretable model outputs can significantly enhance user acceptance and trust in the model. With the increasing complexity of machine learning models, especially deep learning models, scholars and engineers have developed a variety of methods to explain the behavior of the model and analyze the model's decision-making process from different perspectives.
[0003] Neuron-based methods. This type of method attempts to explain the behavior of the model by analyzing the activity of a single or a few neurons within the model. For example, in the prior art "Finding Skill Neurons in Pre-trained Transformer-based Language Models", the authors discovered a special type of neuron in the pre-trained language model based on the Transformer architecture, called skill neurons. The activation of these neurons is highly predictive of the labels of specific tasks. Specifically, the authors found some neurons in the pre-trained model that have a significant impact on the task labels through a hint tuning method, and verified that these neurons do encode the specific skills required to process different natural language tasks, and also verified the practical application of skill neurons.
[0004] Integrated gradient-based methods. Integrated gradients determine the importance of different features to the final prediction by calculating the gradient (i.e., rate of change) of the model output for each input feature. It is particularly suitable for processing neural network models with continuous input spaces, such as image recognition or natural language processing. The advantage of this technology is that it can provide precise and mathematically interpretable results, making the behavior of the model more transparent to developers and end users.
[0005] Although neuron-based methods provide a deep understanding of certain neurons or neural network structures within the model, this approach mainly focuses on analyzing the internal mechanisms of the model and often ignores the specific contributions of the input data. For example, while the identification of skill neurons provides insights into how the model handles specific tasks, this approach does not directly explain which specific words or features in the input data have a decisive impact on the model's predictions.
[0006] Integrated gradient methods provide a mathematically rigorous way to evaluate the impact of input features on model outputs, which is very effective in many applications. However, it also has certain limitations, especially when dealing with natural language processing tasks. Integrated gradients sometimes tend to overemphasize grammatically important words, such as conjunctions or prepositions, which may be grammatically critical but may have very limited contribution to conveying the main semantic content. This bias can lead to misleading model interpretation. Summary of the invention
[0007] The present invention provides a semantic contribution identification method and system using self-descriptive prompts and integrated gradients, which are used to solve the limitation problem of a single method for interpreting the behavior of a large language model in the prior art, improve the comprehensiveness and accuracy of the model interpretation, and meet the requirements for interpretability in a variety of natural language processing applications.
[0008] The present invention provides a semantic contribution recognition method using self-description prompts and integrated gradients, comprising: Get input data and write specific question prompts; Inputting the question prompt multiple times into a preset large language model, guiding the large language model to automatically identify and report words that play a key role in the decision-making process, and generating a set of keyword suggestions; Extract keywords based on the keyword suggestion set and generate a first semantic contribution list; Based on the input data, an integrated gradient calculation is performed using a preset formula to generate a second semantic contribution list; The first semantic contribution list and the second semantic contribution list are integrated and analyzed to determine the words that have a significant impact on the decision of the large language model.
[0009] According to a semantic contribution identification method using self-description prompts and integrated gradients provided by the present invention, the writing of a specific question prompt specifically includes: Add task types and labels during question prompt writing, and set special symbols; The classification tendency of the input data is determined by the task type and label, and the keyword generation position is located through special symbols.
[0010] According to a semantic contribution identification method using self-description prompts and integrated gradients provided by the present invention, the question prompt is input into a preset large language model, and a text containing keywords is generated by the large language model; After repeated input of question prompts into the large language model, the large language model is guided to automatically identify and report multiple keyword texts that play a key role in the decision-making process; Collect multiple key keyword texts to form a keyword suggestion set.
[0011] According to a semantic contribution identification method using self-description prompts and integrated gradients provided by the present invention, extracting keywords based on the keyword proposal set to generate a first semantic contribution list specifically includes: Counting the frequency of occurrence of each keyword based on the keyword suggestion set; Sort the keywords by frequency of occurrence from high to low, and take the first semantic contribution list of the keyword components that have the first set number of positions.
[0012] According to a semantic contribution identification method using self-description prompts and integrated gradients provided by the present invention, the integrated gradient calculation is performed based on the input data through a preset formula to generate a second semantic contribution list, specifically including: Based on the input data, the input data is converted into a word embedding vector through a large language model, and the integrated gradient at the word vector level is calculated through a preset formula; Based on the integrated gradient aggregation, all dimensions in the embedding vector corresponding to a single word are converted into the original keyword, and the second semantic contribution list is generated.
[0013] According to a semantic contribution identification method using self-description prompts and integrated gradients provided by the present invention, the first semantic contribution list and the second semantic contribution list are integrated and analyzed to determine the words that have a significant impact on the decision of the large language model, specifically including: Assigning different weight values to each keyword in the first semantic contribution list and the second semantic contribution list; Perform integrated analysis based on different weight values to obtain importance scores; Keywords corresponding to importance scores exceeding a set threshold are identified as words that have a significant impact on the decision of the large language model.
[0014] The present invention also provides a semantic contribution recognition system using self-description prompts and integrated gradients, the system comprising: A question prompt writing module, used to obtain input data and write specific question prompts; A keyword suggestion module, used to input the question prompt multiple times into a preset large language model, guide the large language model to automatically identify and report words that play a key role in the decision-making process, and generate a set of keyword suggestions; A keyword extraction module, configured to extract keywords based on the keyword suggestion set and generate a first semantic contribution list; An integrated gradient module, used to perform integrated gradient calculation based on the input data through a preset formula to generate a second semantic contribution list; An integration module is used to integrate and analyze the first semantic contribution list and the second semantic contribution list to determine the vocabulary that has a significant impact on the decision of the large language model.
[0015] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method for identifying semantic contributions using self-describing prompts and integrated gradients as described in any one of the above methods is implemented.
[0016] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a semantic contribution identification method using self-describing prompts and integrated gradients as described in any one of the above.
[0017] The present invention also provides a computer program product, comprising a computer program, which, when executed by a processor, implements the semantic contribution identification method using self-descriptive prompts and integrated gradients as described in any one of the above.
[0018] The present invention provides a semantic contribution identification method and system using self-describing prompts and integrated gradients. By extracting keywords based on a keyword proposal set to design self-describing prompts and combining them with integrated gradient technology, the advantages of the two methods are comprehensively utilized, including the ability of self-explanation within the model and external mathematical quantification of the importance of input features, thereby providing a more comprehensive and in-depth explanation of model behavior; it can not only effectively identify the core corpus that affects the model's decision, but also reduce the reliance on manual annotation in practical applications, thereby improving the efficiency and reliability of automated processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1It is a flowchart of the semantic contribution recognition method using self-description prompts and integrated gradients provided by the present invention.
[0021] Figure 2 It is a schematic diagram of module connections of a semantic contribution recognition system using self-descriptive prompts and integrated gradients provided by the present invention.
[0022] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention.
[0023] Reference numerals: 110: question prompt writing module; 120: keyword suggestion module; 130: keyword extraction module; 140: integrated gradient module; 150: integration module; 310: processor; 320: communication interface; 330: memory; 340: communication bus. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.
[0025] Combine the following Figure 1 A semantic contribution recognition method using self-description prompts and integrated gradients is described in the present invention, including: step 100, obtaining input data and writing specific question prompts.
[0026] Specifically, task types and labels are added during the question prompt writing process, and special symbols are set; The classification tendency of the input data is determined by the task type and label, and the keyword generation position is located through special symbols.
[0027] In the present invention, it is crucial to write a specific question prompt, that is, to explicitly add the task type (such as sentiment binary classification task) and label (such as positive or negative) of the input sentence when designing the prompt. In this way, the model not only processes the content of the language itself, but also incorporates the specific goal of the task, that is, to judge the classification tendency of the sentence. Doing so can guide the model to focus more on those words that are crucial to the true label tendency. The second is to set special symbols to facilitate keyword extraction. At the end of the prompt, add a specific marker (such as "{"), followed by the expected output format generated by the model as a keyword list. This formatted prompt helps the model output keywords directly in a specific area when generating text, thereby simplifying the subsequent keyword extraction process. Using regular expressions, you can easily extract the content within the curly braces from the generated text.
[0028] In a specific example, taking the Chinese sentiment binary classification task as an example, suppose we have the following Chinese sentence and need to perform sentiment binary classification: Sentence "The battery life of this phone is really long, I am very satisfied with it." / Sentiment label: "positive".
[0029] You can design the following prompt: "This is a task about sentiment analysis: 'The battery life of this phone is really long, I am very satisfied.', and mark it as positive. The key word for classification is {".
[0030] In this prompt, it is clearly stated that the sentence is for sentiment analysis and the sentiment label is given as "positive". In addition, by adding the "{" mark at the end of the sentence, a clear area is set so that the large language model knows where to start generating a list of keywords.
[0031] Step 200: Input the question prompt multiple times into a preset large language model, guide the large language model to automatically identify and report words that play a key role in the decision-making process, and generate a set of keyword suggestions.
[0032] Specifically, the question prompt is input into a preset large language model, and a text containing keywords is generated by the large language model; After repeated input of question prompts into the large language model, the large language model is guided to automatically identify and report multiple keyword texts that play a key role in the decision-making process; Collect multiple key keyword texts to form a keyword suggestion set.
[0033] In the present invention, we are not limited to a specific large language model. We can choose any mainstream pre-trained language model, such as GPT-3, BERT, ChatGLM, Llama or other similar models, as long as they support text generation tasks. The selected model should be able to handle complex language understanding tasks and support custom prompt input.
[0034] In order to improve the accuracy and robustness of keyword extraction, the present invention recommends inputting the designed prompt into the model multiple times. This is because the language model may show randomness when generating responses, especially when using random sampling techniques such as top-k sampling or temperature setting. After each input, the model will generate a text containing possible keywords. By repeating this process multiple times, different sets of keyword proposals can be collected.
[0035] Step 300: extract keywords based on the keyword suggestion set and generate a first semantic contribution list.
[0036] Specifically, counting the frequency of occurrence of each keyword based on the keyword suggestion set; Sort the keywords by frequency of occurrence from high to low, and take the first semantic contribution list of the keyword components that have the first set number of positions.
[0037] In the present invention, for the previous example, the model's answer may be as follows: "This is a sentiment analysis task: 'This phone has a really long battery life, I am very satisfied with it.', and marked as positive. The key words in the analysis are {battery life, satisfaction}".
[0038] In the text generated by the model, keywords are enclosed in specific symbols (such as curly braces {}). This formatted output design makes keyword extraction direct and efficient, such as using regular expressions to identify and extract these enclosed keywords.
[0039] For each generated response, the extracted keywords will be added to a total keyword pool. Since the model may mention the same words in different generations, it is necessary to record the frequency of each keyword. In multiple generated responses, some keywords will be mentioned repeatedly by the model. These frequently occurring words are usually the factors that the model considers to have the greatest impact on the decision. Based on the frequency of occurrence of keywords, the top few keywords with the highest frequency are selected as the final result. For example, the top 10 keywords with the highest frequency can be selected. This selection process not only reflects the importance of keywords in model decisions, but also provides a set of credible keywords that have been verified many times, namely the first semantic contribution list, which increases the reliability and accuracy of the interpretation.
[0040] The final set of selected keyword lists will be used to explain the model's decision-making process. These keywords provide an intuitive understanding of what specific information the model relies on when performing sentiment analysis or other tasks.
[0041] Step 400: Perform integrated gradient calculation based on the input data using a preset formula to generate a second semantic contribution list.
[0042] Specifically, based on the input data being converted into a word embedding vector through a large language model, an integrated gradient at the word vector level is calculated through a preset formula; Based on the integrated gradient aggregation, all dimensions in the embedding vector corresponding to a single word are converted into the original keyword, and the second semantic contribution list is generated.
[0043] In the present invention, the basic formula for integrated gradient calculation is: .
[0044] in: is the input vector, is the baseline input vector, typically chosen to give the model the lowest activation output (e.g., this could be a completely black or white image in an image model, or an empty or meaningless input in a text model); and The input vectors are and No. elements; is the output function of the model, which is related to the input A specific element of The partial derivative of represents the local influence of the element on the model output; α is an integral path parameter from 0 to 1, which is used to and the actual input Interpolate between.
[0045] In the specific calculation process, the input vector is the word embedding vector after the input data is transformed by the embedding layer of the large language model, and the baseline input vector can be taken as all 0s, indicating "blank"; as for the integration process, the value can be uniformly taken between the input vector and the baseline input vector to simulate the theoretical path integral.
[0046] The basic idea of the integrated gradient is to calculate the integral of the gradient along the path from a reference input (usually an all-zero vector or a completely unimportant input) to the actual input. In this way, the impact of each input feature on the model output throughout the decision-making process can be evaluated. This method helps to understand how the model makes predictions and can provide insights into which features most affect the model's decisions.
[0047] The working principle of integrated gradient is as follows: Select the reference point: First, select a reference input, which represents the "unimportant" situation. For image data, this may be a completely black picture; for text data, this may be a sequence of empty strings or filler symbols.
[0048] Define a path: Define a linear path from the reference point to the actual input. This path consists of multiple steps, each step getting slightly closer to the actual input.
[0049] Calculate gradients: At each point on the path, calculate the gradient of the model output relative to the input features. The gradient represents how the model output will change if the input features are changed a little bit.
[0050] Integral Gradient: Integrate the gradients of all points on the path, that is, sum and average them. This step gives the contribution of each input feature to the model output.
[0051] Normalization: Finally, the integrated values are normalized so that they can be directly compared.
[0052] Ability to implement the completeness axiom: The integrated gradient satisfies the completeness axiom, which means that the sum of the attribution scores is equal to the change in the model output (from the reference point to the actual input). Sensitivity: If a feature changes the output of the model, then this feature will be assigned a non-zero attribution score. Simple to implement: Based on existing automatic differentiation tools, it is relatively simple to implement.
[0053] After the integrated gradient at the word embedding vector level is calculated, it needs to be converted back to the original token or vocabulary level. Since each word embedding consists of multiple dimensions, each dimension has an attribution score. For a single token, its attribution usually requires aggregating the integrated gradients of all dimensions in the embedding vector corresponding to this token. Several common methods include summation, average, absolute value summation, and absolute value average on the word embedding dimension.
[0054] Step 500: Integrate and analyze the first semantic contribution list and the second semantic contribution list to determine the words that have a significant impact on the decision of the large language model.
[0055] Specifically, different weight values are assigned to each keyword in the first semantic contribution list and the second semantic contribution list; Perform integrated analysis based on different weight values to obtain importance scores; Keywords corresponding to importance scores exceeding a set threshold are identified as words that have a significant impact on the decision of the large language model.
[0056] In the present invention, after obtaining the semantic contribution list in two ways, the output data of the two methods can be merged, and each word can be integrated and analyzed: different weights are assigned to the output of each method, and these weights reflect the relative importance of each method in the final decision. For example, if the self-description prompt extraction works better in a certain task type, a higher weight is given. Finally, a threshold is set according to the integrated importance score, and only words above this threshold are considered to have a significant impact on the model decision (the threshold is adjusted according to the specific needs of the application, for example, a stricter threshold may be required in high-risk applications to ensure accuracy).
[0057] Through the self-reporting prompt design and integrated gradient technology, we leverage the strengths of both approaches, including both the model's internal self-explanatory capabilities and the external mathematical quantification of the importance of input features, to provide a more comprehensive and in-depth explanation of model behavior.
[0058] During the experiment, the sentiment classification dataset sst2 was selected to verify the proposed technical solution combining the self-report prompt design with the integrated gradient method. In particular, we focused on evaluating the effectiveness of the present invention in identifying key corpora, and compared the key corpora identified by the model with the data manually annotated by the expert group. The experimental results show that by applying the method proposed in the present invention, the recognition accuracy of key corpora reached 75%, which is significantly better than the existing technology. This shows that the present invention can not only effectively identify the core corpora that affect the model's decision, but also reduce the reliance on manual annotation in practical applications, thereby improving the efficiency and reliability of automated processing.
[0059] A semantic contribution identification method using self-describing prompts and integrated gradients provided by the present invention extracts keywords based on a keyword proposal set to design self-describing prompts and combines them with integrated gradient technology, thereby comprehensively utilizing the advantages of the two methods, including the ability of self-explanation within the model and external mathematical quantification of the importance of input features, thereby providing a more comprehensive and in-depth explanation of model behavior; it can not only effectively identify the core corpus that affects the model's decision, but also reduce the reliance on manual annotation in practical applications, thereby improving the efficiency and reliability of automated processing.
[0060] refer to Figure 2 The present invention also discloses a semantic contribution recognition system using self-description prompts and integrated gradients, the system comprising: A question prompt writing module 110 is used to obtain input data and write a specific question prompt; A keyword suggestion module 120, for inputting the question prompt multiple times into a preset large language model, guiding the large language model to automatically identify and report words that play a key role in the decision-making process, and generating a set of keyword suggestions; A keyword extraction module 130, configured to extract keywords based on the keyword suggestion set and generate a first semantic contribution list; An integrated gradient module 140, configured to perform integrated gradient calculation based on the input data by using a preset formula to generate a second semantic contribution list; The integration module 150 is used to integrate and analyze the first semantic contribution list and the second semantic contribution list to determine the words that have a significant impact on the decision of the large language model.
[0061] Among them, write specific question prompts, including: Add task types and labels during question prompt writing, and set special symbols; The classification tendency of the input data is determined by the task type and label, and the keyword generation position is located through special symbols.
[0062] Input the question prompt multiple times into a preset large language model, guide the large language model to automatically identify and report words that play a key role in the decision-making process, and generate a set of keyword suggestions, specifically including: Inputting the question prompt into a preset large language model, and generating a text containing keywords through the large language model; After repeated input of question prompts into the large language model, the large language model is guided to automatically identify and report multiple keyword texts that play a key role in the decision-making process; Collect multiple key keyword texts to form a keyword suggestion set.
[0063] Extracting keywords based on the keyword suggestion set and generating a first semantic contribution list specifically includes: Counting the frequency of occurrence of each keyword based on the keyword suggestion set; Sort the keywords by frequency of occurrence from high to low, and take the first semantic contribution list of the keyword components that have the first set number of positions.
[0064] Based on the input data, integrated gradient calculation is performed using a preset formula to generate a second semantic contribution list, which specifically includes: Based on the input data, the input data is converted into a word embedding vector through a large language model, and the integrated gradient at the word vector level is calculated through a preset formula; Based on the integrated gradient aggregation, all dimensions in the embedding vector corresponding to a single word are converted into the original keyword, and the second semantic contribution list is generated.
[0065] The first semantic contribution list and the second semantic contribution list are integrated and analyzed to determine the words that have a significant impact on the decision of the large language model, specifically including: Assigning different weight values to each keyword in the first semantic contribution list and the second semantic contribution list; Perform integrated analysis based on different weight values to obtain importance scores; Keywords corresponding to importance scores exceeding a set threshold are identified as words that have a significant impact on the decision of the large language model.
[0066] A semantic contribution identification system using self-describing prompts and integrated gradients is provided based on the present invention. By extracting keywords based on a keyword proposal set to design self-describing prompts and combining them with integrated gradient technology, the advantages of the two methods are comprehensively utilized, including the ability of self-explanation within the model and external mathematical quantification of the importance of input features, thereby providing a more comprehensive and in-depth explanation of model behavior; it can not only effectively identify the core corpus that affects the model's decision, but also reduce the reliance on manual annotation in practical applications, thereby improving the efficiency and reliability of automated processing.
[0067] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute a semantic contribution recognition method using self-description prompts and integrated gradients, the method comprising: obtaining input data and writing specific question prompts; inputting the question prompts into a preset large language model for multiple times, guiding the large language model to automatically identify and report the words that play a key role in the decision-making process, and generating a keyword suggestion set; extracting keywords based on the keyword suggestion set to generate a first semantic contribution list; performing integrated gradient calculation based on the input data through a preset formula to generate a second semantic contribution list; integrating and analyzing the first semantic contribution list and the second semantic contribution list to determine the words that have a significant impact on the decision of the large language model.
[0068] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0069] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute a semantic contribution identification method using self-describing prompts and integrated gradients provided by the above-mentioned methods, and the method includes: obtaining input data and writing specific question prompts; inputting the question prompts into a preset large language model for multiple times, guiding the large language model to automatically identify and report words that play a key role in the decision-making process, and generate a keyword suggestion set; extracting keywords based on the keyword suggestion set to generate a first semantic contribution list; performing integrated gradient calculation based on the input data through a preset formula to generate a second semantic contribution list; integrating and analyzing the first semantic contribution list and the second semantic contribution list to determine the words that have a significant impact on the decision of the large language model.
[0070] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute a semantic contribution identification method using self-describing prompts and integrated gradients provided by the above-mentioned methods, the method comprising: obtaining input data and writing specific question prompts; inputting the question prompts multiple times into a preset large language model, guiding the large language model to automatically identify and report words that play a key role in the decision-making process, and generating a keyword suggestion set; extracting keywords based on the keyword suggestion set to generate a first semantic contribution list; performing integrated gradient calculation based on the input data using a preset formula to generate a second semantic contribution list; integrating and analyzing the first semantic contribution list and the second semantic contribution list to determine words that have a significant impact on the decision of the large language model.
[0071] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0072] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0073] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A semantic contribution identification method using self-description prompts and integrated gradients, characterized in that: include: Get input data and write specific question prompts; Inputting the question prompt multiple times into a preset large language model, guiding the large language model to automatically identify and report words that play a key role in the decision-making process, and generating a set of keyword suggestions; Extract keywords based on the keyword suggestion set and generate a first semantic contribution list; Based on the input data, an integrated gradient calculation is performed using a preset formula to generate a second semantic contribution list; The first semantic contribution list and the second semantic contribution list are integrated and analyzed to determine the words that have a significant impact on the decision of the large language model.
2. The semantic contribution identification method using self-description prompts and integrated gradients according to claim 1, characterized in that: The specific question prompts include: Add task types and labels during question prompt writing, and set special symbols; The classification tendency of the input data is determined by the task type and label, and the keyword generation position is located through special symbols.
3. The semantic contribution identification method using self-description prompts and integrated gradients according to claim 1, characterized in that: The step of inputting the question prompt multiple times into a preset large language model, guiding the large language model to automatically identify and report words that play a key role in the decision-making process, and generating a set of keyword suggestions specifically includes: Inputting the question prompt into a preset large language model, and generating a text containing keywords through the large language model; After repeated input of question prompts into the large language model, the large language model is guided to automatically identify and report multiple keyword texts that play a key role in the decision-making process; Collect multiple key keyword texts to form a keyword suggestion set.
4. The semantic contribution identification method using self-description prompts and integrated gradients according to claim 1, characterized in that: The step of extracting keywords based on the keyword suggestion set and generating a first semantic contribution list specifically includes: Counting the frequency of occurrence of each keyword based on the keyword suggestion set; Sort the keywords by frequency of occurrence from high to low, and take the first semantic contribution list of the keyword components that have the first set number of positions.
5. The method for semantic contribution identification using self-reporting prompts and integrated gradients according to claim 1, characterized in that: The step of performing integrated gradient calculation based on the input data through a preset formula to generate a second semantic contribution list specifically includes: Based on the input data, the input data is converted into a word embedding vector through a large language model, and the integrated gradient at the word vector level is calculated through a preset formula; Based on the integrated gradient aggregation, all dimensions in the embedding vector corresponding to a single word are converted into the original keyword, and the second semantic contribution list is generated.
6. The semantic contribution identification method using self-reporting prompts and integrated gradients according to claim 1, characterized in that: The step of integrating and analyzing the first semantic contribution list and the second semantic contribution list to determine the vocabulary that has a significant impact on the decision of the large language model specifically includes: Assigning different weight values to each keyword in the first semantic contribution list and the second semantic contribution list; Perform integrated analysis based on different weight values to obtain importance scores; Keywords corresponding to importance scores exceeding a set threshold are identified as words that have a significant impact on the decision of the large language model.
7. A semantic contribution recognition system using self-reporting prompts and integrated gradients, characterized in that The system comprises: A question prompt writing module, used to obtain input data and write specific question prompts; A keyword suggestion module, used to input the question prompt multiple times into a preset large language model, guide the large language model to automatically identify and report words that play a key role in the decision-making process, and generate a set of keyword suggestions; A keyword extraction module, configured to extract keywords based on the keyword suggestion set and generate a first semantic contribution list; An integrated gradient module, used to perform integrated gradient calculation based on the input data through a preset formula to generate a second semantic contribution list; An integration module is used to integrate and analyze the first semantic contribution list and the second semantic contribution list to determine the vocabulary that has a significant impact on the decision of the large language model.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method for identifying semantic contributions using self-descriptive prompts and integrated gradients is implemented as described in any one of claims 1 to 6.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for identifying semantic contributions using self-descriptive prompts and integrated gradients is implemented as described in any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for identifying semantic contributions using self-descriptive prompts and integrated gradients is implemented as described in any one of claims 1 to 6.
Citation Information
Cited By
Large-screen data visualization method, system and equipment and storage medium
CN120337860A
Industrial design method and system based on generative artificial intelligence and topological optimization
CN121072085A