Skip to content
Go back

When NOT to Use AI

When NOT to Use AI

I spent three full days building an AI system to extract dates from customer emails. It worked pretty well, getting about 95% of dates correct. I was deep in the process of debugging that problematic 5% when my coworker walked by and casually asked “Why not just use a regex and a date parsing library?”

So I completely rewrote it using a standard date parsing library. The whole thing took 20 minutes. Now it works 100% of the time, costs absolutely nothing to run, requires no API calls, and has no rate limits to worry about.

I had wasted three entire days because I just assumed AI was the right answer. Sometimes it’s absolutely not.

Table of contents

Open Table of contents

The Problem

AI is fundamentally probabilistic, which means it makes educated guesses rather than calculating exact answers. Some problems genuinely need exact, deterministic answers where 95% accuracy is completely unacceptable. For those kinds of problems, you need to use good old-fashioned deterministic code instead.

When Deterministic Code Is Better

Data validation is perfect for regex: A regex pattern for email validation runs instantly, costs nothing, and is always correct for your defined format. An AI might hallucinate that “user@domain” is a valid email address when it clearly isn’t.

Calculations need exact math: Writing principal * Math.pow(1 + rate, years) gives you the exact compound interest every single time. Large language models are notoriously terrible at arithmetic and will give you wrong answers.

Data transformations must be consistent: A function like jsonToCsv(data) is completely deterministic and always produces identical output. AI might format the same data differently on each run, which breaks your downstream processes.

Business logic requires predictability: Code like if (user.orders > 10) applyDiscount() has clear, auditable logic. You absolutely don’t want AI deciding that one customer gets a discount while another customer with identical order history doesn’t.

When Reliability Is Critical

If you need 99.99% reliability or higher, you should not be using AI for that specific function.

Financial systems can’t tolerate hallucinations: One single hallucination in financial calculations can cost thousands of dollars or trigger a regulatory audit. Always use well-tested, deterministic financial calculation libraries instead.

Medical applications demand near-perfect accuracy: An AI with 95% diagnostic accuracy means 1 out of every 20 patients gets a wrong diagnosis, which is completely unacceptable. Use AI as a tool that assists human doctors, not as a replacement for medical professionals.

Legal compliance isn’t probabilistic: “Probably GDPR compliant” is nowhere near good enough when regulatory fines can reach millions. Draft documents with AI assistance if you want, but have actual lawyers review everything before you ship, and never let AI make autonomous compliance decisions.

Safety-critical systems protect human lives: In aviation, autonomous vehicles, and medical devices, system failures can directly cause deaths. Never put LLMs in the critical path of systems where failure has life-or-death consequences.

When Costs Don’t Justify Benefits

Running 1 million API calls per day at $0.01 each adds up to $3.6 million per year. You need to make absolutely sure the business value justifies that cost.

Don’t use AI for basic text manipulation like converting to uppercase, trimming whitespace, or extracting substrings. These operations cost pennies in compute time and take microseconds to execute, not cents per call and seconds of latency.

Processing 10 million customer reviews at $0.01 per review equals $100,000 in API costs alone. Sometimes training your own smaller, specialized model is dramatically cheaper than paying per-call API fees at scale.

When Simple Heuristics Work

Content moderation starts with simple filters: A straightforward banned word list catches 80% of problematic content instantly for free. Use AI only for the nuanced edge cases where context actually matters.

Search doesn’t always need AI: Basic full-text search with title boosting works perfectly fine for most applications. Unless you’re literally trying to build the next Google, you probably don’t need AI-powered ranking algorithms.

Recommendations can be simple: The classic “Users who bought X also bought Y” collaborative filtering approach works remarkably well for most e-commerce sites. Don’t overcomplicate things just because you can.

Skip AI for Marketing

Don’t claim “AI-powered search” when you’re just running full-text search with Elasticsearch. Don’t advertise “intelligent recommendations” when you’re literally just showing the most popular items sorted by sales count. Don’t promise “ML insights” when you’re providing basic aggregated metrics from SQL queries. If you’re not actually using machine learning, don’t claim that you are.

When Team Lacks Skills

Working with AI effectively requires specific skills: prompt engineering to get good results, handling non-deterministic outputs gracefully, implementing proper retry logic, monitoring for hallucinations, and continuously tuning prompts based on production data. If your team doesn’t currently have these skills and doesn’t have time to learn them properly, you should start with deterministic code instead.

When Users Don’t Want It

Aggressive autocomplete that constantly finishes your sentences is genuinely distracting for many users who find it breaks their concentration. Some users specifically want to talk to human support representatives, not chatbots, regardless of how good your AI is. Constantly suggesting writing improvements while people are trying to compose emails is incredibly annoying. Show AI suggestions only when users explicitly request them, don’t interrupt their workflow uninvited.

Real Examples

Email parsing doesn’t need AI: An AI system that’s 96% accurate means 400 failures when processing 10,000 emails. Using regex patterns plus manual review for the small number of unmatched cases gives you 99.9% accuracy and is way simpler to maintain.

Invoice processing has cheaper alternatives: A vision model API costs $2,500 per month for our volume. Traditional OCR combined with structured field extraction costs just $200 per month and achieves 99% accuracy.

Ticket classification works better locally: Using an LLM adds 200ms of latency plus ongoing API costs for every ticket. Training a small fastText model takes minimal effort, runs in 10ms on your existing servers, and costs essentially nothing.

When to Actually Use AI

You should reach for AI when facing genuinely ambiguous problems where there’s no clear deterministic rule, when you need open-ended content generation that requires creativity, when solving complex pattern recognition that humans struggle with, or when tackling problems that fundamentally don’t have deterministic solutions.

Decision Framework

Before using AI, walk through these questions in order:

  1. Can I solve this with deterministic code using regex, SQL, or a library? → If yes, just do that instead.
  2. Does this require 99.9%+ reliability for financial, medical, or safety reasons? → If yes, don’t use AI.
  3. Are the ongoing API costs justified by the actual business value? → If no, find a cheaper alternative approach.
  4. Do I have training examples but no clear deterministic rules? → If yes, AI might be appropriate.
  5. Is this actually a hard problem or am I overcomplicating it? → If overcomplicating, go back to simpler approaches.

Most problems you encounter will fail at step #1 and can be solved with simple, straightforward code.

Bottom Line

Before reaching for AI as your default solution, ask yourself: Can I solve this with a regex pattern? A database query? Simple heuristics? A specialized library? If the answer to any of these is yes, use that simpler solution instead.

Save your AI budget and complexity budget for genuinely hard problems like natural language understanding, open-ended content generation, complex pattern recognition across unstructured data, and ambiguous judgment calls that require human-like reasoning.

For everything else? Just write normal, deterministic code. It’s dramatically faster to develop, significantly cheaper to run, and far more reliable in production.

When you actually need AI for the hard problems that justify it, you’ll have both the financial budget and the complexity budget available to use it well.


Share this post on:

Previous Post
When Streaming Actually Matters
Next Post
Probabilistic Versus Logical Reasoning in Generative AI