Beyond Prompt or Skill? Attribution-Guided Optimization of Modular LLM Programs
Organizations: School of Science and Engineering, The Chinese University of Hong Kong, Shenzhen 518172, China · Shenzhen Future Network of Intelligence Institute (FNii-Shenzhen) · Sun Yat-sen University
Abstract
Large language models can solve increasingly diverse reasoning tasks, yet their performance remains highly sensitive to task prompts, intermediate instructions, and the way reusable problem-solving knowledge is incorporated. Existing optimization methods usually focus on only one part of this design space: they either optimize a monolithic prompt, or separately induce and refine skills from model traces. As a result, they lack a principled mechanism for deciding which component should be updated when failures occur, and they rarely optimize prompts, skills, and skill-use policies in a unified framework. We propose SPARO (Skill, Prompt, And Routing Optimization), a framework that jointly optimizes task instructions, reusable skill blocks, and routing rules. It performs controlled counterfactual evaluations, converts examples' effects into a probabilistic responsibility distribution over prompt, skill, and routing components, samples one component from that distribution, and applies the corresponding targeted mutation. This design moves language-program optimization beyond global prompt rewriting toward structured, reusable, and selectively activated task knowledge. Across five benchmarks and five worker models, SPARO consistently outperforms both prompt-centered and skill-centered optimization baselines. These results suggest that effective language-program optimization depends not only on discovering useful task knowledge, but also on deciding where that knowledge should be stored and when it should be activated.
Figures & tables
| Model | Method | Prompt | Skill | Route | FinQA | CLUTRR | ChartQA | ProofWriter | SearchQA |
| Qwen3.5-4B | OPRO | ✓ | ✗ | ✗ | 16.50 | 30.10 | 81.20 | 52.30 | 73.00 |
| TextGrad | ✓ | ✗ | ✗ | 19.90 ↑3.40 | 31.10 ↑1.00 | 80.20 ↓1.00 | 73.20 ↑20.90 | 73.43 ↑0.43 | |
| GEPA | ✓ | ✗ | ✗ | 35.60 ↑19.10 | 28.00 ↓2.10 | 77.90 ↓3.30 | 54.00 ↑1.70 | 72.90 ↓0.10 | |
| aPSF | ✓ | ✗ | ✗ | 31.70 ↑15.20 | 32.30 ↑2.20 | 81.90 ↑0.70 | 60.90 ↑8.60 | 72.00 ↓1.00 | |
| Trace2Skill | ✗ | ✓ | ✗ | 28.00 ↑11.50 | 65.20 ↑35.10 | 81.80 ↑0.60 | 71.40 ↑19.10 | 69.93 ↓3.07 | |
| SkillOpt | ✗ | ✓ | ✗ | 37.00 ↑20.50 | 62.40 ↑32.30 | 82.30 ↑1.10 | 75.40 ↑23.10 | 74.00 ↑1.00 |
| CLUTRR | ProofWriter | |
| w/o Attribution | 28.2 | 83.1 |
| w/o Skill | 31.2 | 77.1 |
| w/o Cross-Round Memory | 62.9 | 80.7 |
| w/o Routing | 49.7 | 75.5 |
| Sparo (Ours) | 69.0 | 84.7 |
Large Language Model-Guided Optimization
Large Language Model-Guided Optimization uses language models to propose, steer, and refine solutions to hard search and design problems.
See all 613 papers