LLM Basicsthe autocomplete that ate the internet

Topic 1 of 90Module 1: Foundations2 min read

Forget "artificial intelligence" for a second. An LLM (Large Language Model) is, at its core, a very powerful autocomplete.

You've used autocomplete on your phone. You type "I'll call you" and it suggests "later." It learned that from patterns in text. An LLM is the same idea, scaled up insanely: instead of learning from your texting history, it learned from trillions of words — books, websites, code, Wikipedia, conversations.

The core job of an LLM is stupidly simple: given some text, predict the next word.

That's it. That's the whole trick.

"The capital of Pakistan is ___" → the model predicts "Islamabad" because in its training data, that sentence pattern almost always ended that way.

The magic is what emerges when you do this prediction extremely well. To predict the next word in "The lawyer argued that the contract was ___", the model has to implicitly understand law, grammar, logic, and context. Good prediction forces understanding. That's the deep insight of the whole field.

A prompt goes into the model — billions of knobs — and comes out as a probability over every possible next word: Islamabad 40%, a question 10%, banana 0.1%. Good prediction forces understanding.
A prompt goes into the model — billions of knobs — and comes out as a probability over every possible next word: Islamabad 40%, a question 10%, banana 0.1%. Good prediction forces understanding.

Daily-life analogy: Imagine someone who has read every book in the world's biggest library, millions of times. They don't have the books with them anymore — but they absorbed the patterns. Ask them anything, and they complete your sentence based on everything they've absorbed. Sometimes they're brilliant. Sometimes they confidently make things up, because they're pattern-matching, not looking things up.

Difficult word explained: "Model" just means a mathematical system that takes an input and produces an output. Like a formula, but with billions of adjustable knobs instead of two or three.

Summary

An LLM is a next-word predictor trained on massive amounts of text. Everything else — chat, coding, reasoning — is built on top of that one skill.

Mental model

A librarian who memorized the patterns of every book ever written, and answers by completing your sentence.

Mistakes to avoid

  • Thinking the model "looks things up" — it doesn't. It has no database inside. It has learned patterns.
  • Thinking it "knows" facts the way you do. It knows what words tend to follow other words. This is why hallucination exists.

Exercise

Open any LLM and give it half a sentence: "The best way to learn programming is". Do it 5 times. Notice you get different completions. Ask yourself: why different answers each time? (Hold that question — Topic 2 answers it.)