Learning log credibility screening and abnormality suppression method for online education RAG knowledge base construction
By processing learning log data from online education platforms using robust residual energy and joint energy functions, the problems of sequence dependency and heavy-tailed noise are solved, credible evidence screening and anomaly suppression are achieved, and the teaching quality and resource utilization efficiency of online education are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SICHUAN QIMINGDAREN TECH CO LTD
- Filing Date
- 2026-05-18
- Publication Date
- 2026-06-19
Smart Images

Figure CN122240824A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of online teaching technology, and in particular to a method for reliable filtering and anomaly suppression of learning logs used in the construction of RAG knowledge bases for online education. Background Technology
[0002] With the rapid development of online education platforms, learning log data is continuously generated in large quantities during teaching processes such as practice questions, explanations, reviews, and assessments. These logs typically contain multi-dimensional information including question and knowledge point identifiers, answer results, time taken, prompt trigger records, explanation trigger records, device and network status, learning time periods, and continuous learning duration. In recent years, Retrieval Enhanced Generation (RAG) technology has been widely applied in scenarios such as personalized explanation generation, error analysis, and learning plan development. Platforms need to process learning logs and their derived information to construct searchable knowledge bases and evidence bases to support large language models in outputting teaching conclusions based on evidence and to meet the requirements of traceability and interpretability of conclusions in educational scenarios.
[0003] However, in practice, directly using raw learning logs for RAG knowledge base construction faces two fundamental contradictions: First, the log data exhibits significant sequence dependence, failing to satisfy the independent and identically distributed hypothesis. Learning behavior demonstrates clear time and state dependence; students' performance is influenced by continuously changing factors such as knowledge mastery, fatigue, and learning pace. The validity of a single log entry needs to be judged in conjunction with its surrounding context.
[0004] Second, log data contains a large amount of heavy-tailed noise and outliers. In real-world scenarios, common anomalies include accidental touches, account suspensions, proxy requests, extreme time limits, short-term consecutive responses, and record offsets caused by network lag. Once this type of data enters the knowledge base, it will be recalled during the retrieval phase and cited as evidence during the generation phase, leading to problems such as biased teaching conclusions, inconsistent citations, and difficulties in interpretation. Furthermore, the large scale and high update frequency of learning logs mean that fully storing them and calculating vectorized features would incur significant storage and computational overhead; the higher the proportion of polluted data, the more severe the resource waste.
[0005] Existing technologies for learning log cleaning and RAG knowledge base construction mainly employ the following methods, but all have significant shortcomings: The first type is filtering based on fixed rules or thresholds: common practices include removing or downweighting data based on rules such as time thresholds, accuracy thresholds, prompt count thresholds, and consecutive answer intervals. This type of method is simple to implement, but it heavily relies on manual experience to set thresholds, making it difficult to adapt to the distribution changes of different campuses, class types, and learning stages. Furthermore, the rules are usually applied to individual records, lacking constraints on the sequence consistency of the learning process, which can easily lead to incorrect data entry judgments where "a single point is reasonable, but the sequence is unreliable."
[0006] The second approach involves single-model-based anomaly detection or regression scoring methods. Some solutions employ isolated forests, support vector machines, and regression models to score or identify anomalous samples. However, many implementations assume that samples are approximately independent, making it difficult to effectively handle the time-dependent characteristics of the learning state. Furthermore, when noise exhibits a heavy-tailed distribution, the model is easily influenced by extreme samples, leading to unstable discrimination thresholds and fluctuations in performance across periods, further increasing system maintenance costs.
[0007] The third approach involves indiscriminate full data import and RAG construction: Some systems directly write logs or their derived text into the knowledge base, relying on the retrieval system to "naturally filter out noise" during the query phase. This method leads to a rapid increase in vectorization computation and index size as the log size grows, and dirty data can still be recalled, causing skewed search results. Once contaminated evidence enters the generation stage, inconsistencies between citations and conclusions are likely to occur, and it is difficult to provide a complete and traceable chain of evidence for key teaching conclusions.
[0008] In summary, existing technologies either struggle to simultaneously address sequence dependency modeling and heavy-tailed anomaly handling, or lack risk control mechanisms for retrieval and generation after RAG (Rich Internet Gauge) database entry, failing to meet the core requirements of online education scenarios for "credible evidence entry, interpretable citation, and sustainable maintenance." Therefore, there is an urgent need to propose a logically simple, accurate, and reliable method for credible filtering and anomaly suppression of learning logs for constructing online education RAG knowledge bases. This method should achieve credible filtering, anomaly suppression, evidence-based organization, and online maintainable updates of learning logs under complex conditions where sequence dependencies and anomalous noise coexist. Summary of the Invention
[0009] To address the aforementioned problems, the present invention aims to provide a method for reliable filtering and anomaly suppression of learning logs used in the construction of RAG knowledge bases for online education. The technical solution adopted by the present invention is as follows: A method for trustworthy filtering and anomaly suppression of learning logs used in the construction of RAG knowledge bases for online education includes the following steps: Step S1: Organize the original learning logs into a sequence of events by student and time, map them into a unified event sample, and form a global event sample set; Step S2: Convert the original learning logs into fixed-length feature vectors and set a target quantity based on future observable feedback; Step S3: Combine the fixed-length feature vector and the target quantity based on future observable feedback, and use a robust loss function to fit the regression model, calculate the residuals and map them to robust residual energy; Step S4: Based on the robust residual energy, and introducing sequence consistency cost, coverage cost, and anti-cheating consistency cost, construct a joint energy function; Step S5: Construct a confidence score and anomaly score based on the robust residual energy; and divide the global event sample set according to the preset confidence threshold and anomaly threshold. Step S6: Organize the global event sample set after splitting into evidence packages according to knowledge points, and calculate the mean confidence and mean anomaly of the evidence packages; construct the retrieval reordering weights, and set citation threshold constraints on evidence citation during the generation stage; S7: Statistical periodic energy distribution and confidence distribution, adaptively updating the weights of the joint energy function, the robustness threshold of robust residual energy, the confidence threshold, and the anomaly threshold.
[0010] Compared with the prior art, the present invention has the following beneficial effects: This invention performs serialization modeling of logs on a student-by-student basis and introduces a sequence consistency cost to constrain residual fluctuations within a short window. This enables the screening process to identify locally unstable segments and avoids using unstable logs as evidence based solely on single-point rules, thereby improving the stability of the evidence.
[0011] This invention employs robust residual energy to suppress heavy-tailed noise, reducing the impact of outliers on screening and thresholding. It also uses robust residual energy to softly prune prediction errors, ensuring that heavy-tailed anomalies such as extreme time consumption, extreme score jumps, and proxy filtering do not dominate regression fitting and subsequent energy evaluation. Compared to traditional least squares or hard threshold filtering, this invention is less sensitive to outlier distributions, resulting in smaller fluctuations in screening results across periods.
[0012] This invention employs a joint energy function to couple error, sequence, coverage, and anti-cheating into an inseparable whole, demonstrating greater ingenuity. It constructs a joint energy function that simultaneously incorporates robust residuals, sequence consistency, coverage cost, and anti-cheating consistency cost within the same scalar framework, and drives selective sampling with the probability of acceptance of Markov chaining. This mechanism is not simply a series of modules; rather, it uniformly controls sampling acceptance behavior through energy difference (i.e., calculating the probability of acceptance of Markov chaining based on the joint energy difference between the current chain state and candidate states, and determining whether a candidate sample is accepted based on this probability, thus providing a unified computational basis for the reliable screening process and avoiding reliance on multiple independent rules and empirical thresholds). This gives "reliable screening" a computable and reproducible decision-making foundation, avoiding the rule splicing and empirical threshold stacking common in existing technologies.
[0013] This invention uses coverage cost to supplement scarce knowledge point evidence, thereby improving the coverage of RAG retrieval. By linking coverage cost with coverage count within a period, the evidence samples are more evenly distributed across the knowledge point dimension, reducing the situation where knowledge base evidence is concentrated only on high-frequency knowledge points, thus improving the recall and usability of RAG on long-tail knowledge points.
[0014] This invention uses trajectory statistics to generate a credibility score, supporting tiered data entry and maintainable quality control. It constructs the credibility score using the number of sample acceptances and combines it with anomaly scores to achieve a three-tiered data splitting. This tiered strategy controls the proportion of noisy data entry without sacrificing coverage, and the thresholds have clear engineering implications, facilitating long-term operation and auditing.
[0015] This invention employs an evidence package index structure that directly affects retrieval rearrangement and generation citation constraints, reducing the risk of erroneous evidence citations. It organizes incoming evidence into evidence packages, calculates evidence quality statistics, and constructs rearrangement weights. Rearrangement is performed based on these weights during the retrieval phase, and citation constraints are applied based on thresholds during the generation phase. This mechanism reduces the problem of conclusion distortion and inconsistencies in citations caused by similar but unreliable evidence entering the generation process.
[0016] This invention employs drift detection and online adaptive updates to enhance robustness across cycles and campuses. By triggering updates through drift statistics, the joint energy weights, robustness thresholds, and diversion thresholds are adjusted online, enabling the system to adapt to changes in data distribution at different stages and rhythms, reducing the cost of repeated manual parameter tuning, and maintaining the long-term stability of the evidence library quality.
[0017] In summary, this invention has the advantages of simple logic and high accuracy and reliability, and has high practical and promotional value in the field of online teaching technology. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope of protection. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a logic flowchart of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of this application clearer, the present invention will be further described below with reference to the accompanying drawings and embodiments. The embodiments of the present invention include, but are not limited to, the following embodiments. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0021] like Figure 1As shown, this embodiment provides a method for trustworthy filtering and anomaly suppression of learning logs used in the construction of an online education RAG knowledge base. This method addresses the objective characteristics of learning logs—namely, being time-correlated, noisy with heavy tails, large in scale, and frequently updated—by employing an integrated process of robust error suppression, sequence constraint sampling, and evidence-based data entry control. This ensures that log fragments entering the knowledge base have traceable trustworthiness labels and can be directly used for retrieval rearrangement and the generation of reference constraints. Specifically, it includes the following steps: The first step is to organize the raw learning logs into a sequence of events by student and time, map them to unified event samples, and form a global event sample set. In this embodiment, the raw learning logs generated by the online education platform are organized into a computable sequence of events by student and time, and each log entry is uniformly mapped to a sample format that can be processed by subsequent models, providing a consistent data interface for subsequent robust regression, joint energy calculation, and Mahalanobis sampling. The raw learning log records (including fields such as question, knowledge point, answer result, time taken, prompt, device / network, and timestamp).
[0022] The set of students is ;in, Represents a set of students; A unique identifier for the j-th student, j∈ ; This indicates the number of students.
[0023] The original learning logs are sorted by time to obtain the original learning log sequence, the expression of which is: ;in, Indicates the first The original log sequence of each student; Indicates the first The t-th original learning log record of a student; t represents the time index, t∈ ; Indicates the first The number of log entries per student; the original learning log records are sorted by time.
[0024] The original learning logs are organized into a sequence of events by student and time, and mapped to a unified event sample, the expression of which is: ; in, Indicates the first A unified event sample corresponding to the t-th original learning log record of each student; Indicates the first The feature vector corresponding to the t-th original learning log record of each student; Indicates the first The target quantity corresponding to the t-th original learning log record of each student.
[0025] Converting raw log fields into numerical feature vectors avoids subsequent algorithms directly processing unstructured fields, improving feasibility and engineering consistency. This embodiment establishes the first... The tth original learning log record of student 1 With the The feature vector corresponding to the t-th original learning log record of each student Mapping relationship: ; ; in, This represents a feature extraction mapping function that maps the category fields (question type, knowledge point), numerical fields (time spent, number of prompts) and context fields (time period, device) in the original logs into a fixed-length vector. This represents a vector concatenation operation; This represents the output feature extraction mapping function for the answer result (features of the answer result such as correct marking, nearest window accuracy, etc.). This represents the output time feature extraction mapping function (time features such as logarithmic time, standardized time, extreme time indicators, etc.); This indicates the trigger feature extraction mapping function for outputting prompts / explanations (such as the number of trigger feature prompts, the timing of prompts, etc.); This represents the feature extraction mapping function (such as one-hot or fixed-dimensional embedding vector) that outputs knowledge points / question types / difficulty. The feature extraction mapping function represents the output context (such as time period, device type, network status level, continuous learning duration binning, etc.).
[0026] A global event sample set is formed, and its expression is: ; in, This represents the global event sample set, used to represent the pool of all candidate samples within a system build cycle; Represents the set union operation; Indicates the first A sequence of event samples from 10 students.
[0027] The second step is to convert the original learning logs into fixed-length feature vectors and set a target quantity based on future observable feedback.
[0028] Among them, the The feature vector corresponding to the t-th original learning log record of each student The expression is: ; in, This represents the feature vector of the answer result; This represents the time-dependent feature vector; This represents the trigger feature vector for the prompt / explanation; Feature vectors representing knowledge points / question types / difficulty; The feature vector representing the context.
[0029] The target quantity is set based on future observable feedback, and its expression is: ; ; ; in, This indicates that the extraction function is correctly identified; Indicates the first The original log sequence of each student The first one sorted by timestamp in ascending order Log event record; Index variables representing future candidate events; Indicates about the first The time index of the next event for the same knowledge point recorded in the t-th original learning log of each student; Indicates the first The event knowledge point ID of the t-th original learning log event record of a student; This represents a function for extracting knowledge points. Indicates the first The original log sequence of each student The first one sorted by timestamp in ascending order Log event records of future candidate events.
[0030] The third step involves combining a fixed-length feature vector with a target quantity based on future observable feedback, and using a robust loss function to fit the regression model, calculating the residuals and mapping them to robust residual energy.
[0031] (31) Using the first The feature vector corresponding to the t-th original learning log record of each student and the The target quantity corresponding to the t-th original learning log record of each student. Sample pairs are formed and fitted to obtain a regression model using a robust loss function.
[0032] (32) Find the first The feature vector corresponding to the t-th original learning log record of each student The predicted value of the corresponding target quantity is expressed as follows: ; in, Indicates the first The predicted value of the target quantity corresponding to the t-th original learning log record of each student; Represents the regression model function; This represents the set of parameters for the regression model.
[0033] (33) Obtain the residual: ; in, Indicates the first The residuals corresponding to the t-th original learning log record of each student are shown here. The residuals represent the prediction error of that sample, and their magnitude and distribution structure are used to characterize whether the log sample deviates from the normal learning pattern. They are the core fundamental quantities for anomaly suppression and reliable screening.
[0034] (34) Preset a robust threshold constant, and set the first... The residual corresponding to the t-th original learning log record of each student The mapping is to robust residual energy, and its expression is: ; in, Indicates robust residual energy; This represents a robust threshold constant; This represents the absolute value operator.
[0035] (35) Obtain the initial set of regression model parameters by minimizing the robust energy. Its expression is: ; in, This represents the initial training sample set. ; robust residual energy As a robust residual energy scalar output: ;in, Indicates the first The robust residual energy corresponding to the t-th original learning log record of each student.
[0036] The fourth step involves constructing a joint energy function based on the robust residual energy, and introducing sequence consistency cost, coverage cost, and anti-fraud consistency cost. Subsequently, a Markov linking acceptance mechanism is employed to calculate the acceptance probability based on the energy difference, resulting in the set of accepted samples and their acceptance trajectory statistics, which are used for subsequent credibility scoring and stratified data entry.
[0037] The expression for the joint energy function is: ; in, Indicates the first The joint energy of the t-th original learning log record of each student; Indicates robust residual energy weights; Indicates the sequence consistency cost weight; Indicates the coverage cost weight; Indicates the weight of anti-cheating costs; Indicates the first The sequence consistency cost (non-negative scalar) of the t-th original learning log record of a student. Indicates the first The coverage cost of the t-th original learning log record for each student (non-negative scalar). Indicates the first The anti-cheating consistency cost (non-negative scalar) of the t-th original learning log record of a student.
[0038] Among them, the The sequence consistency cost of the t-th original learning log record of a student The expression is: ; ; ; in, Indicates the first The set of window indices for the t-th original learning log record of each student; This represents the time index variable within the window; This indicates the operator for taking the larger value; This represents a constant indicating the sequence window length. Indicates the first The mean residual within the window of the t-th original learning log record of each student; Indicates the first The number of window set elements for the t-th original learning log record of each student. Used to quantify residual fluctuations within a window. The larger this value, the more unstable the recent error is, and the greater the penalty will be imposed on the joint energy, thereby reducing the probability that this type of log segment will be subject to Markov linkage.
[0039] In addition, the Coverage cost of the t-th original learning log record for each student The expression is: ; in, Representing knowledge points The count has been accepted; This indicates the lower limit of the coverage target.
[0040] Among them, the Anti-cheating consistency cost of the t-th original learning log record of a student The expression is: ; ; in, Represents the anti-cheating feature mapping function; Indicates the first The anti-cheating feature vector of the t-th original learning log record of a student; This represents the 2-norm operator. As a non-negative scalar, the larger the amplitude of the anti-fraud feature, the higher the corresponding degree of suspicion, and the greater the cost, thus increasing the penalty in the joint energy and reducing the probability of such samples being accepted.
[0041] In the The joint energy of the t-th original learning log record of each student Based on this, a Markov linker mechanism is used to selectively sample candidate samples to obtain the count statistics required for credibility scoring. Specifically: Assume the total number of steps in the Markov chain is constant. ; Represented as a set of positive integers; This represents the total number of steps in the Markov chain sampling.
[0042] The candidate samples are a global event sample set. The chain is obtained by sampling according to the symmetric proposal distribution. Let the index of the current chain state at step q be . And the candidate state index is .
[0043] The probability of acceptance at step q is expressed as follows: ; in, This represents the probability of acceptance at step q. Indicates the current chain state The combined energy; Indicates candidate state The combined energy; This represents an exponential function. Here, the acceptance probability is given when the candidate energy is lower. When the energy of a candidate approaches 1, the candidate is more likely to be accepted. When the energy of a candidate is higher, it is still accepted by probability to avoid the sampling process from getting stuck in a local mode, thereby obtaining a more stable evidence screening trajectory.
[0044] Let the number of sample acceptances be . .
[0045] Initialize the sample acceptance count at the start of any construction cycle. At the same time, for knowledge points Accepted count Perform initialization, record , k∈ .
[0046] If the candidate state is accepted in step q... Then execute And calculate the knowledge point identifier. Update coverage count Synchronously update chain status Otherwise, keep the chain state unchanged: .
[0047] The fifth step involves constructing a credibility score and anomaly score based on the robust residual energy; and then dividing the global event sample set according to preset credibility and anomaly thresholds.
[0048] (51) The credibility score is used to measure the stability of a sample under joint energy constraints in terms of its acceptance of sampling. Its expression is: ; in, Indicates the first The credibility score of the t-th original learning log record of each student.
[0049] (52) The anomaly score is used to reflect the degree to which a sample deviates from a robust regression structure. Its expression is: ; in, Indicates the first The anomaly score of the t-th original learning log record of each student; This represents the anomaly normalization constant. It is used to unify the energy scale of data from different periods and different campuses to a comparable range.
[0050] (53) Preset credibility threshold With anomaly threshold Let the set of traffic splitting labels be... ; This indicates that the data has been reliably stored in the database. This indicates weakly trusted data entry. This indicates an isolation zone.
[0051] The expression for splitting the global event sample set is as follows: ; in, Indicates the first The routing label for the t-th original learning log record of a student. ; This indicates a logical AND operation.
[0052] Here, samples with anomalies exceeding the threshold are directly isolated to prevent high-risk logs from entering the evidence library; under the premise that the anomalies are acceptable, the confidence threshold is used to distinguish between direct entry into the library and entry into the library with reduced weight; this rule uses both sampling trajectory information and robust energy information to avoid one-sided judgments caused by a single indicator.
[0053] (54) The following processing is performed on the global event sample set after the split: ; ; ; in, This represents a set of highly credible evidence. This represents a set of evidence that is usable but needs to be downgraded. This represents the collection of evidence from the quarantine area.
[0054] The sixth step involves organizing the split global event sample set into evidence packages based on knowledge points, and calculating the mean credibility and mean anomaly of each evidence package; constructing retrieval re-ranking weights, and setting citation threshold constraints for evidence citation during the generation phase. Specifically: (61) Construct the evidence package object ;in, The evidence package object representing knowledge point k; Represents a set of evidentiary events; The mean credibility of the evidence package for knowledge point k; The mean anomaly of the evidence package representing knowledge point k; The evidence package retrieval reordering weight represents the knowledge point k.
[0055] (62) Assign evidence weights to the global event sample set after diversion, the expression of which is: ; in, Indicates the first Uniform event sample corresponding to the t-th original learning log record of each student Weight of evidence; This represents the Clean sample weight coefficient. ; This represents the weight coefficient of the weak sample. .
[0056] The evidence event set in this embodiment The expression is: .
[0057] (63) Calculate the mean confidence level and mean anomaly level of the evidence package, the expressions are as follows: ; ; in, The credibility of the evidence package for knowledge point k; Let represent the mean anomaly score of the evidence package for knowledge point k. Here, .
[0058] (64) Define the retrieval re-ranking weights for evidence packages. Knowledge point evidence packages with high credibility and low anomaly receive greater re-ranking weights, thus being recalled and used more prominently in RAG retrieval. Here, the retrieval re-ranking weights are constructed, and their expressions are as follows: ; in, The retrieval rearrangement weight of the evidence package for knowledge point k; Represents the confidence gain coefficient; This represents the abnormal penalty coefficient.
[0059] (65) To avoid citing low-credibility or highly anomalous evidence during the generation stage, a citation threshold is set to constrain evidence citation during the generation stage: a citation credibility threshold is set. (Minimum mean confidence threshold required for the evidence package to be cited) and upper limit threshold for citation anomalies (The maximum allowable mean anomaly threshold for the evidence package to be cited); Conditions for citing the evidence package: .
[0060] Step 7 involves statistically analyzing the periodic energy distribution and credibility distribution, and adaptively updating the weights of the joint energy function, the robustness threshold of the robust residual energy, the credibility threshold, and the anomaly threshold. The data distribution on the online education platform changes with variations in campus, class type, stage, and exam schedule. To maintain the long-term stability of credible screening and evidence package control, this step performs drift detection on the joint energy distribution and sampling acceptance structure (i.e., this step detects drift in the joint energy distribution and the sampling acceptance statistics formed by the number of sample acceptances and credibility scores; when a significant drift is detected, online adaptive updates to the joint energy weights, robustness threshold, and diversion threshold are triggered).
[0061] (71) Constructing the definition of periodic and statistical sets: Let the sample index set be within period c. ; Let the joint energy set of period c be... ; Let the set of credibility of period c be... .
[0062] (72) Obtain the KS drift statistic for period c: ;in, This represents the KS distance calculation operator; Represents the set of joint energies with period c-1; The reliable structural drift for period c is obtained as follows: ;in, This represents the average confidence level of period c; This represents the average confidence level for period c-1.
[0063] Among them, the average confidence level of period c The expression is: .
[0064] Preset KS drift trigger threshold and trusted drift trigger threshold ; Give the triggering condition: ;in, This indicates a logical OR.
[0065] (73) Online update of joint energy weights: Update the joint energy weights: ; ; ; ; in, This indicates that the step size constant is being updated. ; This indicates the reliability deviation for the current period. ; This represents the preset target value for the average credibility. .
[0066] (74) Online updates of robust threshold and shunting threshold: For robust threshold constant Update: ;in, Represents the quantile operator; Represents the quantile constant; Represents the set of absolute values of residuals. ; Citation credibility threshold With reference anomaly upper limit threshold Update: ; ; in, Indicates the desired Clean ratio. ; Indicates the desired isolation ratio. Here, by updating the threshold quantile, the three-layer diversion ratio remains within a controllable range after distribution drift, avoiding insufficient Clean leading to scarce evidence or insufficient Quarantine leading to contamination in the database.
[0067] The above embodiments are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any changes made based on the design principles of the present invention, or any non-creative modifications made thereon, shall fall within the scope of protection of the present invention.
Claims
1. A method for reliable filtering and anomaly suppression of learning logs used in the construction of RAG knowledge bases for online education, characterized in that, Includes the following steps: Step S1: Organize the original learning logs into a sequence of events by student and time, map them into a unified event sample, and form a global event sample set; Step S2: Convert the original learning logs into fixed-length feature vectors and set a target quantity based on future observable feedback; Step S3: Combine the fixed-length feature vector and the target quantity based on future observable feedback, and use a robust loss function to fit the regression model, calculate the residuals and map them to robust residual energy; Step S4: Based on the robust residual energy, and introducing sequence consistency cost, coverage cost, and anti-cheating consistency cost, construct a joint energy function; Step S5: Construct a credibility score and anomaly score based on the robust residual energy; The global event sample set is divided according to the preset confidence threshold and anomaly threshold; Step S6: Organize the global event sample set after splitting into evidence packages according to knowledge points, and calculate the mean confidence level and mean anomaly level of the evidence packages; Construct retrieval rearrangement weights and set citation threshold constraints for evidence citations during the generation phase; S7: Statistical periodic energy distribution and confidence distribution, adaptively updating the weights of the joint energy function, the robustness threshold of robust residual energy, the confidence threshold, and the anomaly threshold.
2. The method for reliable filtering and anomaly suppression of learning logs for constructing an online education RAG knowledge base according to claim 1, characterized in that, The original learning logs are organized into a sequence of events by student and time, mapped to a unified event sample, and a global event sample set is formed. This includes the following steps: The set of students is ;in, Represents a set of students; A unique identifier for the j-th student, j∈ ; Indicates the number of students; The original learning logs are sorted by time to obtain the original learning log sequence, the expression of which is: ;in, Indicates the first The original log sequence of each student; Indicates the first The t-th original learning log record of each student is sorted by time; t represents the time index, t∈ ; Indicates the first Number of log entries per student; The original learning logs are organized into a sequence of events by student and time, and mapped to a unified event sample, the expression of which is: ; in, Indicates the first A unified event sample corresponding to the t-th original learning log record of each student; Indicates the first The feature vector corresponding to the t-th original learning log record of each student; Indicates the first The target quantity corresponding to the t-th original learning log record of each student; Establish the first The tth original learning log record of student 1 With the The feature vector corresponding to the t-th original learning log record of each student Mapping relationship: ; ; in, Represents the feature extraction mapping function; This represents a vector concatenation operation; This represents the feature extraction mapping function that outputs the answer result; This indicates the time-consuming feature extraction mapping function used for output. This indicates the trigger feature extraction mapping function for outputting prompts / explanations; This represents the feature extraction mapping function that outputs knowledge points / question types / difficulty levels. This represents the feature extraction mapping function of the output context; A global event sample set is formed, and its expression is: ; in, Represents the global event sample set; Represents the set union operation; Indicates the first A sequence of event samples from 10 students.
3. The method for reliable filtering and anomaly suppression of learning logs for constructing an online education RAG knowledge base according to claim 2, characterized in that, The original learning logs are converted into fixed-length feature vectors, and a target quantity based on future observable feedback is set, including the following steps: The first The feature vector corresponding to the t-th original learning log record of each student The expression is: ; in, This represents the feature vector of the answer result; This represents the time-dependent feature vector; This represents the trigger feature vector for the prompt / explanation; Feature vectors representing knowledge points / question types / difficulty; Feature vectors representing the context; The target quantity is set based on future observable feedback, and its expression is: ; ; ; in, This indicates that the extraction function is correctly identified; Indicates the first The original log sequence of each student The first one sorted by timestamp in ascending order Log event record; Index variables representing future candidate events; Indicates about the first The time index of the next event for the same knowledge point recorded in the t-th original learning log of each student; Indicates the first The event knowledge point ID of the t-th original learning log event record of a student; This represents a function for extracting knowledge points. Indicates the first The original log sequence of each student The first one sorted by timestamp in ascending order Log event records of future candidate events.
4. The method for reliable filtering and anomaly suppression of learning logs for constructing RAG knowledge bases in online education according to claim 3, characterized in that, Combining a fixed-length eigenvector and a target quantity based on future observable feedback, and fitting a regression model using a robust loss function, the residuals are calculated and mapped to robust residual energy, including the following steps: Using the first The feature vector corresponding to the t-th original learning log record of each student. and the The target quantity corresponding to the t-th original learning log record of each student Sample pairs are formed and fitted to obtain a regression model using a robust loss function; Find the first The feature vector corresponding to the t-th original learning log record of each student The predicted value of the corresponding target quantity is expressed as follows: ; in, Indicates the first The predicted value of the target quantity corresponding to the t-th original learning log record of each student; Represents the regression model function; Represents the set of parameters for the regression model; Obtain the residual: ; in, Indicates the first The residuals corresponding to the t-th original learning log record of each student; A preset robust threshold constant will be used to determine the first... The residual corresponding to the t-th original learning log record of each student The mapping is to robust residual energy, and its expression is: ; in, Indicates robust residual energy; This represents a robust threshold constant; Represents the absolute value operator; Obtain the initial set of regression model parameters. Its expression is: ; in, This represents the initial training sample set. ; robust residual energy As a robust residual energy scalar output: ;in, Indicates the first The robust residual energy corresponding to the t-th original learning log record of each student.
5. The method for reliable filtering and anomaly suppression of learning logs for constructing an online education RAG knowledge base according to claim 4, characterized in that, Based on the robust residual energy, and introducing sequence consistency cost, coverage cost, and anti-cheating consistency cost, a joint energy function is constructed, the expression of which is: ; in, Indicates the first The joint energy of the t-th original learning log record of each student; Indicates robust residual energy weights; Indicates the sequence consistency cost weight; Indicates the coverage cost weight; Indicates the weight of anti-cheating costs; Indicates the first The sequence consistency cost of the t-th original learning log record for each student; Indicates the first The coverage cost of the t-th original learning log record for each student; Indicates the first The anti-cheating consistency cost of the t-th original learning log record of a student; The first The sequence consistency cost of the t-th original learning log record of a student The expression is: ; ; ; in, Indicates the first The set of window indices for the t-th original learning log record of each student; This represents the time index variable within the window; This indicates the operator for taking the larger value; This represents a constant indicating the sequence window length. Indicates the first The mean residual within the window of the t-th original learning log record of each student; Indicates the first The number of window set elements for the t-th original learning log record of each student; The first Coverage cost of the t-th original learning log record for each student The expression is: ; in, Representing knowledge points The count has been accepted; Indicates the lower limit of the coverage target; The first Anti-cheating consistency cost of the t-th original learning log record of a student The expression is: ; ; in, Represents the anti-cheating feature mapping function; Indicates the first The anti-cheating feature vector of the t-th original learning log record of a student; This represents the 2-norm operator.
6. The method for reliable filtering and anomaly suppression of learning logs for constructing an online education RAG knowledge base according to claim 5, characterized in that, Also includes: In the The joint energy of the t-th original learning log record of each student Based on this, the Markov linkage mechanism is used to selectively sample candidate samples to obtain the count statistics required for the confidence score, including the following steps: Assume the total number of steps in the Markov chain is constant. ; Represented as a set of positive integers; This represents the total number of steps in the Markov chain sampling; The candidate samples are a global event sample set. The chain is obtained by sampling according to the symmetric proposal distribution. Let the index of the current chain state at step q be . And the candidate state index is ; The probability of acceptance at step q is expressed as follows: ; in, This represents the probability of acceptance at step q. Indicates the current chain state The combined energy; Indicates candidate state The combined energy; Represents an exponential function; Let the number of sample acceptances be . ; Initialize the sample acceptance count at the start of any construction cycle. At the same time, for knowledge points Accepted count Perform initialization, record , k∈ ; If the candidate state is accepted in step q... Then execute And calculate the knowledge point identifier. Update coverage count Synchronously update chain status Otherwise, keep the chain state unchanged: .
7. The method for reliable filtering and anomaly suppression of learning logs for constructing an online education RAG knowledge base according to claim 6, characterized in that, Based on the robust residual energy, a reliability score and anomaly score are constructed. Based on preset confidence and anomaly thresholds, the global event sample set is divided into streams, including the following steps: The expression for the credibility score is: ; in, Indicates the first The credibility score of the t-th original learning log record of each student; The expression for the anomaly score is: ; in, Indicates the first The anomaly score of the t-th original learning log record of each student; This represents the anomaly normalization constant. ; Preset credibility threshold With anomaly threshold Let the set of traffic splitting labels be... ; This indicates that the data has been reliably stored in the database. This indicates weakly trusted data entry. Indicates an isolation zone; The expression for splitting the global event sample set is as follows: ; in, Indicates the first The routing label for the t-th original learning log record of a student. ; This indicates a logical AND operation. The following processing is performed on the global event sample set after the splitting: ; ; ; in, This represents a set of highly credible evidence. This represents a set of evidence that is usable but needs to be downgraded. This represents the collection of evidence from the quarantine area.
8. The method for reliable filtering and anomaly suppression of learning logs for constructing an online education RAG knowledge base according to claim 7, characterized in that, The global event sample set after splitting is organized into evidence packages according to knowledge points, and the mean confidence level and mean anomaly level of the evidence packages are calculated. Construct retrieval rearrangement weights and set citation threshold constraints for evidence citation generation, including: Construct evidence package object ;in, The evidence package object representing knowledge point k; Represents a set of evidentiary events; The mean credibility of the evidence package for knowledge point k; The mean anomaly of the evidence package representing knowledge point k; This represents the evidence package retrieval reordering weight for knowledge point k; Assign evidence weights to the global event sample set after splitting, the expression of which is: ; in, Indicates the first Uniform event sample corresponding to the t-th original learning log record of each student Weight of evidence; This represents the Clean sample weight coefficient. ; This represents the weight coefficient of the weak sample. ; The set of evidence events The expression is: ; The mean confidence level and mean anomaly level of the evidence package are calculated using the following expressions: ; ; in, The credibility of the evidence package for knowledge point k; The mean anomaly of the evidence package for knowledge point k; The retrieval reorder weights are constructed using the following expression: ; in, The retrieval rearrangement weight of the evidence package for knowledge point k; Represents the confidence gain coefficient; Indicates the abnormality penalty coefficient; Represents an exponential function; Setting a citation threshold to constrain evidence citation during the generation phase: setting a citation credibility threshold. and the upper limit threshold for reference anomalies Conditions under which the evidence package can be cited: .
9. The method for reliable filtering and anomaly suppression of learning logs for constructing an online education RAG knowledge base according to claim 8, characterized in that, The statistical periodic energy distribution and confidence distribution are analyzed, and the weights of the joint energy function, the robustness threshold of the robust residual energy, the confidence threshold, and the outlier threshold are adaptively updated. This includes the following steps: Let the sample index set be within period c. ; Let the joint energy set of period c be... ; Let the set of credibility of period c be... ; The KS drift statistic for period c is obtained as follows: ;in, This represents the KS distance calculation operator; Represents the set of joint energies with period c-1; The reliable structural drift for period c is obtained as follows: ;in, This represents the average confidence level of period c; This represents the average confidence level for period c-1; The average reliability of the period c The expression is: ; Preset KS drift trigger threshold and trusted drift trigger threshold ; Give the triggering condition: ;in, Indicates logical OR; Update the joint energy weights: ; ; ; ; in, This indicates that the step size constant is being updated. ; This indicates the reliability deviation for the current period. ; This represents the preset target value for the average credibility. ; For robust threshold constant Update: ;in, Represents the quantile operator; Represents the quantile constant; Represents the set of absolute values of residuals. ; Citation credibility threshold With reference anomaly upper limit threshold Update: ; ; in, Indicates the desired Clean ratio. ; Indicates the desired isolation ratio. .