---
title: "AI Comes for the If Statement"
description: "Machine-native models replace human-facing text generation with zero-token typed execution, cutting inference costs by orders of magnitude for basic programming primitives."
categories: ["AI","software"]
keywords: ["machine-native model","large programmatic model","semantic if","SemIf","logit scoring","agent control flow","inference cost"]
date: 2026-09-21
lastmod: 2026-09-21
canonical_url: https://tomtunguz.com/ai-comes-for-the-if-statement/
author: "Tomasz Tunguz"
---


Working in the back of a grocery store has its own set of rules : if the food is a banana, send it to produce ; if it is a cookie, the snack aisle ; if it is cumin, shelve it with the spices.

But what if the load of bananas has spoiled, the cookies have crumbled & the cumin is caked? These rules & exceptions govern every grocery store & neighborhood mart. At the beginning they are rigid ; over time, more exceptions are discovered : is that a plantain? Dubai chocolate : dessert or baking supply?

Coding literally means encoding these rules & exceptions into software. Pre-AI, these programs were rigid. AI handles the exceptions : an image search identifies the unfamiliar fruit as Musa paradisiaca, a brother of the banana.[^1]

But we do not need the world's most brilliant model to handle if-plantain-then-produce logic.

The newest wave of AI is a robust if-then decider. Jev[^2] & SemIf[^3] answer questions like these in hundreds of milliseconds at a 99% reduction in cost compared to traditional AI.[^4] They simplify the existing models by running the attention math once & then determining the probability of each allowed answer, based on a few tokens of output.[^5]

I went looking for the if-then statements in my own code, the ones I had handed to AI. Within a few minutes I had replaced about a quarter of those calls in one of my agents. On 98 hand-verified production email threads, the specialized deciders nearly doubled the classification accuracy of the production model, jumping from 47% to over 80%.[^6]

{{< email_image src="w1gandmv06am5jimt542" alt="Specialized deciders nearly double classification accuracy" width="540" height="345" >}}

Software is composed of primitives : the if-then statement is one of them. By optimizing this single primitive, we see nearly two orders of magnitude in cost reduction alongside higher accuracy.

These advances raise the question of which other programming primitives will benefit from the same specialization. They also highlight the bifurcating economics of AI : state of the art models for discovery & optimized models for production. We use the largest frontier models to train new models, & the most capable models to architect systems. But once a system is engineered & hardened, running it thousands or millions of times through a workflow benefits from narrower AI.

If this is the first of many primitives specialized for production, then harnesses are about to capture a lot more margin.[^7]

[^1]: [Musa × paradisiaca](https://en.wikipedia.org/wiki/Musa_%C3%97_paradisiaca). Linnaeus named plantains Musa paradisiaca & dessert bananas Musa sapientum in 1753 ; both are now known to be hybrids of the same two parents, Musa acuminata & Musa balbisiana. The classification was hard enough that he split one group into two.

[^2]: [Jev](https://openrouter.ai/typesafe/jev-1.13), TypeSafe, released 15 September 2026. Returns typed, calibrated decisions in one parallel pass rather than generated text.

[^3]: [SemIf](https://github.com/TheoLeeCJ/SemIf), Theodore Lee, MIT licensed, released 18 September 2026, & [kev](https://github.com/jaredpalmer/kev), Jared Palmer : open reproductions of the interface pattern. Benchmarks are SemIf's published figures on an RTX 3090 with a frozen Qwen3.5-4B.

[^4]: [Jev pricing](https://openrouter.ai/typesafe/jev-1.13) : $0.042 per million input tokens, $0 output, which TypeSafe says may be subsidized. Sonnet-class pricing is $3 input & $15 output per million. On a typical classification call of 2,000 input & 60 output tokens that is 82 times cheaper. TypeSafe's own workflow evals put Jev at $0.0004 a case against $0.0304 & $0.0836 for two frontier models, a 76x to 209x spread.

[^5]: [SemIf mechanics](https://github.com/TheoLeeCJ/SemIf). Rather than generating tokens autoregressively through the full transformer stack, the open source implementation runs the attention mechanism over the prompt and evaluates candidate choices directly from the output logits, skipping the multi-layer feed-forward network and decode steps entirely.

[^6]: Evaluation on 98 hand-verified production email threads, September 2026 : across the exact same dataset, the production generative LLM classifier achieved 47% accuracy (46/98), while Jev scored 80% (78/98) & local SemIf scored 82% (80/98). In addition, in live production logs across 31 inbound emails, the local decider acted on 8 with zero errors & safely deferred the rest to the frontier model.

[^7]: [The Harness Margin Opportunity](https://tomtunguz.com/the-harness-margin-opportunity/). A harness cuts execution cost without sacrificing accuracy ; specializing the underlying model primitives expands that gross margin wedge even further.
