aifree.dev

How does it know what "it" refers to?

Self-attention · Beginner · 5 min · attention, transformer, llm

Self-attention is how a language model decides which other words matter for each word: every word scores every other word, and the scores are learned from text, not written as rules.

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

1 = not at all · 5 = easily

  1. 1 Guess first

    "The animal didn’t cross the street because it was too tired." How does the model work out what "it" means?
  2. 2 Look

    Who does "it" point at?

    1 / 4
    0%The
    83%animal
    0%didn
    0%'
    0%t
    0%cross
    0%the
    5%street
    0%because
    0%it
    0%was
    0%too
    5%tired

    real bert-base-uncased attention, one head (#220)

    The sentence as pieces in a theatre. "it" is down front with the light. No scores yet.

    One word changes and the light moves from "animal" to "street": the scores are about the whole sentence, not the nearest noun.

  3. It is not reading left to right like you. All pieces look at all pieces at once, and each pair gets a score. High score = pay attention. Nobody typed the scores in; they came out of reading a very large amount of text.

  4. 4 You are the model

    You hold the light. Tap the seat where you think it will settle, press Sweep, then flip "tired" to "wide" and try again.

    0%it

    tap the seat where you think the light will settle

  5. 5 Check

    In "…because it was too wide", which seat should get the highest score from "it"?
  6. Why "self"? Because the sentence scores itself: no outside helper, no lookup. That is also why it can follow a paragraph, not just a line — every piece can reach every other piece in one step.

  7. 7 Say it back

  8. 8 Mission · 2 min

    Open a free chatbot. Paste "The animal didn’t cross the street because it was too tired" and ask what "it" refers to. Then paste the "too wide" version. Then try "The dog chased the cat because it was fast" and watch it hedge.

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.

Sources

Published Oct 20, 2026 · updated Oct 20, 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/self-attention" width="100%" height="620" style="border:0;max-width:720px" title="How does it know what &quot;it&quot; refers to? (aifree.dev Explain)" loading="lazy"></iframe>
<p><a href="https://aifree.dev/explain/self-attention">How does it know what &quot;it&quot; refers to? 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.

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