TechByteByByte

NLP Tasks

A practical taxonomy of the major NLP task categories — understanding, retrieval/search, and generation — connecting every technique covered so far to concrete, real-world applications and modern AI systems.

#NLP#AI#NLP Tasks#Task Taxonomy

Begin with the central question

Are we trying to understand text, find text, or create text?

Essential words

An understanding task assigns labels or extracts structure. A retrieval task finds information. A generation task creates a new sequence.

What You Will Understand

A practical map of the major NLP task categories — understanding tasks, retrieval/search tasks, and generation tasks — and which technique from Modules 1-14 is actually best suited to each. This module is deliberately more of a reference/taxonomy than a deep technical module.

language request -> task category -> suitable NLP method -> result

Why the Task Must Be Identified First

Modules 1-14 built up an entire toolkit — Bag of Words, TF-IDF, static and contextual embeddings, RNNs, attention. This module exists to answer the practical question every AI engineer needs answered before reaching for any of them: which category of task am I actually solving, and what does that imply about which tools are appropriate?


Understand, Retrieve, or Generate

before picking a tool, correctly identify the job. “Classify this email as spam” is a fundamentally different kind of task from “find documents relevant to this query,” which is different again from “write a summary of this article.” Misidentifying the task type is one of the most common, avoidable mistakes in applied NLP work.

Analogy: The Tool Belt Selection & The General Contractor Imagine you are a general contractor hired to build a luxury house:

  • The Mistake: You carry a single heavy tool (like a paint sprayer / a massive LLM) and attempt to use it for everything. You try to spray paint a nail instead of hammering it (wasting power/latency), or try to paint a board by sawing it.
  • The Solution (The Taxonomy): You divide the building project into distinct, logical jobs:
    • Understanding (Hammering): Fitting a neat label to an existing object. E.g. “Is this email spam or billing?” or “Is this customer support user angry?” (Intent classification, sentiment).
    • Retrieval (Measuring/Selecting): Finding the right pre-cut wood planks from your large warehouse stack. E.g. “Find the 3 documents most relevant to our safety query.” (Semantic search, vector index match).
    • Generation (Painting/Finishing): Creating a fresh design that did not exist before. E.g. “Draft a custom email response explaining our refund policy.” (Text generation, translation).
  • Identifying the correct category ensures you pull the most efficient, cost-effective tool from your belt.

📊 Visual Chart: Taxonomy of Core NLP Task Classifications

Here is how common engineering goals map to the three parent groups and their optimal models:

graph TD
    Parent["NLP Tasks Taxonomy"] --> Under["1. Understanding Tasks<br>(Labeling existing text)"]
    Parent --> Retr["2. Retrieval / Search Tasks<br>(Finding existing text)"]
    Parent --> Gene["3. Generation Tasks<br>(Producing new text)"]

Under --> classification["Classification<br>(Sentiment, Intent)<br>Approach: TF-IDF + Logistic Reg"]
    Under --> seqlabel["Sequence Labeling<br>(NER, POS Tagging)<br>Approach: Bidirectional BERT"]

Retr --> LexicalSearch["Lexical Search<br>(BM25, Overlap)<br>Approach: TF-IDF"]
    Retr --> SemanticSearch["Semantic Search<br>(Concepts)<br>Approach: Embeddings + Cosine Sim"]

Gene --> SeqSeq["Structured Generation<br>(Translation, Summary)<br>Approach: Seq2Seq + Attention"]
    Gene --> OpenGen["Open-ended Generation<br>(Chatbots, Assistants)<br>Approach: Modern LLMs"]

4. Core Concept — Three Major Task Categories

UNDERSTANDING TASKS       -- assign a label, category, or
                             structured interpretation to text

RETRIEVAL/SEARCH TASKS     -- find or rank relevant text from
                             a larger collection

GENERATION TASKS             -- produce new text

Understanding tasks

TaskWhat it doesTypical approach
Sentiment analysisClassify text as positive/negative/neutralTF-IDF + classical ML (Module 6), or embeddings + classifier
Text classificationAssign a category (spam, topic, etc.)Same as above
Intent detectionDetermine what a user wants (routing)Classical ML for simple cases; LLM-based for complex, open-ended intents
Named entity recognition (NER)Identify names, dates, locations, etc. in textA sequence LABELING task — different structure from single-label classification
POS taggingLabel each word’s grammatical role (noun, verb, etc.)A classical, sequence labeling task; less central to modern LLM-era work
Semantic similarityMeasure how similar two texts’ meanings areEmbeddings + cosine similarity (Module 8, DL course Module 12)

Retrieval/search tasks

