P

Soft Prompting: Definition and Examples

Soft prompting is a language model adaptation technique that involves adding learnable numerical vectors (called "soft prompts") as input to the model, rather than using natural language words.

Full definition

Soft prompting is a method for optimizing language models that fundamentally differs from classic prompting (so-called "hard prompting"). Instead of formulating instructions in natural language, continuous vectors — sequences of numbers — are injected directly into the model's embedding space. These vectors are trained via backpropagation on a task-specific dataset, while the main model weights remain frozen.

This approach was popularized by the paper "The Power of Scale for Parameter-Efficient Prompt Tuning" (Lester et al., 2021) from Google Research. The researchers demonstrated that with sufficiently large models, simply adding a few dozen learnable tokens as a prefix could rival full fine-tuning of the model, while only modifying a tiny fraction of the parameters.

The major advantage of soft prompting lies in its resource efficiency. Rather than duplicating and retraining an entire model for each task, only the prompt vectors are stored and trained — often a few kilobytes versus several gigabytes for a full model. This allows deploying a single base model with multiple interchangeable "modules" of soft prompts depending on the task.

It is important to note that soft prompting is a technique reserved for practitioners who have access to the model's internal layers. Users of APIs like ChatGPT or Claude cannot directly use soft prompting — they practice hard prompting. Soft prompting belongs more to applied machine learning than to prompt engineering in the common sense.

Etymology

The term "soft" (pliable, continuous) contrasts with "hard" (rigid, discrete) to distinguish prompts made of continuous optimizable vectors from natural language prompts composed of discrete tokens. This terminology follows a tradition in computer science where "soft" designates what is parametric and adjustable, as opposed to "hard" which is fixed and explicit.

Concrete examples

Sentiment classification in customer reviews

[SOFT_PROMPT_VECTORS] + "This product is really disappointing, I do not recommend it."

Adapting a generalist model to a medical domain without full fine-tuning

[MEDICAL_SOFT_PROMPT_50_TOKENS] + "The patient presents dyspnea with bilateral crackles."

Multi-task with a single base model: load a different soft prompt depending on whether you are doing translation, summarization, or code generation

Practical usage

Soft prompting is mainly aimed at ML teams who have access to the model weights and want to adapt it to a specific task without the cost of full fine-tuning. As an API user, you do not directly practice soft prompting, but understanding this concept helps you grasp why certain models perform better on specific tasks — they have potentially been optimized via this technique. If you are looking to improve your results without access to internal layers, focus on hard prompting with techniques like few-shot learning or chain-of-thought.

Related concepts

Hard PromptingPrompt TuningFine-TuningPrefix TuningLoRAFew-Shot PromptingEmbedding

FAQ

What is the difference between soft prompting and hard prompting?
Hard prompting uses natural language words that the user manually writes (e.g., "Summarize this text in 3 points"). Soft prompting uses numerical vectors optimized by a learning algorithm. Hard prompting is accessible to everyone, while soft prompting requires technical access to the model's internal layers.
Can soft prompting be used with ChatGPT or Claude?
No, not directly. Public APIs do not give access to the model's embedding space. Soft prompting is used upstream by teams that train or adapt models. As an end user, you use hard prompting — natural language instructions.
Is soft prompting better than fine-tuning?
Soft prompting is more resource-efficient (a few thousand parameters vs billions), but its performance depends on the model size. On very large models (10B+ parameters), it competes with full fine-tuning. On smaller models, fine-tuning remains generally superior. The key advantage of soft prompting is being able to easily store and swap multiple adaptations for a single base model.

See also

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More definitions

Get new prompts every week

Join our newsletter.