Abstract
Adapting proprietary "black-box" Pre-trained Language Models (PLMs) to specific downstream tasks is often hindered by model confidentiality and data privacy concerns. This paper introduces PEMA (Plug-in External Memory Adaptation), a parameter-efficient fine-tuning method designed for "offsite-tuning." PEMA operates as an external plug-in that interacts only with the PLM's final layer representations, bypassing the need for internal weight access or deep backpropagation. By combining a low-rank adapter with a novel "Gradual Unrolling" interpolation strategy, PEMA preserves base model fluency while achieving high task-specific accuracy. Empirical evaluations on translation and style transfer tasks show that PEMA outperforms existing methods like LoRA and full fine-tuning, while requiring 90% less training memory.
The Problem: Fine-Tuning "Black-Box" Models
Fine-tuning is essential for optimizing PLMs for specialized tasks. However, users face two major hurdles: massive resource requirements for full fine-tuning and the "black-box" nature of proprietary models (e.g., GPT-4), where owners refuse to share weights and users are reluctant to share sensitive data for remote tuning. Existing Parameter-Efficient Fine-Tuning (PEFT) methods like LoRA typically require weight access to insert trainable layers. PEMA addresses this "offsite-tuning" challenge by enabling task adaptation using only extracted features from the model's final layer.
The PEMA Method: A Plug-in Approach
PEMA functions as a lightweight adapter that processes Context Representations (CRs) from the PLM. Its architecture includes:
- External Memory: Stores CRs from the PLM's final layer mapped to target tokens during training.
- LoRA-like Bottleneck Adapter: A low-rank structure (matrices $A$ and $B$) that trains exclusively on extracted features, avoiding the need to load or update the base PLM's billions of parameters.
- Two-Phase Training: The model first learns to reconstruct original PLM features to maintain linguistic knowledge, followed by joint retraining to predict task-specific target tokens.
- Gradual Unrolling (GU): A novel inference technique that dynamically interpolates between PEMA and the base PLM. PEMA exerts more influence at the start of a sentence to ensure task adherence, while the base PLM takes over toward the end to maintain overall fluency.
Key Results and Efficiency
PEMA demonstrates significant advantages in both resource efficiency and task performance. In terms of memory, PEMA requires only 478 MB for a 1.3B parameter model, a reduction of over 90% compared to LoRA's 5,056 MB. This efficiency extends to training speed, as PEMA avoids deep backpropagation through the base model.
On the WMT22 translation benchmark, PEMA achieved a 12.87 sBLEU score, outperforming both LoRA (4.28) and full fine-tuning (10.15). In style transfer tasks (GYAFC), PEMA excelled at complex formalization patterns where other models often failed or hallucinated.
Limitations and Future Directions
While PEMA offers a robust solution for offsite-tuning, some challenges remain. Inference still requires sending prompts to the PLM owner to obtain initial representations, which may pose privacy concerns. Additionally, PEMA currently assumes access to the PLM's Language Model (LM) head. Future research will explore PEMA's performance on a wider array of reasoning-heavy NLP tasks and potential methods to further enhance inference privacy.
Summary updated