Composable Soft-Prompt Distillation of RL Experts: Toward Continual Post-Training
Abstract: RL post-training typically produces domain experts that must then be consolidated into one model, and as new experts keep arriving, this consolidation becomes a continual process. Weight merging and multi-teacher on-policy distillation (MOPD) must re-consolidate the whole model whenever an expert is added, and can erode capabilities outside the target domains. We propose Composable Soft-Prompt Distillation (CSPD), which keeps the pre-RL model frozen, distills each RL expert independently into a soft prompt, and composes experts by concatenating their prompts without joint training. A single soft prompt suffices to distill an RL expert, recovering at least 90% of the teacher's gain in 22 of 23 math, code, and agent settings. Independently trained prompts compose well. In a multi-expert setting, the average rises with every expert added, and the full composition matches MOPD (67.83 vs. 67.79). The composition generalizes best across six held-out benchmarks. Input-space adaptation adds little serving overhead, keeping throughput within 1.5% of the unadapted backbone and reaching 2.40x that of rank-4 LoRA. These results point toward continual post-training on a fixed backbone.
First 10 authors:
Paper Prompts
Sign up for free to create and run prompts on this paper.
Explain it Like I'm 14
1. What is the paper about?
This paper presents a method called Composable Soft-Prompt Distillation (CSPD).
The main idea is to help one AI model learn skills from several specialist AI models without changing the original model itself. For example, one specialist might be good at math, another at programming, and another at science. CSPD tries to combine these skills using small learned “instructions” called soft prompts.
A soft prompt is not a normal sentence written by a person. It is a short sequence of numbers that is added to the model’s input. These numbers guide the model toward a particular skill.
The researchers compare CSPD with other ways of combining expert models, such as merging their internal weights or using LoRA adapters.
2. What questions did the researchers ask?
The paper focuses on several important questions:
- Can a small soft prompt copy most of the useful ability of a much larger reinforcement-learning expert?
- Can separately trained soft prompts be combined successfully?
- Can new expert skills be added later without retraining the old ones?
- Does combining prompts damage the model’s general abilities?
- Is this approach faster and cheaper to use than methods such as LoRA?
- What does a soft prompt actually teach the model?
The larger goal is continual post-training. This means that an AI could keep learning new skills over time, somewhat like installing new apps on a phone, without rebuilding the entire system.
3. How did the researchers do it?
Training individual soft prompts
The researchers began with a normal model called the backbone. They kept this model frozen, meaning its main parameters were not changed.
They also had specialist models, called RL experts. These experts had been improved using reinforcement learning, a training method in which a model receives rewards for producing good answers.
For each expert, the researchers:
- Asked the expert to answer questions in its area, such as math or coding.
- Kept answers that passed a checker, called a verifier.
- Trained a separate soft prompt to make the frozen backbone produce answers similar to the expert’s answers.
This is called distillation. It is similar to a skilled teacher showing a less skilled student how to solve problems. The student does not become the teacher, but learns to imitate the teacher’s useful behavior.
Each soft prompt contained 256 learned vectors. A vector is simply a list of numbers used by the AI to represent information.
Combining prompts
After training, the researchers combined prompts by placing them one after another in the model’s input.
For example:
1 |
Math prompt + Coding prompt + Science prompt |
The prompts were trained separately. They were not retrained together after being combined.
This means that adding a new expert only requires training one new prompt. Removing an expert only requires removing its prompt.
Testing the method
The researchers tested CSPD on:
- Mathematics
- Computer programming
- Science
- Following instructions
- Software-engineering tasks
- Computer-terminal tasks
They compared CSPD with:
- Weight merging, which combines expert models by changing their internal parameters.
- MOPD, which trains one model to copy several experts at once.
- LoRA, a smaller add-on that changes how the model processes information in many of its layers.
They also tested whether the model kept its abilities on unrelated tasks, such as truthfulness, tool use, general knowledge, and financial reasoning.
4. What did the researchers find?
A single soft prompt copied most of an expert’s improvement
The researchers tested 23 different expert settings involving math, coding, and agent tasks.
In 22 out of 23 settings, the soft prompt recovered at least 90% of the expert’s improvement over the original model.
In 15 settings, the prompted model even matched or surpassed the expert.
For example, on one software-engineering test:
- Original model: 24.90%
- Expert model: 44.05%
- Model with a soft prompt: 45.65%
This suggests that a small input-based module can capture a surprisingly large amount of an expert model’s behavior.
Several prompts worked well together
The researchers trained four prompts for:
- Math
- Coding
- Science
- Instruction following
The original model had an average score of 50.41 across these areas. After combining all four prompts, its average score rose to 67.83.
This was almost identical to the score of MOPD, which reached 67.79. However, CSPD did not need to retrain the whole model using all four experts together.
The combined prompts also performed better than the individual prompts in some areas. This suggests that one prompt can sometimes help another prompt.
New experts could be added over time
The researchers added prompts one at a time:
1 2 3 4 5 |
Original model → instruction-following prompt → science + instruction-following prompts → coding + science + instruction-following prompts → math + coding + science + instruction-following prompts |
The average score increased each time, eventually reaching 67.83.
This is important because the model did not need to forget or retrain its earlier prompts whenever a new one was added.
However, the prompts were not always perfectly compatible. For example, adding a coding prompt briefly reduced performance on instruction following. This shows that different skills can sometimes interfere with each other.
General abilities were better preserved
The combined CSPD model performed best on the six unrelated tests used by the researchers. Its average score was 56.6, compared with:
- 53.5 for MOPD
- 54.1 for weight merging
- 53.8 for LoRA-based merging
- 50.3 for the original model
This suggests that keeping the backbone frozen may help protect abilities that were not the main focus of training.
Soft prompts added little serving cost
A model’s throughput is how many output tokens it can produce per second. The researchers found that soft prompts kept throughput within 1.5% of the unmodified model.
With 32 requests running at the same time, soft prompts produced about 2.4 times as many output tokens as rank-4 LoRA adapters.
The reason is that a soft prompt is mostly processed at the beginning of a request. LoRA, in contrast, adds extra calculations throughout every layer while the model is generating an answer.
Soft prompts learned behavior, not simple sentences
The researchers also studied what a math soft prompt had learned.
The prompt did not appear to represent a clear human-readable instruction such as “check your work.” Instead, it changed the model’s behavior so that it was more likely to:
- Question an intermediate result
- Check its calculations
- Avoid quickly moving on after reaching an answer
Written instructions with a similar meaning helped much less. This suggests that soft prompts can store complicated habits that are difficult to express in ordinary language.
5. Why is this research important?
CSPD could make it easier to maintain a growing library of AI skills.
Imagine a general AI model with separate skill modules for:
- Mathematics
- Programming
- Medical information
- Legal reasoning
- Customer service
- Using computer tools
With CSPD, a new skill could be trained as a separate soft prompt and added without changing the original model. Different users or requests could also use different combinations of prompts.
This has several possible benefits:
- Easier updates: New abilities can be added without retraining the whole model.
- Less forgetting: The original model remains unchanged.
- Flexible combinations: Prompts can be added, removed, or combined for different tasks.
- Lower serving cost: Many users can use different prompts while sharing the same backbone model.
- Better protection of general skills: The model may be less likely to lose abilities outside the training domains.
There are also important limitations. The experiments used only one main backbone, four domains, and a limited number of training tests. The prompts sometimes interfered with one another, and longer combinations require more input space and memory. A prompt is also tied to the particular backbone on which it was trained, so moving it to a different model would require new training.
Overall, the paper argues that AI post-training could work more like adding removable modules than rewriting the entire model. CSPD is a promising step toward AI systems that can keep gaining new abilities while keeping their original knowledge and skills.
Practical Applications
Immediate Applications
The paper supports several applications that can be deployed with existing language-model serving and fine-tuning infrastructure, provided that a suitable frozen backbone, RL expert, verifier, and compatible training data are available.
- Modular enterprise AI assistants — software and business operations
- Distill separate experts for coding, mathematical analysis, scientific research, instruction following, customer support, or document processing into independent soft prompts.
- Store the prompts in an expert library and concatenate the relevant modules for a particular request—for example, a coding prompt plus a security-review prompt for software auditing.
- Add or remove capabilities without modifying or retraining the underlying model.
- Dependencies: Prompts are tied to the specific backbone and embedding dimensionality; prompt interactions may be positive or negative, so each composition should be benchmarked before production use.
- Continual post-training pipelines — AI infrastructure
- Organizations can treat newly developed RL experts as installable modules:
- 1. Freeze the production backbone.
- 2. Collect verifier-approved outputs from the new expert.
- 3. Distill the expert into a 256-vector soft prompt.
- 4. Register the prompt in a versioned library.
- 5. Activate it through prompt concatenation at inference.
- This allows teams to update one domain without re-consolidating all previously acquired capabilities.
- Dependencies: The new expert must be sufficiently compatible with the backbone, and a domain-specific verifier or high-quality teacher responses are needed.
- Personalized model serving — consumer and enterprise software
- Provide different users, teams, or applications with distinct prompt combinations on the same shared model:
- A finance analyst receives finance and spreadsheet-reasoning prompts.
- A developer receives code-generation and debugging prompts.
- A compliance team receives policy-analysis and refusal/safety prompts.
- Requests using different prompt sets can share one batch and one backbone, avoiding the need to host a complete model per user or domain.
- Dependencies: User-specific or tenant-specific prompts require access control, prompt versioning, and evaluation for unintended capability transfer or data leakage.
- Efficient multi-adapter inference — cloud AI platforms
- Implement CSPD-like serving as an alternative to per-request LoRA adapters.
- The paper reports soft-prompt throughput within 1.5% of the unadapted backbone and up to the output throughput of rank-4 LoRA under high concurrency.
- Potential products include an inference API with parameters such as
enabled_experts=["math", "code", "science"]. - Dependencies: The reported serving results use a specific GPT-OSS model, NVIDIA B200 hardware, BF16 inference, and SGLang. Other hardware, models, context lengths, and batching systems require validation.
- Coding agents and software engineering automation — software development
- Distill RL experts trained on SWE-bench, Terminal-Bench, or similar environments into coding-agent prompts.
- Compose prompts for workflows such as repository navigation, bug localization, terminal use, test generation, and patch verification.
- A practical workflow could dynamically activate:
- a code-generation prompt,
- a terminal-operation prompt,
- a debugging prompt, and
- a test-verification prompt.
- The paper reports substantial recovery of RL gains on agent tasks, including improvement over some teachers on SWE-bench and Terminal-Bench settings.
- Dependencies: Safe execution sandboxes, reliable test suites, tool permissions, and monitoring remain necessary; prompt composition does not guarantee correct or secure code.
- Mathematical and scientific reasoning assistants — education and research
- Deploy specialized reasoning modules for algebra, competition mathematics, scientific question answering, or verification of intermediate calculations.
- The interpretability analysis suggests that the math prompt can induce behaviors such as checking intermediate results rather than merely following a written instruction to “reason carefully.”
- Applications include automated tutoring, equation verification, research-assistant systems, and answer-quality checking.
- Dependencies: Results were evaluated mainly on benchmark tasks. Real-world tutoring and scientific use require calibration, citation checking, domain validation, and safeguards against confident errors.
- Tool-use and workflow automation — software, robotics, and operations
- Combine prompts for instruction following, tool calling, planning, and domain expertise in agents that interact with APIs, terminals, databases, or enterprise systems.
- The out-of-domain results, particularly on BFCL, suggest that composed prompts may improve tool-calling behavior without changing the backbone.
- Dependencies: Tool schemas, authentication, action validation, and human approval mechanisms must be integrated independently of the soft prompts.
- Safety and compliance overlays — healthcare, finance, and regulated industries
- Maintain safety, refusal, compliance, or policy-analysis prompts as removable modules rather than permanently altering the general-purpose model.
- A deployment could attach a healthcare privacy prompt, a financial-advice disclaimer prompt, or an organization-specific policy prompt depending on the application.
- The frozen backbone and out-of-domain preservation are useful for reducing broad capability degradation when adding narrow behavior.
- Dependencies: The paper does not establish regulatory compliance or safety guarantees. Each module requires adversarial testing, policy review, monitoring, and independent risk controls.
- Academic experimentation and reproducible post-training — research
- Researchers can publish compact soft-prompt artifacts alongside teacher models and training metadata instead of distributing or merging full model weights.
- Independent groups can compare expert modules, arrival orders, prompt lengths, and composition strategies on a common frozen backbone.
- This could simplify ablation studies of continual learning, domain transfer, catastrophic forgetting, and expert interference.
- Dependencies: Reproducibility requires publishing the exact backbone checkpoint, tokenizer, prompt initialization, distillation data or response traces, training recipe, and serving template.
- Model rollback and capability management — production operations
- Removing a capability consists of dropping its prompt, enabling rapid rollback after quality, safety, or policy problems.
- Teams can maintain multiple prompt versions and activate them through configuration management rather than redeploying model weights.
- Dependencies: Removal is exact only with respect to the prompt module; capabilities may still be present in the backbone or transferred through other prompts.
Long-Term Applications
The following applications are promising but require additional research on scalability, automatic selection, reliability, and interactions among larger prompt libraries.
- Large-scale continual capability marketplaces — AI platforms
- Create a marketplace or internal registry of expert prompts contributed by different teams or organizations.
- A shared backbone could acquire new modules for law, medicine, finance, robotics, programming languages, or regional languages as they become available.
- Prompts could be signed, versioned, evaluated, and composed without retraining the central model.
- Dependencies: The current study uses one backbone, four domains, and a single seed. Larger libraries may produce context-length growth, attention interference, security risks, and unpredictable interactions.
- Automatic prompt routing and composition — machine learning systems
- Build a lightweight selector that determines which expert prompts to attach based on the user request, tool state, conversation history, or uncertainty.
- Unlike conventional expert routing, the selector could choose multiple prompts for one request—for example,
science + coding + verification. - A future system could learn prompt subsets and ordering from held-out task performance or online feedback.
- Dependencies: Routing errors may omit important expertise or activate incompatible prompts. The paper explicitly identifies prompt selection as an open research direction.
- Adaptive agents that change expertise during execution — robotics and autonomous systems
- An agent could load and unload prompts as its task changes:
- planning and perception during navigation,
- manipulation and control during physical interaction,
- diagnosis and repair during fault handling.
- This could support modular robots, warehouse systems, autonomous vehicles, and long-running digital agents.
- Dependencies: The current evidence concerns language-model tasks, not real-time control or embodied environments. Latency, safety certification, grounding, and prompt interactions would require substantial validation.
- Healthcare decision-support systems
- Compose modules for medical literature retrieval, differential diagnosis, clinical documentation, coding, patient communication, and safety checking.
- A hospital could add a specialty-specific prompt without altering a general clinical backbone, while retaining separate modules for cardiology, oncology, or radiology.
- Dependencies: Medical deployment requires prospective clinical studies, privacy protection, auditability, calibrated uncertainty, clinician oversight, and regulatory approval. Benchmark gains cannot be treated as evidence of clinical safety.
- Education systems with configurable pedagogy
- Maintain prompts for Socratic tutoring, step-by-step mathematics, language learning, accessibility, exam preparation, and misconception detection.
- A student’s learning profile could determine which prompts are composed for a session, and modules could be updated independently as curricula change.
- Dependencies: Personalization must avoid reinforcing misconceptions or inequities. Long-term learning outcomes, age appropriateness, privacy, and teacher supervision need evaluation.
- Financial analysis and compliance automation
- Combine modules for financial reasoning, spreadsheet interpretation, regulatory compliance, fraud analysis, and explanation generation.
- The paper’s FinQA result indicates a possible route to improving financial reasoning while keeping the shared model unchanged.
- Dependencies: Financial outputs require current data, transparent calculations, suitability controls, and legal oversight. Prompt composition alone cannot ensure factual accuracy or compliant advice.
- Energy and industrial operations
- Use separate modules for predictive maintenance, process optimization, safety procedures, grid analysis, and incident response.
- A plant operator could activate different combinations depending on whether the task concerns routine monitoring, fault diagnosis, or emergency handling.
- Dependencies: Industrial systems require integration with sensor streams, formal constraints, deterministic controllers, and fail-safe mechanisms. Language-model prompts should not directly replace certified control logic.
- Privacy-preserving or decentralized expert training
- Different organizations could train prompts from their own domain data while sharing only the resulting modules with a central backbone operator.
- This could support federated capability expansion across hospitals, universities, companies, or government agencies.
- Dependencies: Soft prompts may still encode sensitive information or training-set artifacts. Privacy leakage, membership inference, prompt tampering, intellectual-property rights, and secure distribution must be studied.
- Prompt compression for very large expert libraries
- Develop shorter prompts, shared sub-prompts, sparse prompt components, or hierarchical representations to limit the current cost of adding 256 vectors per expert.
- A library might store reusable primitives such as verification, planning, tool use, and domain knowledge instead of a separate full prompt for every task.
- Dependencies: Compression may reduce teacher-gain recovery or composability. The paper shows that shorter prompts can work in at least one setting, but does not establish scaling laws for large libraries.
- Automated conflict detection and capability governance
- Build evaluation tools that identify when adding a prompt improves one benchmark but harms another, as happened with some code and instruction-following interactions.
- Such tools could generate compatibility matrices, recommend safe prompt orders, or prevent incompatible modules from being deployed together.
- Dependencies: Interactions may depend on task distribution, ordering, decoding settings, and context length. Reliable governance requires broad, continuously updated evaluation suites.
- Continual post-training for multimodal and embodied models
- Extend CSPD beyond text to modules for vision-language reasoning, speech, robotics, navigation, and interactive simulation.
- Expert modules could encode behaviors such as visual inspection, manipulation planning, or domain-specific perception while a multimodal backbone remains frozen.
- Dependencies: The proposed method is evaluated on language-model inputs. Multimodal embeddings, modality-specific prompts, temporal state, and action grounding may not compose through simple concatenation.
- Training-cost reduction relative to MOPD and LoRA
- Develop production-scale cost models comparing independent prompt distillation with full-model merging, multi-teacher distillation, and adapter training.
- If validated, CSPD could become a lower-cost path for organizations that receive experts continuously rather than in a single consolidation cycle.
- Dependencies: The paper does not provide a complete training-cost comparison. Total cost depends on teacher-response generation, verifier filtering, prompt-training steps, storage, evaluation, and the number of arriving experts.
Glossary
- Agent routing: Selecting specialized model components or experts for individual requests. “Expert routing depends on a router that is hard to train”
- Attention: A neural-network mechanism that determines which input representations should influence each output representation. “It learns the teacher's reasoning behavior, here checking intermediate results, and applies it through the attention of the response tokens.”
- Backbone: The main pretrained model whose parameters provide the base computational architecture. “the backbone is never modified.”
- Catastrophic forgetting: The loss of previously learned capabilities after training on new data or tasks. “Updating the weights for one domain thus degrades another, a form of catastrophic forgetting.”
- Closed-book knowledge: Knowledge-retrieval performance measured without access to external documents or tools. “closed-book knowledge on TriviaQA”
- Composable Soft-Prompt Distillation (CSPD): A method that distills separate reinforcement-learning experts into independently trained soft prompts that can be concatenated. “We propose Composable Soft-Prompt Distillation (CSPD)”
- Concatenation order: The sequence in which multiple prompts or modules are joined together. “We report two concatenation orders, MCSI (math, code, science, instruction following) and its reverse ISCM”
- Continuous input: A learned numerical input representation, rather than ordinary discrete text tokens, used to adapt a model. “Adaptation can reside in weights, continuous inputs, layerwise prefixes, or hidden-state interventions”
- Cosine similarity: A measure of the angular similarity between two vectors. “median cosine similarity 0.25--0.34”
- Distillation: Training a student model or representation to reproduce the behavior of a teacher model. “We use sequence-level distillation”
- Draft model: A smaller or faster model used to propose tokens for speculative decoding. “Soft prompts also remain compatible with draft models trained on the backbone.”
- Embedding space: The vector space in which tokens or other model inputs are represented numerically. “the backbone's -dimensional embedding space”
- Expert routing: Dynamically selecting one or more specialized models or adapters for a request. “Expert routing depends on a router that is hard to train”
- First-token latency: The time between submitting a request and receiving its first generated token. “first-token latency against the same backbone served without adapters.”
- Frozen backbone: A base model whose parameters are kept fixed during adaptation or training. “CSPD attaches all four prompts”
- Hidden-state intervention: Modifying internal neural representations rather than model parameters or input text. “Adaptation can reside in weights, continuous inputs, layerwise prefixes, or hidden-state interventions”
- Input-space adaptation: Modifying a model through its input representations instead of changing its weights. “Input-space adaptation adds little serving overhead.”
- Key–value cache: Stored attention keys and values reused during autoregressive generation to avoid recomputing them. “every later decoding step only attends to its cached keys and values”
- KL gap: The difference between two models’ probability distributions measured using Kullback–Leibler divergence. “It closes 86.8\% of the teacher--student KL gap.”
- Kullback–Leibler divergence: A measure of how one probability distribution differs from another. “The soft prompt moves the student most of the way to the teacher”
- Layerwise prefix: A learned sequence of representations inserted into one or more transformer layers. “Adaptation can reside in weights, continuous inputs, layerwise prefixes, or hidden-state interventions”
- LoRA: Low-Rank Adaptation, a parameter-efficient method that trains low-rank updates to a frozen model. “A LoRA adapter, by contrast, adds computation to every layer at every decoding step.”
- Mixture-of-experts: A neural architecture containing multiple specialized submodels, with routing mechanisms that select among them. “include both dense and mixture-of-experts architectures”
- Multi-teacher on-policy distillation (MOPD): Distillation in which a student learns from multiple teachers while using student-generated trajectories or responses. “Multi-teacher on-policy distillation (MOPD) must retrain the student against all teachers.”
- Negative log-likelihood: A loss function equal to the negative logarithm of the probability assigned to the observed target sequence. “with a length-normalized negative log-likelihood over response tokens”
- On-policy distillation: Distillation based on trajectories or responses generated by the student’s current policy. “whereas on-policy methods supervise student-generated trajectories”
- Oracle routing: An idealized routing strategy that selects the appropriate expert with prior knowledge of the task domain. “which corresponds to an oracle router that sends each benchmark to its own domain expert.”
- Out-of-domain generalization: Performance on tasks or distributions different from those used during training. “We therefore evaluate the MCSI composition of all four prompts from Table~\ref{tab:compose} on six benchmarks outside its four training domains.”
- Parameter arithmetic: Combining model updates by mathematically adding or manipulating parameter differences. “Weight merging combines experts by parameter arithmetic”
- Prefix-robust training: Training a prompt with varied preceding contexts so that it remains effective when other prompts appear before it. “To prepare it for this, we use prefix-robust training”
- Prefill: The initial processing stage in autoregressive generation that computes representations for the input context. “It is processed once during prefill”
- Prompt distillation: Transferring a teacher’s behavior into a learned prompt while keeping the underlying model fixed. “We distill the expert into a soft prompt”
- Reinforcement-learning post-training: Improving a pretrained model through reinforcement-learning procedures after its initial training. “RL post-training typically produces domain experts”
- Sequence-level distillation: Distillation that trains on complete teacher-generated sequences rather than individual logits or tokens alone. “We use sequence-level distillation”
- Soft prompt: A trainable sequence of continuous vectors prepended to an input and optimized to alter a model’s behavior. “a sequence of vectors in the backbone's -dimensional embedding space.”
- Speculative decoding: A generation method in which a draft model proposes tokens that a larger model verifies. “Soft prompts also remain compatible with draft models trained on the backbone.”
- Task Arithmetic (TA): A model-merging technique that combines task-specific parameter updates using scalar coefficients. “We compare against expert weight merging through Task Arithmetic (TA)”
- Teacher–student KL divergence: The divergence between the output distributions of a teacher model and a student model. “Each model then reads the same answers, and at every response position we compare its next-token distribution with the teacher's.”
- Throughput: The amount of generated output processed per unit of time. “SP throughput stays within 1.5\% of the unadapted backbone”
- Verifier filtering: Selecting generated responses according to whether they satisfy an external correctness or reward verifier. “keep those that pass the verifier”
- Weight merging: Combining multiple model adaptations directly in the model’s parameter space. “Weight merging and multi-teacher on-policy distillation (MOPD) must re-consolidate the whole model”
- Zero-shot composition: Combining independently trained modules without additional joint training for their combination. “At inference, the prompts are composed directly by concatenating them in the system message, without any joint training.”




