---
title: Soft Prompt Tuning
url: https://www.emergentmind.com/topics/soft-prompt
type: topic
---

# Soft Prompt Tuning

Soft prompt tuning is a parameter-efficient adaptation paradigm in which a pretrained model remains frozen while a small sequence of continuous embedding vectors is optimized for a downstream task. Unlike hard prompts, whose components are vocabulary tokens, soft prompts are generally not human-readable and need not correspond to valid words. They can be inserted at the model input, introduced as layer-wise key/value states, generated conditionally from task or instance features, transferred between tasks, retrieved from a prompt library, or composed arithmetically. Across language, vision-language, retrieval, time-series, active-learning, and multimodal retrieval systems, soft prompts function as compact task-adaptation interfaces whose effectiveness depends on initialization, prompt geometry, task relatedness, optimization stability, model compatibility, and the preservation or control of information flow.

## 1. Formal foundations and parameter-efficient adaptation

Let a frozen pretrained model have parameters $\theta$, embedding dimension $E$, and input embedding sequence $\mathbf{x}$. A conventional input-level soft prompt is a trainable matrix

$$
\boldsymbol{\rho}\in\mathbb{R}^{L\times E},
$$

where $L$ is the number of virtual prompt tokens. The prompted input is

$$
[\boldsymbol{\rho};\mathbf{x}],
$$

and the model produces

$$
p_\theta(y\mid[\boldsymbol{\rho};\mathbf{x}]).
$$

Only $\boldsymbol{\rho}$ is updated; $\theta$ remains constant. For task dataset $\mathcal{D}_t$, ordinary prompt tuning minimizes the task loss with respect to $\boldsymbol{\rho}$ while keeping the pretrained model frozen. The task-specific parameter count is $LE$, often far below the size of the underlying model. In T5 XXL, a 100-token prompt contains approximately 410K tuned parameters compared with roughly 11B model parameters, corresponding to approximately 27,000 times fewer task-specific parameters than full model tuning [2110.07904].

In text-to-text models such as T5, classification, entailment, question answering, and generation can share the same formulation: the prompted encoder-decoder generates a textual label or output. In autoregressive multilingual models, class prediction can instead use the pretrained language-modeling head and a verbalizer that maps classes to vocabulary tokens [2402.03782]. In CLIP-style vision-language models, a soft context is concatenated with a class-name embedding and passed through the text encoder. For class $c$, a typical prompt is

$$
\boldsymbol{s}_c=[\mathrm{S}]_1\cdots[\mathrm{S}]_L[\mathrm{CLASS}]_c.
$$

The resulting text representation is compared with an image representation using CLIP’s similarity-based classifier [2208.13474].

Soft prompting differs from full fine-tuning, in which all pretrained parameters are updated; from adapters and LoRA, which modify internal transformations; and from hard-prompt optimization, which searches over discrete vocabulary tokens. Prefix tuning may also freeze the model, but generally introduces trainable vectors throughout Transformer attention key/value computations rather than only at the input layer. The precise distinction is architecture-dependent: some methods call conditionally generated continuous vectors “soft prompts” even when the backbone is jointly trained or when prompts are injected at multiple layers.

Parameter efficiency reduces task-specific storage and optimizer-state requirements, but it does not automatically reduce inference cost. A frozen backbone must still execute at inference time, and additional prompt generators, retrieval modules, or internal instrumentation may add computation.

## 2. Initialization, reparameterization, and information content

### Initialization sensitivity

Directly optimized soft prompts are unconstrained points in a high-dimensional embedding space. Their optimization can be highly sensitive to random or vocabulary-based initialization, especially for small models, low-resource targets, and short training schedules. InfoPrompt attributes this sensitivity to a nonconvex prompt-loss landscape containing local minima and argues that conventional prediction-loss training does not explicitly require prompts to encode task-relevant information [2306.04933].

Several methods therefore constrain or structure the prompt parameterization. SuperPos-Prompt represents each prompt vector as a linear combination of pretrained vocabulary embeddings:

$$
\mathbf{p}_i=\mathbf{V}\mathbf{p}'_i
=\sum_{j=1}^{m}p'_{ij}\mathbf{v}_j,
$$

where $\mathbf{V}$ contains $m$ sampled vocabulary embeddings and $\mathbf{p}'_i$ is a trainable coefficient vector [2406.05279]. The reported configuration uses 128 unique vocabulary embeddings shared across ten prompt positions. Unconstrained linear coefficients outperform softmax-normalized coefficients, indicating that restricting the coefficients to a nonnegative simplex is not beneficial in the evaluated setting.

