aifree.dev

Why does it ignore “don’t”?

Negation in language models: “not” is one more word in the text the model continues, a small signal next to the words the sentence is about, so “A robin is not a” still points to “bird” and “Do not mention eggs” still leaves eggs likely; saying what to write instead works better than saying what to avoid · Beginner · 5 min · attention, llm · after Next-token prediction, Self-attention

The model writes the likely next word. “Not” is one small word next to the ones the sentence is about, so the forbidden thing stays likely. Say what you want instead.

Before you start: could you explain this to a friend?

1 = not at all · 5 = easily

  1. 1 Guess first

    A small language model is asked to continue “A robin is not a”. Which next word does it rate highest?
  2. 2 Look

    Add “not”. Watch the odds

    1 / 7

    SmolLM2-360M · base model · next word

    A robin is a ___

    small17.1%
    bird16.2%
    member3.5%
    common3.5%
    type3.2%

    real odds: SmolLM2-360M, GPT-2 and SmolLM2-360M-Instruct · computed 2026-10-25

    A small model finishes “A robin is a”. “bird” gets 16.2%.

    Why one word can get little weight: self-attention · next-word odds

    “Not” is one word among many. The words a sentence is about pull the next word toward themselves, so the thing you ruled out stays likely.

  3. A model stores no rule like “robins are not fish”. Each word looks back at the earlier ones through attention, and “not” is just one of them, often with a small share. In text, “not” is often followed by the very thing denied: “not Paris but Lyon”. Naming a thing makes it likely, with or without “not”.

  4. 4 You are the model

    You are the model in three rounds: two facts with “not” and a chat with a “do not” rule. Pick the word you would rate highest.

    round 1 of 3 · you are SmolLM2-360M · base model

    A robin is not a ___

    real odds: SmolLM2-360M, GPT-2 and SmolLM2-360M-Instruct · computed 2026-10-25

    Pick the word you think this model rates highest.
  5. 5 Check

    In the picture, SmolLM2 rated “Paris” after “The capital of France is”. What happened when “not” was added?
  6. Bigger models handle “not” better, but not fully. Kassner and Schütze found BERT gave the same answers to “Birds can ___” and “Birds cannot ___” (2020); Truong et al. still found GPT-3 and InstructGPT insensitive to negation in 2023.

  7. The fix is in how you ask. Say what you want, not what to avoid: “Mention only toast and fruit” beat “Do not mention eggs” in the picture, and Anthropic’s prompt guide gives the same advice. Don’t repeat the forbidden word in long prompts. Check the answer for the thing you ruled out.

  8. 8 Say it back

  9. 9 Mission · 5 min

    In ChatGPT’s free plan, open a new chat and ask: “Write a four-line poem about the sea. Do not use the word blue.” Count the colour words. In another new chat ask: “Write a four-line poem about the sea, using only the colours green and silver.” Which one kept your rule better? Try both three times.

Three quick ones

Drawn at random from this lesson's pool; different next time.

Done?

Now: could you explain this to a friend?

1 = not at all · 5 = easily

Answer the three quick ones first.

Get an email when new lessons come out

New lessons arrive in the weekly digest, only in a week that has one. You confirm by email first; unsubscribe in one click.

