Skip to main content
Concept #120

Machine Learning vs. Rule-Based Systems

The single most important technical decision behind every "AI" feature you'll evaluate as an accountant โ€” and why "AI" is often the wrong tool for the job.

Educational content for accountants learning AI โ€” not technology advice or a substitute for professional judgment. Always verify AI outputs against primary sources before relying on them in client or firm work.

Why This Matters

Every accounting software vendor now markets "AI-powered" features. Some of those features are genuine machine learning. Others are simply well-built rule-based automation wearing an AI label because it sells better. If you can't tell the difference, you can't evaluate the tool, explain it to a client, or know when to trust it โ€” and when not to.

ABC Coffee Shop's bookkeeper uses two "smart" features in her accounting software this month: one automatically flags any transaction over $10,000 for manager approval. The other automatically categorizes a new vendor bill as "Office Supplies" even though she's never seen that vendor before. The first is a rule. The second is machine learning. They look identical on the screen โ€” and behave completely differently when something unusual happens.

This lesson gives you the framework to tell them apart, on sight, every time.

The Core Distinction, Restated Precisely

You met this idea in the previous lesson. Now we go deep enough that you could explain it to a skeptical partner at your firm.

RULE-BASED SYSTEM:

A human expert writes explicit "if-then" logic in advance. The system executes exactly what it was told, nothing more.

IF condition A is true
THEN perform action B
ELSE IF condition C is true
THEN perform action D

MACHINE LEARNING SYSTEM:

A human provides examples (data). The system discovers the patterns and relationships in that data on its own โ€” no one writes the "if-then" logic by hand.

Show the system 10,000 labeled transactions.
The system finds the statistical patterns that separate categories โ€” patterns a human analyst might never have thought to look for.

The rule-based system is told exactly what to look for. The machine learning system figures out what to look for by studying examples. That's the entire distinction โ€” everything else in this lesson is a consequence of it.

A Side-by-Side Comparison

DimensionRule-Based SystemMachine Learning System
Source of logicWritten explicitly by a human expertLearned automatically from data
AdaptabilityStatic โ€” requires manual rewrites to changeImproves automatically as more data arrives
TransparencyFully interpretable โ€” you can read every ruleOften a "black box" โ€” hard to explain exactly why
Handles ambiguityStruggles โ€” needs conditions spelled out preciselyDesigned for exactly this
Setup costLower โ€” no data collection or model training neededHigher โ€” requires clean, labeled historical data
Best forFixed, well-defined outcomesComplex, evolving, or unstructured problems
Error behavior100% consistent โ€” same input always gives same outputProbabilistic โ€” can be confidently wrong
MaintenanceRules must be manually updated as circumstances changeRequires monitoring, retraining, and drift detection

Rule-Based Systems: How They Actually Work

A rule-based system (sometimes called an "expert system") is built from two components: a set of stored rules (the "knowledge base") and an engine that applies those rules to new information (the "inference engine").

STRUCTURE OF A RULE-BASED SYSTEM:

KNOWLEDGE BASE Rules written by human experts, stored as if-then statements.

INFERENCE ENGINE Compares new input against every stored rule and executes the matching action.

REAL ACCOUNTING EXAMPLE โ€” EXPENSE APPROVAL WORKFLOW:

RULE 1: IF expense amount > $500
THEN require manager approval

RULE 2: IF expense category = "travel"
AND amount > $1,000
THEN require VP approval

RULE 3: IF vendor is not in approved vendor list
THEN flag for accounts payable review

RULE 4: IF invoice due date is within 3 days
AND early payment discount available
THEN flag for immediate payment

These rules are completely deterministic. Given the same invoice twice, the system produces the identical result every single time. No learning occurs. No pattern is discovered. The logic exists exactly as written until a human changes it.

Why this matters for accountants: Tax bracket calculations, GAAP-mandated depreciation schedules, payroll withholding tables, and three-way match rules in accounts payable are all โ€” and should remain โ€” rule-based. These are domains governed by exact, published, legally-binding logic. There is no "pattern to discover" in a tax bracket; there's a number written into the Internal Revenue Code. Using machine learning here would introduce unnecessary risk into a problem that rules solve perfectly.

Machine Learning Systems: How They Actually Work

A machine learning system replaces the hand-written rulebook with a training process. Instead of a programmer specifying every condition, the system is shown historical examples and learns the statistical relationships itself.

STRUCTURE OF A MACHINE LEARNING SYSTEM:

TRAINING DATA Historical examples, often labeled with the correct answer.

LEARNING ALGORITHM Analyzes the data and adjusts internal parameters to capture the patterns that predict the correct answer.

TRAINED MODEL The result โ€” a system that can now make predictions on NEW, never-before-seen data.

REAL ACCOUNTING EXAMPLE โ€” FRAUD DETECTION:

TRAINING DATA: 10,000 known fraudulent transactions and 10 million known legitimate transactions from the company's history.

