Optimizing Soft Prompt Tuning via Structural Evolution
Authors: Zhenzhen Huang, Chaoning Zhang, Haoyu Bian, Songbo Zhang, Chi-lok Andy Tai, Jiaquan Zhang, Caiyan Qin, Jingjing Qu, Yalan Ye, Yang Yang, Heng Tao Shen
Organizations: School of Information and Software Engineering, University of Electronic Science and Technology of China, Chengdu, China · School of Computer Science and Engineering, University of Electronic Science and Technology of China, Chengdu, China · College of Professional and Continuing Education, The Hong Kong Polytechnic University, Hong Kong, China · School of Robotics and Advanced Manufacture, Harbin Institute of Technology, Shenzhen, China · Shanghai Artificial Intelligence Laboratory, Shanghai, China · School of Computer Science and Technology, Tongji University, Shanghai, China
Soft prompt tuning leverages continuous embeddings to capture task-specific information in large pre-trained language models (LLMs), achieving competitive performance in few-shot settings. However, soft prompts rely on high-dimensional, implicit representations and lack explicit semantics and traceable training behaviors, which limits their interpretability. To address this limitation, we propose a soft prompt tuning optimization method based on topological morphological evolution. Specifically, we employ persistent homology from topological data analysis (TDA) to quantify the structural representations of soft prompts in continuous parameter space and their training process evolution. Quantitative analysis shows that topologically stable and compact soft prompts achieve better downstream performance. Based on this empirical observation, we construct a loss function for optimizing soft prompt tuning, termed Topological Soft Prompt Loss (TSLoss). TSLoss guides the model to learn structurally stable adaptations by quantifying inter-parameter connectivity and redundancy. Extensive experiments show that training with TSLoss accelerates convergence and improves tuning performance, providing an interpretable method to understand and optimize soft prompt tuning from structural and topological perspectives.
Figures & tables
Fig. 1: Topological evolution of soft prompts parameter space during training process.
Topological Data Analysis Notation
Symbol
Description
H0
Zero-dimensional homology group
H1
First-dimensional homology group
(bi,di)
Birth-death pair of i -th topological feature
li
Lifespan of topological feature ( li=di−bi )
L
Total lifespan ( L=∑ili )
TABLE I: Notation summary for topological analysis of soft prompts
Fig. 2: Changes in density and topological complexity of soft prompts during the training process.
Metric
Spearman Correlation
Mann-Whitney U Test
ρ
p-value
U
p-value
∣H0∣
N/A
N/A
2664.5
1.000
∣H1∣
−0.324
6.60×10−5
3600.5
9.7×10−5
Avg. li ( H0 )
0.866
3.40×10−45
0.0
1.9×10−25
Avg. li ( H1 )
0.018
0.826
2608.0
0.827
PE
−0.809
5.10×10−35
5153.0
2.1×10−22
TABLE II: Correlation and significance of topological features and accuracy
Fig. 3: Overview of the structural analysis and optimization framework for soft prompts. Persistent homology is used to characterize the structural evolution of soft prompt representations during training, which motivates the design of the proposed TSLoss.
Model
Dataset
Soft Prompt
+ L2-Reg
+ PDLoss
ACT
Prefix-Tuning
DPC
Ours
Gemma-2B-IT
GSM8K
14.2
14.8
16.5
16.0
17.8
19.8
20.5
MMLU
26.5
27.0
28.8
28.2
29.5
31.8
32.4
LongBench
15.1
15.5
17.2
16.8
18.0
20.0
20.8
Open-LLaMA-7B
GSM8K
32.5
33.1
35.8
34.2
36.5
37.9
38.2
MMLU
40.2
40.8
42.5
41.5
43.1
45.2
44.8
LongBench
21.5
21.8
23.2
22.5
23.8
24.8
25.1
TABLE III: Accuracy (%) of different soft prompt tuning methods across models and datasets.
Model
Method
Single-sample
Multi-sample
GSM8K
MMLU-CF
LongBench
GSM8K
MMLU-CF
LongBench
Gemma 2B-IT
Standard
154
8
12
118
16
104
Prefix-Tuning
128
7
10
96
15
88
P-Tuning v2
96
6
9
74
14
65
Ours
88
6
8
62
14
58
Open-LLaMA 7B
Standard
12
4
6
10
8
38
TABLE IV: Number of iterations for soft prompts to achieve complete task accuracy.
Fig. 4: Comparison of convergence behavior of overall loss functions with and without TSLoss across different datasets and models.
Weight ( λ )
Temperature ( α )
Value
Iter.
Value
Iter.
0
154
5
112
0.1
130
10
88
0.5
112
20
135
1
88
–
–
10
–
–
–
TABLE V: Impact of weight ( λ ) and temperature ( α ) on training iterations.
Fig. 5: Convergence of overall loss under different TSLoss weight values.
Model
Configuration
Iterations to Converge
Improvement
Gemma-2B-IT
CE Baseline
154
–
CE + H0 only
132
14.30%
CE + H1 only
115
25.30%
CE + TSLoss
88
42.90%
Open-LLaMA-7B
CE Baseline
12
–
CE + H0 only
11
8.30%
TABLE VI: Convergence iterations and relative improvement of different loss components on GSM8K under the single-sample setting.
Fig. 6: Evolution of topological features of soft prompts under different training strategies.
Fig. 7: Heatmaps of the pairwise Euclidean distance matrix among soft prompt vectors.
Fig. 8: Evolution of soft prompt point clouds in PCA space.
Fig. 9: Evolution of soft prompt point clouds in t-SNE space.
Fig. 10: Averaged results of persistent homology in single-sample and multi-sample training on all datasets.
Fig. 11: Averaged results of persistent homology barcodes and lifetime distributions across all datasets. Left panel: single-sample training; right panel: multi-sample training.
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
Fig. 12: Single-sample results on GSM8K dataset.
Fig. 13: Multi-sample results on GSM8K dataset.
Fig. 14: Single-sample results on MATH dataset.
Fig. 15: Multi-sample results on MATH dataset.
Fig. 16: Single-sample results on BBH dataset.
Fig. 17: Single-sample results on MMLU-CF dataset.
Fig. 18: Single-sample results on HotpotQA dataset.
Fig. 19: Single-sample results on LongBench dataset.