SuperPos-Prompt reports average improvements over Residual Prompt tuning of 6.4 points on T5-Small and 5.0 points on T5-Base. Without dropout in the frozen network, its aggregate scores reach 70.2 on T5-Small and 75.8 on T5-Base, compared with 63.8 and 70.8 for Residual Prompt tuning. The paper interprets the dropout result as evidence that stochastic suppression in a frozen network can destabilize optimization when only a small prompt is trainable, although this causal explanation remains a hypothesis.

### Information-theoretic prompt learning

InfoPrompt augments prediction loss with conditional mutual-information objectives:

$$
\mathcal{L}
=
\mathcal{L}_{\mathrm{pred}}
-\beta\mathcal{I}(P;Z\mid X)
-\gamma\mathcal{I}(P;\theta\mid X),
$$

where $P$ is the prompt, $Z$ is the frozen encoder representation, $X$ is the input, and $\theta$ denotes the trainable prediction head. The head term encourages the prompt to capture task information acquired by the head, whereas the representation term encourages the encoder output to retain information from the prompt. Both are implemented with contrastive variational lower bounds and bilinear scoring functions.

In experiments with frozen RoBERTa-Large, InfoPrompt uses approximately 1.3M trainable prompt-related parameters rather than the model’s approximately 354M parameters. On full-data GLUE, its average score is 0.7590, compared with 0.7403 for WARP and 0.7396 for IDPG. On relation extraction, NER, and SemEval settings, it obtains 0.7916 compared with 0.7291 for WARP. In few-shot GLUE, the corresponding averages are 0.5559 for InfoPrompt and 0.5077 for WARP [2306.04933].

### Interpretability

Soft prompts are not automatically interpretable. A nearest-vocabulary approximation can be geometrically close to a learned vector while failing to preserve model behavior. “Towards Interpretable Soft Prompts” distinguishes **faithfulness**, meaning behavioral correspondence between the continuous prompt and its discrete representation, from **scrutability**, meaning human comprehensibility [2504.02144].

Faithfulness can be measured through embedding-distance, output-logit, or task-performance differentials. Scrutability is evaluated using language-model perplexity, with GPT-2-XL serving as a proxy for linguistic plausibility. The paper finds that lower perplexity can produce more common English-like tokens without yielding a coherent task explanation. On BoolQ, ordinary soft prompting reaches 62% accuracy while the evaluated PEZ configuration reaches 38%, close to the no-prompt baseline. In RLPrompt experiments, increasing the perplexity weight lowers prompt perplexity but can reduce task performance and produce semantically disconnected sequences. These findings indicate that discreteness, vocabulary proximity, or language-model probability alone does not establish interpretability.

## 3. Transfer, generation, retrieval, and arithmetic composition

Soft prompts can be treated as task-specific parameters, task embeddings, generated adapters, or reusable vectors.

### Source-prompt transfer

SPoT, or Soft Prompt Transfer, first learns a prompt on one or more source tasks and uses it to initialize prompt tuning on a target task. The language model remains frozen in both stages [2110.07904]. A source prompt can provide a task-relevant optimization starting point instead of random or vocabulary initialization.

With T5-Base, SPoT improves ordinary Prompt Tuning from 81.2 to 82.8 on GLUE and from 66.6 to 73.2 on SuperGLUE. Across T5 Small, Base, Large, XL, and XXL, SPoT obtains SuperGLUE scores of 64.5, 73.2, 82.7, 88.7, and 91.2, respectively, matching or exceeding Model Tuning at each reported scale. At T5 XXL, SPoT reaches 91.2 while tuning approximately 410K task-specific parameters.

Transfer is task-dependent. MNLI to CB produces a relative error reduction of 58.9%, whereas unrelated or over-broad source mixtures can cause interference and negative transfer. A 16-source, 10-target study comprising 160 source-target combinations shows that task similarity, data size, reasoning demands, task format, and optimization trajectory all influence transferability.

SPoT also treats learned prompts as task embeddings. A prompt checkpoint after 10,000 training steps is used as a task representation, and source prompts are retrieved through cosine similarity. The best source prompt for each target improves average target performance from 74.7 to 80.7. Retrieval with nine candidates preserves approximately 90% of the oracle gain while eliminating roughly 69% of the source search space.

