Pre-training language model post-interpretation method and system based on framework knowledge detection
By constructing a frame semantic parser and an implicit frame knowledge graph through a frame knowledge detection method, the limitations of pre-trained language models in implicit knowledge detection and evaluation are addressed, the interpretability and generalization ability of the model are improved, and its application in downstream tasks is enhanced.
Patent Information
- Application Number
- CN202511693046.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-02-17
AI Technical Summary
Existing knowledge detection methods for pre-trained language models mainly focus on explicit knowledge, failing to effectively detect implicit knowledge behind the text. This leads to an overestimation of the model's generalization ability and makes it difficult to obtain a reasonable assessment that is understandable to humans, thus affecting its application in downstream tasks.
We employ a post-exponential interpretation method based on pre-trained language models for frame knowledge detection. By introducing the concept of frame semantics from cognitive linguistics, we construct a frame semantic parser, generate an implicit frame knowledge graph, and evaluate it using prompt templates from choice-based question answering. This includes semantic frame modeling, argument recognition, and frame element recognition. The frame knowledge graph is then transformed into choice-based question answering for knowledge detection.
It enhances the ability of pre-trained language models to capture implicit knowledge and improves human comprehensibility, thereby increasing the interpretability of the models, enhancing practitioners' trust in the models, and improving the application performance of the models in downstream tasks.
Smart Images

