I’ve been thinking a lot about abstractions lately. If we stay on this trajectory of increasingly capable machine intelligence, what’s left for humans to do?
We've been moving up the stack of abstractions - from prompt engineering to context engineering, to loops and harnesses and now .. evals? (maybe it was always context and evals?). We’ve gone from telling the agent exactly how to do the thing, to giving it what it needs to do the thing, to specifying what a good thing looks like. If we assume models improve at gathering their own context, designing their own harness, and building/running their own checks, then what is left?
The last rung on the ladder must be helping humans express what they actually want. A surprisingly difficult and underappreciated job.
This has been expressed in many different ways over the past twelve months. Satya Nadella [@satyanadella], for example, suggested that private benchmarks and evals might be “the most important IP a firm creates”.
Nadella also discusses private benchmarks in his 20VC interview.
In hindsight, I've spent an uncomfortably large chunk of the past two years building around increasing model capabilities and jaggedness, and not nearly enough time on the declarative part of the job - the ‘specifying what a good thing looks like’. Any framework, philosophy or way of working with LLM’s that doesn’t focus on the ‘what good looks like’, will be bitterly consumed by the tsunami of ever-increasing machine intelligence.
To be more specific:
1 - I’ve continually underestimated model capability improvements and spent way too much time over-engineering workflows, skills, harness, tools, etc, only to have to rip stuff out and rebuild around increasingly capable models
2 - At the same time, I’ve continually failed to predict where models will be jagged in production: they are still frustratingly janky on many real world tasks, and I think this will continue to be the case.
What is DSPy?
I was introduced to DSPy late last year, but I really didn’t get it. After revisiting over the past month, I now realise DSPy is a very good solution to the exact challenges mentioned above.
If you’re interested in learning more about DSPy, I highly recommend work by Drew Breunig [@dbreunig] and Mike Taylor [@hammer_mt].
This is from one of Drew’s DSPy tutorials.
“DSPy is an open-source software framework that lets us declaratively describe the goals of our program, rather than how it should accomplish the task. Think of DSPy as a higher-level language for AI programming, similar to Python compared to assembly. In Python we don't have to manage our memory, track our pointers, or handle register allocation. In DSPy we don't have to hand-craft our prompts, use weird context hacks, manually parse outputs, or manage the details of our test time strategy.” Drew also wrote about using DSPy with decision models and weight space optimisation .If you want a DSPy zero to one, Mike’s course is fantastic.
This is from the closing chapter of the book. I think this really nails the abstraction piece mentioned above.
“DSPy is hard because it doesn’t abstract away the hard part. Every other framework I’ve used is eager to hand you a one-liner that makes a prompt work well enough to ship. DSPy refuses. It asks you to write a Signature, collect examples, define a metric, and hand those things to an optimizer. Three of those four are annoying work. The fourth—the metric—is the hardest thing in the entire field of applied AI. People bounce off DSPy because they expect a framework to take that work away. It doesn’t. It takes away the other work: the endless prompt rewording, the hand-tuned few-shot examples, the string manipulation, the vibes-based QA. The work you enjoy doing that feels like real work and is actually just procrastination”.Omar Khattab [@lateinteraction] also gave a talk on DSPy and the Bitter Lesson.
Omar’s five core bets behind DSPy, also discussed in chapter 2 of Mike’s book:
- Information Flow is the single most key aspect of good AI software
- Interactions with LLMs should be Functional and Structured
- Inference Strategies should be Polymorphic Modules
- Specification of your AI software behavior should be decoupled from learning paradigms
- Natural Language Optimization is a powerful paradigm of learning
Email triage experiment
If you’re impatient like me, one of the best ways to learn DSPy is to just pick a repetitive task/skill/workflow where you’re confidently high-taste - ie. you have a strong opinion of what ‘good looks like’, and go for it.
I built an email triage agent.
Please note - this was just an experiment to help me better understand DSPy, decision models and some of the recent weight space work . You could improve the results significantly with more time labeling emails and tweaking each of the optimizers.Results.
I originally tested a more simple ‘needs a reply? yes/no’ routing. But all the models could do this reasonably well after optimization, so I extended to seven category routing:
- REPLY
- ACTION
- FINANCE
- KEEP
- NEWS
- PROMOTION
- REVIEW
I tested across two LiquidAI decision models and Qwen, all running on my mac.
And then optimised with the following:
- Lora Adapter
- Reanchor
- Gepa
- Weightspace
- Combine Gepa and weightspace
I connected DSPy to Codex through my subscription using a small adapter, so Codex did all the heavy optimizer lift. The three models did the actual sorting on my Mac.
Here are the results from that experiment.
* I had some issues with the final Qwen weight space runs, scores didn’t improve. I’m sure the Qwen weight space setup needs an edit (didn’t have time). Also, re the ReAnchor results: Omni labelled more emails as FINANCE or ACTION which helped on the training set, but on validation it sometimes turned correct labels into mistakes, e.g. flagging a news email as action. So score fell from 67% to 65%.Out of the box, none of the models really worked - d1-2B had the best score (52%) of labels correct. After tuning, d1-2B got 20 of those same 25 right. Almost good enough that I’d try it for a first pass through my inbox.
On 25 email validation set, d1-2B got 20 labels right (80%). Its five mistakes cost six penalty points , so its weighted score was 94 out of 100.Filing a newsletter under PROMOTION is a small mistake. Filing an email under NEWS when someone is waiting for my reply is much worse, so I scored mistakes differently. A missed reply or action cost 4 points, a false alarm cost 2, and any other wrong label cost 1.
How I ran the experiment
1. Set up the task
What do I need to do about this email? Each model sees the sender, subject and body as they were when the email arrived. In this made-up example, the organiser needs an answer, so I’d label it REPLY.
2. Define the signature
The DSPy signature puts that decision into code. The first three fields are the inputs. The last field tells the model to return one of the seven labels.
3. Build the classifier
pass the signature to dspy.Predict, attach the model I want to try and give it an email. I can swap the model and ask exactly the same question.
4. Load the labelled emails
I labelled 36 emails for training and used a separate 25 to compare changes. The final evaluation used 71 emails. Each row has the three things the model sees, plus the label I’d give it.
5. Decide what a mistake costs
Missing a reply costs 4 points. Raising a false alert on a paid receipt costs 2. Calling a required reply ACTION still flags the work, so it costs 1. I add the points up. Lower is better.
6. Establish the zero-shot baseline
I give all three models the same starting instructions and no examples. This tells me how well each one sorts the 25 development emails before I change anything.
7. Add examples to the prompt
I show each model a few training emails alongside their labels. This helped Qwen most. Six examples took it from 5 to 14 correct labels out of 25.
8. Compare two LoRA adapters
LoRA trains a small set of extra weights. The table above shows plain LoRA, which I trained to predict my labels. I also trained a version that gave more weight to costly mistakes. On d1-2B, that version got 18 labels right instead of 17 and cut the penalty from 12 to 9. On Qwen the second got two more labels right, but raised five false alerts instead of two.
9. Adjust the label scores with ReAnchor
The model already gives each label a score. ReAnchor learns a multiplier for each one from the training emails. Giving FINANCE a larger multiplier, for example, can tip a receipt from KEEP to FINANCE.
10. Rewrite the instructions with GEPA
GEPA uses feedback on the training mistakes to draft new instructions. I score each draft on the same 25 emails. On d1-2B, the seventh draft had the lowest penalty of the eight.
11. Try a weight edit with WeightSpace
I keep the starting prompt fixed and fit small weight changes on 25 of the training emails. I screen them on the other 11. Omni had no patch that qualified for the development comparison.
12. Combine GEPA and WeightSpace
I lock a GEPA prompt for each model, then fit new weight edits under those instructions. For d1-2B, testing one candidate per edit family raised the penalty from 8 to 12. Searching all 36 settings found a patch that lowered it to 6.
13. Time the classifiers on my Mac
With the starting prompt, Omni sorted 100 invented emails one at a time in 20 seconds on my M4 Mac. d1-2B took 97 seconds and Qwen took 165. Submitting all 100 together took longer for every model in this run.
14. Test the four finalists
I froze the four configurations and scored them on 38 earlier arrivals plus 33 new emails. All 19 emails that needed work were in the new group. On those 33, both d1-2B versions scored 11 points. The patch filed three more financial records correctly but missed one extra required reply. Its one-point lead overall came from the earlier arrivals.
I settled the final batch after reviewing model errors and checking what each email actually said. None of the 71 had REVIEW as its correct label.
References
Ben Thompson [@benthompson], An Interview with Microsoft CEO Satya Nadella About Finding Core Competencies
https://stratechery.com/2026/an-interview-with-microsoft-ceo-satya-nadella-about-finding-core-competencies/Rich Sutton [@RichardSSutton], The Bitter Lesson
http://www.incompleteideas.net/IncIdeas/BitterLesson.htmlDrew Breunig, Learn DSPy by Building a Deep Research Agent
https://www.cmpnd.ai/blog/learn-dspy-deep-research.htmlMike Taylor, Context Engineering with DSPy
https://www.oreilly.com/library/view/context-engineering-with/0642572261603/Omar Khattab, On Engineering AI Systems that Endure The Bitter Lesson
https://www.youtube.com/watch?v=qdmxApz3EJIRikiya Takehi [@rikiyatakehi] and colleagues, Sparks of Weight-Space Programming
https://rikiyat.github.io/blog/weight-space-programming/Lakshya A. Agrawal [@LakshyAAAgrawal] and colleagues, GEPA: Reflective Prompt Evolution Can Outperform Reinforcement Learning
https://arxiv.org/abs/2507.19457Drew Breunig, Weight-Space Programming with DSPy
https://www.cmpnd.ai/blog/weight-space-programming-dspy.html















