Prompt and Parameter Co-Optimization for Large Language Models

Xiaohe Bo, Rui Li, Zexu Sun, Quanyu Dai, Zeyu Zhang, Zihang Tian, Xu Chen, Zhenhua Dong

TL;DR

MetaTuner is a novel framework that breaks the traditional silo between prompt engineering and model fine-tuning. By jointly optimizing discrete prompts and continuous model parameters through a shared neural architecture, it unlocks synergistic performance gains that standalone methods miss, particularly in complex reasoning tasks.

The Problem: Isolated Optimization

To improve a Large Language Model (LLM), researchers typically take one of two paths: Prompt Optimization (finding the best instructions to guide a frozen model) or Fine-Tuning (updating the model’s internal weights to learn a specific task).

Studying these in isolation limits potential performance. Fine-tuning is highly sensitive to the prompts used during training—if the prompts are sub-optimal, the resulting model weights will be too. Conversely, prompt optimization is limited by the model's fixed internal knowledge. Until now, there hasn't been a unified way to let these two strategies interact during the learning process. The core challenge lies in their mathematical nature: prompts consist of discrete, non-differentiable tokens, while fine-tuning operates in a continuous parameter space.

The MetaTuner Framework

To bridge this gap, the authors introduce MetaTuner, a dual-branch framework designed for joint optimization.

The MetaTuner Framework

The architecture consists of three main components:

  1. The Meta Encoder: The first few layers of an LLM act as a shared foundation. It encodes the input query into a "hidden state" that contains the core knowledge needed for the task.
  2. Dual Decoders:
    • A Prompt Decoder takes the hidden state and generates a query-specific, natural language prompt.
  3. A Parameter Decoder (a hyper-network) uses the same hidden state to generate specific continuous parameters (like LoRA weights) for the downstream model.
  4. Supervised Regularization: To bridge the gap between discrete prompts and continuous weights without relying on messy approximations like Gumbel-Softmax, the authors use a supervised regularization loss. They leverage an "expert" dataset of successful prompts to provide direct signals to the prompt decoder, ensuring the generated instructions are genuinely helpful.

By sharing the Meta Encoder, the prompt and the parameters are forced to co-evolve, finding a "sweet spot" where the instructions and the model weights perfectly complement each other.

Key Insights and Performance

The framework was rigorously evaluated on benchmarks spanning mathematical reasoning (MATH, GSM8K), multi-hop QA (HotpotQA), and commonsense reasoning (CosmosQA) using base models like Qwen2.5, Llama 3, and Mistral-7B.

  • The Sensitivity of Fine-Tuning: Preliminary experiments confirmed that even powerful fine-tuning methods (like SFT) can perform worse than simple prompt optimization if the training prompts are poorly chosen, justifying the need for a unified approach.
  • Knowledge Sharing is Key: Prompts and parameters are essentially two different ways of expressing the same underlying task knowledge. Sharing the bottom encoding layers allows for "mutual regularization"—if one branch starts to overfit, the other helps pull it back.
  • The Capacity Trade-off:
Effect of Shared Decoder Layers

The authors discovered an interesting dynamic regarding model size and shared layers. Larger models (e.g., 7B) perform better when they have more "private" layers for specialization (peaking at 1/4 shared layers), whereas smaller models (e.g., 3B) benefit from more "shared" layers for stability (peaking at 3/4 shared layers).

Results

MetaTuner consistently outperformed standalone prompt optimization (like BPO or OPRO) and fine-tuning (like DPO or KTO). On the 7B model, MetaTuner achieved an average relative improvement of 10.15% over the previous state-of-the-art hybrid method. On the 3B model, that jump was even more significant at 17.08%. Furthermore, MetaTuner maintained its lead on Out-of-Distribution tasks, suggesting it learns robust, generalizable features rather than memorizing task-specific shortcuts.

Limitations and Future Work

While powerful, MetaTuner has areas for future refinement:

  • Reward Sparsity: The current system relies heavily on binary "correct/incorrect" signals. Moving toward more fine-grained rewards (like model uncertainty) could make training more efficient.
  • Inference Overhead & MoE: Generating a custom prompt and custom LoRA weights for every single query adds latency. To solve this efficiency problem, the authors propose a future direction using a Mixture of Experts (MoE) approach, where the model learns to route queries to a fixed pool of pre-optimized LoRA modules instead of generating them from scratch.

Summary updated

BibTeX
@inproceedings{bo2026prompt,
  author = {Xiaohe Bo and Rui Li and Zexu Sun and Quanyu Dai and Zeyu Zhang and Zihang Tian and Xu Chen and Zhenhua Dong},
  title = {{Prompt and Parameter Co-Optimization for Large Language Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=WPJnLvQrP3},
}
Figure