Fine Tuning, Prompt Tuning, and Prompt Engineering

 Differences Between Fine Tuning, Prompt Tuning, and Prompt Engineering

  1. Fine Tuning: This involves re-training a pre-trained model to adapt it for a specific task. It adjusts the model's weights through additional training, which can require significant computational resources. The entire model is updated to optimize performance for the new task.

  2. Prompt Tuning: Unlike fine tuning, prompt tuning involves adding a set of trainable parameters (or soft prompts) to the model’s input without altering the original model’s weights. This approach allows the model to adapt to new tasks while keeping the pre-existing weights fixed, making it less computationally intensive than fine tuning.

  3. Prompt Engineering: This method relies entirely on crafting effective input prompts for the model. It does not involve any computational training or modification of model parameters. Prompt engineering is about designing prompts that effectively guide the model to generate the desired output.

Two Approaches to Prompt Tuning:

  1. Soft Prompt Tuning: This approach uses gradient descent to optimize continuous embedding vectors that are attached to the language model’s input. While soft prompts can be effective, they are typically hard for humans to interpret, which can obscure understanding of the model’s decision-making processes. Additionally, these prompts are not reusable across different models and require access to the model's internal gradients, which can be computationally expensive.

  2. Reinforcement Learning (RL) Prompt Tuning: RL prompt tuning optimizes prompts using reinforcement learning techniques. In this method, an agent generates prompts by selecting tokens in a way that maximizes a reward signal derived from the model’s performance on a task. This approach does not require gradient information from the language model, making it suitable for models where gradient access is impractical. RL prompts are specifically tuned for input scenarios and are interpretable, allowing them to handle diverse textual styles. They are also flexible and can be adapted to different models, such as left-to-right models like GPT or masked models like BERT.

 Fine tuning adjusts the entire model to new tasks but requires substantial resources. Prompt tuning modifies input handling to adapt the model with less resource expenditure, and prompt engineering creatively utilizes designed inputs to steer model outputs without any training. 

PEFT: https://arxiv.org/abs/2104.08691 

RL-prompt: https://arxiv.org/abs/2205.12548 

Comments

Popular posts from this blog

Activation Functions

Efficiency in Large Language Model Training: LoRA, Qlora, and Galore