# Knowing When Not to Use AI: AI Agents vs Rules vs ML

## Executive summary

System design requires disciplined choices regarding intelligence types—Human judgment, Rules/Code, Machine Learning, or Generative AI—rather than defaulting to AI agents for every problem. The choice must balance trade-offs across accuracy, cost, complexity, and risk. Successful modern systems are typically hybrid, combining the determinism of code with the pattern recognition of ML and the flexibility of LLMs.

## Key takeaways

- Human Judgment: Best for high-stakes decisions, ambiguity, ethical considerations, or situations requiring accountability (e.g., medical diagnosis, legal interpretation). Trade-offs include being expensive, slow, and difficult to scale.
- Rules/Code-Based Solutions: Ideal for tasks requiring clear, stable logic, consistent exact outputs, and zero error tolerance (e.g., payment processing, input validation, security access control). Code is fast, cheap, reliable, and highly interpretable.
- Machine Learning (ML): Excels at finding patterns in structured data and making probabilistic predictions when rules are too complex to define manually (e.g., fraud detection, customer churn prediction). Requires monitoring for model drift.
- Generative AI (LLMs/Agents): Best used when inputs are unstructured (text, documents) and tasks require reasoning or transformation. Flexibility is prioritized over precision, and some error is tolerated (e.g., summarization, intent understanding). Trade-offs include non-determinism and higher cost at scale.

## Technical details

- Determinism vs. Non-Determinism: Code-based systems provide deterministic, reliable outputs (e.g., checking if a balance is sufficient for payment). Generative AI systems are non-deterministic, meaning correctness cannot be guaranteed across runs and testing difficulty increases.
- Hybrid System Architecture: The most successful solutions combine these types of intelligence. Example: Using code for transaction calculation (determinism), ML for trend identification, and LLMs to generate a final natural language report.
- ML Limitations: While good at predicting trends over massive structured data, ML models struggle with tasks requiring deep societal analysis or explaining the 'why' behind the trend (explainability).

## Practical implications

- When designing a system, first identify the core requirement: Is absolute determinism (Code) or flexibility (Generative AI) more critical?
- Adopt a hybrid approach that uses specialized tools for specific tasks—e.g., using code for calculations and LLMs only for presentation.
- Recognize that failure to production often stems from choosing the wrong system type, not necessarily poor model performance.

## Topics

AI Agents, Machine Learning (ML), Rules-Based Systems, Generative AI, System Design, Trade-offs and Risk Management, Balancing AI Information, IBM AI News Newsletter

Source: https://www.youtube.com/watch?v=_ZqSFVi6UDY
