Papers
Topics
Authors
Recent
Search
2000 character limit reached

S-Prompts: Selective Prompting in LLMs

Updated 25 April 2026
  • S-Prompts are selective prompt mechanisms that dynamically allocate and fuse specialized prompt tokens to optimize continual, domain-incremental, and personalized learning.
  • They achieve parameter efficiency by tuning only the prompt bank while keeping the base model frozen, enabling scalable adaptation across diverse tasks.
  • Empirical results in dialogue personalization, text classification, and resource-aware pipelines demonstrate significant performance gains and reduced computational overhead.

Selective prompts, or “S-Prompts,” represent a methodological advance in prompt-based adaptation of large pretrained models, unifying several distinct lines of research that emphasize selectivity, modularity, and structural control in prompting. S-Prompts have been explored for their roles in domain incremental learning, continual text classification, personalized LLM dialogue, semi-parametric multitask adaptation, enhancement of segmentation via prompt learning, and resource-aware structured prompt engineering. This survey provides a comprehensive technical account spanning core S-Prompt architectures, mathematical formulations, representative learning algorithms, practical applications, interpretability, and known limitations.

1. Formal Definitions and Architectures

S-Prompts in the literature refer to “Selective Prompts” in continual or modular prompt tuning (Huang et al., 2024, Zhang et al., 27 May 2025), “Shared Prompts” playing a role in task-invariant knowledge retention (Zhang et al., 27 May 2025), domain-specific “Soft Prompts” for domain-incremental learning (Wang et al., 2022), and “Structured Prompts” as the declarative constructs in Structured Prompt Language (SPL) (Gong, 23 Feb 2026). Despite terminological variation, these designs share three defining characteristics:

  • Selectivity: S-Prompts are not monolithic; they are dynamically allocated, retrieved, or fused per input, task, or domain.
  • Parameter Efficiency: Only the prompt (or a small prompt bank) is tuned, with all model parameters frozen.
  • Compositional Modularity: Multiple prompts coexist and are orchestrated—typically via a selection, retrieval, or fusion mechanism.

A canonical S-Prompt system comprises the following components:

  • A frozen base model (e.g., BERT, T5, ViT, Llama2).
  • A set of prompt embeddings ({spi}\{\mathbf{sp}_i\}).
  • A selection or retrieval module to choose or blend spi\mathbf{sp}_i per input XX (e.g., via similarity, KNN, or an MLP/dense retriever).
  • Optional: context-aware or domain-aware constraints.

In domain-incremental learning (DIL), S-Prompts are implemented as domain-specific prompt matrices PsRL×d\mathbf{P}_s \in \mathbb{R}^{L \times d}, with LL prompt tokens prepended to the input, and domain identification handled via KNN over frozen features (Wang et al., 2022). For continual text classification, a shared prompt S\mathbf{S} is maintained alongside private prompts, structured for mutual information maximization (Zhang et al., 27 May 2025). In multitask prompted learning, SPT formalizes “semi-parametric” S-Prompts as the fusion of a trainable discrete prompt encoder with a frozen memory bank, enabling input-conditioned retrieval (Bari et al., 2022). For LLM-driven dialogues, SPT (Selective Prompting Tuning) maintains a prompt bank and learns selection/fusion through a dense retriever plus discriminative contrastive objectives (Huang et al., 2024).

2. Mathematical Formulation and Training Objectives

The generalized S-Promptic workflow entails constructing a parameter-efficient composite prompt P~\tilde{P} for each input XX, followed by prediction and optimization subject to modular loss terms.

Prompt Construction:

P~(C)=Fuse({spj:jTopK(s(C,spj))}),\tilde{P}(C) = \operatorname{Fuse}(\{\mathbf{sp}_j: j \in \operatorname{TopK}(s(C, \mathbf{sp}_j))\}),

where s(C,spj)s(C, \mathbf{sp}_j) is a context-specific selection score from a dual-encoder retriever.

Joint Loss (Dialogue SPT) (Huang et al., 2024):

  • Language modeling loss for each prompt,
  • Selection alignment: KL between softmax of negative NLL and selection probabilities,
  • Context-prompt contrastive loss to enforce diversity among selections,
  • Fusion loss for learning prompt blending weights,
  • Overall:

spi\mathbf{sp}_i0

Continual Classification (InfoComp S-Prompt) (Zhang et al., 27 May 2025):

  • Task sequence: at each task spi\mathbf{sp}_i1, maintain task-specific (spi\mathbf{sp}_i2) and shared (spi\mathbf{sp}_i3) prompts.
  • Information-theoretic objective: maximize mutual information between current and previous spi\mathbf{sp}_i4-Prompt induced representations, using a SimSiam-style positive-only contrastive auxiliary loss:

spi\mathbf{sp}_i5

spi\mathbf{sp}_i6

  • This term regularizes the S-Prompt to retain knowledge across tasks, directly improving forward transfer and attenuating forgetting.

Domain-Incremental Learning (S-Prompting) (Wang et al., 2022):

  • Train prompt spi\mathbf{sp}_i7 for each domain spi\mathbf{sp}_i8 using standard domain-labeled cross-entropy loss. At inference, choose spi\mathbf{sp}_i9 for query XX0 as the nearest domain centroid in frozen feature space.

3. Representative Algorithms and Inference Procedures

Personalized Dialogue SPT (Huang et al., 2024):

  • Maintain a prompt bank XX1.
  • At each round: for incoming context XX2, compute retriever scores XX3.
  • Select top-XX4 prompts and fuse (convex or weighted sum of prompt embeddings).
  • Prepend the (fused) embeddings to XX5, forward through the frozen LLM.
  • Training alternates selection alignment, contrastive learning, and response likelihood optimization.

