Skip to content
AI.info

Natural language processing

Natural Language Processing as Communication Engineering

Build a practical map of NLP by separating language data, representations, tasks, models, evaluation, and product decisions.

By the end you can

A sentence is not the task

In October 2017 Israeli police arrested a Palestinian construction worker in Beitar Illit. His Arabic caption said “good morning”. Facebook's machine translation rendered it as “attack them” in Hebrew and as “hurt them” in English. No Arabic-speaking officer read the original post. He was released after a few hours, once the error was found. Facebook's own account of it ran to one sentence: “Unfortunately, our translation systems made an error last week that misinterpreted what this individual posted.” That was Necip Fazil Ayan, an engineering manager in Facebook's language technologies group.

A support message such as “I was charged twice, but the second payment vanished” can trigger several different NLP problems. A classifier might route it. An extractor might identify two transactions. A retriever might find a policy, and a generator might draft a reply. In Beitar Illit the chain was shorter and the stakes were not. One caption became a translation, a routing decision and an arrest. No component in that chain was asked whether the sentence was a greeting. Each was asked a narrower question, and the last question was answered by a police officer rather than by a model.

The same text therefore does not define one objective. The product must specify which evidence matters, what output is needed, and what happens after the output is produced.

NLP begins with a communication problem, not with a model family.

Visual

Five layers of an NLP system

This map keeps language phenomena separate from the software that acts on them. The second layer is the one most often treated as neutral, and it is the hardest to keep honest. A corpus is not a recording of a language. It is the residue of the rules used to collect and clean it.

C4.EN is the 365-million-document, 156-billion-token corpus behind T5 and the Switch Transformer. It was built by discarding any page containing a word from the “List of Dirty, Naughty, Obscene or Otherwise Bad Words”. One cleaning rule, applied once. Dodge and colleagues audited what that rule had deleted and reported in 2021 that “we find that AAE and Hispanic-aligned English are removed at substantially higher rates (42% and 32%, respectively) than WAE and other English (6.2% and 7.2%, respectively)”. African American English at 42%. Hispanic-aligned English at 32%. White-aligned English at 6.2%.

The recorded-data layer had made a decision about whose language counts. Every layer above it inherited that decision without being told.

FigureLayers · 5 layers
  1. 01

    Human communication

    Words are shaped by intention, context, social convention, and missing shared knowledge.

  2. 02

    Recorded language data

    Documents, messages, transcripts, metadata, and annotations capture only part of the original situation.

  3. 03

    Representation and model

    Tokens, vectors, rules, indexes, and learned parameters transform the recorded evidence.

  4. 04

    Task output

    The system predicts labels, spans, rankings, records, answers, summaries, translations, or responses.

  5. 05

    Product decision

    A workflow accepts, rejects, escalates, displays, stores, or acts on the output.

Comparison

Language tasks that look similar but fail differently

Choosing the wrong task definition can make a technically strong model useless. Each of the risks named below has been measured. The measurements are worse than the intuition.

Retrieval: in 1985 a full-text retrieval system was measured while it did real legal work. The system was IBM STAIRS, supporting the defence of an actual lawsuit; Blair and Maron ran the study. Two defence lawyers generated 51 information requests. Two paralegals turned them into queries and searched until they were satisfied they had retrieved the 75% of relevant documents the lawyers had stipulated. Recall and precision were computed for 40 of those 51 requests. Average precision was 79.0% — what came back was largely relevant. Average recall was 20.0%, with a standard deviation of 15.9. Grossman and Cormack, reviewing the study in 2011, put the finding in one line: “Although the searchers believed they had found 75% of the relevant documents, their average recall was only 20.0%.” The TREC-2006 Legal Track overview attributes the gap to “the inherent ambiguity of language”. Nothing in the search session told the searchers they were missing four documents in five.

Generation: unsupported content in summaries is not a rare tail. Three trained annotators judged 2,500 document–summary pairs — 500 randomly sampled XSum articles, each paired with summaries from four neural systems (PtGen, TConvS2S, TranS2S, BertS2S) plus the human-written BBC gold summary. Maynez and colleagues report in 2020 that “intrinsic and extrinsic hallucinations happen frequently – in more than 70% of single-sentence summaries”. Over 90% of the extrinsic hallucinations were erroneous. One sentence long, judged by humans, and unsupported more often than not.

Dialogue: MultiWOZ is the field's most-used booking-assistant benchmark, 10,000 dialogues. Re-annotating it produced MultiWOZ 2.1, whose authors report that “This correction process results in changes to over 32% of state annotations across 40% of the dialogue turns.” An independent Google team then found and fixed further state errors in 17.3% of utterances on top of 2.1, in MultiWOZ 2.2. Two rounds of correction by two teams, before the dialogue-state metric measured what it claimed to.

FigureComparison · 5 columns

Classification

Assign a document or utterance to one or more categories.

  • Output: fixed label set
  • Risk: categories hide mixed intent
  • Example: ticket routing
  • Evidence: class and slice errors

Extraction

Locate spans or relationships expressed in text.

  • Output: entities, slots, or events
  • Risk: boundary and schema ambiguity
  • Example: invoice fields
  • Evidence: span and relation quality

Retrieval

Rank existing evidence for a query or need.

  • Output: ordered documents or passages
  • Risk: relevant evidence is never surfaced
  • Example: policy search
  • Evidence: recall and ranking utility

Generation

Produce text under content and style constraints.

  • Output: answer, summary, translation, or reply
  • Risk: fluent unsupported content
  • Example: response drafting
  • Evidence: meaning, support, usefulness, safety

