A method and system for generating counterfactual explanations based on multi-objective genetic algorithm
By applying multi-objective genetic algorithms to generate counterfactual explanations in the deep knowledge tracking model, the problem of personalized learning guidance and false associations in the existing technology is solved, and efficient and personalized explanations of the deep knowledge tracking model are achieved.
Patent Information
- Application Number
- CN202410377882.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-03-29
AI Technical Summary
The existing technology is difficult to provide personalized learning guidance strategies for deep knowledge tracking models, and traditional counterfactual interpretation methods cannot be applied to deep knowledge tracking models, and there are problems such as false associations.
A counterfactual explanation generation method based on multi-objective genetic algorithm is adopted, and a population of counterfactual instances is generated by adding new answer interaction pairs after the original instance, and the optimal counterfactual instance is obtained to explain the deep knowledge tracking model through cross-section, mutation and individual selection processing.
The personalized interpretation of the deep knowledge tracking model is realized, and the strategies of how learners should improve to master knowledge points are provided, avoiding false correlation problems, and improving the causal effect and diversity of explanations.
Smart Images

Figure CN118709774B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to a counterfactual explanation generation method and system based on a multi-objective genetic algorithm. Background Art
[0002] Knowledge Tracing (KT) is a core module in the Intelligent Tutoring System (ITS). By evaluating learners' knowledge mastery in different time periods, learners can fully understand their knowledge mastery level, thereby providing personalized support for future learning planning. Introducing deep learning into the modeling process of knowledge tracing can obtain a series of deep knowledge tracing models with powerful feature extraction capabilities and excellent prediction performance. However, due to the ubiquitous black box properties of deep learning neural networks, it is difficult for people to understand the decision-making process and results of deep knowledge tracing models, which can easily lead to a "trust crisis". Therefore, in addition to paying attention to the performance of the model, it is also very important to study the interpretability of the model so that more personalized and educational services such as tracing the causes of learners' errors and attribution analysis can be carried out.
[0003] Explainable methods can be mainly divided into ex ante explanation and ex post explanation.
[0004] Ex ante explanation refers to making the model easier to explain and understand through reasonable model selection, feature engineering, and design before building a black box model. However, ex ante explanation often improves explainability at the expense of accuracy, and the ex ante explanations all propose strongly coupled self-explanatory models, which are difficult to explain other models, and have poor applicability and explainability.
[0005] Ex post interpretability refers to the use of interpretation methods and tools to analyze the built model after the black box model is built, so as to understand its internal decision-making process and prediction results. Ex post interpretability allows the model to be explained through subsequent interpretation analysis even if interpretability is not considered when the model is built, thereby enhancing the understanding and trust of the model. A typical method is to use the layer-wise relevance propagation (LRP) method, which uses the back propagation mechanism of the neural network to calculate the correlation between each input and the final prediction result to provide an explanation. There is also a method that uses game theory ideas (Deep SHapley Additive exPlanation, Deep SHAP) to explain the deep knowledge tracking model, which responds to the importance of the input features through the gradient in the back propagation. Although these methods can be applied to explain the deep knowledge tracking model, the final interpretable results obtained may be affected by false correlations between the data.
[0006] At present, the traditional counterfactual explanation method mainly modifies the feature values in the original instance, hoping that the counterfactual instance obtained in this way can change and reach the expected prediction result value, thereby explaining some models; but this traditional counterfactual explanation paradigm cannot be applied to the explanation of deep knowledge tracking models. This is because in the field of deep knowledge tracking, the fact that learners failed to master a certain knowledge point due to making mistakes in some questions in the past has become a fact, and learners hope to know what to do next to master the knowledge points that they made mistakes in the past.
[0007] Therefore, the counterfactual instances generated by this traditional counterfactual explanation method are not suitable for the explanation scenario of the deep knowledge tracing model. This explanation paradigm cannot provide learners with more personalized learning guidance strategies with more coaching significance, while some other explanation methods have problems such as poor applicability and false associations. Therefore, it is urgent to propose a new counterfactual explanation paradigm to adapt to the scenario requirements of the knowledge tracing model explanation. Summary of the invention
[0008] The present invention provides a method and system for generating coaching counterfactual explanations based on a multi-objective genetic algorithm, which is used to solve the problems of poor applicability of prior explanation methods, problems caused by false associations, and the inability to provide learners with more personalized learning guidance strategies based on traditional counterfactual explanation paradigms.
[0009] On the one hand, the present invention proposes a method for generating counterfactual explanations based on a multi-objective genetic algorithm, the method comprising:
[0010] Get the original instance of the learner from the knowledge tracing dataset;
[0011] Get the number and length of the questions to be added, and randomly generate multiple length codes;
[0012] Based on the number length, obtaining the questions to be added from the knowledge tracking data set, and obtaining the answer values corresponding to the questions to be added through the deep knowledge tracking model to be explained, so as to form the interactive pairs of the questions to be added;
[0013] Based on the length encoding, the question-answer interaction pair to be added, and the original instance, a counterfactual instance is obtained; different question-answer interaction pairs to be added are repeatedly obtained to obtain multiple different counterfactual instances, and a counterfactual instance population is generated;
[0014] The population of counterfactual instances is screened to obtain an optimal counterfactual instance; and the deep knowledge tracking model is explained based on the optimal counterfactual instance.
[0015] Further, obtaining the to-be-added topic from the knowledge tracking data set based on a search strategy; wherein the search strategy includes: any one of the first strategy, the second strategy, the third strategy or the fourth strategy;
[0016] A first strategy is to obtain a first type of question corresponding to an associated knowledge point corresponding to the question in the original instance;
[0017] The second strategy is to obtain the second type of questions corresponding to the associated knowledge points corresponding to the wrong questions in the original instance;
[0018] The third strategy is to obtain the third type of questions corresponding to the target knowledge points;
[0019] The fourth strategy is to randomly select a fourth type of question from the knowledge tracking dataset.
[0020] Furthermore, screening the counterfactual instance population includes: sequentially performing crossover processing, mutation processing, and individual selection processing on the counterfactual instance population.
[0021] Further, obtaining the optimal counterfactual instance includes: taking the counterfactual instance that maximizes the first indicator and the second indicator as the optimal counterfactual instance;
[0022] Among them, the first indicator is the individual causal effect value of the counterfactual example on the mastery of the target knowledge point; the second indicator is the degree of counter-intervention of the counterfactual example compared with the original example.
[0023] Furthermore, the optimal counterfactual instance The formula is:
[0024]
[0025] in, represents the optimal counterfactual instance; o1(Y(S Δk ), Y(S t )) represents the first indicator; o2(S Δk , S t ) represents the second index; S Δk represents the counterfactual instance; S t Represents the original instance.
[0026] Furthermore, a number of different counterfactual instances are obtained, including:
[0027] The original instance S t and the counterfactual instance S Δk are respectively input into the deep knowledge tracking model, and the corresponding mastery level of the first knowledge point f is obtained θ (S t ) and the second knowledge point mastery degree f θ (S Δk );
[0028] Determine whether the counterfactual instance satisfies both: θ (S Δk )>f θ (S t ) and f θ (S Δk )>target mastery threshold; if it is met, the counterfactual instance is selected; if it is not met, the counterfactual instance is eliminated and the to-be-added question is reselected to generate the counterfactual instance.
[0029] Furthermore, the individual selection process includes:
[0030] Obtaining a first set by non-dominated sorting of the counterfactual instances;
[0031] sorting the counterfactual instances of each layer in the first set from large to small according to the first index, and dividing the counterfactual instances of each layer into two, to obtain a sorted second set;
[0032] Selecting the counterfactual instances of the first half of each layer from the second set and entering the elite set until the number of counterfactual instances in the elite set is equal to the number of counterfactual instances in the counterfactual instance population;
[0033] The counterfactual instances in the elite set are evolved as the next generation parents, and the counterfactual instance with the largest first indicator in the last generation elite set is selected as the optimal counterfactual instance.
[0034] Furthermore, the crossover process includes: performing pairwise crossover on the number length and title, number length, and genes corresponding to the title of every two counterfactual instances in the counterfactual instance population.
[0035] Furthermore, the mutation process includes: mutating the number length of every two counterfactual instances in the counterfactual instance population and the gene corresponding to the question respectively.
[0036] On the other hand, the present invention also provides a counterfactual explanation generation system based on a multi-objective genetic algorithm, comprising a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any of the above methods.
[0037] In general, the present invention provides a method and system for generating counterfactual explanations based on a multi-objective genetic algorithm. The technical solution conceived by the present invention can achieve the following beneficial effects compared with the prior art:
[0038] (1) The counterfactual explanation proposed in the present invention is a causal reasoning method, which is applied as a post-hoc explanation method between the input and output of the deep knowledge tracking model. By adding the questions to be added after the original instance to intervene in the learning behavior characteristics of the input, the changes in the prediction results are observed, and the optimal counterfactual instance that can change the model prediction result value is found, avoiding the problem of false correlation.
[0039] (2) Compared with directly changing the original instance, the present invention can better explain the learning behavior characteristics that have the largest causal effect value on improving the predicted results of learners' learning performance. In addition, the counterfactual explanation in causal inference can be further used to mine the causal relationship between the input learning characteristics and the output of the deep knowledge tracking model, which is more suitable for the interpretation scenario of the deep knowledge tracking model and increases the learner's trust in the decision-making process and results of the deep knowledge tracking model. In addition, based on the interpretation results, learners can know what they should do next to better master the knowledge points, providing learners with a more personalized learning guidance strategy and increasing the application scope of the deep knowledge tracking model.
[0040] (3) Based on a multi-objective genetic algorithm, the counterfactual explanation problem is transformed into a multi-objective optimization problem, and a coding sequence is designed according to the problem context to solve the exponential spatial discrete search problem and increase the efficiency of counterfactual explanation generation.
[0041] (4) Based on the prior knowledge of the knowledge tracing task, we introduce multiple strategies for obtaining the questions to be added in order to obtain a population of counterfactual instances. This not only accelerates the evolution and convergence of the population, but also increases the individual diversity of the population of counterfactual instances through multiple strategies, crossover processing, mutation processing, etc. Compared with the existing technology, better counterfactual instances can be obtained, making the deep knowledge tracing model more interpretable.
[0042] (5) With regard to the priority of the optimization target, the present invention utilizes a sorting strategy that prioritizes the first indicator within the group and performs elite set selection, which not only makes the final causal effect value and effectiveness significantly better than the existing methods, but also makes the obtained counterfactual examples have higher diversity and more reasonable explanations. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction will be given below to 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 any creative work.
[0044] Figure 1 It is a schematic diagram of the principle of a method and system for generating counterfactual explanations based on a multi-objective genetic algorithm provided by the present invention;
[0045] Figure 2 It is a schematic diagram of the coding form of a counterfactual explanation generation method and system based on a multi-objective genetic algorithm provided by the present invention;
[0046] Figure 3 It is a schematic diagram of individual selection processing of a counterfactual explanation generation method and system based on a multi-objective genetic algorithm provided by the present invention;
[0047] Figure 4 It is a schematic diagram of ablation results of a counterfactual explanation generation method and system based on a multi-objective genetic algorithm provided by the present invention;
[0048] Figure 5 It is a schematic diagram of fine-grained experimental results of a counterfactual explanation generation method and system based on a multi-objective genetic algorithm provided by the present invention. DETAILED DESCRIPTION
[0049] 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 and embodiments 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 belong to the scope of protection of the present invention.
[0050] It should be noted that, in the description of the embodiments of the present invention, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a method, step or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such method, step or system. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the method, step or system including the element.
[0051] In the field of knowledge tracking, the learner's past answer sequence is the original instance. Currently, the main method is to perturb the answer interaction pair values in the original instance to explain the importance of the answer interaction pair in the original instance to the prediction results of the deep knowledge tracking model, and answer the question "If the learner had answered a certain question correctly, he would have mastered a certain knowledge point." However, since the fact that the learner failed to master a certain knowledge point due to a few wrong answers in the past has become a fact, the learner would like to know what to do next to master the knowledge points that were wrong in the past. Therefore, the counterfactual instances generated by this traditional counterfactual explanation method are not suitable for the explanation scenario of knowledge tracking.
[0052] It should be noted that the idea of the counterfactual interpretation of the deep knowledge tracing model is to answer the question "Suppose x is input into the black box model f and the output is decision y, then how to change x so that the model f outputs the alternative decision y′" through the generated counterfactual instances.
[0053] The present invention proposes a method for generating counterfactual explanations based on a multi-objective genetic algorithm. Instead of perturbing the answer interaction pair values in the original instance, a new answer interaction pair is added after the original instance to answer the question: "The learner failed to master a certain knowledge point in the past. If the learner does a few more questions, he will be able to master the knowledge point that he failed to master in the past." This shows that the connotation of guided counterfactual explanations is to help learners develop learning guidance strategies to overcome their own weaknesses and improve their learning abilities.
[0054] like Figure 1As shown, the present invention proposes a counterfactual explanation generation method based on a multi-objective genetic algorithm, the method comprising: obtaining the original instance of the learner from the knowledge tracking data set; obtaining the number length of the questions to be added, and randomly generating a plurality of length codes; obtaining the questions to be added from the knowledge tracking data set based on the number length, and obtaining the answer values corresponding to the questions to be added through the deep knowledge tracking model to be explained, forming the question-answer interaction pairs to be added; obtaining the counterfactual instances based on the length codes, the question-answer interaction pairs to be added and the original instances; repeatedly obtaining different question-answer interaction pairs to be added to obtain a plurality of different counterfactual instances, and generating a population of counterfactual instances; screening the population of counterfactual instances to obtain the optimal counterfactual instance; and realizing the interpretation of the deep knowledge tracking model based on the optimal counterfactual instance.
[0055] S101: Get the original instance of the learner from the knowledge tracing dataset.
[0056] The knowledge tracking dataset is a learning question bank on the online learning platform, which can be the ASSIST09 dataset, ASSIST12 dataset, Eedi dataset, etc.
[0057] Original instance S t is the learner’s historical answer sequence. In the explanation scenario of the deep knowledge tracing model, the deep knowledge tracing model f to be explained is a trained model, and the model input is the learner’s original instance S t ={x1, x2, ... x t}, which is the learner's historical answer sequence; among them, x t By answering the question interactively (q t , a t ) constitutes, q t Indicates the question to be answered, a t Indicates the answer to the question, a t =1 means the answer is correct, a t =0 means the answer is wrong. The parameter in the model is θ, and the model output is y t+1 =f θ (S t ), which is the predicted value of the mastery of the knowledge point corresponding to question t+1.
[0058] S102: Obtain the number and length of the questions to be added, and randomly generate multiple length codes.
[0059] Since the present invention uses the do operator to perform a form of intervention on the original instance, that is, whether to add a new answer interaction pair after the original instance. And the present invention is a multi-objective optimization problem. On the one hand, it is necessary to obtain a larger individual causal effect value (ICE value), and on the other hand, it is necessary to add as few new answer interaction pairs as possible. Therefore, the present invention is divided into two parts in terms of gene encoding.
[0060] It should be noted that the length of the number of questions to be added refers to the maximum number of questions to be added from the knowledge tracking dataset. If the length of the number is 5, it means that the maximum number of questions to be added after the original instance is 5, and the length is coded as 5 bits; if the length of the number is 3, it means that the maximum number of questions to be added after the original instance is 3, and the length is coded as 3 bits; generally, the smaller the length, the better.
[0061] As an embodiment of the present invention, Figure 2 As shown, the maximum length n of the number of questions to be added is 4, where n is a positive integer and can be expressed as {Δx1, Δx2, Δx3, Δx4,}. Then the randomly generated multiple length codes can be [1, 1, 0, 0,], [1, 0, 1, 0], or [1, 1, 0, 1,], etc.; the encoding form corresponding to [1, 1, 0, 0,] is [1, 1, 0, 0, Δx1, Δx2, Δx3, Δx4], which means that Δx1 and Δx2 in the questions to be added are added to the end of the original instance.
[0062] The first half of the encoding form [1, 1, 0, 0,] is a length code, indicating whether to add the question {Δx1, Δx2, Δx3, Δx4,} to the original instance, 1 means adding, 0 means not adding. It should be noted that the first half can be randomly generated [1, 0, 0, 0,], [1, 1, 1, 0,], [1, 0, 1, 0,], [0, 0, 1, 0,], [1, 0, 1, 1,], etc.
[0063] The second half of the encoding form [Δx1, Δx2, Δx3, Δx4] represents n randomly selected questions {Δx1, ..., Δx n}; do({Δx1, Δx2}) means adding two questions Δx1 and Δx2 to the original instance to form a new counterfactual instance.
[0064] Similarly, the decoding operation can recover the final counterfactual instance from the evolved single gene sequence using the encoded form.
[0065] S103: Obtain the questions to be added from the knowledge tracking data set based on the number length, and obtain the answer values corresponding to the questions to be added through the deep knowledge tracking model to be explained, so as to form the interactive pairs of the questions to be added.
[0066] To be added To search for new questions selected from the knowledge tracking dataset, the original instance after adding the question to be added is input into the knowledge tracking model to be explained to obtain the answer corresponding to the question to be added Thus, we get a pair x to be added. Δ , that is Multiple interactive pairs to be added Δ Generate interactive pairs of questions to be added.
[0067] According to the prior knowledge of knowledge tracking, the present invention introduces a variety of search strategies for obtaining the questions to be added, so as to jointly form an initialization population during the population initialization process to accelerate the evolution and convergence of the population.
[0068] As a specific embodiment of the present invention, the topic to be added is obtained from the knowledge tracking data set based on a search strategy; wherein the search strategy includes: any one of the first strategy, the second strategy, the third strategy or the fourth strategy.
[0069] The first strategy is the skill exploration strategy, which means not selecting other questions corresponding to the associated knowledge points corresponding to the questions in the original instance, but exploring other knowledge points to obtain the first type of questions corresponding to the associated knowledge points corresponding to the questions in the original instance.
[0070] The second strategy is a wrong question related strategy, which obtains the second type of questions corresponding to the associated knowledge points corresponding to the wrong questions in the original instance.
[0071] The third strategy is a skill-related strategy, which obtains the third type of questions corresponding to the target knowledge points.
[0072] The fourth strategy is a random strategy, which randomly selects the fourth type of questions from the knowledge tracing dataset to prevent the local optimal problem caused by the full use of the first three strategies.
[0073] For example, if the maximum length of the number of questions to be added is five, the first strategy is used to randomly select five questions from the knowledge tracking data set to form the interactive pair group of questions to be added. Alternatively, the second strategy is used to randomly select five questions from the knowledge tracking dataset to form the interactive pairs to be added. Alternatively, the third strategy is used to randomly select five questions from the knowledge tracking dataset to form the interactive pair to be added. Alternatively, the fourth strategy is used to randomly select five questions from the knowledge tracking dataset to form an interactive pair of questions to be added.
[0074] S104: Obtain a counterfactual instance based on the length encoding, the question-answer interaction pair to be added, and the original instance; repeatedly obtain different question-answer interaction pairs to be added to obtain multiple different counterfactual instances, and generate a population of counterfactual instances.
[0075] Based on the length coding, the to-be-added question-answering interaction pair and the original instance, a counterfactual instance is obtained. That is, a length coding is arbitrarily selected from the generated length codings; and the randomly obtained to-be-added question-answering interaction is added to the original instance according to the selected length coding.
[0076] It should be noted that it is preferred to add the to-be-added answering interaction to the back of the original instance in order. As a preferred embodiment of the present invention, the original instance is {x1, x2, x3} and a length code [1, 1, 0, 0,] is randomly selected. Add to the original instance in sequence to get the counterfactual instance
[0077] Repeatedly obtain different question-answer interaction pairs to be added to obtain multiple different counterfactual instances and generate a population of counterfactual instances. Preferably, multiple different question-answer interaction pairs to be added are obtained based on different search strategies, for example Etc. Generate a population of counterfactual instances based on a specified population.
[0078] As a specific embodiment of the present invention, obtain any length code, such as [1,0,1,1,], and add the answering interaction pair to be added based on [1,0,1,1,]. Add to the original instance to get the counterfactual instance
[0079] It should be noted that the population of counterfactual instances includes counterfactual instances obtained using different search strategies, thereby increasing the diversity of the population. Preferably, the number of counterfactual instances in the population of counterfactual instances is set to 5m, where m is a positive integer. Then, the number of counterfactual instances generated using the first strategy is m, the number of counterfactual instances generated using the second strategy is m, the number of counterfactual instances generated using the third strategy is m, and the number of counterfactual instances generated using the fourth strategy is 2m.
[0080] Add a new answer interaction pair after the original instance Get counterfactual examples The goal of the counterfactual example is to change the original predicted value y t+1 , get the new predicted value yt+1 =f θ (S Δk ), and f θ (S Δk )>f θ (S t ).
[0081] Furthermore, a number of different counterfactual instances are obtained, including:
[0082] The original instance S t and the counterfactual instance S Δk Input them into the deep knowledge tracking model respectively, and get the mastery level of the first knowledge point f θ (S t ) and the second knowledge point mastery degree f θ (S Δk );
[0083] Determine whether the counterfactual instance satisfies both: θ (S Δk )≥f θ (S t ) and f θ (S Δk )≥target mastery threshold; if it is satisfied, the counterfactual instance is selected; if it is not satisfied, the counterfactual instance is eliminated and the question to be added is reselected to generate the counterfactual instance.
[0084] In this way, a population of counterfactual instances with a set number of individuals is obtained.
[0085] S105: Screen the population of counterfactual instances to obtain the optimal counterfactual instance; and interpret the deep knowledge tracking model based on the optimal counterfactual instance.
[0086] Preferably, screening the population of counterfactual instances includes: sequentially performing crossover processing, mutation processing, and individual selection processing on the population of counterfactual instances.
[0087] The crossover process includes: performing pairwise crossover on the number length and title, number length, and genes corresponding to the title of every two counterfactual instances in the counterfactual instance population.
[0088] That is, the number length, topic, and the genes corresponding to the number length and topic of every two individuals in the population are crossed over, and the crossover probability is set to p cross If the gene crossover is performed on the number length between individuals, then according to p cross Cross the corresponding genes of the first half of the two individuals; if it is a crossover of the title gene between individuals, then according to p cross Cross the corresponding genes of the second half of the two individuals; if the number length and the gene of the question are crossed at the same time, then according to pcross Directly crossover the corresponding genes of two individuals.
[0089] The mutation process includes: mutating the number and length of every two counterfactual instances in the counterfactual instance population and the gene corresponding to the question.
[0090] That is, the length of each two individuals in the population and the gene corresponding to the question are mutated respectively, and the probability of mutation of the length is p mutation1 , the probability of title position mutation is p mutation2 If the number length is mutated, then according to p mutation1 The gene encoding of the number length part is set from 0 to 1 or from 1 to 0; if the question is mutated, then according to p mutation2 The corresponding question gene encoding is randomly changed to other question values in the knowledge tracking dataset.
[0091] Since this is a multi-objective optimization problem, the ICE value of the counterfactual instance and the length of the number of changes are used to measure the importance of the counterfactual instance to the prediction result, that is, the importance of adding questions to improve the mastery of the corresponding knowledge points. Therefore, the present invention uses the first indicator and the second indicator as the general fitness of the corresponding individual.
[0092] As an embodiment of the present invention, obtaining the optimal counterfactual instance includes: taking the counterfactual instance that maximizes the first indicator and the second indicator as the optimal counterfactual instance.
[0093] The first indicator is the individual causal effect value of the counterfactual instance on the mastery of the target knowledge point. That is, to measure the individual causal effect of each question S to be added Δk The degree of mastery of target knowledge points t+1 From the perspective of causal explanation, the contribution of the improvement can quantify the causal effect of the newly added question-answering interaction on the mastery of the target knowledge point. Based on the theory of causal inference, the disturbance method in the counterfactual explanation is called intervention, which is based on the do(·) calculation. The ICE value is formed by intervention in the attribution function. Preferably, the first indicator o1 can be expressed as:
[0094]
[0095] Specifically, whether the original instance adds the answer interaction pair is considered as a control variable and is intervened twice: do(S Δk )and Among them, do(S Δk ) means adding k question-answering interaction pairs to the original instance. Indicates that no new question-answering interaction pairs are added to the original instance, Y(do(S Δk ))and It represents the predicted value of the model to be explained under the two interventions, and ICE represents the difference. The larger the ICE, the better the causal effect of the answer interaction added in the counterfactual instance. Therefore, it is hoped that the optimal counterfactual instance will achieve a larger ICE value.
[0096] The second indicator is the degree of counter-intervention of the counterfactual instance compared to the original instance. The change length value of the counterfactual instance compared to the original instance is k, k quantifies the degree of counterfactual intervention, and -k represents the optimization goal. The larger the -k, the higher the degree of counter-intervention. It is hoped that the change length value of the counterfactual instance is as small as possible, and the higher the degree of counter-intervention, the better, which means that the counterfactual instance is closer to the original instance. Preferably, the second indicator o2 can be expressed as:
[0097] o2(S Δk , S t )=-k;
[0098] Among them, S Δk represents a counterfactual instance; S t Represents the original instance.
[0099] As an embodiment of the present invention, it can be converted into a multi-objective maximization task, that is, finding the optimal counterfactual instance that maximizes the first indicator and the second indicator.
[0100] Preferred, optimal counterfactual instance The formula is:
[0101]
[0102] in, represents the optimal counterfactual instance; o1(Y(S Δk ), Y(S t )) represents the first index; o2(S Δk , S t ) represents the second index; S Δk represents a counterfactual instance; S t Represents the original instance.
[0103] Due to the particularity of the knowledge tracking problem, the maximum number of interactive pairs of questions is preset, and the first and second indicators need to be optimized. In addition, it is also necessary to consider that the counterfactual instance must satisfy f θ (S Δk )≥f θ (S t ) and f θ (S Δk )≥ target mastery threshold. For example, if the mastery level of the final target knowledge point is greater than or equal to 0.7, it means that the student has truly mastered the knowledge point and reached the ideal predicted target value, that is, f θ(S Δk )≥0.7. Therefore, individuals with better performance in the first indicator are given priority for individual selection.
[0104] It should be noted that if Figure 3 As shown, the individual selection process includes: obtaining a first set by non-dominated sorting of counterfactual instances; sorting the counterfactual instances of each layer in the first set from large to small according to the first index, and dividing the counterfactual instances of each layer into two to obtain a sorted second set; selecting the counterfactual instances of the first half of each layer from the second set to enter the elite set until the number of counterfactual instances in the elite set is equal to the number of counterfactual instances in the counterfactual instance population; the counterfactual instances in the elite set are evolved as the next generation parents, and the counterfactual instance with the largest first index in the last generation of elite set is selected as the optimal counterfactual instance.
[0105] It should be noted that for a large number of predictions of learning results by different learners, multiple interpretable instance tasks need to be completed, that is, given the original instance set Get the optimal counterfactual explanation instance set This is the explanation.
[0106] In order to verify the effectiveness of the present invention, two deep knowledge tracing models DKT and SAKT to be interpreted were selected to conduct experiments on two commonly used datasets ASSIST09 and Eedi, and the interpreter performance was measured by two different indicators: ICE value and effectiveness.
[0107] ICE value, which is the optimal counterfactual instance generated The higher the ICE value, the better the interpreter:
[0108] Validity is defined as the counterfactual interpretation instance where the mastery of the corresponding knowledge point after the counterfactual intervention reaches above the set threshold, which is recorded as reaching the target prediction value y i ′ , and count the number of successful counterfactual instances as a percentage of the total number of counterfactual instances n CF The higher the validity, the better the performance of the explanation:
[0109] In order to ensure the fairness of the comparative experiments, the maximum length of the number of changes is set to 5, the length of the original instance is 10, and a unified search space is set. Existing methods are used as baselines, namely random selection, random search, gradient-based search, and NSGA-II algorithm.
[0110] Among them, random selection: randomly select the questions to be added one by one and add them to the original instance to form counterfactual instances with a changed number length from 1 to 5; gradient-based search is to evaluate the importance of input features according to the gradient of the model; the existing multi-objective genetic algorithm (NSGA-II algorithm) is a classic multi-objective genetic algorithm with fixed crossover and mutation probabilities.
[0111] Regarding performance comparison, the present invention sets up a set of experiments, as shown in Tables 1-2, to statistically analyze the average ICE value and effectiveness of the target knowledge points of counterfactual instances under different models and data sets with different change number lengths.
[0112] Table 1 Comparison results of ICE values
[0113]
[0114]
[0115] Table 2 Effectiveness comparison results
[0116]
[0117]
[0118] First, the present invention can obtain a higher average ICE value and effectiveness under almost all the change lengths, especially compared with the NSGA-II algorithm, which reflects the advantages of the first index priority search strategy and the initialization population strategy within the group. Although the performance of random search is better when the change length is 1, it shows that the search characteristics of the algorithm of the present invention are biased towards priority, and individuals with better first indicators will be preferentially selected. It is rare that the first indicator can be improved by changing the number length by only 1 unit.
[0119] Second, the present invention has a larger increase in each index from a change number length of 1 to 2, which indicates that the present invention can find the optimal counterfactual instance faster and better under a longer change number length.
[0120] Third, for different change number lengths, the present invention can search for more successful counterfactual instances, which shows that the algorithm proposed by the present invention has diversity and can better achieve personalized topic recommendation.
[0121] Fourth, the three explanation methods, random selection, random search, and gradient-based search, performed poorly in the three indicators. This may be due to the use of non-causal methods, which can easily capture false input-output correlations and miss causal relationships. The poor performance of the NSGA-II algorithm is likely to be due to the average distribution of the priorities of the two indicator tasks. While looking for a higher ICE value, it also looks for a shorter change number length, ignoring the need to pay more attention to the first indicator priority task in the deep knowledge tracking model scenario. Therefore, the performance is even worse than random search under a longer change number length.
[0122] Regarding the ablation experiment, the present invention conducted an analysis of the first indicator priority sorting strategy within the group and a fine-grained analysis of the first indicator priority sorting strategy within the group.
[0123] In order to deeply analyze the difference between the first indicator priority sorting strategy within the group and the crowding distance strategy, the present invention conducted three experiments to explore the performance advantages of the first indicator priority sorting strategy within the group in this problem scenario from three perspectives.
[0124] like Figure 4 As shown, D1 represents the data set ASSIST09, and M1 and M2 represent the models DKT and SAKT, respectively. The changes in the ICE value and the length of the number of changes after 100 rounds of iterations of the NSGA-II algorithm and the present invention under random initialization are observed. It can be found that the convergence speeds of the two are similar on the DKT model, but the ICE value reached by the present invention is higher. At the same time, the present invention also converges to a longer length of the number of changes, which shows that the first indicator priority sorting strategy within the group pays more attention to optimizing the first indicator and has better performance, but it also optimizes the second indicator at the same time, and the iteration does not blindly converge to the longest change length of 5. Under the SAKT model, the ICE value achieved by the present invention gradually increases with iteration, but the NSGA-II algorithm does not have a more obvious increase, indicating that the interpretation performance of NSGA-II is greatly affected by model changes.
[0125] In order to conduct a fine-grained analysis of the first indicator priority sorting strategy within the group, the present invention conducts a fine-grained analysis experiment, such as Figure 5As shown, D1 and D2 represent the data sets ASSIST09 and Eedi respectively; M1 and M2 represent the models DKT and SAKT respectively. By observing the changes in the ICE values under the change number lengths of 2, 3, and 4, it can be found that the performance of the present invention is better under the longer change number length, but the performance of the NSGA-II algorithm under all three lengths is not significantly different. This shows that the algorithm characteristic of the first indicator priority strategy in the group is that it tends to find counterfactual instances with higher ICE values. Although the possibility of increasing the ICE value is greater when more questions are added, the optimization of the second indicator is not completely ignored, because the gap between the change lengths of 3 and 4 is significantly smaller than the gap between 2 and 3. Therefore, the present invention is constrained by the second indicator to a certain extent. In contrast, the NSGA-II algorithm tends to balance between the two indicators, and therefore tends to find counterfactual instances with shorter change number lengths, which leads to the fact that it cannot be compared with the present invention in the optimization of the first indicator in the group. Moreover, the ICE value performance of NSGA-II on the SAKT model is not very ideal, but the present invention is not greatly affected by the change of the explanation model, so the present invention is more suitable for post-hoc explanations that are not related to the model. In addition, since the ICE value of the present invention performs better under each change in the length of the number, it can bring more diverse counterfactual explanation examples to provide learners with more optional learning guidance strategies.
[0126] On the other hand, the present invention also provides a counterfactual explanation generation system based on a multi-objective genetic algorithm, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any of the above methods. The technical features of the system are consistent with those of the above methods, and are not described one by one here.
[0127] In summary, for the particularity of knowledge tracking tasks, the present invention adds certain prior knowledge, and is significantly different from the applications that the traditional NSGA-II algorithm has targeted in the past in terms of encoding and decoding of problems. The interpretable task of the present invention is a multi-instance task, that is, the multi-objective genetic algorithm needs to complete multiple instances of the task of searching for the optimal counterfactual instance; it can better explain the learning behavior characteristics that have the maximum causal effect value for improving the prediction results of learners' learning performance, and can let learners know what to do in the future to better master the knowledge points based on the interpretation results, providing learners with a more personalized learning guidance strategy.
[0128] It should be noted that, for the above-mentioned various embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0129] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0130] In the several embodiments provided in this application, it should be understood that the disclosed method or system can be implemented in other ways. For example, the above-described embodiments are only schematic, and the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
[0131] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0133] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application.
[0134] A person skilled in the art can understand that all or part of the various circuits in the above-mentioned embodiments can be completed by entering a program to instruct related hardware. The program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0135] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the specification and practicing the disclosure here, those skilled in the art will easily think of the implementation scheme of the present disclosure. This application is intended to cover any modification, use or adaptation of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.
[0136] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0137] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for generating counterfactual explanations based on a multi-objective genetic algorithm, characterized in that: The method comprises: Get the original instance of the learner from the knowledge tracing dataset; Get the number and length of the questions to be added, and randomly generate multiple length codes; Based on the number length, the questions to be added are obtained from the knowledge tracking data set, and the answer values corresponding to the questions to be added are obtained through the deep knowledge tracking model to be explained, so as to form the interactive pairs of questions to be added; wherein, the questions to be added are obtained from the knowledge tracking data set based on the search strategy; the search strategy includes: any one of the first strategy, the second strategy, the third strategy or the fourth strategy; the first strategy is to obtain the first type of questions corresponding to the associated knowledge points corresponding to the questions in the original instance; the second strategy is to obtain the second type of questions corresponding to the associated knowledge points corresponding to the wrong questions in the original instance; the third strategy is to obtain the third type of questions corresponding to the target knowledge points; the fourth strategy is to randomly select the fourth type of questions from the knowledge tracking data set; Based on the length encoding, the question-answer interaction pair to be added, and the original instance, a counterfactual instance is obtained; different question-answer interaction pairs to be added are repeatedly obtained to obtain multiple different counterfactual instances, and a counterfactual instance population is generated; Screening the population of counterfactual instances to obtain an optimal counterfactual instance includes: sequentially performing crossover processing, mutation processing, and individual selection processing on the population of counterfactual instances; taking the counterfactual instance that maximizes the first indicator and the second indicator as the optimal counterfactual instance; wherein the first indicator is the individual causal effect value of the counterfactual instance on the mastery of the target knowledge point; the second indicator is the degree of counter-intervention of the counterfactual instance compared with the original instance; and implementing an interpretation of the deep knowledge tracking model based on the optimal counterfactual instance.
2. A method for generating counterfactual explanations based on a multi-objective genetic algorithm as claimed in claim 1, characterized in that: The optimal counterfactual instance The formula is: ; in, represents the optimal counterfactual instance; represents the first indicator; represents the second indicator; represents said counterfactual instance; Represents the original instance.
3. A method for generating counterfactual explanations based on a multi-objective genetic algorithm as claimed in claim 1, characterized in that: We get several different counterfactual examples including: The original instance and the counterfactual instance Input them into the deep knowledge tracking model respectively, and obtain the mastery degree of the first knowledge point And the second knowledge point mastery ; Determine whether the counterfactual instance satisfies both: and Threshold; if it is satisfied, the counterfactual instance is selected; if it is not satisfied, the counterfactual instance is eliminated, and the question to be added is reselected to generate the counterfactual instance.
4. A method for generating counterfactual explanations based on a multi-objective genetic algorithm as claimed in claim 1, characterized in that: The individual selection process includes: Obtaining a first set by non-dominated sorting of the counterfactual instances; sorting the counterfactual instances of each layer in the first set from large to small according to the first index, and dividing the counterfactual instances of each layer into two, to obtain a sorted second set; Selecting the counterfactual instances of the first half of each layer from the second set and entering the elite set until the number of counterfactual instances in the elite set is equal to the number of counterfactual instances in the counterfactual instance population; The counterfactual instances in the elite set are evolved as the next generation parents, and the counterfactual instance with the largest first indicator in the last generation elite set is selected as the optimal counterfactual instance.
5. The method for generating counterfactual explanations based on a multi-objective genetic algorithm according to claim 1, characterized in that: The crossover process includes: performing pairwise crossover on the number length and title, number length, and genes corresponding to the title of every two counterfactual instances in the counterfactual instance population.
6. A method for generating counterfactual explanations based on a multi-objective genetic algorithm as claimed in claim 1, characterized in that: The mutation process includes: mutating the number length of every two counterfactual instances in the counterfactual instance population and the gene corresponding to the question respectively.
7. A counterfactual explanation generation system based on a multi-objective genetic algorithm, comprising a memory, a processor, and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Explanatable deep knowledge tracking method and system and application of explanatable deep knowledge tracking method and system
CN113724110A
Deep knowledge tracking causal interpretation method and device based on genetic algorithm
CN116776992A