AI, ML & RL Under the Hood

Interactive Mechanics Lab
The Foundational Core: As established in Roan Brasil Monteiro’s Machine Learning From Scratch, AI is the overarching goal of machine intelligence, ML learns parameters by minimizing calculated error residuals, and RL discovers optimal behavior by accumulating trial rewards.
1. Symbolic AI (Rules)
Hand-Engineered Expert Logic
Deterministic
Rule: IF (Feature ≥ θ) THEN Decision = 1
θ = 0.60 | Rigid Boundary: Zero Error Tolerance
Rule Threshold (θ) 0.60
Rule Accuracy 70.8%
Handcrafted Threshold0.60

The Brittleness Problem: Programmers hardcode logic (e.g. if keyword > 0.6). It fails catastrophically when inputs drift or complex edge-cases interact. It cannot learn from past mistakes.

2. Machine Learning (MSE Descent)
Parameter Optimization via Loss Gradients
Supervised
∂L/∂w = -(2/N)∑ x(y - (wx + b))
w: 0.850, b: 0.120 | MSE Loss: 0.0421
Weights (w, b) w:0.85, b:0.12
Mean Sq Error 0.0421
Learning Rate (α)0.05

The Grounded Equation: Instead of writing rules, the computer calculates residuals (y - ŷ) and nudges w ← w - α(∂L/∂w) iteratively downward toward global minimum error.

3. Reinforcement Learning (Q-Learning)
Reward-Driven Policy Optimization
Temporal Difference
Q(s,a) ← Q + α[R + γ max Q(s',a') - Q]
Agent: (0,0) | Last Step Reward: 0.00 | TD Target: 0.00
Episodes / Steps Ep: 1 | Step: 0
Cumulative Reward 0.00
Discount Factor (γ)0.90

The Bellman Mechanics: No labeled answers exist. The agent chooses actions, observes rewards (+10 for goal, -1 for step, -5 for pit), and propagates expected future returns backward through its Q-table.

Comparative Algorithmic Engine Mechanics
Paradigm Primary Engine & Under-the-Hood Math Input Data Requirements Adaptability to Novel States Current Simulator Status
Symbolic AI Explicit conditional predicates: IF x > θ THEN y=1 Human domain expertise codified into rigid heuristic rule sets Brittle (Zero generalization beyond authored thresholds) Threshold θ = 0.60 | Accuracy: 70.8%
Machine Learning Loss gradient optimization: w ← w - α ∇L(w, b) Static labeled dataset (X, Y) of historical ground truth High (Interpolates regression boundaries across noise) w: 0.850, b: 0.120 | Loss: 0.0421
Reinforcement Learning Bellman TD updates: Q(s,a) ← Q + α[R + γ max Q' - Q] Dynamic environment feedback (States, Actions, Reward signals) Optimal (Discovers emergent paths via trial & error) Episodes: 1 | Step: 0 | Q-Convergence: Active
Enjoy this tool? Build your own with Super