Prompts Expansion Method Overview
- Prompts Expansion Methods are strategies to augment and adapt input prompts for LLMs/VLMs, enhancing performance and generalization.
- They employ techniques like automated searches, learnable tokens, rule-based generation, and dynamic rewriting to optimize model responses.
- Applications span personalization, continual learning, query expansion, and robust multi-modal adaptation across diverse domains.
A prompts expansion method is any strategy that systematically augments, enriches, or adapts the input prompts fed into LLMs or vision-LLMs (VLMs) to improve performance, generalization, interpretability, or task-specific adaptation. These methods move beyond static, manually crafted templates to introduce techniques such as automated gradient-guided search, learnable soft or discrete prompt tokens, compositional rule-based generation, multi-branched conditional logic, or dynamic prompt rewriting. The goal is to unlock more of the hidden potential within foundational models, achieving improved accuracy, adaptability, and repertoire without extensive parameter updates or retraining.
1. Automated and Learnable Prompt Discovery
Prompt expansion methods increasingly exploit automated search and learning techniques to optimize prompt content:
- AutoPrompt uses a gradient-guided, discrete search to select a sequence of trigger tokens, which, when inserted into a prompt template, maximize the log-likelihood of the correct answer within a frozen masked LLM (MLM) (Shin et al., 2020). The process iteratively adjusts each discrete trigger token by estimating, via a first-order gradient approximation, which vocabulary item will most improve model output on the target task. Formally, for trigger token , the update is:
This enables conversion of tasks such as sentiment analysis, NLI, and fact retrieval into fill-in-the-blank cloze formats without finetuning.
- Extensible Prompt (X-Prompt) introduces imaginary words—discrete, learnable tokens outside the natural language (NL) vocabulary (Ge et al., 2022). When trained with context-augmented learning (CAL), these tokens facilitate robust, zero-shot customization (e.g., emulating individual language styles) by acting as placeholders for abstract attributes that NL cannot easily capture.
- Soft Prompt Expansion encompasses prompt tuning frameworks that attach a sequence of learnable embeddings to the model input. Progressive Prompts (Razdaibiedina et al., 2023) advances this paradigm for continual learning by concatenating a new soft prompt for each new task, freezing all previous prompts, and using only newly learned tokens for adaptation, thus preventing catastrophic forgetting and supporting efficient forward transfer.
2. Prompt Expansion by Data-Driven or Algorithmic Enrichment
Several methods expand prompts not by changing their structure but by systematically generating and selecting from large pools of candidate instructions:
- Spell: Selecting Prompts by Estimating LM Likelihood (Gonen et al., 2022) proposes seed expansion through:
- GPT-3–driven paraphrase generation
- Backtranslation via high-resource languages
- Selection of prompts with the lowest LLM perplexity, based on the empirical observation that lower perplexity correlates with higher task performance. The overall strategy is:
- 1. Seed human-written prompts
- 2. Expand via paraphrasing/backtranslation
- 3. Score each for perplexity over task instances
- 4. Select with lowest perplexity, maximizing LM familiarity
- Examples as the Prompt (EaP) (Zeng et al., 14 Mar 2025) (and its variant EaP_lite) replaces much or all of the prompt with selected in-context labeled examples, using unsupervised global selection (K-means, random sampling) and local similarity matching (using TF-IDF, embeddings, or approximate nearest neighbor search). This provides scalable, dynamic prompt construction adaptable to evolving data distributions, with documented production benefits in e-commerce workflows.
- AMPO: Automatic Multi-Branched Prompt Optimization (Yang et al., 11 Oct 2024) automates the expansion of prompt logic by iteratively creating multi-branched conditional prompts. Using an LLM-based pipeline, failure cases are clustered into error patterns, which are then mapped to new or enhanced prompt branches. A greedy minimal search strategy maintains efficiency by retaining only the best expanded prompt at each iteration.
3. Hierarchical, Partitioned, and Modular Expansion in Multi-Task/Multi-Modal Contexts
Prompt expansion in multi-modal or multi-task settings often leverages architectural decomposition and hierarchy:
- Partitioned Multi-modal Prompt (PMPO) (Tian et al., 2023) decomposes the visual encoder into hierarchical depths, linking learnable prompts to distinct transformer layer partitions. Class embedding is then the mean over all multi-depth prompt encodings, offering improved harmonic mean accuracy for new class and domain generalization through diversified hierarchical context.
- Prompt Production System (PRopS) (Pilault et al., 2023) generalizes prompt generation via a neural production system: input metadata is mapped to continuous prompts composed from a bank of learned neural “rules,” selected by differentiable (Gumbel top-k) attention. For conditions and rule bank , mapping is realized as . This modularization enables compositional, conditional adaptation and transfer to many tasks with few parameters.
- MoPD: Mixture-of-Prompts Distillation (Chen et al., 26 Dec 2024) performs expansion by aggregating soft prompts (students) with distributions distilled from a mixture of hard, human-designed teacher prompts. A gating network selects the most informative teachers for each instance, and combined KL divergence losses ensure the resulting soft prompts inherit generalization to unseen classes.
4. Specialized Expansion for Structured and Continual Learning Settings
Prompt expansion underlies several parameter-efficient or data-scarce continual learning strategies:
- Progressive Prompts enables continual learning by sequentially expanding the prompt pool, avoiding the overwriting prevalent in full fine-tuning. With each new task, only prompt parameters specific to that task are updated, and the concatenated prompt sequence is prepended to the input. A two-layer MLP with residual connections is used to improve prompt parameter updating.
- Expand and Compress: Continual Spatio-Temporal Graph Forecasting (Chen et al., 16 Oct 2024) applies dual principles: “expand” (adding node-specific prompt vectors as new nodes/sensors are added) and “compress” (applying low-rank approximations to prune redundant prompt parameters without accuracy loss). The objective is to ensure that the adaptation to heterogeneity and the minimization of parameter growth are mathematically balanced, as shown by:
- Language-Aware Prompt Tuning (LAPT) for multilingual ASR (Yang et al., 16 Jun 2025) computes cross-lingual similarity (via Whisper base probabilities) to identify which soft prompt matrices to share or specialize per new language, enabling parameter-efficient expansion without re-training the entire network.
5. Applications: Alignment, Personalization, Retrieval, and Robustness
Prompt expansion methods underpin a range of challenging applications:
- Personalization: Automated prompt rewriting (Li et al., 2023) employs a pipeline where an initial, manually crafted template is revised via supervised learning and then by RL (PPO), focusing on summary and synthesis elements that encode personal context. Prompt expansion in this sense means not just growth, but refinement and re-weighting of salient context cues for the frozen model.
- Retrieval and Query Expansion: LLM-based query expansion (Jagerman et al., 2023) exploits zero-shot, few-shot, or chain-of-thought (CoT) prompts to generate new lexical expansions for information retrieval. The CoT style, in particular, is shown to yield richer, more semantically relevant expansions than classical PRF, improving both recall and ranking metrics (e.g., NDCG@10).
- Jailbreaking and Defense: JUMP (Hsu et al., 3 Feb 2025) iteratively optimizes a set of universal (multi-)adversarial prompts using beam search and perplexity-based constraints, while DUMP adapts a similar framework for defensive prompt expansion to mitigate adversarial attacks.
- Tool-Enabled Conversation and Human-in-the-Loop: Insert-expansions (Göldi et al., 2023) structure the prompt logic for LLM-driven conversational agents by inserting clarifying turns (“user-as-a-tool”) when divergence from user intent is detected. The use of intermediary expansion prompts increases perceived control and naturalness in dialogue.
6. Theoretical and Empirical Considerations
Prompt expansion methods have empirically demonstrated:
- Strong and sometimes state-of-the-art performance on standard datasets without model finetuning, e.g., AutoPrompt achieving ≥91% accuracy on SST-2 and up to 43% precision on LAMA fact retrieval compared to ~34% for manual prompts (Shin et al., 2020).
- Improved generalization and robustness, as in MoPD’s harmonic mean (H) gains on unseen vision-language classes (Chen et al., 26 Dec 2024) and significant AR/AP improvements in class-agnostic object detection via DiPEx (Lim et al., 21 Jun 2024).
- Efficient parameter usage: Progressive Prompts, PMPO, and prompt pool compression strategies often tune <0.1% of the model’s total parameters, supporting scalable continual learning (Razdaibiedina et al., 2023, Chen et al., 16 Oct 2024, Tian et al., 2023).
- Algorithms can operate entirely at the prompt (input) level, allowing adaptation when model weights are frozen or only API-accessible (Li et al., 2023, Zeng et al., 14 Mar 2025).
7. Future Directions and Open Problems
Active research directions and unresolved questions include:
- Exploring more robust optimization in discrete token spaces, richer interpretability, and minimizing training-data sensitivity for fully automatic prompt discovery (Shin et al., 2020, Ge et al., 2022).
- Integrating meta-learning or search-based controllers for hierarchical or conditional expansion strategies, such as algorithmic selection among branch additions, depth enhancements, and pruning (as exemplified by AMPO (Yang et al., 11 Oct 2024)).
- Extending prompt expansion to new domains such as streaming and cross-modal settings (spatio-temporal forecasting (Chen et al., 16 Oct 2024), vision-language generalization (Chen et al., 26 Dec 2024)), multilingual and low-resource language adaptation (Yang et al., 16 Jun 2025), and code-structured tasks (taxonomy construction (Zeng et al., 17 Aug 2024)).
- Bridging hand-crafted and learnable prompts efficiently, possibly via mixtures and distillation (teacher-student frameworks), and leveraging instance- or task-selective gating.
- Addressing the security implications of universal adversarial prompt expansion and its duals (e.g., JUMP/DUMP (Hsu et al., 3 Feb 2025)), which raise further challenges for safe deployment and alignment.
In summary, prompts expansion methods have evolved from hand-crafted, fixed templates to highly adaptive, automated, and multi-faceted strategies that efficiently probe, steer, and unlock the capabilities of large-scale language and vision-LLMs. This trajectory has substantially expanded the operational frontier of pretrained models and enabled new forms of continual adaptation, robustness, and application-specific flexibility across language, vision, and multi-modal domains.