Continual and Domain-Incremental Learning (Zhang et al., 27 May 2025, Wang et al., 2022):

  • For each new task or domain:
    • Randomly initialize a new prompt XX6 or XX7.
    • Optimize using within-task cross-entropy.
    • Update shared prompt XX8 with SimSiam-style auxiliary loss (if applicable).
    • For S-liPrompts (language-image modality): learn both image-side and text-side prompts.
    • At inference, identify task/domain via KNN over frozen representations, select corresponding prompt(s) and classifier head.

Semi-Parametric Prompt Tuning (SPT) (Bari et al., 2022):

  • Input is tokenized with a human-authored template; embeddings are pooled and projected to a query.
  • Use the query to soft-retrieve from a frozen memory bank; aggregate to a memory prompt.
  • Concatenate memory prompt, optional soft-prompt, and input embeddings, then feed to the frozen LLM.
  • Only the discrete prompt encoder (and optional soft prompt) parameters are learnable.

4. Applications and Experimental Results

Personalized LLM Dialogue (Huang et al., 2024):

  • SPT on ConvAI2 yields +16–33% mean improvement over baseline PT on average metrics (F1, BLEU, Distinct-n, etc.).
  • Dialogue diversity (Distinct-1/2) increases up to +90% relative gain.
  • Ablations show the necessity of the multi-term objective for maintaining diversity and alignment.

Continual Text Classification (Zhang et al., 27 May 2025):

  • In 5-task and 15-task settings, InfoComp S-Prompts yield up to +6.2% mean accuracy improvement over variants without shared prompts.
  • S-Prompt and its MI surrogate loss directly improve forward transfer and forgetting resistance (full InfoComp: 69.2%; w/o S-Prompt: 63.0%).

Domain Incremental Learning (Wang et al., 2022):

  • S-liPrompts achieve state-of-the-art in exemplar-free DIL—30% relative gain over best prior methods, negligible forgetting (<1% on CDDB-Hard).
  • Parameter overhead extremely low (0.03% per domain, enabling scalability).

Multitask Prompted Learning (Bari et al., 2022):

  • SPT shows +1.7% to +3.9% increase in average classification accuracy across multitask splits; outperforms discrete-only or soft-only approaches in most settings.

Resource-aware pipeline control (SPL S-Prompts) (Gong, 23 Feb 2026):

  • Declarative prompt constructs manage context budgets, allowing complex RAG/memory flows and plan explanations.
  • Reduces prompt engineering boilerplate by 65%, offers robust cost-portability and hybrid model routing.

5. Interpretability and Limitations

Soft S-Prompts are inherently non-interpretable; nearest-token unembedding typically yields incoherent, non-linguistic representations, and attempts to regularize for interpretability (e.g., perplexity penalties in RLPrompt/PEZ) reveal a fundamental trade-off between scrutability and downstream accuracy (Patel et al., 2 Apr 2025). For instance, promoting low perplexity in prompt tokens causes accuracy to degrade (SST-2 sentiment: 85%→70% as perplexity drops from ~100 to ~40).

Limitations common to S-Prompt variants include:

  • Possible mis-selection or mis-identification of prompts in domain-incremental/class-incremental setups, especially if the domain identifier is imperfect (Wang et al., 2022).
  • Dependence on accurate retrievers for selection/fusion in SPT-style architectures (Huang et al., 2024).
  • Inheriting annotator bias or stasis from static templates/memory banks in semi-parametric S-Prompts (Bari et al., 2022).
  • Lack of interpretability for domain-specific or task-specific soft-prompts, and reduced adaptation flexibility in the absence of prompt dynamism.

6. Extensions and Future Directions

  • Hierarchical Prompting: Layering S-Prompts to capture sub-domain or attribute-level information (Santos et al., 2022).
  • Hybrid Retrieval + Prompting: Integration of light retrievers or contrastive search over the prompt pool, reducing reliance on explicit domain identification.
  • Dynamic Prompt Expansion/Update: Online augmentation and pruning of the prompt set as new domains or tasks arrive (Wang et al., 2022).
  • Structured Prompting for Resource Management: Explicitly declaring and optimizing token budgets or context across multiple source pipelines in SPL (Gong, 23 Feb 2026).
  • Interpretability-Augmented Tuning: Systematic exploration of alternative proxies (BLEU, MAUVE, human-in-the-loop) for guiding S-Prompts toward more transparent representations (Patel et al., 2 Apr 2025).

A plausible implication is that as S-Prompt architectures mature and model providers increasingly expose prompt slots or memory caches in their APIs, modular prompt tuning and selection will become the principal mechanism for scalable, privacy-preserving, and adaptive learning across domains, tasks, and user personalization regimes.

7. Summary Table of S-Prompt Paradigms

Paper / Group S-Prompt Paradigm Domain Main Mechanism
(Huang et al., 2024) Selective Prompting Tuning Dialogue personalization Dense retriever + fusion/selection of soft prompts
(Zhang et al., 27 May 2025) Shared-Prompt (InfoComp) Continual classification Info-theoretic MI objective; prompt regularization
(Wang et al., 2022) S-Prompting Domain-incremental LE Independent, domain-specific soft prompts + KNN
(Bari et al., 2022) Semi-parametric S-Prompts (SPT) Multitask NLP Discrete prompt encoder + memory bank
(Gong, 23 Feb 2026) Structured Prompt (SPL) Resource-aware pipelines Declarative token & context budgeting

In conclusion, S-Prompts enforce modular, scalable, and dynamic control in prompt-driven adaptation. Their success across knowledge-intensive, continual, and personalized model scenarios demonstrates that the future of efficient and robust model adaptation is prompt-selective rather than monolithic or globally fine-tuned.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to S-Prompts.