
Josselin Perrus retweeted
Wow! Just finished "Messy Jobs" by @lugaricano, Jin Li and Yanhui Wu, and I've been recommending it to everyone around me since.
It's about AI, jobs and the future economy and society
Here's the core of the book and my notes in 15 cards as a primer but you should totally read the whole thing 🧵
Josselin Perrus retweeted
maybe a hot take but i now consider adversarial reviews mostly a waste of tokens. far better to use those tokens on empirical combined with formal verification. i have updated pstack to use the interrogate skill less, and eventually i think i may remove it altogether
i have found very little value with code review in the abstract, agents tend to just get lost in the nitpicks and yagnis
Josselin Perrus retweeted
Evals are the most underrated skill in AI engineering.
1. Start with error analysis, not metrics
Sample 100+ production traces. Annotate each failure in free text (open coding), then cluster them into failure categories (axial coding). Count frequency per category. Your top 3 categories are your first metrics.
2. Build a versioned golden dataset
Store inputs, expected outputs or rubrics, and metadata (intent, difficulty, user segment) in a versioned dataset. Stratify it so rare but critical cases aren't drowned out by easy ones. Version it alongside your prompts so every score is reproducible.
3. Generate synthetic data along explicit dimensions
Don't just ask an LLM for "test questions." Define dimensions (persona × intent × complexity × edge case), generate combinations as tuples, then turn each tuple into a natural input. You get coverage instead of 200 near-identical examples.
4. Deterministic assertions first
JSON schema validation, regex checks, required fields, length limits, code execution, SQL that actually runs against a test DB. These are cheap, fast, and have zero variance. Reserve model-based grading for what code genuinely can't check.
5. Evaluate retrieval separately from generation
For RAG, measure retrieval with recall@k, MRR, or nDCG against labeled relevant chunks. Measure generation with faithfulness (is every claim supported by retrieved context?). If you only score the final answer, you can't tell which half is broken.
6. Trajectory evals for agents
Log every step: tool name, arguments, result, tokens. Score tool-call precision and recall against a reference path, argument correctness, step count, and error recovery. An agent that reaches the right answer in 14 calls when 3 would do is a cost and latency bug.
7. pass@k vs pass^k
pass@k = succeeded at least once in k runs. pass^k = succeeded in all k runs. At 80% per-run success, pass^5 drops to roughly 33%. Production reliability lives in pass^k, so run each case multiple times at your real temperature.
8. Simulated users for multi-turn
Give an LLM a persona, a hidden goal, and constraints, then let it converse with your system until the goal is met or a turn limit hits. Grade goal completion, turns-to-resolution, and policy violations. Single-turn evals miss most state and memory bugs.
9. Align your LLM judge like a classifier
Hand-label 100+ examples as pass/fail. Split into train/dev/test. Iterate on the judge prompt using dev, then report TPR and TNR on test. Use binary outputs with a written rubric, require a short critique before the verdict, and pin the judge model version.
10. Control judge bias in pairwise comparisons
LLM judges have position bias and often prefer longer answers. Run every A/B comparison twice with swapped order and only count consistent verdicts. Normalize or cap length if verbosity is skewing results.
11. Respect statistics
With 100 examples at 80% accuracy, your 95% confidence interval is about ±8 points. A jump from 80% to 83% is probably noise. Use bootstrapped confidence intervals, or a paired test on the same examples, before declaring a win.
12. Gate deploys in CI
Run the eval suite on every PR that touches prompts, models, tools, or retrieval config. Set per-category thresholds instead of one global score, so a big win in one area can't hide a regression in another. Fail the build on a regression.
13. Online evals in production
Sample a percentage of live traffic, run your judges asynchronously, and alert on drift per failure category. Use shadow deployments to run a new prompt or model on real traffic without showing users the output.
14. Make cost and latency first-class metrics
Track tokens per request, cost per successful task (not per call), and p50/p95 latency next to quality. A change that keeps quality flat while cutting cost 40% is a real win and deserves to ship.
15. Close the loop
Every production failure becomes a new labeled test case. Every new model release gets run against the full suite before anyone debates switching. Over time your eval set becomes the most valuable asset in the codebase.
Prompts are disposable. Models get replaced every few months.
Your eval infrastructure is what compounds.
Josselin Perrus retweeted
"Trait-driven development"
I'm no longer really operating directly on code.
Instead, I create traits which operate on the code + ensure agents never need the same feedback twice.
Josselin Perrus retweeted
Stop doomscrolling Jev takes. Here’s the map.
Every use case I could find, MECE’d into six pillars — Workflow, Bulk, Realtime, Verify, Harness, Voice.
Paste a link. Jev grades it against the live map. Truly new → auto-merges as a leaf.
galigutta.github.io/jev-use-…
Josselin Perrus retweeted
speed will change UX so much more than intelligence
intelligence matters but the biggest blocker right now for jumps in UX like in this video are speed
I am really stoked about Jev we’re going to see soooo much cool stuff, so fast
Josselin Perrus retweeted
It's also a much more effective way to improve the system rather than keep adding more and more to your system prompt. It's much nicer working in the continuous space for improvements with gradient descent, rather than in the discrete lexical space.
Josselin Perrus retweeted
6 months ago: laptop open all day, typing into Claude Code, waiting.
Today: I write a spec, go to the gym, and my phone only pings when an agent needs a decision. 95% of my work runs itself.
Full breakdown so you can build your own 👇
Josselin Perrus retweeted
the problem with "spec driven development" is that most software can't be spec'd up front
software is a creative act, where you figure out what you're building as you build it
you need to get your hands dirty in the details, and react to incremental versions
it's telling that all the examples of spec driven development are sorting a list or porting thoroughly tested code (like a js runtime or browser engine), which are the exception, not the rule. the vast majority of software doesn't have a spec – or if it does, the spec was created *after*
Josselin Perrus retweeted
Hot take: I think it's still important to understand the code that our agents write!
In this mega thread (based on my AIE talk today), I will explain why that's the case, and show some ideas for how to efficiently understand code. Alright, let's dive in. 1/
Josselin Perrus retweeted
I feel what these results (@mattjustram) mainly show is NOT that retrievers like BM25 are better than previously thought, NOT that GPT 5.5 is amazing at search orchestration, but rather that scaffolds matter a lot in search (and should be reported).
Pi-serini is one of the first non-trivial search specific efforts to give some proper tooling to LLMs (cached results, well defined tool calls) and smashes the baseline with the same retriever and baseline model. @antoine_chaffin 's results with/without the "get_document" tool also vastly differ: purely scaffolding. CC and Codex are good scaffolds by design and also perform very well at search as shown here (although they are not built specifically for this).
What does this mean:
Biggest low hanging fruits right now in search probably aren't through better embedding models (or even better baseline LLMs) but smart scaffolding paradigms (think RLMs @a1zhang, Pi-serini @lintool, Deep Research systems @din0s_ ).
As LLMs get better, I would expect inductive biases cooked in the scaffolds to become less important than now. However, scaffolds will still need to be expressive enough to let the baseline model "cook" and still need to encode what matters to the end user (speed matters a lot, search is not just accuracy).
Importantly, I believe scaffolds are not an inference time thing only, but should serve during document indexing. To properly contextualize documents in a corpus, we need to move away from the "1 paragraph/webpage is 1 document" concept and use agents to properly map the corpus space, and leverage their priors to index then retrieve. Test time compute scaling is not reserved to querying agents!
Just a few thoughts on recent results, this direction will be well aided by novel datasets like @dianetc_ 's Obliq-Bench which will necessarily require a change in paradigms, the easiest surely being around scaffolding.
i’ve been playing around with flue, and have been really enjoying it
i’ve created a visual guide, let me know what you think
momito.co.uk/flue/?2
Josselin Perrus retweeted
Fun interactive science app ideas | Part 3
Played around with generating 3D biological structures and made an app to explore them interactively
UI Design
GPT Images 2
Code
Gemini 3.1 Pro
More demos ↓
Josselin Perrus retweeted
how did we make deepseek outperform opus 4.7?
i've been thinking about why "open model bad at tool calling" is almost always a harness problem, not a model problem.
context: spent the two days looking at billions of tokens in @CommandCodeAI (tb open source ai cli) using deepseek. I ended up writing a tool-input repair layer. the trigger was watching deepseek-flash fail on the simplest /review run, every shellCommand and readFile call bouncing back with a raw zod issues blob, the model unable to recover because the error wasn't in a form it could read. by the end deepseek v4 pro was beating opus 4.7 6/10 times on our internal evals.
a few things i learned that feel general:
1/ the failure modes aren't random they're a small finite compositional set.
across deepseek-flash, deepseek v4 pro, glm, qwen, the same four mistakes repeat almost exactly:
- sending `null` for an optional field instead of omitting it
- emitting `["a","b"]` as a json *string* instead of an actual array
- wrapping a single arg in `{}` where the schema expected an array (an "empty placeholder")
- passing a bare string where an array was expected (`"foo"` instead of `["foo"]`)
four repairs, ~30-100 lines each, ordered carefully (json-array-parse must run before bare-string-wrap or `'["a","b"]'` becomes `['["a","b"]']`). that is the whole catalogue. when i hear "this open source model can't do tool calls" i now assume one of those four, and so far that's been right ~90% of the time.
2/ the funniest failure mode is also the most revealing.
deepseek-flash, when asked to edit or write a file, sometimes emits the path as a *markdown auto-link*:
filePath: "/Users/x/proj/[notes.md](http://notes. md)"
our writeFile tool obediently trued creating files literally named `[notes.md](http://notes .md)` until we caught it. this is not a hallucination. it's the post-training chat distribution leaking through the tool boundary the model has been rewarded for auto-linking in conversational output, and is applying that prior in a context where it makes no sense. the fix is two regex lines that unwrap only the degenerate case where link text equals url-without-protocol real markdown like `[click](https://x .com)` passes through untouched.
this is also conditioning of their own tools during RL which were different from all other tools we write and ofc can't predict.
"tool confusion" is a more useful frame than "capability gap." the model knows how to format a path. it just hasn't been told clearly enough that this path is going to fopen, not into a chat bubble. so we encode that hint at the schema level `pathString()` instead of `z.string()` and the leak is plugged for every path field at once.
3/ the design choice that mattered was inverting preprocess-then-validate to validate-then-repair.
my first attempt was the obvious one: a preprocessing pass that normalized inputs (strip nulls, parse stringified arrays, etc.) before zod ever saw them. it broke immediately, writeFile content that *happened* to be json-shaped got rewritten before it hit disk. silent corruption, easy to miss in a smoke test.
then i made it less greedy
- parse the input as-is. if it succeeds, ship it. valid inputs are never touched.
- on failure, walk the validator's own issue list. for each issue path, try the four repairs in order until one applies.
- parse again. on success, log `tool_input_repaired:${toolName}`. on failure, log `tool_input_invalid:${toolName}` and return a model-readable retry message.
the structural insight here is: when you preprocess, you encode a prior about what's broken. when you let the validator complain first, the schema is the prior, and you only spend repair budget at the exact paths the schema actually disagreed at. the validator is doing the work of localizing the bug for you. it's the same shape as cheap-then-careful everywhere else try the fast path, fall back on evidence.
(this also gives you per-tool telemetry for free. you can watch repair rates per (model, tool) and notice when a model regresses on a specific contract before users do.)
4/ shape invariants and relational invariants need different fixes.
the four repairs above all handle shape problems wrong type, missing key, wrong container. but read_file had a *relational* invariant: "if you provide offset, you must also provide limit, and vice versa." deepseek kept calling `readFile({ absolutePath, limit: 30 })` and getting an `ERROR:` back. you can't fix this with input repair, because each field is independently valid the bug is in the relationship between them.
so i taught the function the model's intent instead. `limit` alone → `offset = 0`. `offset` alone → `limit = 2000` (matches common read tool ops default). then surfaced the decision back to the model in the result:
"Note: limit was not provided; defaulted to 2000 lines. To read more or fewer lines, retry with both offset and limit."
no `Error:` prefix, so the tui doesn't paint it red. the model sees what we picked and can self-correct on the next turn if our guess was wrong. transparency over silent magic wins big.
repair where you can. extend semantics where you can't. surface the choice either way.
zoom out:
a lot of what looks like model capability is actually contract design. a strict schema is a choice with a cost it filters out noise, but it also filters out recoverable noise from any model that hasn't memorized the exact json contract you happened to pick. the largest commercial models eat that cost invisibly and are linient on tool calling because they've seen enough of every contract during pretraining; open models pay it loudly and get dismissed for it.
the harness is where you mediate between distributions. four small repairs (i'm sure more to follow as we have three more merging today), two regex lines for auto-links, one relational default, one prefix change. the model didn't change. the contract got more forgiving in exactly the places it needed to be.
deepseek v4 pro now beats opus 4.7 6/10 times on our internal evals.
imo "skill issue" applies to the harness more often than the model.
Josselin Perrus retweeted
tldr
> evals are the new training data. instead of updating weights, you're updating the agent harness
> problem is agents are famous cheaters. they will reward-hack your evals and overfit just to make the score go up
> solution is treat evals like real ml. you need strict train/test splits and holdout sets to force actual generalization
> quality over quantity. a few hand-curated, highly-tagged evals easily beat thousands of noisy ones
> the better-harness loop is mine prod traces for failures -> turn into evals -> auto-tweak prompts & tools -> validate
> the ultimate flywheel is more prod usage -> more failure traces -> more evals -> continuously self-improving agents

















