### Task prompt vectors

Task Prompt Vectors represent a task-specific prompt as the displacement from its random initialization:

$$
\tau_{P_t}
=
\theta^t_{P_{\mathrm{ft}}}
-
\theta_{P_{\mathrm{pre}}}.
$$

The vector can be applied to another prompt through

$$
\theta_{P_{\mathrm{new}}}
=
\theta_P+\lambda\tau_{P_t},
$$

and multiple task vectors can be added:

$$
\tau_{P_{\mathrm{new}}}
=
\sum_i\tau_{P_i}.
$$

The method preserves the small parameter footprint of prompt tuning while supporting modular arithmetic composition. Across twelve NLU datasets, related task vectors tend to exhibit greater similarity, although cosine similarity is not a complete predictor of transfer. TPV combinations improve zero- and few-shot initialization on selected targets, including SciTail and IMDB, but can suffer destructive interference, especially for unstable tasks such as TREC Coarse [2408.01119].

### Prompt retrieval for zero-shot generalization

ROSPR, or Retrieval of Soft Prompt, trains a separate 100-token soft prompt for each of 230 source hard prompts, indexes prompted source instances using a T0-small dense retriever, and retrieves a prompt for an unseen target task [2210.03029]. At inference, the selected soft prompt is concatenated with the target hard prompt while the T0-3B backbone remains frozen.

ROSPR adds approximately 0.007% parameters to T0-3B. On eleven held-out datasets, it improves mean accuracy from 51.22% for T0 to 53.24% and outperforms T0 on ten datasets. On fourteen BIG-bench tasks, mean accuracy rises from 42.56% to 44.95%. The paper’s most notable finding is that answer-choice format can matter more than semantic task type: source prompts with compatible output formats can transfer better than semantically related prompts with incompatible formats.

### Generated prompts

Prompt generation replaces a fixed prompt with a learned mapping from task, domain, or instance representations to prompt vectors. SoftCPT uses a task-shared meta-network for few-shot vision-language learning. A frozen CLIP text encoder converts a task name into a task feature, and a learned projection generates the task-specific context:

$$
\mathbf{S}_t
=
\operatorname{Reshape}
\left(\mathbf{W}^{T}g(\mathbf{u}_t)\right).
$$

SoftCPT-NATA improves over class-agnostic CoOp from 66.39 to 67.12 on General-10, from 62.59 to 67.68 on Plant-6, from 73.23 to 76.86 on RS-8, and from 59.95 to 62.75 on Fashion-20 [2208.13474]. Hard task sharing is generally weaker because it forces unrelated tasks to use an identical context.

SPG generates image-conditioned prompts for domain generalization using a conditional generative adversarial network. Stage I learns a separate domain prompt label for every source domain. Stage II trains a generator

$$
\tilde{\mathbf v}
=
G(\mathbf z\mid f(\mathbf x)),
$$

conditioned on the image feature and random noise. On multi-source domain generalization, SPG obtains average accuracies of 67.5 with ResNet-50 and 74.7 with ViT-B/16 [2404.19286].

DPSPG addresses instability in generated prompts through positive and complementary negative prompts. Two Transformer generators produce $\hat{\mathbf v}^{+}(x)$ and $\hat{\mathbf v}^{-}(x)$, and the combined class logit is

$$
g_i(x)
=
s_i^{+}(x)-\alpha s_i^{-}(x).
$$

On PACS with CLIP ResNet-50, DPSPG improves over SPG from 92.80% to 93.66%; on TerraIncognita, it improves from 38.39% to 46.28%. Its reported prompt-variability ratio on PACS-Photo is 0.2426, compared with 0.2936 for SPG and 0.9722 for DPL [2505.18770].

## 4. Conditional and domain-specific soft prompting

Conditional prompting distinguishes shared task knowledge from instance-specific information.

In video action recognition, PLAR uses a pool of trainable prompt experts,

$$
P=\{P_1,\ldots,P_l\},
$$

and generates a video-dependent prompt using sigmoid gating:

$$
P^*
=
\operatorname{Matmul}\bigl(\sigma(FC(X^*)),P\bigr).
$$

The prompt experts encode input-invariant knowledge, whereas the gating network produces input-specific coefficients. Prompt-conditioned frame features are then processed by a temporal action-recognition model. On Okutama, the learnable prompt improves accuracy from 71.54% for the baseline to 75.93%; eight experts outperform four, sixteen, and thirty-two experts [2305.12437].

