All posts
Cyan flowing lines transforming into geometric shapes and chevron arrows in blue and turquoise tones.

Stop Prompt Whispering: Why You Need to Engineer, Not Just Prompt, Your LLMs

TL;DR

Stop hand-crafting LLM prompts like it's an art. DSPy lets you program, compile, and optimize your prompts, turning prompt engineering into real engineering. This means more reliable, performant AI products and faster iteration for your teams.

Alright, let's cut through the noise. Every other day, there's a new AI model, a new benchmark, a new buzzword. My inbox is a graveyard of 'groundbreaking' announcements. But every now and then, something drops that truly makes you pause and say, “Okay, this changes things.” For me, that’s the shift we’re seeing in how we actually build with LLMs, specifically around prompt engineering. And frankly, if your team is still just ‘prompt whispering,’ you’re falling behind. Fast.

The Prompt Problem You Didn't Know You Had (Or Did You?)

For the past couple of years, building with LLMs has felt a lot like artisanal craftsmanship. You have a task: summarize this document, extract these entities, answer this question. So, what do you do? You start writing prompts. “Act as an expert summarizer…” “Extract the following fields in JSON format…” You test it, tweak it, add examples, try different phrasing. It’s an iterative, often frustrating, manual process.

And let me tell you, I’ve seen this play out in countless teams. We’d have ‘prompt whisperers’ – engineers who just had a knack for getting the LLM to behave. They were invaluable, but they were also a single point of failure. What happens when they leave? What happens when the model changes? Or when you need to adapt that prompt for a slightly different use case?

I remember one project where we spent weeks trying to get a specific data extraction task to hit a consistent accuracy target. Every time we thought we had it, a new edge case would break the prompt. The ‘fix’ was always another magic phrase, another example crammed in, another layer of complexity. It wasn't engineering; it was voodoo. And it was painfully slow.

The core issue is that our prompts were brittle. They weren't composable, testable, or optimizable in any systematic way. They were just strings, often long and complex, baked into our code. And that, my friends, is not how you build robust software.

Enter DSPy: Programming Your Prompts Like a Real Engineer

This is where tools like DSPy come in, and frankly, they're a game-changer. DSPy isn't just another library for sending requests to an LLM. It's a framework that fundamentally shifts how you interact with these models. It treats your LLM prompts – and the entire application logic – as a *program* that can be compiled and optimized, much like a traditional software program.

Conceptual How It Works

Think of it this way:

  1. Define Your Program (Logic, Not Prompts): Instead of writing a prompt for each step, you define a “program” made up of smaller, composable “modules.” Each module represents a specific LLM operation (e.g., “Generate a summary,” “Extract entities,” “Answer a question based on context”). Crucially, you tell DSPy *what* each module should do by defining its *input and output types* (a “signature”), not *how* it should do it via a prompt.
  2. The Optimizer (The “Compiler”): This is the magic. You give DSPy some examples of your desired input/output behavior for the overall task. Then, you use an “optimizer” (like a `BayesianSignatureOptimizer` or `BootstrapFewShot`) to “compile” your program. What does compilation mean here? It means DSPy automatically generates the *best possible prompts* for each module within your program, and even *tunes small language models (SLMs)* if you're using them, to achieve the desired output on your examples.
  3. Metrics (Your “Tests”): You define metrics to evaluate your program’s performance. DSPy uses these metrics during optimization to figure out which generated prompts (and potential model weights) are actually working best.

In essence, you focus on the *logic* of your LLM application – the sequence of steps and the desired inputs/outputs. DSPy handles the arduous, error-prone task of crafting the optimal natural language instructions (prompts) and even fine-tuning models to execute that logic efficiently and accurately. It’s like moving from writing assembly code directly to writing in a high-level language, and letting the compiler optimize the low-level details.

Why This Isn't Just Another Library; It's a Mindset Shift

This isn't about making prompt writing a bit easier. This is about transforming prompt engineering from an art into a repeatable, systematic, and optimizable engineering discipline. Here’s why it matters:

  • From Brittle Strings to Robust Code: Your LLM interactions become structured, testable components. You can debug them, refactor them, and version control them like any other piece of software.
  • Automated Optimization: No more endless manual tweaking. DSPy can automatically find the best prompts, often outperforming human-written ones, by iteratively testing and refining based on your defined metrics.
  • Portability and Maintainability: If you switch LLM providers or a model updates, your core program logic remains. DSPy can re-optimize your prompts for the new backend, saving you massive re-engineering effort.
  • Democratizing LLM Development: It lowers the barrier to entry. Junior engineers or even product managers can define the desired behavior, and DSPy helps translate that into high-performing LLM interactions, reducing the reliance on a few ‘prompt whisperers.’

