Abstract
In-context learning (ICL) is a recent advancement in the capabilities of large language models (LLMs). This feature allows users to perform a new task without updating the model by conditioning on a few input-label pair demonstrations. However, this flexibility introduces potential issues, such as the use of models on improper or sensitive content that violates model policies. We introduce the concept of "applicability authorization" for ICL and propose ICLGuard, a fine-tuning framework designed to regulate ICL behavior. ICLGuard fine-tunes a minimal set of additional parameters to "guard" the LLM. Empirical results show that the guarded LLM can deactivate its ICL ability on target data without affecting its performance on authorized tasks or its general functionality.
Introduction
In-Context Learning (ICL) has revolutionized how users interact with Large Language Models (LLMs), enabling them to perform new tasks simply by providing a few examples in a prompt. While this offers unprecedented flexibility compared to traditional fine-tuning, it also presents a significant challenge for model owners: the lack of control over what data the model is applied to. A user could, for instance, leverage ICL to process sensitive, copyrighted, or policy-violating data that the model was never intended to handle.
To address this, we propose the framework of applicability authorization. This mechanism allows a model owner to specify which datasets or tasks are authorized for ICL. If a user attempts to use the model on prohibited "target" data, the model's ICL capability is selectively deactivated.
Methodology: The ICLGuard Framework
ICLGuard employs Parameter-Efficient Fine-Tuning (PEFT), specifically Low-Rank Adaptation (LoRA), to create a "guard" module that integrates with a frozen LLM. This approach ensures the base model's core knowledge remains untouched while providing a surgical mechanism for behavioral control.
The framework is optimized using a three-pronged loss function:
- Disable Loss ($L_D$): This loss "breaks" the ICL ability on target data. Instead of simple hard-labeling, it uses soft distorted labels. By zeroing out the probabilities of correct labels in the model's output distribution, it forces the model to produce incorrect results when it detects the target data format.
- Maintenance Loss ($L_M$): To ensure the model retains its ICL capabilities for authorized tasks, ICLGuard uses surrogate data—randomly sampled text that acts as a stand-in for the infinite set of possible authorized tasks.
- Utility Loss ($L_U$): This loss prevents "concept forgetting" by minimizing the distance between the internal hidden states of the guarded model and the original model during standard text processing.
Experimental Results
We evaluated ICLGuard across various benchmarks, including Financial Phrasebank (FP), SST-2, TREC, and WMT19 translation tasks. The results demonstrate that ICLGuard can effectively neutralize specific capabilities with high precision.
Key Findings
- Effective Deactivation: On LLaMA-13B, accuracy on the target Financial Phrasebank dataset dropped from 80% to approximately 31% (near random guessing), effectively rendering the model useless for that specific task.
- Preservation of Utility: While the target task was neutralized, performance on auxiliary authorized datasets remained stable. For example, deactivating FP had a negligible impact on SST-2 sentiment analysis performance.
- Robustness: ICLGuard proved resilient against adaptive attacks, such as changing prompt templates, varying the number of demonstrations, or altering label names. The guard remained active despite these attempts to bypass it.
- Generative Control: The framework extends beyond classification. In English-to-German translation tasks, ICLGuard reduced BLEU scores from 18.24 to 1.26, successfully blocking unauthorized generative use cases.
Conclusion
ICLGuard provides a robust and efficient solution for model owners to enforce applicability authorization. By selectively deactivating ICL on prohibited datasets while preserving general intelligence and authorized task performance, ICLGuard offers a necessary tool for the responsible deployment of large language models.
Summary updated