Figure CN121543591A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and natural language processing technology, specifically relating to a method and system for post-exposure interpretation of pre-trained language models based on frame knowledge detection. Background Technology
[0002] Pretrained Language Models (PLMs), trained on massive amounts of unlabeled data, have demonstrated remarkable language understanding and reasoning capabilities, achieving significant progress in natural language processing and multimodal tasks. However, as typical "black box" models, their internal parameter knowledge understanding and reasoning mechanisms remain opaque, drawing widespread attention.
[0003] Existing methods for knowledge detection and interpretation of pre-trained language models mainly focus on extracting surface embeddings from the language model to detect specific types of explicit knowledge understanding, such as lexical syntax, factual knowledge complexities, or relationships based on entities and cloze prompts. Specifically, these methods include using cloze prompts to detect relational knowledge in the model; using closed-book question answering to assess the knowledge retention capacity of generative models; and detecting domain knowledge through fixed entity inputs. While these methods can assess the model's ability to store specific knowledge to some extent, they still have significant limitations: 1) They mostly focus on the explicit content of the text and fail to detect the implicit knowledge associated with the text, such as concept understanding, role relationships, and contextual reasoning; 2) Due to the overlap of test knowledge, the model's generalization ability is overestimated at different stages, leading to biased evaluation results that cannot be effectively explained.
[0004] Due to the aforementioned problems, although pre-trained language models have made rapid progress in recent years, they often lose the trust of practitioners because they cannot be reasonably evaluated and explained in a way that is understandable to humans, making them difficult to apply widely in downstream tasks. Summary of the Invention
[0005] To address the aforementioned problems, this invention provides a method and system for post-interpretation of pre-trained language models based on frame knowledge detection. This method and system introduce the concept of frame semantics from cognitive linguistics, construct a frame semantic parser (including a semantic frame model, an argument recognition model, and a frame element recognition model), generate an implicit frame knowledge graph behind the text, and utilize prompt templates from choice-based question answering for combined classification probe evaluation. This addresses the limitations of existing pre-trained models in capturing implicit knowledge in a way that is understandable to humans and in assessing generalization capabilities.
[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0007] A post-explanation system for pre-trained language models based on frame knowledge detection is provided. The system includes a frame-based semantic parsing module, a frame-based knowledge graph construction module, and an interpretable frame knowledge detection module.
[0008] Furthermore, the frame-based semantic parsing module is used to perform semantic frame modeling, argument recognition, and frame element recognition modeling on a given text in order to extract and generate implicit knowledge behind the text.
[0009] The frame-based knowledge graph construction module is used to construct a frame knowledge graph, using extracted frames and frame elements (FEs) as nodes, and defining three types of edge relationships, including relationships between frames, relationships between frames and frame elements, and relationships between frame elements.
[0010] The interpretable framework knowledge detection module transforms the framework knowledge graph into a selection-based question-and-answer prompt template and performs knowledge detection to evaluate the ability of the pre-trained language model to capture implicit knowledge.
[0011] Furthermore, the types of knowledge exploration include three types of knowledge understanding: internal frame elements (IFEs), external frame elements (EFEs), and identical frame elements (SFEs), as well as three types of knowledge reasoning: internal frame element relations (IFEsR), external frame element relations (EFEsR), and inter-frame relations (FFR).
[0012] A method for post-explanation of pre-trained language models based on frame knowledge detection is provided. This method utilizes the aforementioned post-explanation system for pre-trained language models based on frame knowledge detection. The specific steps of this method are as follows:
[0013] Step 1: Construct a seed dataset for supervising the fine-tuning of the framework semantic parser;
[0014] Step 2: Using a frame-based semantic parsing module, perform semantic frame modeling, argument recognition, and frame element recognition modeling on the given text to extract and generate implicit knowledge behind the text;
[0015] Step 3: Construct the framework knowledge graph using the framework-based knowledge graph construction module;
[0016] Step 4: Transform the framework knowledge graph into a selection-based question-and-answer prompt template using the interpretability knowledge detection module, and use knowledge probes to detect knowledge and evaluate the pre-trained model's ability to capture implicit knowledge.
[0017] Furthermore, the specific operation of step 1 is as follows:
[0018] First, 15,000 example sentences were searched and filtered from the Chinese Tree Bank corpus, and preprocessing was performed to remove example sentences with excessively short sequence lengths.
[0019] Then, frame semantic information is labeled based on frame semantic concepts, including identifying semantic frames in sentences and frame elements based on these frames;
[0020] Finally, a rigorous annotation and review protocol was implemented, including three rounds of iterations and discussions with linguistics experts when uncertainties arose, to ensure quality. The final result was a frame library containing 10,000 lexical units, 695 frames, and 990 frame elements, as well as 10,000 semantic frame instances annotated with 629 frame instances and 673 frame element instances.
[0021] Furthermore, the specific operation of step 2 is as follows:
[0022] (1) Semantic frame modeling: The frame recognition task is defined as a mapping function, which is expressed as:
[0023]
[0024] in, , and Representing sentences and target words respectively; first, the context is decomposed into a set of sentences. Use retrieval-based methods to identify sentences The target words in the sentence are identified; then a pre-trained language model encoder is used to process the input sentence. Encode, where, In the sentence The m-th Token in From this, we can obtain and take As an embedded representation of the sentence; furthermore, the target word position encoding matrix can be calculated based on the position information of the target word:
[0025]
[0026] Then, the target word embedding representation is obtained as:
[0027]
[0028] in, This represents the average pooling operation, which, through the Dense layer and softmax layer, allows us to obtain the relevant scores for each frame:
[0029]
[0030]
[0031] in, and Let w represent the learnable weight matrix and bias term, respectively. i This represents the score for each candidate semantic frame. This includes the probability distribution of all candidate frames. During training, we minimize the cross-entropy loss to measure... The difference between the true and false labels; during inference we select the highest score. The corresponding framework serves as the correct semantic framework.
[0032] (2) Argument recognition: Argument recognition is regarded as a sequence labeling problem, and a language model is used to encode sentences. ,Pick As input, labels are predicted through a linear layer, and the following calculations are performed:
[0033]
[0034]
[0035] in, for( () represents one of the "BIO" tags. BIO represents the marker symbol corresponding to the start, middle, and end positions of the argument range.
[0036] (3) Frame element recognition and modeling: Frame elements in the frame are used to represent scene concepts, which are the arguments mentioned above. Target words and sentences Assign appropriate frame elements; obtain using a pre-trained language model The embedding is used as a sentence representation, and uses and Mark targets and frames. For argument features, clause embeddings... Extract the token-level weights for calculation, such as extracting the weights of c tokens to obtain the target word. The characteristics of a corresponding argument Furthermore, it is possible to obtain all predictive arguments. Embedded representation:
[0037]
[0038] in, This represents the max pooling operation, where c represents the length of the argument; This represents the weight at the token level. Finally, based on... We can obtain the predicted probability for each argument:
[0039]
[0040] in, Represents a trainable matrix. and Represents a trainable vector; This represents the trainable bias vector.
[0041] Furthermore, step 3 specifically involves formalizing the framework knowledge graph into... ,in A set of nodes, including frame nodes. and frame element nodes , This represents the padding text associated with the frame element; The set of edges includes three types of edges: relationships between frames. Relationship between frames and frame elements and the relationships between frame elements The frame semantic parser (which includes semantic frame modeling, argument recognition, and frame element recognition) is used to extract frames and semantic frame elements in a given context and construct a context subgraph, where the semantic information represented by the graph comes entirely from external semantic knowledge (implicit knowledge type) outside the dataset itself.
[0042] Furthermore, step 4 specifically involves converting the triplet knowledge in the framework knowledge graph into selection-type question-answer pairs, and generating questions using prompt templates. and predicted answers Using pre-trained language models Evaluate question-answering performance. Then observe the question-answering performance of implicit knowledge. Considering the two scenarios of zero-shot and supervised fine-tuning widely used in application services, we explored six implicit knowledge types, including three knowledge understanding types: internal frame elements (IFEs), external frame elements (EFEs), and same frame elements (SFEs), and three knowledge reasoning types: internal frame element relations (IFEsR), external frame element relations (EFEsR), and inter-frame relations (FFR). The evaluation metric used was accuracy.
[0043] Thirdly, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the method provided in the second aspect.
[0044] Fourthly, embodiments of the present invention provide a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in the second aspect.
[0045] Compared with the prior art, the present invention has the following advantages:
[0046] (1) A method for post-explanation of pre-trained language models is proposed. For the first time, this method explores and explains the parametric conceptual knowledge understanding and reasoning of pre-trained models from the perspective of implicit knowledge beyond the text, thereby improving practitioners’ understanding and trust in pre-trained language models.
[0047] (2) A graph-based knowledge detection method that integrates frame knowledge representation is proposed. The framework knowledge graph is constructed using human-understandable frame cognitive concepts to evaluate and interpret the internal parameter concepts of pre-trained language models that are not human-understandable.
[0048] (3) It provides six potential explanations, including three types of knowledge understanding and three types of knowledge reasoning, which are rooted in the human understanding process from the perspective of cognitive linguistics and promote the interpretability of the black box mechanism of pre-trained language models. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 This is an overall flowchart of a method for post-exponential interpretation of a pre-trained language model based on frame knowledge detection, provided in an embodiment of the present invention.
[0051] Figure 2 This is a data example used in this invention.
[0052] Figure 3 This is a schematic diagram illustrating the six aspects of the explanation of the changes in Model 1-BERT from zero-sample scenarios to supervised fine-tuning scenarios, as detailed in this embodiment of the invention.
[0053] Figure 4 This is a schematic diagram of the framework semantic parsing module in an embodiment of the present invention.
[0054] Figure 5 This is a schematic diagram of the framework-based knowledge graph construction process in an embodiment of the present invention.
[0055] Figure 6 This is a flowchart illustrating the detection process of the interpretability knowledge detection module in an embodiment of the present invention.
[0056] Figure 7 This is a schematic diagram of the structure of a pre-trained language model post-explanation system based on frame knowledge detection, provided in an embodiment of the present invention. Detailed Implementation
[0057] To gain a deeper understanding of this invention, we will provide a comprehensive and detailed description. However, this invention has various implementations and is not limited to the specific examples listed herein. These examples are presented to enhance a full understanding of the disclosure of this invention.
[0058] Example 1
[0059] Figure 1 This invention provides an overall architecture diagram of a pre-trained language model post-interpretation method based on frame knowledge detection, which mainly includes a frame-based semantic parsing module, a frame-based knowledge graph construction module, and an interpretability knowledge detection module. Arrows indicate data flow, and rectangles represent the core components of each module. The specific contents of each module are as follows:
[0060] The frame-based semantic parsing module uses a pre-trained language model to perform semantic frame modeling, argument recognition, and frame element modeling on a given text, extracting implicit knowledge behind the text.
[0061] The framework-based knowledge graph construction module constructs a framework knowledge graph, using frameworks and framework elements as nodes, and defines three types of edge relationships, including relationships between frameworks, relationships between frameworks and framework elements, and relationships between framework elements.
[0062] Explainable knowledge exploration module: Transforms knowledge graphs into selection-based question-and-answer prompt templates to explore knowledge and evaluate the ability of pre-trained language models to capture implicit knowledge beyond the text.
[0063] First, the semantic frame parsing module is used to perform semantic frame modeling, argument identification, and frame element modeling on the given text to obtain the implicit knowledge behind the text. The specific calculation formula is shown below:
[0064] Semantic frame modeling: Defining the frame recognition task as a mapping function:
[0065]
[0066] in , and Representing sentences and target words respectively; first, the context is decomposed into a set of sentences. Use retrieval-based methods to identify sentences The target word in the input; then the pre-trained model encoder is used to process the input. Encode, where, In the sentence The m-th Token in ;get and take As a sentence embedding representation; and then, based on the positional information of the target word, the positional encoding matrix of the target word can be calculated:
[0067]
[0068] Then, the target word embedding representation:
[0069]
[0070] in, This represents the average pooling operation, which, through the Dense layer and softmax layer, allows us to obtain the relevant scores for each frame:
[0071]
[0072]
[0073] in, and Let w represent the learnable weight matrix and bias term, respectively. i This represents the score for each candidate semantic frame. This includes the probability distribution of all candidate frames. During training, we minimize the cross-entropy loss to measure... The difference between the true and false labels; during inference we select the highest score. The corresponding framework serves as the correct semantic framework.
[0074] Argument recognition: Treating argument recognition as a sequence labeling problem, it uses language models to encode sentences. ,Pick As input, the label is predicted through a linear layer, which can be represented as:
[0075]
[0076]
[0077] in for( () represents one of the "BIO" tags. BIO represents the marker symbol corresponding to the start, middle, and end positions of the argument range.
[0078] Frame element recognition modeling: Using frame elements within a frame to represent scene concepts, as described above, are used as arguments. Target words and sentences Assign appropriate frame elements; obtain using a pre-trained language model The embedding is used as a sentence representation, and uses and Mark targets and frames. For argument features, clause embeddings... Extract the token-level weights for calculation, such as extracting the weights of c tokens to obtain the target word. The characteristics of a corresponding argument Furthermore, it is possible to obtain all predictive arguments. Embedded representation:
[0079]
[0080] in, This represents the max pooling operation, where c represents the length of the argument; This represents the weight at the token level. Finally, based on... We can obtain the predicted probability for each argument:
[0081]
[0082] in, Represents a trainable matrix. and Represents a trainable vector; This represents the trainable bias vector.
[0083] Next, a framework knowledge graph is constructed using a framework-based knowledge graph module. The framework knowledge graph can be formalized as follows:
[0084] ,in A set of nodes, including frame nodes. and frame element nodes , This represents the padding text associated with the frame element; The set of edges includes three types of edges: relationships between frames. Relationship between frames and frame elements and the relationships between frame elements The frame semantic parser is used to extract frames and semantic frame elements in a given context and construct a context subgraph, where the semantic information represented by the graph comes entirely from external semantic knowledge (implicit knowledge type) outside the dataset itself.
[0085] The interpretable knowledge detection module transforms the framework knowledge graph into a selection-based question-answering prompt template, and a linear classification probe is used for knowledge detection to evaluate the pre-trained model's ability to capture implicit knowledge behind the text. Triple knowledge in the framework knowledge graph is converted into selection-based question-answer pairs, and questions are generated using the prompt template. and predicted answers Use black-box pre-trained language models Evaluate question-answering performance. Then observe the question-answering performance of implicit knowledge. ,
[0086] Considering zero-shot and supervised fine-tuning scenarios, exploration is conducted on six knowledge types, including the three knowledge understanding types of IFEs, EFEs, and SFEs mentioned above in the internal framework meta-meta-text, and the three knowledge reasoning types of IFEsR, EFEsR, and FFR. The evaluation metric is accuracy.
[0087] A seed dataset was constructed to supervise the fine-tuning of the frame semantic parser. First, approximately 15,000 sentences were searched and filtered from the Chinese Tree Bank corpus, with preprocessing removing sentences with excessively short sequences. Then, frame semantic information was annotated based on frame semantic concepts, including identifying semantic frames within sentences and frame elements based on these frames. Finally, a rigorous annotation and review protocol was implemented, including three rounds of iterations and discussions with linguistic experts when uncertainties arose, to ensure quality. Ultimately, a frame library containing 10,000 lexical units, 695 frames, and 990 frame elements was constructed, along with 10,000 annotated semantic frame instances, including 629 frame instances and 673 frame element instances.
[0088] Example 2
[0089] Figure 2This is a typical example of natural language text, from a story within a natural language scenario: "Tom's grandma was reading a new book when she dropped her glasses. She couldn't pick them up, so she called Tom for help. Tom rushed to help her look forth, and they heard a loud crack. They realized that Tom broke her glasses by stepping on them. Promptly, his grandma yelled at Tom to go get her a..." The example, "newpair," demonstrates implicit knowledge not directly present in the text. It includes the following frameworks: Becoming_aware (involving elements like Cognizer, Means, and Instrument), Request (involving elements like Addressee, Message, and Speaker), Scrutiny (involving elements like Cognizer, Ground, and Instrument), Reading_activity (involving elements like Time, Reader, and Text), Motion_directional (involving elements like Area, Distance, Speed, and Direction), Intentionally_act (involving elements like Agent, Act, and Domain), Communication_noise (involving elements like Message, Speaker, Topic, and Voice), and Getting (involving elements like Recipient, Theme, and Beneficiary). This example also showcases the connections between these frameworks, such as Concessive relationships, to validate the black-box model's ability to understand implicit knowledge.
[0090] The semantic frame parsing module is used to perform semantic frame modeling, argument identification, and frame element modeling on the above text to obtain implicit knowledge. Figure 2 This is a structural diagram of the module.
[0091] Semantic frame modeling: Defining the frame recognition task as a mapping function:
[0092]
[0093] in, , and These represent sentences and target words, respectively. First, the context is broken down into a set of sentences. Use retrieval-based methods to identify sentences The target word in the input; then the pre-trained model encoder is used to process the input. Encode to obtain and take As a sentence embedding representation; furthermore, the positional encoding matrix of the target word can be calculated based on the positional information of the target word.
[0094]
[0095] Then, the target word embedding representation can be obtained:
[0096]
[0097] in, This represents the average pooling operation, through which the Dense layer and softmax layer can be used to obtain the relevant scores for each frame:
[0098]
[0099]
[0100] in, and Let w represent the learnable weight matrix and bias term, respectively. i This represents the score for each candidate semantic frame. This includes the probability distribution of all candidate frames. During training, we minimize the cross-entropy loss to measure... The difference between the true and false labels; during inference we select the highest score. The corresponding framework serves as the correct semantic framework.
[0101] For example, identify the Reading_activity framework corresponding to "reading".
[0102] Argument recognition: Treating argument recognition as a sequence labeling problem, it uses language models to encode sentences. ,Pick As input, the label is predicted through a linear layer, which can be represented as:
[0103]
[0104]
[0105] in, for( The symbol ) represents one of the "BIO" tags. BIO represents the markers corresponding to the beginning, middle, and end positions of an argument range. For example, it identifies "Tom's grandma" as an argument in the Reader.
[0106] Frame element recognition modeling: Using frame elements within a frame to represent scene concepts, as described above, are used as arguments. Target words and sentences Assign appropriate frame elements; obtain using a pre-trained language model The embedding is used as a sentence representation, and uses and Mark targets and frames. For argument features, clause embeddings... Extract the token-level weights for calculation, such as extracting the weights of c tokens to obtain the target word. The characteristics of a corresponding argument Furthermore, it is possible to obtain all predictive arguments. Embedded representation:
[0107]
[0108] in, This represents the max pooling operation, where c represents the length of the argument; This represents the weight at the token level. Finally, based on... We can obtain the predicted probability for each argument:
[0109]
[0110] in, Represents a trainable matrix. and Represents a trainable vector; This represents a trainable bias vector. Specifically, an example of argument assignment is assigning "new book" as a Text element.
[0111] A framework knowledge graph is constructed using the aforementioned framework-based knowledge graph module. The framework knowledge graph is then formalized as follows:
[0112]
[0113] in, A set of nodes, including frame nodes. and frame element nodes , This represents the padding text associated with the frame element; The set of edges includes three types of edges: relationships between frames. Relationship between frames and frame elements and the relationships between frame elements A frame semantic parser is used to extract frames and semantic frame elements from a given context, constructing a context subgraph where the semantic information represented by the graph comes entirely from external semantic knowledge outside the dataset itself. For example, the frame relationship between Becoming_aware and Request is constructed. .
[0114] The knowledge detection module is used to transform the framework knowledge graph into a selection-based question-answering prompt template, and knowledge detection is performed to evaluate the ability of the pre-trained language model to capture implicit knowledge. Triple knowledge in the framework knowledge graph is converted into selection-based question-answer pairs, and questions are generated using the prompt template. and answer Use black-box pre-trained language models Evaluate question-answering performance: The question-answering performance of implicit knowledge is observed as follows: Considering zero-shot and supervised fine-tuning scenarios, we probe six implicit knowledge types, including three knowledge understandings: internal frame elements (IFEs), external frame elements (EFEs), and shared frame elements (SFEs), and three knowledge reasonings: internal frame element relations (IFEsR), external frame element relations (EFEsR), and inter-frame relations (FFR). Accuracy (Acc) is used as the evaluation metric. For example, generating questions... "In the Becoming_aware scenario, is [MASK] a Cognizer?". Then, based on the given benchmark dataset, the macro-average Acc of all samples in the dataset is calculated to validate the model performance.
[0115] To further verify the advancement and effectiveness of the proposed technology, this invention applied the proposed interpretability technique to current state-of-the-art pre-trained language models and conducted experimental tests on public datasets (C3-M, C3-D, C3-ALL) to observe the accuracy of capturing implicit knowledge behind the text. Each knowledge type was evaluated separately. This invention tested random and zero-sample scenarios (for random scenarios, the experiment was repeated 5 times with a random seed, and the average value was taken). Specific test results are shown in Table 1:
[0116] Table 1. Test results of the interpretable technique proposed in this invention on a classic pre-trained language model (random and zero-shot scenarios).
[0117]
[0118] The embedding representations of pre-trained language models (without fine-tuning) in zero-shot scenarios are relatively scattered and lack good representational power. As shown in Table 1, the interpretability techniques proposed in this paper can effectively analyze the differences between them. They can also indicate the degree to which different language models understand the hidden knowledge behind the text on different datasets.
[0119] Furthermore, to verify the effectiveness of the proposed key technologies, experiments were conducted in a supervised fine-tuning scenario, and the specific results are shown in Table 2:
[0120] Table 2. Test results of the interpretable technique proposed in this invention on a classic pre-trained language model (supervised fine-tuning scenario).
[0121]
[0122] As shown in Table 2, compared to the zero-shot scenario, the supervised fine-tuning of the aforementioned model significantly improved its understanding of the implicit knowledge behind the text, with average improvements of 12.23%, 12.20%, and 13.34% on the three experimental datasets, respectively. This further directly demonstrates that the key technology proposed in this invention can effectively identify the implicit knowledge understanding capabilities of different models at different stages. To demonstrate more granular interpretable information, this invention further refines the six aspects of the explanation changes of Model1-BERT from the zero-shot scenario to the supervised fine-tuning scenario from six dimensions, as follows: Figure 3 As shown, this diagram compares the performance changes of the model in evaluating implicit knowledge behind the text across six dimensions (IFEs, EFEs, SFEs, IFEsR, EFEsR, FFR) from zero-shot scenarios to supervised fine-tuning scenarios. The left side of the diagram is a radar chart of Model 1 - BERT on the Dev and Test datasets in the zero-shot scenario, while the right side is the corresponding radar chart in the supervised fine-tuning scenario. The black arrows indicate the logic of the scenario change from zero-shot to supervised fine-tuning. Each vertex of the radar chart corresponds to the indicator values of the six dimensions, and different lines represent the performance on the Dev and Test datasets, clearly showing the differences in model interpretability across multiple dimensions at the two different stages.
[0123] Example 3
[0124] This invention provides a post-exposure explanation system for a pre-trained language model based on frame knowledge detection, including a frame semantic parsing module (e.g., Figure 4 As shown, this includes steps such as input text decomposition, pre-trained model encoding for frame and element allocation, arrows indicating computational flow, and circular nodes representing key embedding representations, and frame-based knowledge graph construction (e.g. Figure 5As shown, this illustrates the graphing process of using extracted frames and frame elements as nodes, defining three types of edge relationships (relationships between frames, relationships between frames and frame elements, and relationships between frame elements), and forming a context subgraph, as well as interpretability knowledge detection (such as...). Figure 6 As shown, the process of transforming a framework knowledge graph into a selection-based question-answering prompt template includes generating questions and answers, evaluating question-answering performance using a black-box model, and probing six implicit knowledge types (IFEs, EFEs, SFEs, IFEsR, EFEsR, FFR), calculating accuracy as the evaluation metric. For a detailed implementation of the above-described method for post-interpretation of a pre-trained language model based on knowledge probing, please refer to the above-described embodiment of a method for post-interpretation of a pre-trained language model based on framework knowledge probing; it will not be repeated here.
[0125] This embodiment provides an electronic device. Figure 7 This is a schematic diagram of the overall structure of an electronic device provided in an embodiment of the present invention. The device includes a processor, a memory, a communication bus, and a communication interface. The processor, communication interface, and memory communicate with each other via the communication bus. The memory stores program instructions executable by the processor. The processor can execute the methods provided in the above-described method embodiments by calling the program instructions, such as: extracting implicit knowledge through a framework semantic parsing module; constructing a framework knowledge graph; and performing interpretable knowledge detection, etc.
[0126] Furthermore, the logical instructions in the aforementioned memory can be implemented as software functional units and stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), and random access memory (RAM).
[0127] This embodiment provides a non-transitory computer-readable storage medium that stores computer instructions. The computer instructions cause the computer to execute the methods provided in the above-described method embodiments, such as: extracting implicit knowledge through a framework semantic parsing module; constructing a framework knowledge graph; and performing interpretability knowledge detection.
[0128] Contents not described in detail in this specification are prior art known to those skilled in the art. Although illustrative specific embodiments of the invention have been described above to facilitate understanding by those skilled in the art, it should be understood that the invention is not limited to the scope of the specific embodiments. Various modifications are readily apparent to those skilled in the art as long as they fall within the spirit and scope of the invention as defined and determined by the appended claims, and all inventions utilizing the concept of this invention are protected.
Claims
1. A post-exposure explanation system for pre-trained language models based on frame knowledge detection, characterized in that, The system includes a frame-based semantic parsing module, a frame-based knowledge graph construction module, and an interpretable frame knowledge detection module.
2. The post-exponential explanation system for pre-trained language models based on frame knowledge detection according to claim 1, characterized in that, The frame-based semantic parsing module is used to perform semantic frame modeling, argument recognition, and frame element recognition modeling on a given text in order to extract and generate implicit knowledge behind the text. The frame-based knowledge graph construction module is used to construct a frame knowledge graph, taking the extracted frames and frame elements as nodes, and defining three types of edge relationships, including relationships between frames, relationships between frames and frame elements, and relationships between frame elements. The interpretable framework knowledge detection module transforms the framework knowledge graph into a selection-based question-and-answer prompt template and performs knowledge detection to evaluate the capture capability of the pre-trained language model pair.
3. The post-exponential explanation system for pre-trained language models based on frame knowledge detection according to claim 2, characterized in that, The types of knowledge exploration include three types of knowledge understanding: internal frame elements, external frame elements, and identical frame elements; and three types of knowledge reasoning: internal frame element relationships, external frame element relationships, and inter-frame relationships.
4. A method for post-processing explanation of a pre-trained language model based on frame knowledge detection, characterized in that: The post-exponential interpretation system for pre-trained language models based on frame knowledge detection as described in any one of claims 1 to 3, specifically includes the following steps: Step 1: Construct a seed dataset for supervising the fine-tuning of the framework semantic parser; Step 2: Using a frame-based semantic parsing module, perform semantic frame modeling, argument recognition, and frame element recognition modeling on the given text to extract and generate implicit knowledge behind the text; Step 3: Construct the framework knowledge graph using the framework-based knowledge graph construction module; Step 4: Transform the framework knowledge graph into a selection-based question-and-answer prompt template using the interpretability knowledge detection module, and use knowledge probes to detect knowledge and evaluate the pre-trained model's ability to capture implicit knowledge.
5. The method for post-exposure interpretation of a pre-trained language model based on frame knowledge detection according to claim 4, characterized in that: The specific operation of step 1 is as follows: First, 15,000 example sentences were searched and filtered from the Chinese Tree Bank corpus, and preprocessing was performed to remove example sentences with excessively short sequence lengths; Then, frame semantic information is labeled based on frame semantic concepts, including identifying semantic frames in sentences and frame elements based on these frames; Finally, a rigorous annotation and review protocol was implemented, including three rounds of iterations and discussions with linguistics experts when uncertainties arose, to ensure quality. The final result was a frame library containing 10,000 lexical units, 695 frames, and 990 frame elements, as well as 10,000 semantic frame instances annotated with 629 frame instances and 673 frame element instances.
6. The method for post-exposure interpretation of a pre-trained language model based on frame knowledge detection according to claim 4, characterized in that: The specific operation of step 2 is as follows: (1) Semantic frame modeling: The frame recognition task is defined as a mapping function, which is expressed as: ; in , and Representing sentences and target words respectively; first, the context is decomposed into a set of sentences. Use retrieval-based methods to identify sentences The target words in the sentence are identified; then a pre-trained language model encoder is used to process the input sentence. Encode, where, In the sentence The m-th token in the middle, ; from this we can obtain and take As an embedded representation of the sentence; then, the target word position encoding matrix is calculated based on the position information of the target word; ; Then the target word embedding representation can be expressed as: ; in This represents the average pooling operation, which, through the Dense layer and softmax layer, allows us to obtain the relevant scores for each frame: ; ; in, and Let w represent the learnable weight matrix and bias term, respectively. i This represents the score for each candidate semantic frame. It includes the probability distribution of all candidate frames; during training, the cross-entropy loss is minimized to measure the probability. The difference between the true and false labels; during inference, select the highest score. The corresponding framework serves as the correct semantic framework; (2) Argument recognition: Argument recognition is regarded as a sequence labeling problem, and a language model is used to encode sentences. ,Pick As input, labels are predicted through a linear layer, and the following calculations are performed: ; ; in, for( ) represents one of the "BIO" tags; BIO represents the marker symbols corresponding to the beginning, middle and end positions of the argument range; (3) Frame element recognition and modeling: Frame elements in the frame are used to represent scene concepts, which are the arguments mentioned above. Target words and sentences Assign appropriate frame elements; obtain using a pre-trained language model The embedding is used as a sentence representation, and uses and Mark targets and frames; for argument features, clause embeddings Extract token-level weights for calculation, such as extracting the weights of c tokens to obtain the target word. The characteristics of a corresponding argument Furthermore, it is possible to obtain all predictive arguments. Embedded representation: ; in, This represents the max pooling operation, where c represents the length of the argument; Represents token-level weight; finally, based on We can obtain the predicted probability for each argument: ; in, This represents a trainable matrix. and Represents a trainable vector; This represents the trainable bias vector.
7. The method for post-exponential interpretation of a pre-trained language model based on frame knowledge detection according to claim 4, characterized in that: The specific operation of step 3 is to formalize the framework knowledge graph into... ,in A set of nodes, including frame nodes. and frame element nodes , This represents the padding text associated with the frame element; The set of edges includes three types of edges: relationships between frames. Relationship between frames and frame elements and the relationships between frame elements Using the framework semantic parser constructed above, the framework and semantic framework elements in the given context are extracted, and a context subgraph is constructed, in which the semantic information represented by the graph comes entirely from implicit knowledge types outside the dataset itself.
8. The method for post-exposure interpretation of a pre-trained language model based on frame knowledge detection according to claim 4, characterized in that: The specific operation of step 4 is to convert the triplet knowledge in the framework knowledge graph into multiple-choice question-answer pairs, and generate questions using prompt templates. and predicted answers ; and then use a pre-trained language model Evaluate question-answering performance. Observation of question-and-answer performance Considering the two scenarios of zero-shot and supervised fine-tuning widely used in application services, exploration is carried out on six knowledge types, including three knowledge understanding types of internal frame elements, external frame elements and same frame elements, and three knowledge reasoning types of internal frame element relationships, external frame element relationships and inter-frame relationships. The evaluation metric is accuracy.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method for post-interpretation of a pre-trained language model based on frame knowledge detection as described in any one of claims 4 to 8.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of a post-interpretation method for a pre-trained language model based on frame knowledge detection as described in any one of claims 4 to 8.