TaskWhat it doesTypical approach
Information retrievalFind relevant documents for a queryTF-IDF/BM25 (lexical) or embeddings (semantic) — Module 5, 8
RankingOrder results by relevanceCombines retrieval scores, sometimes with a dedicated reranking model
Semantic searchFind conceptually related content, even without exact word overlapContextual embeddings (Module 13) — directly solves Module 7’s proven TF-IDF limitation

Generation tasks

TaskWhat it doesTypical approach
TranslationConvert text between languagesSequence-to-sequence (Module 11) historically; modern LLMs (Transformers course) now
SummarizationCondense text while preserving meaningSame evolution as translation
Question answeringProduce an answer given a question (and often context)Modern approach: retrieval (Module 17) + LLM generation
Text generationProduce open-ended new textModern LLMs (Transformers course), the current standard

5. How It Works — Step by Step (Diagnostic Approach)

1. Ask: does this task assign a LABEL to existing text
   (understanding), FIND/RANK existing text (retrieval), or
   PRODUCE new text (generation)?
2. For UNDERSTANDING tasks: is it a single label per document
   (classification) or a label per TOKEN (sequence labeling,
   like NER)? -- these need genuinely different model structures
3. For RETRIEVAL tasks: does exact term matching matter (lean
   toward TF-IDF/lexical, Module 5) or does semantic/conceptual
   matching matter more (lean toward embeddings, Module 8, 13)?
   Often BOTH matter -- hybrid search (Module 5)
4. For GENERATION tasks: modern systems overwhelmingly use LLMs
   (Transformers course) rather than the classical seq2seq
   architectures covered in Module 11

6. Mathematical Intuition

No new formulas — this module is a synthesis and mapping exercise across everything covered in Modules 1-14, not a new technical mechanism.


7. Simple Example

“Is this email spam?” is understanding (single-label classification) — TF-IDF + logistic regression (Module 6) is often genuinely sufficient. “Find the most relevant support articles for this user’s question” is retrieval — likely benefiting from embeddings (Module 8, 13) given the value of semantic matching. “Write a summary of this support ticket thread” is generation — a task modern LLMs handle directly.


8. Real-World Example

A complete customer support AI system typically uses all three categories together: understanding (intent classification routes the ticket), retrieval (semantic search finds relevant knowledge base articles), and generation (an LLM drafts a response using the retrieved context) — precisely the RAG pattern Module 17 covers in full.


One request can contain three NLP tasks

Consider the message: “My card was charged twice. Find the refund policy and draft a reply.”

1. Understanding
   Intent probabilities: billing = 0.82, cancellation = 0.11, other = 0.07
   Chosen intent: billing

2. Retrieval
   Similarity scores: refund policy = 0.91, card replacement = 0.54, rewards = 0.22
   Retrieved item: refund policy

3. Generation
   Input: original message + retrieved policy
   Output: a new customer-facing reply

The numbers are illustrative, but the boundaries are real. The classifier chooses a category, the retriever selects existing text, and the generator creates new text. If the reply is wrong, inspect all three stages rather than blaming “the AI” as one indivisible box.

9. How Is This Used in Modern AI?

🤖 How Is This Used in Modern AI?

Correctly categorizing a new problem into understanding, retrieval, or generation is often the single most important early design decision in building an NLP-powered system — it directly determines whether a fast, cheap classical approach (Module 6) suffices, or whether embeddings (Module 8, 13) or a full LLM (Transformers course) are genuinely needed.


Real systems you can recognize

Hugging Face organizes models by tasks including text classification, token classification, question answering, sentence similarity, summarization, translation, and text generation. See Hugging Face Tasks.

One support agent can combine several: classify intent, retrieve policy passages, and ask GPT or Gemini to generate a grounded response. The application should evaluate each stage separately because one final answer score cannot reveal which stage failed.

10. How Is This Used in Agentic AI?

Direct relevance to Agentic AI: Very High. A well-designed agent system typically decomposes into exactly this taxonomy: understanding components (intent classification, routing — often a fast classical classifier, ML course Module 8’s “gatekeeper” pattern), retrieval components (RAG’s semantic search), and generation components (the core LLM producing responses and tool calls). Recognizing which category a given sub-problem falls into is directly useful for deciding which tool is appropriate for each piece of an agent’s architecture.


11. Common Mistakes / Misunderstandings

⚠️ Mistake: defaulting to an LLM for every task, regardless of category. Many understanding tasks (like straightforward spam classification) are genuinely well-served by fast, cheap classical approaches (Module 6) — reaching for an LLM by default can be unnecessarily slow and expensive.

⚠️ Mistake: treating sequence labeling (like NER) the same as single-label classification. NER assigns a label to EACH token, not one label per document — a structurally different task requiring different model output shapes.

⚠️ Mistake: assuming retrieval and generation are the same problem. Finding relevant existing text (retrieval) and producing genuinely new text (generation) require different techniques and different evaluation criteria entirely.


12. Important Distinctions

UnderstandingRetrieval
Assigns a label/interpretation to EXISTING textFinds/ranks RELEVANT existing text
Classification, sequence labelingSearch, semantic matching
RetrievalGeneration
Finds text that ALREADY EXISTSProduces NEW text
Embeddings + similarity searchLLM-based generation (modern standard)
ClassificationSequence Labeling
ONE label per documentOne label PER TOKEN (e.g., NER)

13. When to Use

Match the technique to the task category deliberately: classical ML (Module 6) for well-defined understanding tasks with available labeled data; embeddings (Module 8, 13) for retrieval/semantic matching; modern LLMs (Transformers course) for open-ended generation or tasks requiring deep contextual reasoning.


14. When Not to Use

Don’t use a heavyweight, expensive approach (a full LLM call) for a task a lightweight classical classifier could handle just as well — this directly wastes cost and latency, a genuine, avoidable inefficiency in production systems.


15. Production Considerations

  • Task category strongly influences evaluation strategy — accuracy/ F1 for classification, precision/recall@k or NDCG for retrieval, and quality/coherence metrics (often human or LLM-based evaluation) for generation are genuinely different measurement approaches.
  • Real systems typically combine multiple task categories — as Section 8 demonstrated, a single production AI application often needs understanding, retrieval, AND generation components working together.

16. What You Should Remember

  • NLP tasks fall into three broad categories: understanding (labeling existing text), retrieval (finding relevant existing text), and generation (producing new text).
  • The right technique depends on the task category — not every problem needs the most sophisticated available tool.
  • Real production systems combine multiple categories — RAG and agent systems (Module 17) are concrete, standard examples of this combination.

17. Interview Questions

Beginner

Q: What are the three major categories of NLP tasks?

Ans: Understanding tasks (assigning a label or structured interpretation to existing text, like classification or named entity recognition), retrieval tasks (finding or ranking relevant text from a larger collection, like search), and generation tasks (producing new text, like translation or summarization).

Intermediate

Q: Why is named entity recognition (NER) structurally different from a task like sentiment classification?

Ans: Sentiment classification assigns ONE label to an entire document. NER assigns a label to EACH individual token in the text (identifying which specific words are names, dates, locations, etc.) — this is called sequence labeling, and requires a model architecture that produces a prediction per token, not just one prediction for the whole input.

Advanced

Q: Why might a production system deliberately use a classical ML classifier (Module 6) for an understanding task rather than an LLM, even though the LLM might achieve marginally higher accuracy?

Ans: For well-defined, high-volume understanding tasks with available labeled training data, a classical classifier is dramatically faster and cheaper per prediction than an LLM API call. If the accuracy gap is marginal for the specific task, the cost and latency savings at scale often justify the classical approach — this connects directly to the “cheap gatekeeper before an expensive LLM call” pattern covered in the ML course and Module 6 of this course, a genuine, common architectural decision in production systems.

Scenario

Q: You’re asked to build a system that finds internal company documents relevant to an employee’s question, phrased in their own words, which might use different terminology than the documents themselves. Which task category is this, and what technique would you lean toward?

Ans: This is a retrieval/semantic search task specifically — the goal is finding relevant EXISTING documents, not generating new text or assigning a single label. Given that the employee’s phrasing might differ from the documents’ exact wording, I’d lean toward embedding- based semantic search (Module 8, and especially Module 13’s contextual embeddings) rather than pure TF-IDF/lexical matching (Module 5), since Module 7 proved directly that lexical matching alone struggles when exact wording differs, even when the underlying meaning is closely related.

AI Engineering

Q: How does this module’s task taxonomy map onto a typical RAG-based agent system’s architecture?

Ans: A RAG-based agent typically combines all three categories: an understanding component (often a classifier or the LLM itself) determines user intent and whether retrieval is needed; a retrieval component (embedding-based semantic search, Module 8/13) finds relevant context from a knowledge base; and a generation component (the core LLM, covered fully in the Transformers course) produces the final response using the retrieved context. Recognizing this decomposition helps identify which specific technique is appropriate for each piece of the system, rather than treating the whole pipeline as one undifferentiated “AI” problem.

18. Next Step

Next: Module 16 — NLP → Transformers — the complete historical progression assembled end to end, with the specific problem, solution, and remaining limitation named at every transition.

Author
TechByteByByte Editorial Team
Reviewed by
TechByteByByte Admin
Published
Last reviewed