Dialogue

Maintain goals and state across multiple turns.

  • Output: next action or utterance
  • Risk: state and repair failures
  • Example: booking assistant
  • Evidence: completion and recovery

Case

Nine tasks were folded into one headline number

Benchmarks make the difference between language tasks visible instead of hiding it. Then, if a field is not careful, they hide it again inside a single score.

Wang, Singh, Michael, Hill, Levy and Bowman presented the General Language Understanding Evaluation in 2018 as “a benchmark of nine diverse NLU tasks, an auxiliary dataset for probing models for understanding of specific linguistic phenomena, and an online platform for evaluating and comparing models”. The same abstract adds that “four of them feature privately-held test data”. Nine task definitions, one headline number, and a separate diagnostic set built precisely because the headline number cannot say which linguistic phenomenon a model failed on.

Within a year the two numbers had come apart. By early July 2019 the best GLUE score, 88.4 from XLNet, had passed the non-expert human baseline of 87.1 by 1.3 points and beaten it on four of the nine tasks. GLUE's own expert-built diagnostic entailment set said something else over the same period. The team that went on to build SuperGLUE wrote it down: “Performance on the GLUE diagnostic entailment dataset, at 0.42 R3, falls far below the average human performance of 0.80 R3 reported in the original GLUE publication, with models performing near, or even below, chance on some linguistic phenomena”.

88.4 against 87.1 on the aggregate. 0.42 against 0.80 on the phenomena. Same models, same month. The headline number was solved before the linguistic phenomena were, and only the diagnostic set could say so.

Example

One sentence, five engineering questions

A human reader handles these questions almost invisibly. An NLP system needs explicit design choices. Shipped products get them wrong at rates that are easy to measure, once someone writes the tests.

Microsoft Text Analytics, Google Cloud Natural Language and Amazon Comprehend were run through their paid APIs against a behavioural test suite called CheckList. Ribeiro and colleagues report the result in 2020: “The failure rate is near 100% for all commercial models when the negation comes at the end of the sentence”. Three sentiment services sold by three of the largest vendors, defeated by where the negation sits. In the same paper's user study, practitioners given CheckList wrote twice as many tests and found almost three times as many bugs.

  • Reference: In “She sent it after the meeting,” the system may need to resolve what “it” refers to before extracting an action.
  • Negation: “The device did not overheat” should not trigger the same alert as “The device overheated” — and on the CheckList negation tests all three commercial sentiment APIs failed at a rate near 100% once the negation came at the end of the sentence.
  • Temporal scope: “The account was locked last week” differs from an account that is locked now.
  • Pragmatics: “Could you perhaps check the invoice?” is a request even though it is phrased as a question.
  • Domain language: “Positive margin” has different practical meaning in oncology, finance, and manufacturing.

Analogy

A newsroom with several desks

A newsroom receives a raw tip. One desk verifies names, another searches archives, another writes a brief, and an editor decides whether publication is justified.

An editor exercises human judgment, while NLP components manipulate numerical representations. No single desk should be expected to perform every language function. And no desk downstream can recover what an earlier desk never surfaced.

Treat NLP as a coordinated system of specialized language operations.

Key idea

Fluency is not a universal quality score

A system can write polished prose while misunderstanding the request, omitting a condition, or inventing support. Conversely, a terse span extractor can be valuable even though it produces no natural-sounding sentence.

The evaluation target must match the job: retrieval recall, boundary accuracy, calibrated routing, factual support, or conversation repair.

In 2020 that engineering distinction was pushed into principle. Emily Bender and Alexander Koller open their position paper by stating the argument: “In this position paper, we argue that a system trained only on form has a priori no way to learn meaning.” The successes of large neural language models, they write, “sometimes lead to hype in which these models are being described as ‘understanding’ language or capturing ‘meaning’”. Form is what the training data contains. Meaning is what a reader brings to it.

This is not a complaint from outside the field. ACL 2020 gave that paper its Best Theme Paper award, announced on 8 July 2020 alongside CheckList as Best Paper. One conference, one announcement: the argument that form is not meaning, and the test suite that measured how far three shipped commercial products were from it.

The best-looking output may be the wrong output for the product.

Steps

Frame an NLP problem before selecting a model

Use this sequence to turn a vague language feature into an auditable task. Each step exists because a measured failure above skipped it. An unnamed user decision put a police officer in front of a mistranslation. An unexamined evidence boundary left average recall at 20.0%. An output contract that rewarded fluency produced hallucinations in more than 70% of single-sentence summaries.

FigureProcess · 5 steps
  1. 1. Name the user decision

    Describe what a person or workflow must decide after reading the text.

  2. 2. Define the evidence boundary

    Specify documents, turn history, metadata, and external sources that are available.

  3. 3. Choose the output contract

    State whether the output is a label, span, ranking, record, or response.

  4. 4. List ambiguity and abstention cases

    Identify inputs where several interpretations are plausible or evidence is missing.

  5. 5. Connect evaluation to harm

    Measure errors by downstream consequence, not only average frequency.

How this path fits the wider curriculum

This path focuses on language data, linguistic structure, task design, retrieval, extraction, translation, summarization, dialogue, and NLP-specific evaluation. Neural architectures appear only when they clarify a language task.

The deeper mechanics of Transformers belong to the architecture path. Prompting, tool use, fine-tuning, and RAG product design are treated more fully in the Generative AI path.

The goal is broad NLP competence without duplicating every neighboring subject.

Key takeaways