跳到正文
原文
Tomasz Tunguz 博客·· 2026-09-21AI 评分55

AI Comes for the If Statement

AI Comes for the If Statement

文章要点
  • 1作者论证新一波 AI 是强大的 if-then 判定器,可在数百毫秒完成分类,成本较传统 AI 降低 99%
  • 2作者将自家 agent 约四分之一调用换成专用判定器,98 条人工核验邮件准确率从 47% 升至 80% 以上
  • 3TypeSafe 数据显示 Jev 典型分类调用比 Sonnet 级模型便宜 82 倍,工作流评测较两个前沿模型价差 76x 至 209x
  • 4作者判断 AI 经济正在分化,前沿模型用于探索与训练,狭窄专用模型负责生产环境的大规模重复运行
决策要点

AI 的经济性正在分层,生产环境中重复运行的判定逻辑可由专用小模型以低两个数量级的成本接管。

  • 影响:高频分类与路由类任务的推理成本有望下降一到两个数量级;替换前需自建人工核验样本,评估本身有一次性成本;规模化后的毛利更集中在 harness 层。
  • 参考:可考虑盘点现有 AI 调用里的简单分类与路由任务,先攒一批人工核验样本对比准确率与单次成本,再挑高频场景小范围替换。
  • 依据:作者在 98 条人工核验生产邮件线程上自测,47% 对 Jev 80%、SemIf 82%;成本数字为 TypeSafe 口径,其称定价可能获补贴。
正文

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. Jev2 & SemIf3 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

Specialized deciders nearly double classification accuracy

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. 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, TypeSafe, released 15 September 2026. Returns typed, calibrated decisions in one parallel pass rather than generated text. ↩︎

  3. SemIf, Theodore Lee, MIT licensed, released 18 September 2026, & 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 : $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. 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. A harness cuts execution cost without sacrificing accuracy ; specializing the underlying model primitives expands that gross margin wedge even further. ↩︎

来源:Tomasz Tunguz 博客 · tomtunguz.com