30% off every book in our site-wide sale. Shop the sale

Why Language Is Hard: Ambiguity, Three Layers, and the Outside-In Machine

Why Language Is Hard: Ambiguity, Three Layers, and the Outside-In Machine

TL;DR: You will be able to explain why language is hard for machines using ambiguity, the three layers of syntax, semantics, and pragmatics, and the inside-out versus outside-in difference.

This article is one Wisdom Nugget from What Is Natural Language Processing? by Trevor Stephenson.

You use language so effortlessly that it is easy to forget how much invisible work you are doing every single time you speak or read. Think about the last conversation you had, maybe you asked a colleague, ‘Can you look at this when you get a chance?’ You did not stop to define ‘look’ or ‘chance’. Your colleague knew you meant review it when they had time, not literally stare at it during a chance event. You both followed a set of unwritten rules without ever discussing them. Human language is full of that kind of invisible understanding, and that is exactly what makes it hard for machines.

By the end of this Nugget you will be able to explain ambiguity at word, sentence, and context level with the book’s examples, test any sentence through syntax, semantics, and pragmatics, and explain why a computer that sees only character strings needs help at five steps: tokenisation, normalisation, representation, structure and context, and world knowledge.

The core idea

Human language is not like a simple code with one meaning per symbol. It is a living, contextual, social system. The first big challenge is ambiguity, which lives at every level. At the word level we have homonyms and polysemes, but the fancy name does not matter: what matters is you disambiguate without thinking, because you know the world. At the sentence level you use world knowledge to guess. Then there is context beyond the sentence, indirect requests, and world knowledge: ‘She poured water into the glass until it was full, then she poured the rest into the plant’: you know that ‘it’ refers to the glass, not the water, and that ‘rest’ refers to leftover water, because you know about pouring, glasses, fullness, and plants.

How it works

Section 1 covers ambiguity, context, and unwritten rules (Figures 2.0 and 2.1). Section 2 covers the three layers (Figure 2.2). Syntax is the most straightforward layer to model: we can teach a computer to parse a sentence into noun phrase, verb phrase, prepositional phrase, and build trees. Early NLP systems were almost entirely syntax-focused; they could tell you if a sentence was grammatically valid, but grammatically valid does not mean meaningful. Semantics is where ambiguity lives: ‘bank’ has the same syntax in ‘river bank’ and ‘savings bank’ but completely different semantics.

The tools

Tool 1: Use ambiguity examples to show the problem. ‘I saw her duck’: did you see a bird that belongs to her, or did you see her quickly lower her head? Both are perfectly valid interpretations of the same four words. Word level: ‘bank’, ‘bat’, ‘light’. Sentence level: ‘The man saw the woman with the telescope’: who has the telescope? Context level: ‘It is cold in here’ might mean close the window; ‘The bin is full’ often means ‘Could you take it out?’ Machines trained only on literal meanings miss these entirely.

Tool 2: Use the three layers as a test. Syntax is about structure, the order and arrangement of words: ‘The cat sat on the mat’ follows English syntax, ‘Cat the mat on sat the’ does not. Syntax is like the blueprint of a house. Semantics is about meaning: ‘Colourless green ideas sleep furiously’ is syntactically perfect but semantically bizarre. Pragmatics is about what we mean in a real situation: ‘It is getting late’ might mean ‘We should wrap up this meeting’ or ‘I need to go home’ depending on who says it, where, and with what tone.

Step by step

The end-of-chapter exercise as a numbered protocol, in order.

  1. Write 3 ambiguous sentences with explanations of at least two meanings each, like I saw her duck.
  2. Find an example of indirect request in your last 10 messages (e.g., It is cold in here meaning close window) and explain syntax vs semantics vs pragmatics.
  3. Choose a word with multiple meanings like bank, bat, light, and write two sentences where context disambiguates it, then describe what world knowledge a machine would need.
  4. Explain to a colleague why It is getting late can mean We should wrap up, using syntax, semantics, pragmatics layers. No time is stated in the book for this exercise.

Worked example

The book’s worked example is the email test. You receive an email that says: ‘Can you send the report ASAP? The client is waiting.’ Syntax check: Is it a well-formed sentence? Yes. Semantics check: What does it mean? Someone wants a report quickly because a client is waiting. Pragmatics check: What does it really mean in context? If it comes from your boss at 4:55 pm on a Friday, it probably means ‘Drop everything and send this now, this is urgent and important.’ The urgency is not in the words alone; it is in the situation.

