Ruifeng Shi

Author directory

2026

Existing prompt optimization methods often improve prompts for a specific task or deployment setting, but their optimized prompts transfer poorly to new tasks and usually require re-optimization. We propose Prompting to Prompt (PTP), a framework that learns meta-templates as structured intermediate representations for reusable prompt construction. PTP decomposes prompts into transferable elements and optimizes them with LLM-generated textual gradients. Its inner loop refines task-specific prompts from natural-language feedback and an element list, while its outer loop abstracts structural changes across tasks to update the meta-template.The learned meta-template is then reused for task-level and query-level prompt generation, reducing the need to rerun full prompt optimization for each target setting. Experiments on six benchmarks show gains in both offline transfer and test-time deployment settings, with improvements up to 10.52 points on Arena-Hard.