The model is NOT given a rule like "flag any transaction over $10,000." Instead, it studies subtle combinations โ€” transaction time, merchant category, geographic distance from typical spending, frequency patterns, amount relative to the account's history โ€” and learns which COMBINATIONS of these factors correlate with known fraud.

RESULT: The model can flag a $340 transaction as suspicious (because of an unusual combination of factors) while ignoring a $9,800 transaction that fits the customer's normal pattern perfectly โ€” the exact opposite of what a simple dollar-threshold rule would do.

Why this matters for accountants: Fraud rarely follows one obvious rule โ€” that's precisely why it's fraud. Bad actors adapt specifically to avoid tripping known rules. Machine learning's advantage is finding the subtle, multi-factor patterns that no rule-writer would think to encode, and adapting as fraud patterns evolve.

The Canadian Border Example: Why This Distinction Has Real Financial Consequences

Consider a real illustration used across the industry to explain this exact difference: a U.S. credit card holder who frequently crosses into Canada.

Rule-Based Fraud System

RULE: IF purchase location = international
THEN suspend card / flag for review

EVERY time this customer crosses into Canada โ€” which they do regularly and legitimately โ€” their card gets suspended. The rule cannot distinguish "this customer's normal behavior" from "genuinely suspicious international activity."

Machine Learning Fraud System

The model has learned, from this specific customer's transaction history, that Canadian purchases are a regular, low-risk pattern for THEM specifically โ€” even though international purchases are, in general, a higher-risk signal across the customer base as a whole.

Result: Legitimate Canadian purchases are NOT flagged. The model applies personalized, pattern-based judgment rather than a blanket rule.

THE BUSINESS IMPACT:

The rule-based approach creates friction, false declines, and customer frustration on every trip. The ML approach reduces false positives while (ideally) maintaining detection of genuinely unusual activity. This single example is why banks and card networks moved decisively toward ML-based fraud detection over the last decade.

The Knowledge Bottleneck

Rule-based systems have a well-documented failure mode worth understanding by name: the knowledge bottleneck.

THE KNOWLEDGE BOTTLENECK:

As a business grows more complex, the number of rules needed to cover every scenario grows โ€” often faster than humans can write and maintain them.

A simple expense approval system might need 5 rules. A multinational company's full compliance and approval workflow might logically require thousands of rules, covering every currency, every jurisdiction's tax rule, every vendor relationship type, every exception case.

Each new edge case requires a human to:
1. Notice the gap
2. Understand the correct handling
3. Write a new rule
4. Test it against every EXISTING rule to check for conflicts
5. Deploy it

This process does not scale linearly โ€” it gets disproportionately harder as the rule set grows, because new rules can conflict with old ones in ways that are hard to predict.

Why this matters for accounting firms: A firm that tries to build a purely rule-based system to catch every conceivable type of expense reimbursement fraud will eventually hit this wall. There will always be a new scheme the rule-writers didn't anticipate. Machine learning's core value proposition is precisely that it doesn't require anticipating every scenario in advance โ€” it generalizes from examples to new situations.

The Decision Framework: Which One Do You Actually Need?

This is the single most practical skill in this lesson โ€” a framework you can apply the next time your firm evaluates a new software feature or considers automating a process.

Use a Rule-Based System When:

  • The correct answer can be fully specified in advance ("if invoice > $10,000, require two approvals")
  • There is a small, fixed number of possible outcomes
  • The cost of a wrong decision is high, and you need 100% consistency and auditability
  • Regulatory or legal requirements demand an exact, explainable, reproducible calculation (tax withholding, GAAP depreciation)
  • Your team doesn't have โ€” and doesn't plan to build โ€” ML expertise or infrastructure

Use Machine Learning When:

  • The "correct answer" depends on complex, multi-factor patterns that are difficult or impossible to write down as explicit rules
  • The situation involves unstructured data โ€” natural language, images (receipts, documents), or audio
  • Conditions change faster than a human team could keep rewriting rules
  • You have sufficient historical data โ€” clean, labeled, and representative
  • Some tolerance for occasional errors is acceptable in exchange for handling scale and nuance rules cannot

MOST REAL SYSTEMS USE BOTH:

The most effective production systems combine machine learning for the intelligent judgment call with rule-based logic for the structured workflow around it.

Example: A modern accounts payable system might use MACHINE LEARNING to read and extract data from an incoming invoice (unstructured PDF โ†’ structured fields) and then use RULE-BASED logic to route that invoice through the correct approval chain based on amount, department, and vendor โ€” because approval chains ARE fully specifiable, fixed-outcome processes.

A Practical Test You Can Apply to Any "AI Feature"

Before believing a vendor's "AI-powered" marketing claim, ask this one diagnostic question:

THE ONE QUESTION TEST:

"Could a human accountant write down the exact if-then logic for every case this feature handles?"

IF YES โ†’ It's very likely rule-based automation, regardless of what it's marketed as. (This isn't necessarily bad! Rules are often the RIGHT tool. But it's not "learning" anything.)

