Skip to main content

Architecture

Thinking Fast and Slow in AI Systems: Where Decision Models Belong

Where a small, fast decision model helps in a production AI system and where it does not: 57 investigations, seven integrations that each sit on a deterministic answer with authority in one direction, and what a month of recorded production decisions shows: every answer valid, none yet proven right.

Published November 23, 2026

Between September and November 2026 I investigated 57 places in my portfolio's codebase with the same question: would a small, fast decision model make this part of the system better? The photography assistant, the engineering Q&A, a career tool, an animated companion and my own Git workflow each got asked. In 40 of those investigations I called the model; the other 17 I settled without it, by working out what even a perfect classifier could gain. When I did call it, it answered in about a fifth of a second, always in the shape I asked for, and almost never failed. Most of the time, the right answer was still no.

This article is about where the yeses landed, why most answers were no, and what the 3,611 production decisions I have records for do and don't tell me.

Two speeds, as an analogy

Daniel Kahneman describes human thinking as two systems: a fast, automatic System 1 and a slow, deliberate System 2. I use the terms here as a software analogy, not a claim about cognition, and the mapping needs one correction up front. Deterministic code is not System 1. Code is closer to procedure: the rules that must hold whatever anyone thinks. So the system has four roles, not two, and they don't form a pipeline:

  1. Requestfrom a visitor, from me, or from my tooling
  2. Rulesthe authoritative answer, always first
    • Decision modelonly when eligible · one bounded judgment · ~0.2 s
    • Generative modelonly when text is needed · seconds
  3. Resultthe rules' answer, adjusted within a bound or unchanged
  4. Meonly at some boundaries: a commit, a merge, a publication

This diagram is conceptual. Both model branches are optional: many requests use only the rules, some call one model, and in the engineering Q&A the decision model runs beside the generator rather than before it. Any failure in either branch leaves the rules' answer standing. I am not a step every request passes through; I approve at a few boundaries, which the section on what stays human spells out.

The analogy also breaks in a useful place. Human intuition answers whatever question it likes. The fast path here is told exactly which question it may answer and what shapes the answer may take, and every one of its answers can be thrown away without anyone noticing.

What a decision model is

The model is Jev, a decision model rather than a text model. You send it a block of state and a typed question, and it answers with a value, never prose. My code uses two of its question types:

  • a scalar between 0 and 1 ("does this photograph support the visitor's query?");
  • a choice from an enum I supply, with a probability for each option ("is this job advertisement relevant, possibly relevant, or not relevant?").

That restriction is the point. A text model can always say something plausible; this one can only pick from what I allowed. It's also the limit. It can't write a search query, explain itself or quote evidence. I found that out the hard way: the first experiment tried to let it replace the photography assistant's planner, and 28 of 31 planner turns needed a free-text query it could not produce.

One shape, seven places

The model is used in seven places today: six features on the site and one developer tool. All of them go through one small client, and all of them have the same shape:

  1. Requestvisitor, owner or developer
  2. Deterministic stagethe authoritative answer comes first
  3. Eligibilitya gate, cue or rule miss
  4. Decision modelone typed question · pinned model
  5. Validationright model · allowed value · in range
    • Caller policythreshold, floor or adopt rule
    • Deterministic answeron any failure
  6. Resulta bounded change, or the rules' answer unchanged

The client is deliberately unhelpful. It has no default model, no default timeout and no default question; each feature has to name the exact model version it evaluated, its latency budget and its wording. It never retries, because retries on top of a parallel fan-out are how a small call becomes a flood. And it treats two failures differently: the provider not answering is an outage the feature may absorb, while the provider answering with something unusable is a contract failure that must never be quietly turned into a value. One check catches something no reviewer would see (lightly trimmed):

// The router echoes the model that actually answered. A silent substitution
// would change what the caller is buying without changing any visible constant.
if (typeof model !== "string" || model !== expectedModel) {
  throw new Error("decision was answered by an unexpected model");
}
if (typeof choice !== "string" || !allowed.includes(choice)) {
  throw new Error("decision chose an option outside the enum");
}

What each integration may change is as important as what it asks:

FeatureThe questionWhat the answer may doOn failure
Photography evidenceDoes this rejected photo support the query?Admit a photo the rules rejected, never remove onethe rules' answer
Curator comparisonsWhich on-screen photos does "one and four" mean?Narrow an unresolved comparisonthe rules' plan
Engineering Q&A stanceDoes the evidence lean yes, no, or depend?Label the answer; it can't change itno label
Engineering Q&A confidenceHow well does the evidence cover the question?Lower the confidence, never raise it past a floorthe rules' level
Companion deliveryHow is this sentence spoken?Decorate the faceneutral
Job screeningIs this advertisement relevant engineering work?Recover or demote a listing; never a role-title matchthe rules' relevance
Commit scopeWhich scope fits this diff?Suggest; I confirm every commitno scope

