KA2L: A Knowledge-Aware Active Learning Framework for LLMs
Organizations: Faculty of Computing, Harbin Institute of Technology, Harbin, 150001, China · Institute for Advanced Algorithms Research, Shanghai, 201306, China · National Key Laboratory of Smart Farm Technologies and Systems, Harbin, 150001, China
Abstract
Fine-tuning large language models (LLMs) with high-quality knowledge has been shown to enhance their performance effectively. However, there is a paucity of research on the depth of domain-specific knowledge comprehension by LLMs and the application of targeted active learning to improve their expertise. To address this gap, we introduce the Knowledge-Aware Active Learning (KA2L) framework. This framework assesses LLMs' mastery of specific knowledge points to aid in constructing unanswerable or unknowable questions through latent space analysis. This active learning strategy enhances training efficiency by focusing on knowledge the model has yet to master, thereby minimizing redundancy in learning already acquired information. This study innovatively employs a knowledge distribution probing technique to examine the hidden states of specific Transformer layers and identify the distribution of known and unknown knowledge within the LLM. Additionally, a hidden-state decoding method is proposed to generate numerous unknown questions in natural language from the latent knowledge space. In our experiments, we selected nine open-source LLMs to validate the effectiveness of the proposed framework. Results indicate that KA2L not only significantly reduces 50% annotation and computation costs across two open-domain and one vertical-domain dataset but also achieves better performance, offering valuable insights into active learning strategies for LLMs. The code is available at https://github.com/greenjerry/KA2L.
Figures & tables
| Model | Hidden-State Layer Index | ||
| TriviaQA Mix | NQ-Open Mix | MedMCQA Mix | |
| DeepSeek-R1-Distill-Qwen-7B | 28 | 28 | 28 |
| glm4-9b-chat | 38 | 38 | 24 |
| Llama-2-7b-chat-hf | 31 | 30 | 30 |
| Llama-3.1-8B-Instruct | 31 | 32 | 31 |
| Mistral-7B-Instruct-v0.1 | 31 | 31 | 30 |
| Model | Learning Rate | Template | Batch Size | Gradient Accumu- lation Steps |
| DeepSeek-R1-Distill-Qwen-7B | 5.0e-5 | qwen | 4 | 4 |
| glm4-9b-chat | 1.0e-4 | glm4 | 2 | 8 |
| Llama-2-7b-chat-hf | 1.0e-4 | llama2 | 4 | 2 |
| Llama-3.1-8B-Instruct | 1.0e-4 | llama3 | 4 | 2 |
| Mistral-7B-Instruct-v0.1 | 1.0e-4 | mistral | 4 | 4 |
| Mistral-7B-Instruct-v0.3 | 1.0e-4 | mistral | 4 | 4 |
| Model | SFT Dataset | BLEU | ROUGE-L | METEOR | BS(%) | SFT Dataset | BLEU | ROUGE-L | METEOR | BS(%) |
| DeepSeek-R1- Distill-Qwen-7B | None | 0.02 | 0.52 | 1.31 | 76.29 | 10k Combine | 2.44 | 12.55 | 7.92 | 83.70 |
| 5k Known | 1.85 | 10.41 | 6.50 | 83.19 | 10k Unknown | 2.85 | 14.53 | 9.20 | 84.00 | |
| 5k Unknown | 1.91 | 11.99 | 7.54 | 83.62 | 10k Augmented | 2.62 | 13.55 | 8.91 | 84.00 | |
| glm4-9b-chat | None | 0.08 | 1.71 | 4.21 | 78.48 | 10k Combine | 6.90 | 28.27 | 19.67 | 86.80 |
| 5k Known | 4.17 | 20.62 | 13.86 | 85.17 | 10k Unknown | 9.82 | 36.02 | 25.50 | 88.30 | |
| 5k Unknown | 6.61 | 28.44 | 19.87 | 86.73 | 10k Augmented | 8.48 | 29.92 | 21.67 | 87.13 |
| Model | SFT Dataset | BLEU | ROUGE-L | METEOR | BS(%) | SFT Dataset | BLEU | ROUGE-L | METEOR | BS(%) |
| DeepSeek-R1- Distill-Qwen-7B | None | 0.02 | 0.46 | 1.26 | 76.39 | 10k Combine | 6.10 | 13.17 | 9.68 | 86.45 |
| 5k Known | 4.69 | 11.15 | 7.87 | 86.19 | 10k Unknown | 7.48 | 16.05 | 11.84 | 86.98 | |
| 5k Unknown | 4.05 | 12.19 | 8.78 | 86.37 | 10k Augmented | 2.85 | 13.56 | 10.04 | 86.49 | |
| glm4-9b-chat | None | 0.22 | 3.68 | 8.63 | 79.94 | 10k Combine | 28.78 | 45.94 | 36.50 | 91.33 |
| 5k Known | 19.55 | 35.78 | 27.67 | 89.62 | 10k Unknown | 39.54 | 57.89 | 46.91 | 93.27 | |
| 5k Unknown | 28.61 | 45.91 | 36.47 | 91.31 | 10k Augmented | 22.49 | 46.00 | 36.62 | 91.34 |
| Model | SFT Dataset | BLEU | ROUGE-L | METEOR | BS(%) | SFT Dataset | BLEU | ROUGE-L | METEOR | BS(%) |
| DeepSeek-R1- Distill-Qwen-7B | None | 0.02 | 0.49 | 1.24 | 76.13 | 10k Combine | 9.98 | 23.65 | 16.38 | 87.05 |
| 5k Known | 7.79 | 18.77 | 12.82 | 86.32 | 10k Unknown | 14.20 | 27.00 | 18.86 | 87.56 | |
| 5k Unknown | 9.41 | 22.22 | 15.39 | 86.85 | 10k Augmented | 6.68 | 24.46 | 17.11 | 87.16 | |
| glm4-9b-chat | None | 0.15 | 3.62 | 8.16 | 79.13 | 10k Combine | 21.51 | 41.26 | 30.71 | 88.18 |
| 5k Known | 14.68 | 31.65 | 23.03 | 86.34 | 10k Unknown | 11.68 | 55.80 | 42.43 | 91.00 | |
| 5k Unknown | 19.62 | 40.28 | 29.85 | 87.97 | 10k Augmented | 15.21 | 40.47 | 30.07 | 88.09 |
| Method | BLEU | ROUGE-L | METEOR | BertScore(%) |
| Traditional Methods ( samples selected from pool) | ||||
| Random | ||||
| Entropy | ||||
| Coreset | ||||
| BADGE (adapted) | ||||
| Our Method ( samples) | ||||
| Method | BLEU | ROUGE-L | METEOR | BertScore(%) |
| Traditional Methods (5k samples selected from 10k pool) | ||||
| Random | ||||
| Entropy | ||||
| Coreset | ||||
| BADGE (adapted) | ||||
| Our Method (5k samples) | ||||
| Method | BLEU | ROUGE-L | METEOR | BertScore(%) |
| Traditional Methods (5k samples selected from 10k pool) | ||||
| Random | ||||
| Entropy | ||||
| Coreset | ||||
| BADGE (adapted) | ||||
| Our Method (5k samples) | ||||
| Models | Ours | SE Probe | Accuracy Probe | Log-Likeli hood | Regular Entropy | P(True) | Semantic Entropy |
| DeepSeek-R1-Distill-Qwen-7B | 0.89 | 0.85 | 0.81 | 0.61 | 0.84 | 0.83 | 0.86 |
| glm4-9b-chat | 0.83 | 0.81 | 0.72 | 0.56 | 0.76 | 0.82 | 0.80 |
| Llama-2-7b-chat-hf | 0.85 | 0.78 | 0.70 | 0.55 | 0.73 | 0.71 | 0.77 |
| Llama-3.1-8B-Instruct | 0.89 | 0.85 | 0.73 | 0.57 | 0.75 | 0.79 | 0.79 |
| Mistral-7B-Instruct-v0.1 | 0.88 | 0.83 | 0.76 | 0.62 | 0.75 | 0.78 | 0.81 |
| Dataset | |||||||
| TriviaQA | 0.8543 | 0.8602 | 0.8623 | 0.8853 | 0.8847 | 0.8784 | 0.8721 |
| NQ_Open | 0.8232 | 0.8290 | 0.8277 | 0.8307 | 0.8265 | 0.8248 | 0.8247 |
| MedMCQA | 0.8281 | 0.8267 | 0.8323 | 0.8345 | 0.8285 | 0.8238 | 0.8333 |
| # | Question | Ground Truth | Generated Answers (10 Samples) |
| Low Entropy (Known Knowledge, SE 0) | |||
| 1 | how many keys are on microsoft windows standard keyboard | 104 | 104 (10 times) |
| 2 | who played willy wonka in the original movie | Gene Wilder | Gene Wilder (8 times), gene wilder (2 times) |
| 3 | how many original harry potter books are there | 7 | 7 (6 times), Seven (2 times), seven (2 times) |
| Medium Entropy (The Knowledge Boundary, SE 1.3 - 1.7) | |||
| 4 | the haagen-dazs brand of ice cream originated in which country | United States | United States (2), Poland (4), Scandinavia (1), scandinavian (1), Belgium (1), Jamaica (1) |
| Dataset | Avg Usable Variants | Source BERTScore | Self-BLEU | Exact-Copy Rate |
| MedMCQA | 3.51 | 0.908 | 42.24 | ¡0.01 |
| NQ_Open | 3.37 | 0.880 | 35.01 | ¡0.01 |
| TriviaQA | 3.19 | 0.913 | 48.13 | ¡0.01 |
| Augmentation Trait | Original Source Question | Generated Question Variants |
| Structural Rephrasing (TriviaQA) | Ex-world champion boxer Alan Rudkin, who died in September 2010, fought at what weight? | • Ex-world champion boxer Alan Rudkin, who died in September 2010, was fighting at what weight and age in 1960s? |
| Entity Substitution (NQ_Open) | Which player has won the most UEFA champions league titles? | • Which player has won the most trophies in the European cup 2018? • Which team has won the most trophies in the European cup 2017? |
| Terminological Perturbation (MedMCQA) | Type of immunologic injury in AIHA (Auto immune hemolytic anemia) | • Type of immunological response to IgA hemolytic anemia (IgA) is |
| Dataset | Domain Ratio | General | Domain | BLEU | ROUGE-L | METEOR | BERTScore | Exact-Copy Rate |
| NQ_Open | 0% | 250,000 | 0 | 5.42 | 22.94 | 39.18 | 85.83 | ¡0.01 |
| NQ_Open | 10% | 225,000 | 25,000 | 6.24 | 23.39 | 41.92 | 86.40 | ¡0.01 |
| NQ_Open | 20% | 200,000 | 50,000 | 7.67 | 26.79 | 45.98 | 87.16 | ¡0.01 |
| NQ_Open | 30% | 175,000 | 75,000 | 6.94 | 25.37 | 44.07 | 86.93 | ¡0.01 |
| TriviaQA | 0% | 250,000 | 0 | 16.12 | 43.56 | 50.33 | 89.57 | ¡0.01 |
| TriviaQA | 10% | 225,000 | 25,000 | 19.16 | 47.07 | 53.18 | 90.22 | ¡0.01 |
Active Learning
Active learning selects the examples, labels, features, or experiments most useful for improving a model under limited budgets.
See all 288 papers