IF NO, because the logic depends on patterns too complex or too numerous to write down by hand โ†’ It's likely genuine machine learning.

Follow-up questions worth asking a vendor:

  1. "Was this feature trained on data, or configured with rules?"
  2. "Does its accuracy improve as our data grows, or is its behavior fixed at deployment?"
  3. "Can you explain WHY it made a specific decision, or only THAT it made a decision?" (Rules can always answer "why." Many ML models cannot, fully.)
  4. "What happens when it encounters a situation completely unlike anything in its training data?"

Where This Shows Up Across Accounting

Accounting TaskTypical ApproachWhy
Tax bracket withholding calculationRule-basedExact, legally defined values โ€” no pattern to learn
GAAP straight-line depreciation scheduleRule-basedFixed formula, fully specifiable
Three-way match (PO, receipt, invoice)Rule-basedFixed, well-defined comparison logic
Transaction categorization from bank feedsMachine learningVendor names and descriptions vary infinitely; pattern-based
Fraud and anomaly detectionMachine learningPatterns too complex and evolving for fixed rules
Invoice data extraction (PDF to structured data)Machine learningUnstructured documents in endless formats
Approval routing after data is extractedRule-basedFixed org chart and dollar thresholds
Predicting which receivables will go uncollectedMachine learningMulti-factor pattern prediction, not a fixed rule
Expense report policy compliance flaggingRule-based (usually)Company policy is a fixed, written set of limits

Rule or ML?

Sort each scenario as Rule-Based or Machine Learning โ€” including the ABC Coffee Shop examples from the opening of this lesson.

Rule-Based
Machine Learning

ABC Coffee Shop's software automatically flags any transaction over $10,000 for manager approval.

The software categorizes a brand-new vendor bill as "Office Supplies" even though that vendor has never appeared before.

Payroll software calculates federal income tax withholding from published IRS tables.

Fraud detection flags a $340 purchase as suspicious while letting a $9,800 purchase through for the same customer.

Accounts payable matches PO, receipt, and invoice amounts and flags mismatches automatically.

The system extracts vendor name, amount, and due date from a messy PDF invoice in an unfamiliar layout.

Common Mistakes

Mistake 1: Assuming "AI" always means machine learning.

Many vendor features labeled "AI-powered" or "smart" are well-built rule-based automation. This isn't dishonest, necessarily, but it means you should ask what's actually happening under the hood before trusting or explaining it.

Mistake 2: Using machine learning where rules would be simpler, cheaper, and more auditable.

If the correct logic can be written down in a page of if-then statements, building an ML model is often unnecessary complexity, cost, and risk โ€” with LESS transparency than the rules would have given you.

Mistake 3: Using rules where machine learning is needed.

Trying to write a rule for every possible fraud pattern is the knowledge bottleneck in action โ€” you will always be one step behind evolving schemes. This is exactly the scenario ML was built to solve.

Mistake 4: Assuming machine learning is always "more accurate" than rules.

For narrow, well-defined, stable problems, a correctly written rule is 100% consistent โ€” genuine ML introduces probabilistic error that a rule wouldn't have. More sophisticated is not the same as more appropriate.

Key Takeaway

Rule-based systems execute exactly what a human expert wrote down in advance โ€” transparent, consistent, and auditable, but rigid and unable to adapt without manual rewrites. Machine learning systems learn patterns directly from historical data โ€” flexible and capable of handling complexity and ambiguity that rules cannot capture, but often less transparent and never perfectly consistent. Neither approach is universally "better": rule-based systems win when the correct logic can be fully specified in advance (tax calculations, GAAP formulas, approval thresholds), while machine learning wins when the correct answer depends on complex, evolving, multi-factor patterns that are impractical to write down by hand (fraud detection, transaction categorization, document extraction). The best production accounting systems typically combine both โ€” machine learning for judgment-heavy pattern recognition, rules for the structured, auditable workflow around it.

Test Your Understanding

Rule vs. ML identification, fraud pattern behavior, and when rules are the right tool โ€” check your answers below.

Question 1: A company's expense policy states "any expense over $500 requires manager approval; any expense over $5,000 requires VP approval." A system that automatically routes expenses according to these exact thresholds is:

Question 2: A bank's fraud detection system flags a $340 purchase as suspicious while allowing a $9,800 purchase from the same customer to go through, based on subtle patterns in each customer's individual transaction history. This behavior is most consistent with:

Question 3: A firm wants to automate calculation of federal income tax withholding from employee paychecks according to published IRS withholding tables. The most appropriate technical approach is:

Ready to Practice?

Apply accounting fundamentals in the Practice Lab while you build the AI fluency this course develops โ€” judgment first, tools second.

Try the Practice Lab

What's Next?

How LLMs Work โ€” Having established the core distinction between rules and learning, the next lesson goes one level deeper into the specific type of machine learning behind ChatGPT, Copilot, and every other generative AI tool: how large language models are trained, and what "predicting the next word" really means in practice.

Related Concepts

Up Next

How LLMs Work