Every row has a deterministic answer underneath it, and the model's authority runs in one direction. That property, more than any accuracy number, is what made the yeses safe. Only one row waits for me: commit scope. The other six act on their own, within their bound: a photo is admitted, a comparison narrowed or a job listing recovered without anyone approving that decision. What limits a wrong answer there is the bound, not my review.

Case 1: evidence the rules threw away

The photography assistant only cites photographs that pass a deterministic corroboration gate: a caption, tag, mood or visual-concept match. The gate is strict, and on an English holdout it delivered 100% precision at 33.3% recall: it never cited a wrong photo, but it rejected two-thirds of the right ones. Adding the decision model only for photos the gate had rejected moved recall to 95.2% and precision to 90.9%.

Then the German test failed. Precision 75.0% and recall 78.9%, against gates of 85% for both, even though the model separated relevant from irrelevant photos well (an area under the curve of 0.896). I shipped it anyway, as admission-only: it can add a photo the gate rejected and do nothing else. The failed gate stayed in the record unedited.

The next investigation found that most of the German loss came from how it was measured. The benchmark could not represent a conversation, and the worst query was one the real assistant routes elsewhere; on the production path, German precision was 93.3%. I didn't know that when I shipped. What made shipping defensible was the bounded authority, not the later number.

Two smaller lessons came from the same feature. Fanning out more than four calls at once made the provider queue them, so the stage runs four at a time; even so, its slowest five percent took about a second offline, which failed its own latency gate. In production the same figure is 1,066 milliseconds, against 1,074 measured offline.

Case 2: a label nobody was reading

The engineering Q&A used to tell its answer generator whether the evidence leaned for or against the question. The decision model was far better at that judgment than my rules: 33 of 36 against 17 of 36, and it caught 9 of 10 cases where the evidence opposed the question. Then I measured whether the label changed the answers, and it didn't. The generator followed the evidence, not the label. So I removed the label from the prompt instead of making it better.

The same classification turned out to be useful somewhere else: the small stance chip a visitor sees. The model now runs beside the generator, never inside it. It removed 18 of the 19 wrong chips the old rules showed, and it hides the chip on explanatory questions where a stance means nothing. It still has one serious, reproducible error: asked whether I keep brand colours hand-synced, it says "leans yes" in three runs out of three, although I rejected that approach. Nothing in its input separates that case. The chip can be wrong; the answer above it can't be changed by it.

Confidence went the other way round. The model's confidence labels were far more accurate than the rules', but it called more answers HIGH that shouldn't be. What fixed that was a rule, not a better model: HIGH needs a probability of at least 0.70, a non-empty evidence pack and nothing missing, and the model can only lower the deterministic level. I chose 0.70 on development data and tested it once on 62 new questions: 43 correct in both runs against 18 for the rules, and no false HIGH. The labels in both experiments were written by an AI agent, not by a person, and the reports say so. The floor carries the safety property; the model supplies the accuracy.

Case 3: where the fast path loses

The photography assistant's conversational planner was the place I most expected a fast model to win. It is about three times faster than the generative planner (289 against 851 milliseconds at the median). It is also useless there: most planner turns have to write a refined search, and it got 12 of 90 of those right against the generative planner's 79.

Context handling went the same way. Across a run of experiments, deterministic reference resolution and a better planner contract kept beating the model-assisted arms. In the last head-to-head, a plain rule passed 162 of 189 trials and the model-gated version of the same rule 160. Even a perfect version of a model-chosen retrieval strategy would have scored below the deterministic routing already in production (0.6473 against 0.6494).

The one context integration that shipped is narrow: when a visitor names photos by position in words the rules can't parse, such as "compare photos one and four", the model reads which ones they mean. Replayed over 897 real visitor turns, it changed nothing, and in about a month of production traffic it has run once. It's correct and nearly dormant, and I keep it because it is cheap and can only narrow.

Case 4: volume is not value

The busiest integration is not on the public site. My career tool screens job advertisements with deterministic rules for geography, role and technology, then asks the model about two kinds of listing: those the rules rejected but whose title still looks like engineering, and those that matched only on technology keywords. Offline it found all 19 relevant listings in a sample instead of 15, and promoted none of 317 irrelevant ones.

In production it has made 3,456 decisions for $0.23, without a single failure. It recovered 241 listings the rules had rejected and demoted 60. And none of the 241 has been evaluated since: the evaluation batch ranks role-title matches first, and the 178 evaluations so far never got past them. I have triaged 6 listings out of more than 4,000 by hand. So the most-used decision in the system has a measured cost and no measured value. That isn't a defect in the model. It's a reminder that an integration's worth is decided downstream.

