MoPrO-SD: Modular Prompt Optimization for Stance Detection
Organizations: Kansas State University · University of Illinois Chicago
Abstract
Stance detection remains challenging for large language models (LLMs) due to implicit opinions, sarcasm, and context-dependent expressions of stance. Although automatic prompt optimization offers an alternative to fine-tuning without updating model parameters, existing structured approaches are not specifically designed around stance-label semantics and class-specific ambiguities. We introduce MoPrO-SD, a stance-specific prompt optimization framework that decomposes prompts into functional semantic modules and refines them sequentially using LLM-based feedback. We study three refinement strategies: instruction-only optimization (I), instruction with reasoning (I+R), and instruction with per-example reasoning (I+R+E), using class-conditioned errors for stance-label refinement. We also introduce VaccineStance, a new human-annotated benchmark for vaccine stance detection. Experiments across four datasets and five open-weight LLMs show that MoPrO-SD improves upon the human-written Base prompt in many settings. On SemEval-2016, class-conditioned feedback achieves higher mean Macro-F1 than pooled feedback for four of five backbones. Both reasoning-based strategies, I+R and I+R+E, achieve strong performance, with their relative effectiveness varying across models and datasets, while remaining competitive with recent prompt optimization methods. The MoPrO-SD code and VaccineStance dataset are available on GitHub.
Figures & tables
| Dataset | Method | Phi | GPT-OSS | Mistral | Gemma | Llama |
|---|---|---|---|---|---|---|
| SemEval | Base (zero-shot) | 55.37 0.12 | 60.02 0.44 | 53.90 0.28 | 65.82 0.20 | 73.52 0.14 |
| Base+CoT | 66.60 0.74 | 57.90 0.87 | 67.06 0.25 | 67.45 0.43 | 71.77 0.30 | |
| Base+FS | 57.90 1.48 | 62.17 0.79 | 64.69 0.35 | 69.30 0.05 | 72.28 0.11 | |
| Base+CoT+FS | 64.85 0.44 | 59.89 0.28 | 67.32 0.56 | 66.98 0.11 | 70.41 0.12 | |
| Base+CoS | 53.40 0.81 | 60.18 1.67 | 63.94 0.37 | 59.92 2.12 | 62.96 1.45 | |
| OPRO | 67.49 0.74 | 66.59 0.94 | 56.61 3.19 | 64.76 1.39 | 73.45 0.27 |
| Method | Mistral | Gemma | Llama |
|---|---|---|---|
| UniPrompt (Original Init.) | |||
| UniPrompt (Shared Init.) | |||
| SCULPT | |||
| I+R+E (Ours) |
| GPT-5 vs. Same LLM ( Macro-F1) | |||||
|---|---|---|---|---|---|
| Dataset | Phi | GPT-OSS | Mistral | Gemma | Llama |
| SemEval | +0.48 | +0.25 | 5.82 | +2.23 | +1.68 |
| GunStance | +1.87 | 1.56 | 0.87 | +2.78 | +9.42 |
| COVID-19 | +0.10 | +0.07 | +1.04 | +8.44 | +9.23 |
| VaccineStance | +2.27 | +1.02 | +3.66 | +11.64 | +8.55 |
| Method | Calls | In. | Out. | Total | Rel. |
|---|---|---|---|---|---|
| Base | 1,249 | 768.9K | 4.4K | 773.4K | 1.00 |
| Base+FS | 1,249 | 1.14M | 4.3K | 1.14M | 1.48 |
| Base+CoT | 2,521 | 1.85M | 423.4K | 2.27M | 2.94 |
| Base+CoT+FS | 2,520 | 2.60M | 420.8K | 3.02M | 3.91 |
| SCULPT | 9,680 | 6.08M | 306.5K | 6.38M | 8.26 |
| I+R+E (FP-5) | 7,851 | 6.25M | 133.8K | 6.39M | 8.26 |
| Method | Phi | GPT-OSS | Mistral | Gemma | Llama |
|---|---|---|---|---|---|
| Base | 55.37 0.12 | 60.02 0.44 | 53.90 0.28 | 65.82 0.20 | 73.52 0.14 |
| I+R+E (Full Prompt, 5 iter.) | 65.69 1.88 | 65.46 0.62 | 67.02 1.08 | 70.82 0.39 | 74.03 0.83 |
| I+R+E (Full Prompt, Best-Only Memory, 10 iter.) | 66.67 0.76 | 65.10 0.94 | 67.63 0.61 | 70.53 0.58 | 74.73 0.77 |
| I+R+E (Modular, 10 iter.) | 68.63 0.53 | 66.10 1.14 | 71.12 0.85 | 69.68 1.14 | 74.78 0.38 |
| Routing | Phi | GPT | Mistral | Gemma | Llama |
|---|---|---|---|---|---|
| Pooled | |||||
| Class-conditioned |
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | Target | Train | Valid | Test | Total |
|---|---|---|---|---|---|
| COVID-19-Stance | Anthony Fauci | 1,464 | 200 | 200 | 1,864 |
| Face Masks | 1,307 | 200 | 200 | 1,707 | |
| School Closures | 790 | 200 | 200 | 1,190 | |
| Stay at Home Orders | 972 | 200 | 200 | 1,372 | |
| Total | 4,533 | 800 | 800 | 6,133 | |
| GunStance | Guns Should Be Banned | 900 | 900 | 900 | 2,700 |
| Split | Favor | Against | Neutral | Total |
|---|---|---|---|---|
| Train | 159 | 103 | 238 | 500 |
| Validation | 169 | 102 | 229 | 500 |
| Test | 396 | 259 | 345 | 1,000 |
| Total | 724 | 464 | 812 | 2,000 |
| Model | ||||||
|---|---|---|---|---|---|---|
| Target | Method | Phi | GPT-OSS | Mistral | Gemma | Llama |
| Atheism | Base | 37.88 1.41 | 42.71 0.96 | 20.15 0.98 | 60.48 0.22 | 63.74 1.36 |
| Base+CoT | 64.11 0.56 | 33.65 1.53 | 55.71 0.50 | 63.34 0.74 | 64.09 0.34 | |
| Base+FS | 45.92 2.87 | 52.47 1.98 | 51.08 0.97 | 65.84 0.03 | 72.25 0.23 | |
| Base+CoT+FS | 66.17 0.57 | 44.94 1.62 | 59.68 1.61 | 61.99 0.04 | 68.84 0.56 | |
| Base+CoS | 51.23 1.34 | 55.08 3.22 | 56.77 2.57 | 58.10 0.93 | 64.56 1.80 | |
| Target | Method | Phi | GPT-OSS | Mistral | Gemma | Llama |
|---|---|---|---|---|---|---|
| Guns should be banned | Base | 39.84 1.92 | 57.53 0.81 | 53.75 0.56 | 43.49 0.23 | 52.17 0.50 |
| Base+CoT | 60.73 1.24 | 57.26 1.20 | 54.44 0.43 | 49.46 0.08 | 54.66 0.81 | |
| Base+FS | 51.99 2.07 | 58.69 0.70 | 62.86 0.13 | 57.18 0.14 | 53.61 0.29 | |
| Base+CoT+FS | 59.92 0.53 | 56.41 0.76 | 58.77 0.58 | 62.44 0.08 | 55.84 1.10 | |
| Base+CoS | 42.52 1.06 | 50.39 1.50 | 62.19 1.11 | 57.98 0.49 | 46.87 0.63 | |
| OPRO | 54.13 3.03 | 56.74 3.02 | 54.09 0.62 | 42.60 0.71 | 52.14 0.84 |
| Target | Method | Phi | GPT-OSS | Mistral | Gemma | Llama |
|---|---|---|---|---|---|---|
| Anthony Fauci | Base | 57.47 1.84 | 70.76 3.03 | 72.65 0.13 | 58.08 0.43 | 70.91 0.33 |
| Base+CoT | 66.75 0.46 | 73.35 1.36 | 73.71 0.83 | 61.95 1.35 | 69.71 0.42 | |
| Base+FS | 63.23 2.49 | 73.28 0.96 | 75.20 0.77 | 64.53 0.34 | 73.28 0.50 | |
| Base+CoT+FS | 63.29 0.86 | 74.83 0.84 | 70.62 0.63 | 67.22 0.54 | 71.31 1.10 | |
| Base+CoS | 53.62 2.26 | 52.93 0.69 | 62.66 1.01 | 57.88 3.59 | 60.67 3.26 | |
| OPRO | 70.12 0.32 | 69.48 2.32 | 72.61 2.42 | 59.12 0.50 | 69.39 0.49 |
| Dataset | Reasoner | Phi | GPT-OSS | Mistral | Gemma | Llama |
|---|---|---|---|---|---|---|
| SemEval | I+R+E (Same) | 68.63 0.53 | 66.10 1.14 | 71.12 0.85 | 69.68 1.14 | 74.78 0.38 |
| I+R+E (GPT-5) | 69.11 0.26 | 66.35 1.17 | 65.30 2.46 | 71.91 1.21 | 76.46 0.27 | |
| GunStance | I+R+E (Same) | 59.74 0.26 | 62.12 1.76 | 65.01 2.18 | 60.21 1.84 | 59.03 3.58 |
| I+R+E (GPT-5) | 61.61 1.40 | 60.56 0.04 | 64.14 1.08 | 62.99 1.34 | 68.45 1.75 | |
| COVID-19-Stance | I+R+E (Same) | 69.97 2.43 | 71.14 1.89 | 78.03 2.24 | 69.55 1.96 | 73.58 3.29 |
| I+R+E (GPT-5) | 70.07 1.07 | 71.21 0.57 | 79.07 0.26 | 77.99 0.17 | 82.81 0.10 |
Stance Detection
Stance detection identifies whether people support, oppose, or remain neutral toward a target, claim, or position in text and conversation.
See all 36 papers