← Latest papers
💬 NLP

Making Prompts First-Class Citizens for Adaptive LLM Pipelines

This paper introduces SPEAR, a framework that treats prompts as first-class citizens to enable structured management, dynamic runtime refinement based on feedback, and policy-driven control, thereby overcoming the limitations of brittle, opaque prompts in modern LLM pipelines.

Original authors: Ugur Cetintemel, Shu Chen, Alexander W. Lee, Deepti Raghavan, Duo Lu, Andrew Crotty

Published 2026-04-07
📖 4 min read☕ Coffee break read

Original authors: Ugur Cetintemel, Shu Chen, Alexander W. Lee, Deepti Raghavan, Duo Lu, Andrew Crotty

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a chef running a very busy, high-tech kitchen. In this kitchen, the "chefs" are Artificial Intelligence (AI) models, and the "recipes" they follow are called prompts.

Right now, most AI kitchens operate with a broken system. The recipes are written on sticky notes that are taped to the wall. They are messy, hard to read, and if the food tastes bad, the chef has to stop, peel the sticky note off, rewrite it by hand, and tape it back up. Worse, the kitchen manager (the computer program) can't see the recipe; it just sees a black box. It doesn't know why the chef made a mistake, so it can't fix the recipe automatically.

This paper introduces a new system called SPEAR (Structured Prompt Execution and Adaptive Refinement). It wants to turn those messy sticky notes into living, breathing digital cookbooks that the kitchen manager can read, edit, and optimize in real-time.

Here is how SPEAR works, broken down into three simple ideas:

1. Prompts as "Living Recipes" (Structured Management)

The Old Way: Prompts are just long strings of text. If you want to change a recipe for "soup," you have to rewrite the whole thing. You can't easily reuse the "chopping vegetables" part of the soup recipe for the "salad" recipe.
The SPEAR Way: SPEAR treats prompts like modular LEGO blocks.

  • Instead of one giant recipe, you build a "Soup View" that says: Take the "Chopping Block," add the "Boiling Block," and then add the "Seasoning Block."
  • If you want to change the seasoning, you just swap out the "Seasoning Block." You don't have to rebuild the whole soup.
  • Because these blocks are saved in a library, you can see exactly how the recipe changed over time (version control), just like tracking changes in a Google Doc.

2. The Recipe That Fixes Itself (Adaptive Refinement)

The Old Way: If the AI chef burns the soup, the human has to go in, stop the process, and manually rewrite the recipe to say, "Don't burn the soup next time." This is slow and happens after the mistake.
The SPEAR Way: The recipe is alive. It can watch itself while it cooks.

  • If the AI chef starts to burn the soup, the recipe can instantly say, "Oh, the heat is too high! Let me add a step to lower the temperature."
  • It can also say, "I'm not sure about this ingredient; let me ask a senior chef (a bigger AI model) for help."
  • This happens while the work is being done, not after. The system adapts on the fly.

3. The "If-Then" Rulebook (Policy-Driven Control)

The Old Way: The kitchen manager has no rules. It just hopes the chef does a good job.
The SPEAR Way: You can write a simple rulebook for the kitchen manager:

  • Rule: IF the customer is a VIP (Input Condition), THEN use the "Premium Recipe."
  • Rule: IF the chef takes too long to cook (Output Condition), THEN switch to a faster, simpler recipe.
  • Rule: IF the chef seems confused (Runtime Feedback), THEN ask for a second opinion.

This rulebook allows the system to make smart decisions automatically without a human needing to press a button every time something changes.

Why Does This Matter? (The Results)

The authors tested this system using a medical example: asking an AI to summarize a patient's medication history.

  • Without SPEAR: The AI often forgot details or gave messy answers. Fixing it required hours of manual tweaking.
  • With SPEAR: The system realized, "Hey, this question is easy; let's use a small, fast, cheap AI." But if the question was hard, it said, "This is tricky; let's switch to a big, smart, expensive AI."
  • The Result: They got the same high-quality answers as the expensive AI, but for half the cost and much faster.

The Big Picture

Think of SPEAR as upgrading from a paper map to a GPS navigation system.

  • Paper Map (Current AI): Static. If you take a wrong turn, you have to stop, unfold the map, and figure out a new route manually.
  • GPS (SPEAR): Dynamic. It knows where you are, sees traffic ahead, and instantly reroutes you to the best path, all while you are driving.

By making prompts "first-class citizens" (meaning they are treated as important, manageable data rather than just text), SPEAR makes AI pipelines smarter, cheaper, and much easier for humans to manage.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →