Types of AI Tasks — Classification, Generation, Retrieval
Modern AI tasks fall into three broad families: Discriminative (classify/predict from input), Generative (produce new content), and Retrieval (find and use relevant information). Knowing which family your problem belongs to determines which architecture you reach for.
AI Task Taxonomy
# AI Task Types — Which Architecture Fits Your Problem?
# ─────────────────────────────────────────────────────────────────
# 1. DISCRIMINATIVE TASKS — Input → Label/Number
# ─────────────────────────────────────────────────────────────────
discriminative_tasks = {
"Image Classification": ("CNN, ViT", "Is this a cat or dog?"),
"Object Detection": ("YOLO, DETR", "Where are the pedestrians?"),
"Sentiment Analysis": ("BERT, DistilBERT", "Is this review positive?"),
"Named Entity Recognition":("BERT + token classifier","Find company names in text"),
"Tabular Prediction": ("XGBoost, TabNet", "Will this customer churn?"),
"Speech Recognition": ("Whisper", "Convert audio → text"),
}
# ─────────────────────────────────────────────────────────────────
# 2. GENERATIVE TASKS — Input → New Content
# ─────────────────────────────────────────────────────────────────
generative_tasks = {
"Text Generation": ("GPT-4, Llama 3", "Write an email given a prompt"),
"Image Generation": ("Stable Diffusion", "Generate photo from text"),
"Code Generation": ("Codex, DeepSeek Coder","Write function from docstring"),
"Translation": ("T5, mBART", "English → French"),
"Summarization": ("BART, Pegasus", "Summarize a news article"),
"Text-to-Speech": ("ElevenLabs, XTTS", "Convert text to natural speech"),
"Music Generation": ("MusicGen", "Generate music from description"),
}
# ─────────────────────────────────────────────────────────────────
# 3. RETRIEVAL TASKS — Query → Ranked Relevant Items
# ─────────────────────────────────────────────────────────────────
retrieval_tasks = {
"Semantic Search": ("FAISS + Embeddings", "Find similar documents"),
"RAG": ("LangChain + ChromaDB", "Q&A over your own documents"),
"Recommendation": ("Matrix Factorization", "Suggest products/content"),
"Re-ranking": ("Cohere Rerank, BGE", "Reorder search results by relevance"),
}
# ─────────────────────────────────────────────────────────────────
# DECISION GUIDE — Which task type is YOUR problem?
# ─────────────────────────────────────────────────────────────────
def identify_task_type(problem_description: str) -> str:
if any(w in problem_description.lower() for w in ["classify", "detect", "predict", "score"]):
return "DISCRIMINATIVE — use BERT, CNN, XGBoost"
elif any(w in problem_description.lower() for w in ["generate", "write", "create", "synthesize"]):
return "GENERATIVE — use GPT, Diffusion, T5"
elif any(w in problem_description.lower() for w in ["find", "search", "retrieve", "recommend"]):
return "RETRIEVAL — use Embeddings + Vector DB"
return "HYBRID — combine approaches with RAG + LLM"
# Examples:
problems = [
"classify customer emails into 5 categories",
"generate marketing copy from product specs",
"find the most relevant FAQ answer for a user question",
"answer questions from a 500-page PDF document",
]
for p in problems:
task_type = identify_task_type(p)
print(f"Problem: '{p}'")
print(f" → {task_type}\n")Tip
Tip
Practice Types of AI Tasks Classification Generation Retrieval in small, isolated examples before integrating into larger projects. Breaking concepts into small experiments builds genuine understanding faster than reading alone.
Technical diagram.
Practice Task
Note
Practice Task — (1) Write a working example of Types of AI Tasks Classification Generation Retrieval from scratch without looking at notes. (2) Modify it to handle an edge case (empty input, null value, or error state). (3) Share your solution in the Priygop community for feedback.
Quick Quiz
Common Mistake
Warning
A common mistake with Types of AI Tasks Classification Generation Retrieval is skipping edge case testing — empty inputs, null values, and unexpected data types. Always validate boundary conditions to write robust, production-ready ai code.