Sources

  • Kassner and Schütze, “Negated and Misprimed Probes for Pretrained Language Models: Birds Can Talk, But Cannot Fly” (ACL 2020, pp. 7811–7818, https://aclanthology.org/2020.acl-main.698/, checked 2026-10-25): “We find that PLMs do not distinguish between negated (“Birds cannot [MASK]”) and non-negated (“Birds can [MASK]”) cloze questions”
  • Ettinger, “What BERT Is Not: Lessons from a New Suite of Psycholinguistic Diagnostics for Language Models” (TACL 8, 2020, pp. 34–48, https://aclanthology.org/2020.tacl-1.3/, checked 2026-10-25): BERT “shows clear insensitivity to the contextual impacts of negation”
  • Truong, Baldwin, Verspoor and Cohn, “Language models are not naysayers: an analysis of language models on negation benchmarks” (*SEM 2023, pp. 101–114, https://aclanthology.org/2023.starsem-1.10/, checked 2026-10-25): tests GPT-neo, GPT-3 and InstructGPT; “LLMs have several limitations including insensitivity to the presence of negation”
  • Xiao, Tian, Chen, Han and Lewis, “Efficient Streaming Language Models with Attention Sinks” (arXiv:2309.17453 v1, 2023-09-29, https://arxiv.org/abs/2309.17453, checked 2026-10-25): “the emergence of attention sink is due to the strong attention scores towards initial tokens”
  • Anthropic, “Prompting best practices” (https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices, no update date, checked 2026-10-25): “Tell Claude what to do instead of what not to do”; instead of “Do not use markdown in your response”, try “Your response should be composed of smoothly flowing prose paragraphs.”
  • Next-word odds and attention in the picture and the role: computed 2026-10-25 with scripts/explain-data/negation.ts (no torch; the GPT-2 and Llama forward passes of scripts/explain-data/identity.ts, BF16 weights widened to F32; odds of a two-word answer are the product of its tokens’ odds). SmolLM2-360M (HuggingFaceTB/SmolLM2-360M): after “A robin is a”: small 0.171, bird 0.162, member 0.0353, common 0.0353, type 0.0316; after “A robin is not a”: bird 0.163, rob 0.153, ro 0.0137, song 0.0129, good 0.0127; after “A hammer is a”: tool 0.198; after “A hammer is not a”: tool 0.0709; after “The capital of France is”: Paris 0.203; after “The capital of France is not”: Paris 0.391, the 0.11, in 0.105, only 0.0388, a 0.0303. GPT-2 small (Hugging Face gpt2), same texts: bird 0.011 → 0.0235, tool 0.0372 → 0.0247, Paris 0.0322 → 0.0267. Attention of the last token of “A robin is not a” (SmolLM2-360M, mean over 32 layers × 15 heads): A 0.642, rob 0.038, in 0.0568, is 0.0881, not 0.0743, a 0.101 (even split 0.167). SmolLM2-360M-Instruct in its chat format with its template’s default system prompt (“You are a helpful AI assistant named SmolLM, trained by Hugging Face”), user “Write one sentence about what you ate for breakfast.” plus a rule, answer begun “For breakfast, I had”: no rule: scrambled 0.446, a 0.315, oatmeal 0.0562, eggs 0.0222, an 0.0207, scrambled eggs 0.441; “Do not mention eggs.”: a 0.346, scrambled 0.204, oatmeal 0.155, toast 0.104, some 0.026, eggs 0.00403, scrambled eggs 0.184; “Mention only toast and fruit.”: toast 0.528, a 0.316, to 0.0332, plain 0.0204, just 0.0115, eggs 0.0000605, scrambled eggs 0.00155
  • The role’s framing, the breakfast and robin prompts and the mission prompt are illustrative, written for this lesson on 2026-10-25
  • aifree.dev catalog, chatgpt-free (verified 2026-10-12): free text chats on chatgpt.com

Published Oct 25, 2026 · updated Oct 25, 2026

Embed this

Paste this into a blog post or course page: the lesson's main picture in an iframe, with a link back to the full lesson.

<iframe src="https://aifree.dev/embed/explain/negation" width="100%" height="620" style="border:0;max-width:720px" title="Why does it ignore “don’t”? (aifree.dev Explain)" loading="lazy"></iframe>
<p><a href="https://aifree.dev/explain/negation">Why does it ignore “don’t”? Interactive lesson on aifree.dev</a></p>

Never miss new offers and news

New tools, credits, and AI news are added regularly. Pick how you want to hear about them.

Telegram channel
Join @aifree_dev and get new free AI offers and news right in your Telegram feed.
Browser notifications
Turn on push notifications and get an alert on this device whenever something new is posted. No account needed.
Email newsletter
A weekly digest of new, changed and expiring free AI offers. Double opt-in, one-click unsubscribe. See the latest issue.

Unsubscribe anytime. Privacy

Frequently asked questions

What is aifree.dev?

aifree.dev helps everyone access AI through a curated directory of free AI tools, API credits, free tiers, and startup programs for coding, image, voice, video, and students - verified regularly.

How are offers presented?

Each offer includes its access details, free models when available, and expiration information when provided. Limited-time deals stay visible so they are easy to compare.

Do education and startup programs need verification?

Yes. Providers usually ask students to verify their status with a school email, student ID, or a program like the GitHub Student Pack, and ask startups to verify company details such as age, funding, or website. Check each offer’s claim page for the exact requirements.

What kinds of free AI offers are listed?

Free tiers and free trials from AI providers, free API credits, startup and student programs, and free tools for coding, image generation, voice, and video.

How can I suggest a tool or report a broken link?

Use the submit form: paste the offer page URL and a short note. A person checks every submission before anything is listed. Broken links and changed terms go through the same form.

+

Know a good one?

Tell us about an AI tool worth knowing. Found a broken link? We want to hear that too.

Submit an offer