aifree.dev

How did it learn all this?

Training: loss and gradient descent · Builder · 8 min · training, llm · after Next-token prediction

Training is a loop: the model guesses the next piece of real text, a loss score measures how wrong the guess was, and every number inside is nudged slightly downhill. Billions of small nudges, no rules, no teacher explaining anything.

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

1 = not at all · 5 = easily

  1. 1 Guess first

    How does the model learn that "Paris" follows "The capital of France is"?
  2. 2 Look

    Guess, measure, nudge

    1 / 3
    lowest lossloss ↑ = more wrong

    learning rate 0.4 · steps 0

    The model starts as a ball dropped somewhere random. Height is loss: how wrong its guesses are on the training text.

    The ball only ever moves a little downhill, yet it finds the valley — unless the nudge is so big it flies out.

  3. Take a sentence from the training text, hide the next piece, let the model guess. The loss says how far the odds were from the truth. Then nudge every one of the billions of numbers a hair in the direction that lowers the loss. Repeat on the next sentence. For months.

  4. 4 You are the model

    Choose a nudge size (the learning rate), then Step the ball down the hill. Reach the valley without flying out.

    lowest lossloss ↑ = more wrong
    1.2 ✓
    tinyhuge
    Pick a nudge size, then step the ball down. Reach the valley without flying out.
  5. 5 Check

    What happens if the learning rate is too large?
  6. This is why facts can be fuzzy: nothing was stored as a fact. The numbers that make "Paris" likely after "capital of France" are the same numbers that do everything else, nudged together.

  7. 7 Say it back

  8. 8 Mission · 5 min

    Grab a free GPU quota and run a tiny training notebook (any "train a character-level model" tutorial). Watch the loss number fall for five minutes. That falling number is this lesson.

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/training" width="100%" height="620" style="border:0;max-width:720px" title="How did it learn all this? (aifree.dev Explain)" loading="lazy"></iframe>
<p><a href="https://aifree.dev/explain/training">How did it learn all this? 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