A real example from the book

Case Study – Chapter 2: L’Artusi Reservation Confusion: Why Language Breaks Machines. No person age is given. The Italian restaurant L’Artusi receives a message: I saw her duck with the telescope at the bar. The host is confused. Is this about a bird, a person ducking, or a reservation note? This real customer message contains syntactic and semantic ambiguity. The pronoun her could refer to a guest or staff, duck could be noun or verb, and with the telescope could modify saw or duck. A human uses context: there is no pond at the bar, so bird is unlikely, and telescope suggests someone observing. The restaurant’s early rule-based chatbot, trained only on keywords table and reservation, fails and books a table for Duck, a guest name it invents.

Mistakes to avoid

  • Treating language like a simple code with one meaning per symbol. Correction: it is a living, contextual, social system.
  • Judging a system only on syntax. Correction: grammatically valid does not mean meaningful, test semantics and pragmatics too.
  • Answering ‘Could you pass the salt?’ literally. Correction: it is a polite request, and a system that answers ‘Yes, I could’ and does nothing has failed at pragmatics.
  • Assuming a machine shares your world knowledge. Correction: it has text, it has never held a glass, so it needs enough examples to learn the pattern.
  • Ignoring indirect requests. Correction: ‘It is cold in here’ and ‘The bin is full’ are requests, not weather reports.

What not to do

  • Do NOT treat language as a code with one meaning per symbol.
  • Do NOT judge an NLP tool on grammar alone.
  • Do NOT answer indirect requests literally.
  • Do NOT assume a machine knows what a glass or a suitcase is from lived experience.
  • Do NOT expect pragmatics to work just because syntax works.

Low-energy mode

Write one ambiguous sentence with two meanings, then name which layer, syntax, semantics, or pragmatics, makes it hard for a machine. That counts.

If you freelance

This is one way to apply the idea, not a passage from the book. A freelancer can use the three-layer test on a client message: check syntax, then meaning, then what the client really means in context, before replying, so an indirect request like ‘It is cold in here’ in a brief is not answered literally.

How to know it worked

You wrote 3 ambiguous sentences with at least two meanings each. You found one indirect request in your last 10 messages and explained it through syntax, semantics, and pragmatics. You wrote two sentences where context disambiguates bank, bat, or light, and named the world knowledge a machine would need.

Key takeaways

  • Human language is full of that kind of invisible understanding, and that is exactly what makes it hard for machines.
  • Syntax is like the blueprint of a house.
  • You understand language from the inside out, from meaning to words. Machines work from the outside in, from words towards meaning.
  • When you hear that NLP is hard, this is what people mean.

Try it today

Do Exercise – Chapter 2: Why Language Is Hard today (no time stated in the book, see Exercise).

End of Chapter Exercise – Chapter 2: Why Language Is Hard. No time stated in the book.

  1. Write 3 ambiguous sentences with explanations of at least two meanings each, like I saw her duck.
  2. Find an example of indirect request in your last 10 messages (e.g., It is cold in here meaning close window) and explain syntax vs semantics vs pragmatics.
  3. Choose a word with multiple meanings like bank, bat, light, and write two sentences where context disambiguates it, then describe what world knowledge a machine would need.
  4. Explain to a colleague why It is getting late can mean We should wrap up, using syntax, semantics, pragmatics layers.

Frequently asked questions

Why does trying harder not work here?
Trying harder to write more rules fails here, and the chapter’s history in Chapter 3 confirms it: hand-writing rules scales poorly because for every rule there are dozens of exceptions. The book’s own logic is that the fix is not more effort on rules, it is modelling ambiguity, context, and unwritten rules, which is the work NLP does.

How do I know it worked?
You wrote 3 ambiguous sentences with at least two meanings each. You found one indirect request in your last 10 messages and explained it through syntax, semantics, and pragmatics. You wrote two sentences where context disambiguates bank, bat, or light, and named the world knowledge a machine would need.

What if it does not work?
If you cannot find an indirect request, then check your last 10 messages for ‘It is cold in here’ or ‘The bin is full’ style lines and ask what the speaker wanted done. If syntax, semantics, and pragmatics blur together, then run the email test: well-formed, what it means, what it really means at 4:55 pm on a Friday.

Get the book

Google Play eBookGoogle Play AudiobookBarnes & Noble

More from What Is Natural Language Processing?