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
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
Figure 1: KA2L Workflow : (a) Knowledge Distribution Probing : Training Phase : For each question in the sampled question set, sample its hidden state once and its textual outputs multiple times. Perform semantic clustering on the textual outputs to calculate Semantic Entropy (SE). The SE is then binarized using a dynamic threshold to serve as labels for the classifier. An MLP classifier is trained using these hidden states and the binarized SE (BiSE). Inference Phase : For a new set of questions, sample their l -th layer hidden states. These are then classified by the MLP classifier, representing the knowledge distribution as ”Known” and ”Unknown” knowledge. (b) Unknown Question Augmentation : Sample the hidden states ( hunk ) of questions identified as ”Unknown” from the knowledge distribution. These are then transformed and decoded into multiple similar questions. (c) Downstream Tasks : This knowledge distribution guides dataset construction and model fine-tuning. Many existing methods can be applied, such as LoRA ( Hu et al., 2022 ) and P-tuning ( Liu et al., 2022 ) .
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
Table 1: Model-specific layer index choices based on probing accuracy.
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
Table 2: SFT training parameters for different models.
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
Table 3: Active learning performance on MedMCQA. KA2L-selected data (Unknown) is compared against Known data and a mixed Combine setting. Bold values indicate the best performance.
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
Table 4: Active learning performance on the NQ_Open dataset. Bold values indicate the best performance.
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
Table 5: Active learning performance on the TriviaQA dataset. Bold values indicate the best performance.
Method
BLEU
ROUGE-L
METEOR
BertScore(%)
Traditional Methods ( 5k samples selected from 10k pool)
Random
21.75±0.03
38.53±0.02
29.65±0.02
90.01±0.01
Entropy
19.59±1.15
37.91±0.10
29.38±0.07
89.91±0.01
Coreset
22.04±0.07
38.69±0.05
29.81±0.03
90.16±0.01
BADGE (adapted)
19.64±0.15
38.70±0.05
29.73±0.05
90.06±0.01
Our Method ( 5k samples)
Table 6: Performance comparison of active learning methods on the NQ_Open dataset. Our method, KA2L ( 5k Unknown ), significantly outperforms all adapted traditional AL method, approaching the performance of the Full Dataset ( 10k ) with only half the data budget. Results are reported as mean ± std over 4 runs. Bold values indicate the best performance.
Method
BLEU
ROUGE-L
METEOR
BertScore(%)
Traditional Methods (5k samples selected from 10k pool)
Random
7.19±0.22
26.67±0.05
18.55±0.05
86.44±0.02
Entropy
6.85±0.09
26.66±0.07
18.46±0.05
86.40±0.01
Coreset
8.11±0.11
28.48±0.08
19.86±0.03
86.83±0.01
BADGE (adapted)
6.68±0.12
26.76±0.06
18.64±0.07
86.41±0.01
Our Method (5k samples)
Table 7: Performance comparison of active learning methods on the MedMCQA dataset. Bold values indicate the best performance.
Method
BLEU
ROUGE-L
METEOR
BertScore(%)
Traditional Methods (5k samples selected from 10k pool)
Random
12.33±0.14
45.25±0.01
32.96±0.02
88.95±0.01
Entropy
22.34±0.08
46.25±0.09
33.91±0.06
89.10±0.01
Coreset
20.37±1.80
45.64±0.07
33.31±0.04
89.02±0.00
BADGE (adapted)
20.58±0.22
45.50±0.06
33.15±0.03
88.98±0.01
Our Method (5k samples)
Table 8: Performance comparison of active learning methods on the TriviaQA dataset. Bold values indicate the best performance.
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
Table 9: Performance comparison of knowledge distribution probes (AUROC) on TriviaQA dataset. Our method achieves the highest score. Bold values indicate the best performance.
Figure 2: Classifier AUROC score across different hidden layers (embedding layer excluded) on the Trivia_QA dataset.
Dataset
γ∗−0.20
γ∗−0.10
γ∗−0.05
γ∗
γ∗+0.05
γ∗+0.10
γ∗+0.20
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
Table 10: AUROC scores of the knowledge distribution probe under perturbed binarization thresholds for LLaMA-3.1-8B-Instruct (Layer 31 ). The optimal threshold γ∗ is determined by minimizing MSE. The highest score in each row is highlighted in bold.
Figure 3: PCA Analysis on Mistral-7B-Instruct-v0.3, showing a macroscopic overview of knowledge distribution.
#
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)
Table 11: Case Study: Generative distributions of 10 independent samples across different SE ranges. The Medium SE category explicitly visualizes the ”Knowledge Boundary” where outputs mix correct facts with plausible hallucinations.
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
Table 12: Intrinsic quantitative evaluation of generated question variants. Avg Usable Variants indicates the ratio of unique variants among 5 generations. Source BERTScore measures semantic relatedness to the original question. Self-BLEU measures the lexical diversity among the variants themselves.
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
Table 13: Qualitative examples of generated question variants. The decoder introduces beneficial diversity through structural rephrasing, entity substitution, and terminology perturbation, effectively broadening the augmented data distribution.
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
Table 14: Effect of decoder-training data composition on generation metrics using Llama-3.1-8B-Instruct . The total training size is fixed at 250,000. Bold values indicate the highest metric among the evaluated ratios.
1The Key Laboratory of Cognition and Decision Intelligence for Complex Systems, Institute of Automation, Chinese Academy of Sciences, Beijing, China · School of Artificial Intelligence, University of Chinese Academy of Sciences, Beijing, China