The experiments that said no

Out of 57 experiments, 28 measured the model and rejected it, 11 found no problem for it to solve, and 4 couldn't be run because the labels to judge them didn't exist. 17 of the 57 reached their answer without calling the model at all, usually by computing what a perfect classifier could gain and finding the ceiling too low. A few rejections taught me more than the successes:

  • Holdout precision can collapse on real data. A tag-relationship classifier reached 92.3% precision on its holdout. Run over the real stream of 35,043 candidate pairs, only 28% of its proposals were right, because most real pairs are merely related, and a small leak from a large class outnumbers a rare one.
  • Correct can still hurt. Mood relationships the model derived were 94.7% acceptable, and adding them to search still lowered ranking quality, because each correct addition pushed a relevant photo out of a full result window.
  • Speed can't buy recall. A model-guided way to find code for an AI agent cost $0.00047 per question instead of $0.37 and ran about 13 times faster. It also found 39.5% of the required evidence instead of 77.8%. I decided in advance that speed doesn't outrank evidence, and the rule held.

What production says

Production cost tracking now records every decision made inside a public request or an owner workflow. Over the first month it holds 3,611 recorded decisions:

DecisionCountMedianSlowest 5%Cost
Job relevance3,456188 ms357 ms$0.228
Photo supports query56237 ms1,066 ms$0.001
Answer confidence52217 ms434 ms$0.006
Answer stance43222 ms455 ms$0.004
Photo comparison reading4 (1 request)about 240 ms—<$0.001

Every recorded decision returned a valid answer. The records cover five of the seven integrations: the companion's delivery labels run on a route outside the cost tracking, and the commit-scope suggestion runs on my machine. For those two I have no production numbers at all, failures included, so "no failures" means no recorded failures, not none. Metering the delivery route is the next thing I'd fix.

That is also the honest limit of the evidence I do have: it shows the recorded answers were valid, and it says nothing about whether they were right. No production decision has a label.

Valid is not correct

The architecture is very good at one property and silent on another. The client guarantees that every answer comes from the pinned model, has the declared type and stays in range. It can't know whether "relevant" was the right call, and neither can a probability. In one experiment the model's wrong answers and its right ones had the same median confidence, 0.81. The fast path is consistently fast and consistently well-formed, which is exactly why its mistakes look trustworthy.

The evidence behind the integrations is thinner than the engineering around them, and the reports say so. Of the eight decisions that added or changed an integration, one rests on human labels, four on labels an AI agent wrote, two on my bulk approval, and one makes no accuracy claim at all. Bounded authority is what lets that be acceptable: when you can't prove a decision is right, you can still make sure a wrong one is cheap.

What stays human

Three integrations exist because I decided, not because a gate passed. The commit-scope suggestion failed its accuracy bar and ships anyway, because I confirm every commit and a wrong scope costs one keystroke. The companion's delivery labels came out of an experiment whose own verdict was "needs human perceptual review"; I watched the comparison videos, liked one, and shipped it, and a blind review is still pending. One comparison contract overrode its own quality gates after I accepted the trade-off. In each case the record says who decided and on what evidence.

What I approve per decision is much narrower than that. I confirm every commit, and that is the only integration where each model answer waits for me. The delivery label only changes a face, and the comparison reading can only narrow which photos are compared, without asking me first. Evidence recovery and job screening act automatically too, within their bounds; screened listings reach me later, in the list I triage, but nothing waits for my approval. My authority sits at the boundaries that matter more: what ships, what merges and what is published. How a change travels from idea to merge, and who authorizes each step, is the subject of the Software Factory case study.

Where decision models belong

After 57 experiments, this is the test I apply before adding one:

  1. There is already a deterministic answer. The model refines it; it never replaces it, and every failure falls back to it.
  2. The question fits one typed answer. If the honest answer is a sentence, a search query or an explanation, it belongs to a generative model.
  3. Its authority runs one way. Admit but not remove, lower but not raise, label but not change.
  4. An evaluation chose the threshold. A probability is not a confidence I can use until data has shown where it separates right from wrong.
  5. Someone measures it downstream. Volume, latency and validity are free to observe. Value isn't, and needs labels someone has to make.

Most of the time, one of these fails, and the right design is a rule, a generative model, or nothing at all. That's the main thing I learned. The fast system is worth having because the slow systems and the rules around it are good enough to throw its answer away.

The systems in the case studies are described in more depth in Photography Assistant, Engineering Ask and Voice Interaction.