Intermediate

AI Techniques

AI encompasses a diverse toolkit of techniques, from classical search algorithms to modern deep learning. This lesson surveys the major approaches used to build intelligent systems.

Search Algorithms

Many AI problems can be framed as searching through a space of possible solutions. Search algorithms explore these spaces systematically.

AlgorithmStrategyOptimal?Use Case
BFS (Breadth-First Search)Explores all nodes at current depth before moving deeperYes (unweighted)Shortest path in unweighted graphs
DFS (Depth-First Search)Explores as deep as possible before backtrackingNoMaze solving, tree traversal
A* SearchUses heuristic + cost to find optimal pathYes (with admissible heuristic)GPS navigation, game pathfinding
MinimaxEvaluates game trees for optimal adversarial playYes (within depth limit)Chess, tic-tac-toe, Go

Knowledge Representation

For AI to reason about the world, it needs ways to represent knowledge formally:

  • Ontologies: Formal definitions of concepts and their relationships within a domain. Used in medical AI, the Semantic Web, and more.
  • Knowledge Graphs: Networks of entities and relationships. Google's Knowledge Graph, Wikidata, and enterprise knowledge graphs power search, recommendations, and question answering.
  • Semantic Networks: Graph-based representations where nodes are concepts and edges are relationships.
  • Frames and Scripts: Structured representations of stereotypical situations (e.g., a "restaurant" frame with slots for menu, waiter, food).

Reasoning

AI systems use different forms of reasoning to draw conclusions from available information:

  • Deductive Reasoning: Drawing specific conclusions from general rules. "All mammals breathe air. Whales are mammals. Therefore, whales breathe air."
  • Inductive Reasoning: Forming general rules from specific observations. "Every swan I have seen is white. Therefore, all swans are white." (Can be wrong!)
  • Abductive Reasoning: Inferring the most likely explanation for observations. "The grass is wet. It probably rained." Used in medical diagnosis and troubleshooting.

Planning

AI planning involves generating a sequence of actions to achieve a goal. Given a description of the current state, possible actions, and a goal state, a planner finds a valid action sequence. Applications include robotics, logistics, game AI, and autonomous systems.

Machine Learning

Machine learning is the most widely used AI technique today. Instead of programming explicit rules, ML systems learn patterns from data:

  • Supervised Learning: Learning from labeled examples (input-output pairs). Used for classification and regression.
  • Unsupervised Learning: Finding patterns in unlabeled data. Used for clustering, dimensionality reduction, and anomaly detection.
  • Semi-supervised Learning: Combining a small amount of labeled data with a large amount of unlabeled data.

Deep Learning

Deep learning uses neural networks with many layers to learn hierarchical representations of data. It has achieved breakthrough results in:

  • Computer Vision: CNNs (Convolutional Neural Networks) for image classification, detection, and segmentation.
  • Natural Language Processing: Transformers for text understanding and generation.
  • Speech: RNNs and Transformers for speech recognition and synthesis.
  • Generative AI: GANs and Diffusion models for creating images, music, and video.

Reinforcement Learning

An agent learns by interacting with an environment, receiving rewards or penalties for its actions. The goal is to learn a policy that maximizes cumulative reward over time.

  • Key concepts: Agent, environment, state, action, reward, policy
  • Algorithms: Q-Learning, Deep Q-Networks (DQN), Policy Gradient, PPO, SAC
  • Applications: Game playing (AlphaGo, Atari), robotics, resource management, RLHF for LLMs

Evolutionary Algorithms

Inspired by biological evolution, these algorithms use concepts like mutation, crossover, and selection to evolve solutions:

  • Genetic Algorithms: Encode solutions as "chromosomes" and evolve them over generations
  • Genetic Programming: Evolve computer programs to solve problems
  • Neuroevolution: Evolve neural network architectures and weights

Expert Systems

Rule-based systems that encode human expert knowledge as if-then rules. While less popular today than ML approaches, they remain useful in domains where decisions must be explainable and auditable (medical diagnosis, legal reasoning, financial compliance).

Key takeaway: AI is not a single technique but a rich toolkit. The best approach depends on the problem: search for optimization, knowledge graphs for structured reasoning, ML for pattern recognition, deep learning for perception tasks, and RL for sequential decision-making.