AI Comes for the If Statement

Open the original

Short summary

New lightweight AI models like Jev and SemIf outperform expensive general-purpose language models on straightforward classification tasks—cutting costs by 76-209x while improving accuracy. These tools skip the expensive token-generation process and instead directly evaluate a handful of predefined options, suggesting a future where production systems use cheap specialized models rather than frontier AI.

  • Jev and SemIf reduced classification costs by 76-209x compared to frontier models while jumping accuracy from 47% to 80-82% on email thread categorization
  • These models work by running attention once and evaluating candidate answers directly from logits, skipping the expensive autoregressive token generation that general LLMs use
  • The author replaced roughly 25% of AI calls in their own code with these specialized deciders, suggesting if-then logic is a ripe target for optimization—and hinting other programming primitives could follow

Full summary

The core argument is simple: AI doesn't need to be brilliant at everything. Specialized models built just to handle if-then logic—classification decisions with a fixed set of answers—are radically cheaper and more accurate than general-purpose language models. The author found this out the hard way, replacing about a quarter of AI calls in his own code with specialized deciders like Jev and SemIf. On 98 real production emails, these narrow models jumped classification accuracy from 47% to over 80%, while costing 76 to 209 times less. The trick is that these models skip the expensive parts of a transformer—they run attention once, then directly evaluate probabilities for each allowed answer from the output logits, rather than generating tokens one by one. This matters because it splits the AI economy into two tiers. Frontier models like Claude or GPT-4 stay useful for discovery, training new systems, and architectural decisions. But once you've engineered a workflow and know exactly what outputs you need, you can hand it off to a cheaper, narrower model that does one thing well. The grocery store analogy at the start captures this perfectly: you don't need a genius to sort bananas from plantains once you've defined what counts as each. You just need a reliable classifier that works fast and costs almost nothing. If this pattern holds for other programming primitives beyond if-then statements, the economics reshape how AI gets deployed. Companies that build harnesses—the orchestration layer deciding which model handles which task—suddenly have a lot more margin to work with. The cost difference is so stark that it's not really about optimization anymore; it's about whether you can afford to keep using a $15-per-million-tokens model for work a $0.042 model can do better.

Ask about this article