甚麼是人工智能?規則式程式碼與學習行為的分別
Day 01: What is Artificial Intelligence? (Rules-Based Code vs. Learned Behavior)
人工智能的核心轉變,是由編寫明確規則,轉為讓演算法從數據中提取模式。傳統程式由開發者設定規則並輸出答案;機器學習則以數據和正確答案為輸入,學出規則,即模型權重。若邏輯能以靜態、確定的規則清楚描述,就不應使用 AI;高維、嘈雜或非結構化模式則適合用 AI 處理。
Day 01: What is Artificial Intelligence?
Part of the 90-Day Master Series: AI Explained: Zero to Advanced by NeuBench
If you ask ten software developers to define Artificial Intelligence, you will often get ten wildly different answers ranging from simple if/else decision trees to sentient sci-fi systems.
To master modern AI engineering, we must strip away the marketing hype and establish the fundamental mental model:
AI is the transition from writing explicit rules to writing algorithms that extract patterns from data.
The Paradigm Shift
1. Classical Programming (Rules-Engine)
In traditional software development, the engineer acts as the domain expert and explicitly writes every logical branch:
- Inputs: Data + Explicit Rules (Code)
- Output: Answers
# Classical Software: The developer writes every edge-case
def detect_spam(email_text):
spam_keywords = ["free money", "click here", "wire transfer"]
for keyword in spam_keywords:
if keyword in email_text.lower():
return True
return False
The limitation? The moment an attacker writes cl!ck here or fr33 m0ney, your rule breaks. You are forced to play an endless game of whack-a-mole.
2. Machine Learning & Modern AI (Pattern Synthesis)
Instead of hand-crafting rules, we feed the system raw inputs alongside their correct outcomes, and allow the mathematical model to synthesize the decision boundary:
- Inputs: Data + Answers
- Output: Rules (Parameters / Model Weights)
Classical Software:
[ Data ] + [ Rules ] ===> [ Output ]
Machine Learning:
[ Data ] + [ Output ] ===> [ Rules (Weights) ]
Key Takeaway for Developers
AI is not magic and it is not sentient.
At its foundational layer, an AI system is a parameterized mathematical function optimized over high-dimensional data to minimize error.
- 💡 Rule of thumb: If the logic can be cleanly described in static deterministic rules, do not use AI.
- Use AI when the underlying patterns are high-dimensional, noisy, or inherently unstructured (e.g., natural language, computer vision, user preference embeddings).
90 Days. 90 Concepts. One AI Journey.
Tomorrow in Day 02, we explore Symbolic AI vs. Statistical Learning: How We Got Here.
Explore live benchmarks across 260+ AI models at neubench.netlify.app.
來源:DEV Community · dev.to