Real-World Implications for Product and Engineering Teams

The impact of this approach on product and engineering teams is profound. I've seen teams get stuck for weeks, sometimes months, trying to iron out prompt inconsistencies. This kind of systematic approach addresses that head-on.

  • Faster Iteration and Shipping: When prompt optimization is automated, your iteration cycles shrink dramatically. You can test new ideas, deploy, measure, and refine much quicker. This directly translates to shipping better products faster.
  • Higher Quality, More Reliable AI Products: By systematically optimizing prompts against defined metrics, you build more consistent and accurate LLM-powered features. This reduces the “flakiness” that often plagues early AI products and builds user trust.
  • Reduced Technical Debt: Manual prompt engineering often leads to spaghetti code – hardcoded strings, magic numbers, and undocumented heuristics. A programmatic approach fosters cleaner architecture, making your LLM applications easier to maintain and scale.
  • Empowering Your Team: Your engineers can focus on solving core product problems and designing intelligent workflows, rather than spending cycles on trial-and-error prompt crafting. It shifts the value creation up the stack.

TPM Tip: Don't Just Adopt, Adapt.

When bringing new tools like DSPy into your stack, don't just dump it on your team. Provide clear guidelines, share best practices, and dedicate time for experimentation. The "how" you introduce and support it is as critical as the "what." Pilot it with a few projects, document the wins, and build internal champions. This isn't just a technical shift; it's a cultural one.

What This Means for Your Team

Alright, enough theory. Here are three concrete takeaways for your team, right now:

  1. Standardize Your LLM Development Pipeline: You need a systematic way to build, test, and deploy LLM-powered features. This means moving beyond ad-hoc prompt files. Explore frameworks like DSPy to bring structure and version control to your prompt management. Treat your prompts as compiled code, not just static configuration.
  2. Invest in Prompt Optimization Tools, Not Just Raw LLM APIs: The value isn’t just in accessing the latest LLM; it’s in how effectively you orchestrate and optimize its use. Allocate resources – engineering time, compute, and training – to integrate and leverage tools that automate prompt generation, testing, and optimization. This is where you’ll find your performance gains and competitive edge.
  3. Shift Your Hiring and Training Focus for LLM Engineers: The ‘prompt whisperer’ role is evolving. While intuition is always helpful, future LLM engineers need to be proficient in defining clear task logic, setting up robust evaluation metrics, and understanding how to leverage optimization frameworks. Encourage your team to think programmatically about LLM interactions, not just creatively.

Related: see MirrorCode and the Long-Horizon Problem: Why Week-Long Coding Tasks Are the Real AI Benchmark and Agentic Traffic Is Quietly Breaking Your Autoscaler — Here's Why.

What I'm Doing About This

For my teams at Google, this isn't just talk. We're actively exploring and piloting frameworks that enable this programmatic approach to LLM development. Specifically, I'm pushing for:

  • Internal DSPy Pilots: We're running focused pilots on a couple of internal tools where prompt reliability and performance are critical. The goal is to compare ‘artisanal’ prompt performance and development velocity against a DSPy-driven approach.
  • Establishing Prompt Metrics and Test Suites: We're defining clear, objective metrics for our LLM-powered features and building comprehensive test suites. No more ‘it feels good’ – we want data. This is foundational for any automated optimization.
  • Training and Knowledge Sharing: We're setting up internal workshops and documentation to educate teams on these new paradigms. It's about empowering everyone to move beyond basic API calls and embrace more sophisticated, engineering-driven approaches.

The days of treating LLM prompts as a black art are numbered. If you want to build truly robust, scalable, and high-performing AI products, you need to start engineering your prompts. It’s not just a nice-to-have; it’s a necessity.

Reactions

Keep reading

AI & TechnologyThe Real AI Bottleneck Isn't the Agents — It's the Wiring Between Them · 6 min AI & TechnologyAgentic Traffic Is Quietly Breaking Your Autoscaler — Here's Why · 6 min AI & TechnologyThe Autonomy Trap: Why AI Agents Going 'Auto Mode' Should Terrify (and Excite) Every TPM · 6 min

All posts