https://www.boundaryml.com logo
🟡 Query about DSPy vs BAML prompt optimization
# questions
r
I love BAML but people keep telling me to try DSPy because you don’t have to prompt and it fine tunes your prompts using an LLM. Is fine tuning a likely feature of BAML? I don’t mind writing my own prompt but if they start to be AI optimized I’d want to do that too.
v
I would say prompt optimizers on top of BAML are quite likely. we have contemplated something to help people navigate BAML syntax trees, so then a user could use smoething like dspy to create better prompts. Our priority here has been slightly lower, because most AI prompts I see don't actually yield good results. They are verbose and often too derivative. That said I do think they will get there within the next 12-18 months, so likely we'll have a solution well before then!
r
Cool
Seems like BAML’s prompt approach is superior, but the combination of prompt instruction tuning and BAML could achieve next level results. I appreciate the fact you’re developing on Rust for three platforms though, you can’t just build it quickly in Python.
If prompts become optimized, you’ll have to optimize prompts before a year from now, because people will stop writing their prompts.
p
Yeah, I think the timeline towards which prompts can be well-optimized is greatly accelerated since the GEPA paper came about. It's really amazing and I find it hard to imagine a future 6 months from now where I want to be writing prompts by hand at the start of any project. https://arxiv.org/abs/2507.19457
The 12-18 months timeline seems a little too lax imo @Vaibhav (BAML 🐑) 😅
The paper's key findings are that prompts matter WAY more than people realized, and that there's SO much that can be done by hybrid (gradient-based + gradient free optimization algorithms) to discover the best prompts not just for single-prompt workflows, but complex, multi-prompt workflows too.
And rather than hoping for that one magic prompt that can solve a complex task, this GEPA approach settles on a population of optimal prompts (enclosed in their respective modules) - that then together produce the best outcome. It's a really clever combination of prior techniques, and when wrapped inside DSPy's usability features, it becomes a superpower
r
Graph machine learning using LLMs uses gradient descent optimized, unreadable text node representations... you don't even need language to best prompt an LLM. That's how much prompts can be optimized.
We tend to underestimate how much the strong language priors learned by LLMs can actually help rather than collapsing them into scalars and learning from those instead
GEPA is revolutionary because it introduces the idea of "coarse tuning", where you don't rely on gradients (which can end up in local optima), but instead you search much further in the prompt space using a population of genetic variants. Classic genetic optimization that's been around for decades. And from the pareto front, you get a population of optimal prompts that are each best at that module's task. When these modules are all combined into a single larger composite module, you benefit from using a population of optimal prompts, each selected for in every population that was sampled during training.
It's totally different from 2024 research where people were saying "text-based prompting sucks". On the contrary, LLMs have become so good at interpreting text that we should build optimizers that specialize in exploiting those priors, instead.