PromptAL applies sample-aware prompts to few-shot active learning. A shared task prompt $\mathbf T$ and a sample-specific prompt $\mathbf S(x)=f(E(x))$ are fused by multi-head self-attention:

$$
\mathbf P(x)
=
\operatorname{MultiHead}
\left(
\operatorname{concat}[\mathbf T,\mathbf S(x)]
\right).
$$

The dynamic prompt changes the masked-language-model distribution, the mask representation used for diversity, and the uncertainty estimate. PromptAL combines calibrated entropy with local diversity,

$$
S(x)=\lambda U(x)+(1-\lambda)D(x),
$$

and uses K-means++ to impose global diversity. With $\lambda=0.9$, PromptAL obtains the best reported results on five of six in-domain datasets and improves out-of-domain performance on the evaluated IMDB-derived tasks [2507.16424].

SPEAR applies soft prompting outside natural language by quantizing time-series values into bins, mapping them to embeddings, and prepending learnable prompt vectors to the resulting sequence. A frozen BERT-Base-110M or Gemma-2B processes the sequence, while a binary classification head predicts anomalies. With prompt length 20, SPEAR-BERT achieves 0.9300 accuracy on MIMIC-IV and 0.9112 on NASA. The method’s contributions from quantization, prompt tuning, and the classification head are not fully isolated by the reported ablations [2510.03962].

Cross-lingual soft prompt tuning provides a contrasting case in which the prompt is deliberately kept minimal. The method freezes multilingual XGLM or BLOOM and trains only input-level prompt embeddings on English examples, evaluating zero-shot transfer to 30 or 38 languages. The paper reports that model freezing can improve transfer to linguistically distant languages by preserving the multilingual representation space. Prompt length and reparameterization are important: longer prompts are not always better, and reparameterization can help some languages while harming others [2402.03782].

## 5. Soft prompts as task-adaptive data and context interfaces

Soft prompts are also used indirectly to generate data, compress context, or transfer private adaptation.

SPTAR uses a learned prompt to adapt an LLM into a domain-specific query generator for dense retrieval. Fifty labeled document-query pairs tune the prompt; selected demonstrations are inserted alongside the prompt; the LLM generates weak queries for unlabeled documents; BM25 filters the generated pairs; and DPR, ColBERT, or BM25CE is trained on the resulting weak supervision [2307.08303].

On MS MARCO, SPTAR obtains NDCG@10 scores of 0.2580 with DPR, 0.2445 with ColBERT, and 0.2647 with BM25CE. On FiQA-2018, the corresponding scores are 0.2404, 0.2749, and 0.2785. The method illustrates that a soft prompt need not be the final deployed adapter: it can instead control an LLM whose outputs become training data for another model.

SoftPromptComp combines natural-language summarization with a continuous summary-vector representation and a learned soft-prompt matrix:

$$
C
=
f_{\mathrm{LM}}
\left(
S\oplus f_S(f_{\mathrm{NL}}(D))
\right).
$$

The intended goal is to replace a long context with a shorter information-dense representation. Reported processing-time reductions range from 63.9% on SST-2 to 80.1% on SQuAD 2.0 [2404.04997]. However, the manuscript does not specify the summarizer, summary-vector encoder, soft-prompt length, weighting mechanism, optimization objective, target-model interface, or complete task-quality results. The method is therefore a high-level framework rather than a fully reproducible compression algorithm.

POST, or Privacy Of Soft prompt Transfer, addresses cross-model prompt incompatibility and privacy. A provider distills a large target model into a smaller source model, the user tunes a prompt locally on private data, and the provider transfers the prompt to the large model using a small public dataset [2506.16196]. The transfer loss combines output imitation and prompt-effect alignment:

$$
\mathcal L
=
(1-\alpha)\mathcal L_1+\alpha\mathcal L_2.
$$

Optional PromptDPSGD provides $(\varepsilon,\delta)$-differential privacy for the locally tuned prompt. On Llama2-7B, POST reaches 90.02 on SST-2, 79.59 on TweetEval, 86.71 on ArisTV, and 76.18 on MPQA without differential privacy. Directly applying the source prompt to the target model performs substantially worse, confirming that soft prompts are strongly coupled to the model’s embedding and representation spaces.

## 6. Stability, security, and unresolved limitations

### Optimization and reasoning stability

