Personalized learning long-tail data processing method integrating neural collapse detection and regulation
Through hierarchical sampling and LoRA fine-tuning combined with text modal collapse detection, the weight matrix of the large language model is optimized, which solves the problem of low classification accuracy caused by long-tail data distribution in personalized learning, and improves the classification ability and robustness of the model.
Patent Information
- Application Number
- CN202510726538.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-03
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-06-03
AI Technical Summary
The prior art has the problem of low classification accuracy caused by long-tail data distribution in personalized learning, especially in educational scenarios, model performance significantly decreases with data imbalance.
The test set is constructed using hierarchical sampling, and the degree of text modal collapse is calculated through the multi-headed attention of the large language model, the comprehensive loss function is defined in combination with text modal collapse loss and task-specific loss, and the model weight matrix is fine-tuned and adjusted through LoRA, and the weight update is used to optimize the model's classification capabilities.
It significantly improves the classification accuracy of personalized learning data of large language models, improves the generalization ability and robustness of the model, and is suitable for different personalized learning tasks.
Smart Images

Figure CN120234657B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of machine learning and intelligent education, and specifically relates to large language model text processing technology, especially a personalized learning long-tail data processing method that integrates neural collapse detection and regulation to address the long-tail data distribution problem in personalized learning methods. Background Art
[0002] Data-based personalized learning is widely used in important educational scenarios, such as knowledge tracking, cognitive diagnosis, and computer adaptive testing. In recent years, researchers have made continuous progress in in-depth exploration, not only enhancing the expressive power of models through more complex architectures, but also focusing on building larger and more diverse datasets to improve the generalization ability of models in different scenarios. For example, in cognitive diagnosis tasks, through in-depth analysis of students' learning behaviors and cognitive characteristics, personalized diagnostic reports can be generated to help teachers monitor students' progress in real time and identify learning bottlenecks, thereby providing technical support for student-centered teaching models. However, these methods usually assume that the data used for data-driven methods is high-quality and accurately labeled.
[0003] Due to the challenges of protecting the privacy of minors and relying on expert annotation, collecting high-quality, standardized educational data is both challenging and impractical. Consequently, personalized learning benchmarks based on data often exhibit imbalanced or long-tailed distributions. However, existing research has largely ignored this issue. Experimental results show that the performance of large language models varies with changes in data balance. Models perform well when data imbalance is low; conversely, when data imbalance increases, model performance significantly degrades. Summary of the Invention
[0004] The purpose of the present invention is to solve the above-mentioned problems existing in the prior art and to provide a personalized learning long-tail data processing method that integrates neural collapse detection and regulation to solve the problem of low classification accuracy in long-tail data, thereby improving the classification efficiency of large models for personalized learning data.
[0005] The specific technical solutions adopted in the present invention are as follows:
[0006] A personalized learning long-tail data processing method integrating neural collapse detection and regulation includes the following steps:
[0007] S1. Obtain a personalized learning text dataset with a long-tail distribution, construct a test set using stratified sampling, and use the remaining data as the training set.
[0008] S2. Multi-head attention is calculated using parallel attention heads in each layer of the large language model. The hidden state of each transformer layer is obtained based on the hidden state of the previous layer and the multi-head attention. The text modal collapse (TCD) is obtained based on the difference between the inner product of the hidden state of each transformer layer and the fixed length constraint of the text representation for each two different sample inputs.
[0009] S3. Collapse TC loss based on text modality and mission-specific losses Define the comprehensive loss function in the LoRA fine-tuning process, use a binary function to calculate the degree of text modality collapse between samples of different categories and accumulate them as the text modality collapse TC loss, and calculate the task-specific loss by intra-class cohesion and inter-class repulsion. The comprehensive loss function is composed of a linear combination of text modality collapse TC loss and task-specific loss , the calculation expression is as follows
[0010]
[0011] Among them, λ is a constant parameter that controls the impact of text modality collapse TC loss;
[0012] S4. Fine-tune the LoRA on the pre-trained large language model (such as GPT, BERT, etc.) and the training set, and adjust the weight matrix of the pre-trained large language model. Modify the weight matrix by It is achieved by adding low-rank matrices A and B on the basis of . The formula is:
[0013]
[0014] in, is the weight update matrix, is the input feature vector, is the hidden layer output of the model after low-rank adjustment, is a constant parameter used for scaling, is the rank of the low-rank matrices A and B.
[0015] The hidden layer output m of the model passes through the fully connected layer to generate the predicted probability of each category, and the loss is calculated for m according to the comprehensive loss function. Update the parameters of the low-rank matrices A and B through backpropagation;
[0016] S5. Test and evaluate the fine-tuned large language model based on the test set content to complete the classification of the test set.
[0017] Furthermore, the calculation of the text modal collapse degree TCD specifically includes:
[0018]
[0019] Among them, Avg means taking the arithmetic mean of all elements that meet the conditions. and is the sample input, N is the number of categories, is a fixed length constraint for text representations, represents the hidden state of layer l, .
[0020] Furthermore, the text modality collapse TC loss is calculated, and its calculation expression includes:
[0021]
[0022] Among them, ∑ is the accumulation, is a binary function, B is the batch size, is the category of the i-th sample; the text modality collapse TC loss is constrained by the following conditions:
[0023]
[0024] in, represents the Euclidean normal form, represents any sample i from the 1st to the Bth sample in a batch.
[0025] Furthermore, the test evaluation on the fine-tuned large language model uses reported classification accuracy and recall as indicators.
[0026] Compared with the prior art, the present invention has the following beneficial effects:
[0027] This paper introduces neural collapse into text embedding and LoRa fine-tuning of large language models, improving the model's ability to classify personalized learning data. This effectively ensures personalized model training and addresses the issue of low classification accuracy for long-tail data. The method is model-agnostic and compatible with various architectures and methods, making it widely applicable to diverse personalized learning tasks, particularly those targeting educational data, mathematical reasoning, and dialogue classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 3. This is a rendering of the personalized learning long-tail data processing method integrating neural collapse detection and regulation under different data ratios provided by an embodiment of the present invention;
[0029] Figure 2 This is a flow chart of a personalized learning long-tail data processing method that integrates neural collapse detection and regulation, provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways than those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The technical features in the various embodiments of the present invention can be combined accordingly without conflicting with each other.
[0031] Example
[0032] The corpus datasets used in this example are TMWPL and PMTD. The overall process is as follows:
[0033] 1. Dataset Selection
[0034] To evaluate performance, this example considers two different downstream tasks for personalized learning: math problem classification and teaching strategy classification. The following is a description of the downstream datasets used for each task:
[0035] S1. Mathematical Problem Classification: The mathematical problem classification task was evaluated using TMWPL (based on the TIMSS Mathematical Problem Labeling Dataset). This dataset contains mathematical word problems designed for grades 3 to 6 and is suitable for analyzing student performance across different cognitive dimensions of mathematics. Each mathematical problem is annotated by experts and covers multiple cognitive dimensions such as recall, reasoning, and analysis. Among the cognitive dimensions, recall has the highest sample frequency, with a total of 5,045 samples (accounting for 63.85% of the entire TMWPL dataset), while analysis has the lowest sample frequency, with only 216 samples (accounting for 2.73% of the entire TMWPL dataset). The test set contains 50 samples for each cognitive dimension, and the remaining samples are used for training.
[0036] S2. Teaching Strategy Classification: The teaching strategy classification task uses PMTD (Personalized Mathematics Tutoring Dialogue Dataset), which records one-on-one teaching interactions between teachers and students, focusing specifically on the guiding teaching strategies used when solving challenging mathematical problems. The PMTD dataset is constructed based on the IRF (Initiation-Response-Feedback) framework and Scaffolding Theory. Among all dimensions, R-FR (students' factual responses) contains 1014 samples, accounting for 24.06% of the total interaction samples; while R-RR (students' rejection responses) contains only 62 samples, accounting for 1.47%. The test set consists of 40 samples from each category, and the remaining samples are used for training.
[0037] 2. Implementation Details
[0038] See also Figure 2 This embodiment introduces a personalized learning long-tail data processing method that integrates neural collapse detection and regulation, which specifically includes the following steps:
[0039] S1. Obtain the personalized learning text datasets TMWPL and PMTD, which contain long-tail distributions. Use stratified sampling to construct a test set, and use the remaining data as the training set.
[0040] S2. Multi-head attention is calculated using parallel attention heads in each layer of the large language model. The hidden state of each transformer layer is obtained based on the hidden state of the previous layer and the multi-head attention. The text modal collapse (TCD) is obtained based on the difference between the inner product of the hidden state of each transformer layer and the fixed length constraint of the text representation for each two different sample inputs.
[0041] S3. Collapse TC loss based on text modality and mission-specific losses Define the comprehensive loss function in the LoRA fine-tuning process, use a binary function to calculate the degree of text modality collapse between samples of different categories and accumulate them as the text modality collapse TC loss, and calculate the task-specific loss by intra-class cohesion and inter-class repulsion. The comprehensive loss function is composed of a linear combination of text modality collapse TC loss and task-specific loss , the calculation expression is as follows
[0042]
[0043] Among them, λ is a constant parameter that controls the influence of text modality collapse TC loss;
[0044] S4. Fine-tune the pre-trained large language model Qwen2.5-instruct and the training set using LoRA, and adjust the weight matrix of the pre-trained large language model Modify the weight matrix by It is achieved by adding low-rank matrices A and B on the basis of . The formula is:
[0045]
[0046] in, is the weight update matrix, is the input feature vector, is the hidden layer output of the model after low-rank adjustment, is a constant parameter used for scaling, is the rank of the low-rank matrices A and B.
[0047] The hidden layer output m of the model passes through the fully connected layer to generate the predicted probability of each category, and the loss is calculated for m according to the comprehensive loss function. Update the parameters of the low-rank matrices A and B through backpropagation;
[0048] S5. Test and evaluate the fine-tuned large language model based on the test set content to complete the classification of the test set.
[0049] 3. Evaluate the effectiveness of long-tail data processing
[0050] As shown in Table 1, the 7-parameter model tuned by our method achieves significant results, outperforming models with 7 to 14 parameters, including dense and mixture-of-experts (MoE) architectures. This impressive performance across all evaluation benchmarks demonstrates that our method delivers state-of-the-art performance while maintaining computational efficiency with a low number of parameters. In particular, the TMWPL task achieves the largest improvement in classification accuracy, achieving a 13.72% improvement over the strongest baseline model, as evidenced by the results for the NCAL-Qwen2.5-Instruct model.
[0051] Table 1 Comparison of performance of different models on educational tasks
[0052]
[0053] 4. Evaluating the Performance of the Present Invention at Different Data Ratios
[0054] The performance of the representative large language model Owen2.5 varies with the change of data balance. Figure 1 The experimental results shown in (ad) show that when testing different minimum and maximum class number ratios In, when The higher the value, the weaker the data imbalance, and the better the model performance. The decrease of the value, that is, the worsening of data imbalance, will cause the performance of the model to decline, and the accuracy will decrease from 71.71 ( Figure 1 (a)) dropped to 61.14 ( Figure 1 (c)). As the data distribution becomes more balanced, the model accuracy improves. However, due to insufficient data, effective fine-tuning cannot be performed, and the performance decreases at a scale of 0.25. Our analysis shows that there is a strong correlation between TCD value and classification accuracy in all model variants. Specifically, the larger the TCD value, the better the classification accuracy. The lower the value, the more deviation from the ideal ETF structure, which directly affects the performance of the model.
[0055] 5. Evaluating the performance of the present invention with and without prompt words
[0056] In the context of instruction-tuned models, the design of prompt words can greatly affect the model's zero-shot capability, especially in distinguishing between directly generated categories and categories generated after applying Chain of Thought (COT) reasoning. To address this issue, the present invention includes the impact of prompts for specified classification tasks on model performance. Specifically, the optimal model input combines the task description and dataset features, while the scheme without prompts only includes dataset features. The results in Table 2 show that all models experience a significant performance drop when only dataset features are input without any additional prompts for LoRA fine-tuning.
[0057] Table 2 The influence of the presence or absence of prompt words on the present invention
[0058]
[0059] The embodiment described above is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Persons skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent substitution or equivalent transformation falls within the scope of protection of the present invention.
Claims
1. A personalized learning long-tail data processing method integrating neural collapse detection and regulation, characterized by: The following steps are involved: S1. Obtain a personalized learning text dataset with a long-tail distribution, use stratified sampling to construct a test set, and use the remaining data as a training set; S2. Multi-head attention is calculated by parallel attention heads in each layer of the large language model. The hidden state of each transformer layer is obtained based on the hidden state of the previous layer and the multi-head attention. The text modal collapse degree (TCD) is obtained based on the difference between the inner product of the hidden state of each two different sample inputs in the transformer layer and the fixed length constraint of the text representation. S3. Collapse TC loss based on text modality and mission-specific losses Define the comprehensive loss function in the LoRA fine-tuning process, use a binary function to calculate the degree of text modality collapse between samples of different categories and accumulate them as the text modality collapse TC loss, and calculate the task-specific loss by intra-class cohesion and inter-class repulsion. The comprehensive loss function is composed of a linear combination of text modality collapse TC loss and task-specific loss The calculation expression is as follows: Among them, λ is a constant parameter that controls the influence of text modality collapse TC loss; S4. Perform LoRA fine-tuning on the pre-trained large language model and training set, and modify the weight matrix W0 of the pre-trained large language model by adding low-rank matrices A and B on the basis of the weight matrix W0; the formula is: Where ΔW is the weight update matrix, x is the input feature vector, m is the hidden layer output of the model after low-rank adjustment, α is a constant parameter for scaling, and r is the rank of the low-rank matrices A and B; The hidden layer output m of the model passes through the fully connected layer to generate the predicted probability of each category, and the loss of m is calculated according to the comprehensive loss function; the text modal collapse degree TCD and comprehensive loss function Update the parameters of the low-rank matrices A and B through backpropagation; S5. Test and evaluate the fine-tuned large language model based on the test set content and complete the classification of the test set; where: Calculate the text modal collapse degree TCD, which specifically includes: Δ TCD =Avg i≠j {<h l (t i ),h l (t j )>-T W ·μ}, Among them, Avg represents the arithmetic mean of all elements that meet the conditions, t i and t j is the sample input, N is the number of categories, T W is the fixed length constraint of the text representation, h l represents the hidden state of layer l, Calculate the text modality collapse TC loss, and its calculation expression includes: Among them, ∑ is the accumulation, is a binary function, b is the batch size, y i is the category of the i-th sample; the text modality collapse TC loss is constrained by the following conditions: Among them, || ||2 represents the Euclidean normal form, represents any sample i from the 1st to the bth sample in a batch.
2. The personalized learning long-tail data processing method integrating neural collapse detection and regulation according to claim 1 is characterized in that: Test and evaluate the large language model described in step 5, using reported classification accuracy and recall as metrics.
Citation Information
Patent Citations
Slope detection, evaluation, classification and prediction model based on neural network model
CN118395281A
Neural collapse theory-based pre-training model class incremental learning identification method
CN119760495A