SCULPT: Systematic Tuning of Long Prompts

Shanu Kumar, Akhila Yesantarao Venkata, Shubhanshu Khandelwal, Bishal Santra, Parag Agrawal, Manish Gupta

TL;DR

SCULPT (Systematic Tuning of Long Prompts) is a novel framework designed to optimize long, complex LLM prompts by treating them as hierarchical tree structures rather than flat sequences of text. Using an iterative Critic-Actor framework, SCULPT applies targeted, localized updates to specific prompt components while preserving overall contextual integrity. This approach yields significant performance gains across diverse tasks, enhances robustness to prompt perturbations, and cuts computational optimization costs by 50% compared to existing state-of-the-art methods.

What Problem Does This Paper Address?

As LLM applications grow in complexity, prompts have evolved from simple one-liners into massive, structurally intricate documents. Modern production prompts often span hundreds or thousands of tokens, integrating layered instructions, edge-case guidelines, and few-shot examples.

While automatic prompt optimization methods like APE, OPRO, or ProTeGi excel at tweaking short prompts, they struggle with these longer documents due to two main limitations:

  1. Information Loss: Existing methods typically rewrite prompt candidates from scratch, token by token. For long prompts, this risks discarding crucial task constraints or expert domain knowledge present in the initial draft.
  2. Instability: LLMs exhibit highly non-convex and non-monotonic behavior when faced with minor structural changes. Small, unstructured perturbations in a long prompt can cause unpredictable performance drops.

To address this, the authors introduce a method that respects and preserves the macro-structure of a prompt while surgically refining only the problematic sections.

Methods

SCULPT redefines prompt optimization as a hierarchical tree refinement problem. The framework consists of four core components:

  • Prompt Structuring: The initial prompt is parsed (either directly via markdown formatting or inferred by an LLM) into a hierarchical tree structure where nodes represent distinct components like headings, body text, sub-instructions, and examples.
Figure 2: Illustration of SCULPT’s Prompt Structuring Process. Unstructured prompt is transformed into a hierarchical tree structure, with different colors represent various node types (e.g., heading, instructions, examples).
  • Critic Module: Instead of giving generic feedback, the Critic evaluates the prompt tree to generate Structural Reflections (assessing overall clarity and redundancy) and Error Reflections (identifying specific nodes that caused the LLM to make incorrect predictions on a training batch).
  • Aggregation of Reflections: To prevent the model from overfitting to individual training errors, SCULPT groups and merges reflections affecting the same nodes before passing them to the actor.
  • Actor Module: The Actor operates strictly on an induced subtree containing only the nodes marked for modification. It selects targeted actions from a predefined expert-inspired menu—such as Structural Reordering, Instruction Update, Example Addition/Deletion, or Node Pruning—and updates the tree accordingly.

The entire workflow is managed via a beam search strategy, utilizing an Upper Confidence Bound (UCB) bandit algorithm to efficiently balance the exploration of new prompt variations with the exploitation of high-performing candidates without wasting API tokens.

Datasets

The authors evaluated SCULPT across a diverse suite of long-prompt tasks (averaging 1,000 words, with a maximum length of 2,644 words):

  • Big-Bench Hard (BBH): Causal Judgement, Disambiguation QA, Formal Fallacies, and Salient Translation Error Detection.
  • Responsible AI (RAI): Inappropriate Content, Hate Speech, Misinformation, and Suicidal Ideation/Drug Use Detection.
  • Multi-label Classification: GoEmotions (28 emotion categories) and BeaverTails (14 harm types).
  • Generalization Tasks: Short-prompt benchmarks (Object Counting, Odd One Out, Sentiment Classification) and an open-ended generative task (CNN/DailyMail summarization).

Key Insights and Ideas

  • Surgical vs. Wholesale Edits: By treating the prompt as a tree, SCULPT can fix a broken few-shot example or clarify a single sub-instruction without altering the rest of a 2,000-word prompt. This keeps the core task intent perfectly intact.
  • The Danger of Content Bloat: The authors found that unstructured baseline methods like ProTeGi frequently suffer from an "add-only" bias, trying to fix errors by constantly piling on new instructions and examples, which leads to overfitting. SCULPT maintains a balanced action distribution, actively pruning and merging nodes to keep prompts concise and generalizable.
  • API Cost Efficiency: Because SCULPT refines existing subtrees rather than generating massive prompts from scratch, it avoids the combinatorial explosion of input tokens during optimization, making it highly practical for production budgets.

Key Results

  • Performance Gains: SCULPT consistently outperformed all baselines across both GPT-4o and Llama-3.1-8B. Notably, it achieved absolute performance jumps exceeding 10% on highly complex multi-label tasks like GoEmotions and BeaverTails.
  • Robustness to Perturbations: When tested against adversarial prompt degradations (e.g., misspelling 20% of words, swapping example labels, or injecting multilingual noise), SCULPT successfully recovered performance where other methods degraded sharply.
  • Information Preservation: Qualitative analysis demonstrated that SCULPT maintains high textual similarity and low semiotic dissimilarity compared to the initial prompt, ensuring that refinements remain controlled and meaningful.
Comparison of Textual Similarity, Semiotic Dissimilarity, and Information Preservation
  • Token & Cost Savings: SCULPT proved to be dramatically more cost-efficient than iterative feedback baselines, reducing total token usage and financial costs by approximately 50% compared to ProTeGi.

Limitations and Future Work

  • LLM Scope: The evaluation was restricted to two primary models (GPT-4o and Llama-3.1-8B). Testing across a wider variety of open-source architectures remains future work.
  • Language Constraints: SCULPT was only evaluated on English-language prompts. Extending the tree-parsing and critique mechanisms to multilingual prompts is an open challenge.
  • Lack of Historical Trajectory Memory: The framework optimizes step-by-step but does not explicitly leverage the history of past optimization trajectories to dynamically adjust its strategy. Integrating reinforcement learning or memory-based mechanisms could further improve efficiency.

Summary updated

BibTeX
@inproceedings{kumar2025sculpt,
  author = {Shanu Kumar and Akhila Yesantarao Venkata and Shubhanshu Khandelwal and Bishal Santra and Parag Agrawal and Manish Gupta},
  title = {{SCULPT: Systematic Tuning of Long Prompts}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=hCEFttUDZ0},
}
Figure