TL;DR
Prompt tuning, a parameter-efficient method for adapting large language models (LLMs), suffers from training instability. This paper introduces Prompt Tuning with Perturbation-based regularizer (PTP), which smooths the LLM's loss landscape using random noise or adversarial perturbations, significantly improving stability and boosting performance on NLU tasks.
What Problem Does This Paper Address?
Fine-tuning entire LLMs for every downstream task is computationally expensive and memory-intensive. Prompt tuning offers a more efficient alternative by only tuning a small set of continuous "prompt" embeddings prepended to the input. However, existing prompt tuning methods exhibit high variance in performance across different random seeds, indicating a critical training instability issue. The authors investigate this by visualizing the loss landscape of vanilla prompt tuning, revealing precipitous "sharp crests" that are highly sensitive to small input changes, leading to this instability.
Methods
The core contribution is the Prompt Tuning with Perturbation-based regularizer (PTP). PTP aims to smooth the loss landscape by introducing regularization through perturbations. Two main types of perturbation-based regularizers are proposed:
- PTP-RN (Random Noise): Inspired by randomized smoothing, this method adds Gaussian noise to the input embeddings.
- PTP-ADV (Adversarial): Inspired by adversarial training, this method uses adversarial examples to perturb the input.
Crucially, these perturbations can be applied in two spaces:
- Embedding Space: Perturbing the continuous word embeddings directly.
- Text Space: Perturbing the discrete input tokens (e.g., replacing tokens with
[MASK]).
The paper details specific implementations for each combination, such as PTP+RG (Random Gaussian noise in embedding space), PTP+RM (Random Masking in text space), PTP+PGD (Projected Gradient Descent for adversarial perturbations in embedding space), and PTP+A2T (Adversarial Training algorithm for text space perturbations). The overall PTP algorithm involves training on both clean and perturbed data pairs to encourage a smoother loss landscape.
Datasets
The paper evaluates PTP on two benchmark suites for natural language understanding (NLU) tasks:
- SuperGLUE: A collection of 8 challenging NLU tasks.
- FewGLUE: A few-shot version of SuperGLUE, containing 32 training samples per dataset.
Key Insights and Ideas
- Loss Landscape Sensitivity: The instability in prompt tuning is directly linked to a precipitous loss landscape, where small input perturbations cause large fluctuations in loss.
- Perturbation as Regularization: Applying random noise or adversarial perturbations can effectively "smooth out" this precipitous landscape, leading to more stable training.
- Space Matters: Perturbations in the continuous embedding space (PTP+RG, PTP+PGD) generally yield better results than text-space perturbations (PTP+RM, PTP+A2T) in fully-supervised settings.
- Generalization Boost: Beyond stability, PTP methods consistently improve performance on NLU tasks, suggesting that smoothing the loss landscape also enhances generalization.
Key Results
- Performance Improvement: PTP+PGD (adversarial perturbation in embedding space) achieved the best performance, outperforming the baseline PT2 by 1.94% on SuperGLUE and 2.34% on FewGLUE benchmarks on average.
- Training Stability: PTP methods significantly reduced the variance of scores across different random seeds compared to the baseline prompt tuning methods, demonstrating improved training stability. Figure 3 visually shows this reduction in variance across SuperGLUE tasks.
- Ablation Studies: Extensive ablation studies confirmed the effectiveness of different perturbation strengths and types, identifying optimal configurations for each method. For instance, PTP+PGD with a perturbation size of $10^{-3}$ and 4 PGD iterations showed optimal performance on FewGLUE.
Limitations and Future Work
- Computational Cost: While PTP is parameter-efficient, adversarial perturbation methods (like PGD) can increase training time compared to random noise methods.
- Hyperparameter Sensitivity: The performance of PTP methods can be sensitive to the choice of perturbation strength and other hyperparameters, as explored in the ablation studies.
- Future Directions: The paper suggests that further exploration of perturbation strategies and their application across different LLM architectures and tasks could yield further improvements. The authors also highlight the potential of PTP for improving robustness against adversarial attacks, although this was not the primary focus of the current study.
Summary updated