Dynamic Prompt Corruption studies cases in which a soft prompt helps initiate reasoning but continues to exert harmful influence during later chain-of-thought steps. Using attention-gradient saliency, the method identifies excessive prompt-to-rationale information flow and selectively masks influential prompt positions during inference. On GSM8K, MATH, and AQuA, DPC improves vanilla prompt tuning for LLaMA2, LLaMA3, and Mistral, with reported gains generally in the 4%–8% range [2503.13208]. On LLaMA3-8B, DPC improves over prompt tuning from 65.5 to 67.6 on GSM8K, from 33.7 to 36.3 on MATH, and from 38.5 to 42.5 on AQuA.

The evidence is correlational: saliency is not a complete causal account of Transformer computation, and the method requires internal attention and gradient access. Dynamic triggering and a second inference pass also increase latency.

### Privacy and extraction

CoSPED demonstrates that soft prompts can act as targeted extraction triggers under a white-box threat model. An attacker optimizes a continuous prefix against known prefix-suffix pairs while keeping the language model frozen. On GPT-Neo 1.3B, CoSPED reaches a 65.2% exact 50-token extraction rate, compared with 62.3% for Ethicist and 54.3% for CLM [2510.11137]. The attack is model-specific: a prompt trained on GPT-Neo 1.3B transfers poorly to GPT-Neo 2.7B through nearest-token or dimension-scaling procedures.

A modified ROME defense reduces CoSPED’s five-token extraction rate to 1.6% and reports zero 40- or 50-token matches in the defense evaluation. The defense–utility trade-off remains important: more aggressive editing degrades LAMBADA performance.

### Adversarial retrieval

DSPrompt inserts layer-wise soft prompts into both visual and textual encoders of a frozen multimodal retriever. Prompts are inserted after the class token, interact with the layer’s original representations, and are removed before the next layer. A shallow-to-deep schedule allocates approximately $1/2/4$ prompt tokens across depth groups. The prompts are trained through an online min-max procedure against adversarial multimodal documents, using contrastive losses and a clean-anchor regularizer [2608.16536].

On PE-C/Places365, DSPrompt reduces attack success rate from 81.15% to 6.66% while increasing task fidelity from 17.70% to 93.18%. On unseen GPA/WebQA, attack success falls to 0.64%. The method requires offline adversarial training and adds less than 1% parameters, but its reported deployment cost is 1.85 times that of an undefended retriever because prompted encoding is more expensive.

### General limitations

Soft prompting has several recurring limitations:

- **Model dependence**: prompt vectors are tied to embedding dimensions, tokenization, architecture, and internal representation geometry. Direct transfer across models usually fails.
- **Initialization sensitivity**: random, vocabulary-based, reparameterized, and transferred initializations can produce materially different optimization behavior.
- **Negative transfer**: source tasks, demonstrations, domains, or prompt components can interfere when their objectives or output formats are incompatible.
- **Capacity trade-offs**: longer prompts and larger prompt-generator pools can improve expressivity but also increase overfitting, instability, and storage.
- **Interpretability gap**: continuous prompts can encode distributed control signals rather than linguistic instructions, and low perplexity does not guarantee faithfulness.
- **Inference overhead**: freezing the backbone lowers adaptation cost but does not eliminate the backbone’s inference cost. Conditional generation, retrieval, saliency analysis, or adversarial defense can add further computation.
- **Evaluation scope**: many results are specific to T5, RoBERTa, CLIP, GPT-Neo, or particular benchmark families. Generalization to other architectures, languages, modalities, and generation settings is not established universally.
- **Incomplete reproducibility**: several methods omit exact prompt initialization, prompt lengths, optimization schedules, weighting formulas, layer locations, or trainable-parameter partitions.

Soft prompts therefore represent neither a single algorithm nor a uniformly superior alternative to fine-tuning. They constitute a family of continuous adaptation mechanisms whose common principle is to place task-specific information in a small parameter set while preserving most pretrained weights. Research has expanded this principle from independent prompt tuning to transfer, retrieval, arithmetic composition, semantic generation, active learning, context compression, privacy-preserving adaptation, anomaly recognition, adversarial defense, and interpretability analysis. The central unresolved question is not whether soft prompts can improve a model, but how their information should be initialized, represented, transferred, controlled, interpreted, and secured across tasks, domains, models, and deployment environments.

Source: https://www.emergentmind.com/topics/soft-prompt