Prompt Tuning and Prefix Tuning
The original concept of prompt tuning refers to changing the prompt to the LLM to achieve better modeling results. However, it now means adding learnable prompt tokens to pre-trained models, which are inserted either to input embeddings only or to multiple intermediate layers. The following is an example of hard prompt tuning to achieve a better translation result: Hard prompt tuning is where you directly change the discrete input tokens which are not differentiable. Soft prompt tuning concatenates the embeddings of the input tokens with a trainable tensor that can be optimized via backprop to improve the modeling performance on a target task. You can train a small model for a specific task that learns to generate an output that performs the model’s overall performance. After learning a soft prompt, you have to supply it as a prefix when performing the specific task you finetuned the model on. This allows the model to tailor its responses to that particular task. Moreover, we can have
The original concept of prompt tuning refers to changing the prompt to the LLM to achieve better modeling results. However, it now means adding learnable prompt tokens to pre-trained models, which are inserted either to input embeddings only or to multiple intermediate layers. Hard Prompt Tuning § The following is an example of hard prompt tuning to achieve a better translation result: 1) "Translate the English sentence '{english_sentence}' into German: {german_translation)" 2) "English: '{english_sentence}' | German: (german_translation}" 3) "From English to German: '{english_sentence}' -> {g
related reading
- Prefix-Tuning: Optimizing Continuous Prompts for Generationarxiv.org
- Conditioning, Prompts, and Fine-Tuning — LessWronglesswrong.com
- Fine-Tuning and Prompt Optimization: Two Great Steps that Work Better Togetherarxiv.org
- Transformer Explainer: LLM Transformer Model Visually Explainedpoloclub.github.io
- Recent Advances in Language Model Fine-tuningruder.io
- GitHub - brexhq/prompt-engineering: Tips and tricks for working with Large Language Models like OpenAI's GPT-4.github.com
- Mastering LLM Techniques: Customization | NVIDIA Technical Blogdeveloper.nvidia.com
- Fine-tune Llama 2 with DPOhuggingface.co
- Tinkerthinkingmachines.ai
- Fine-tuning LLMs Guide | Unsloth Documentationdocs.unsloth.ai
- Getting Caught Up to Modern LLM Research | Samarth Goeldev.samarthgoel.com
- Model optimization | OpenAI APIplatform.openai.com