LESSON 1

Autocomplete in Overdrive

Developed by Carl T. Bergstrom and Jevin D. West

Photo: Carl Bergstrom

Photo: Carl Bergstrom

Complete this sentence:

After eating their fill of the sweet green grass, the horse and the cow returned home to the _____.

Did you say "barn"?

Most people do. So does ChatGPT.

This game of finishing the sentence asked you to try your hand at text prediction.

Given a string of words, you guessed the next one in the sequence. This basically all that ChatGPT and other LLMs are doing.

Fundamentally, large language models are autocomplete systems—like the one you use when texting.

They are vastly more powerful than what you get on an iPhone, but the principle is similar. 

Cell phone on a black slate blackground. Text message begins "Hey can you". Autocomplete suggests "please", "send", or "give".

Photo: Carl Bergstrom

Photo: Carl Bergstrom

For example, open a ChatGPT window and type the first sentence of a story.

Press the play () icon below to see what happens...

This may seem like a frivolous amusement...

But the same process allows the machine to hold a conversation…

ChatGPT Session: You said: Crows: great birds, or the best birds? ChatGPT said: ChatGPT  The best birds, hands down. They’re clever, funny, and a little spooky—in the best way. What do you love about them? You said: I love how smart and social they are. Brave and loyal.  ChatGPT said: ChatGPT  Exactly! They’ve got brains, heart, and guts. I love how they look out for each other and form tight-knit groups. Plus, the way they can solve puzzles and even remember people they like (or don’t!)—it’s next-level. They’re the whole package.

ChatGPT 4.o query 1/10/2025

ChatGPT 4.o query 1/10/2025

Revise your prose...

ChatGPT session: Please help me revise the following: Science is amazing because it gives us superpowers. We can measure things that are bigger or smaller than we can see with the naked eye. We can study things that happen faster than we can perceive. We can study things that happen much slower than our lifetime.  ChatGPT said: ChatGPT  Here’s a revised version of your text with smoother flow and a touch of polish:  Science is amazing because it gives us extraordinary abilities. It lets us measure things far beyond the reach of our eyes, from the tiniest particles to the vastest structures. It helps us explore events that unfold faster than we can perceive and those that occur over timescales far longer than a single lifetime.

ChatGPT 4.o query 1/10/2025

ChatGPT 4.o query 1/10/2025

Write code in any programming language you like...

ChatGPT session: Write me a python program to find anagams of my name, Carl T. Bergstrom. ChatGPT said: ChatGPT  Here's a concise Python program to find anagrams of your name, "Carl T. Bergstrom." It uses the itertools library to generate permutations: from itertools import permutations  def find_anagrams(name):     name = name.replace(" ", "").replace(".", "").lower()     perms = set(permutations(name))     return ["".join(p).capitalize() for p in perms]  name = "Carl T. Bergstrom" anagrams = find_anagrams(name)  # Limit the output to the first 20 anagrams for readability print(anagrams[:20])

ChatGPT 4.o query 1/10/2025

ChatGPT 4.o query 1/10/2025

And so much more.

We find it absolutely amazing that simply by predicting the next words in a stream of text, an algorithm can do all of the things that ChatGPT does. 

In a marketing masterstroke, AI companies have framed our interaction with LLMs not as autocomplete, but in the guise of a chat window.

As we will see, this small shift makes a huge difference in how we interact with these machines—and in what we expect of them. 

How do these systems do all the amazing things they do?

And why have then been developed just recently, rather than twenty years ago, or twenty years in the future?

The key ingredients seem to include the following:

  • a novel algorithmic architecture known as a transformer, developed in 2017.
  • the massive amounts of training data—information used to teach the machine to predict what will come next in a stream of text—that can now be scraped from the internet. Current models are thought to be trained on terabytes of text and code.
  • The process of reinforcement learning from human feedback, whereby an LLM interacts with human trainers to "learn" what humans are seeking when they query the model and what constitutes a good answer to a question.
  • the scale of contemporary computational power, which only recently became great enough to train a model of appropriate scale.

These developments, coupled with the weirdness of the trillion-dimensional spaces in which these algorithms operate, the remarkable utility of machine learning, and the surprising predictability of most linguistic activity, made it possible to create the powerful LLMs that we use today.

By thinking about what LLMs do, we can better understand what they don’t do. They don’t engage in logical reasoning. They don’t have any sort of embodied understanding of the world. They don’t even have a fundamental sense of truth and falsehood.

They simply generate plausible dialogue that resembles the text they were trained on.

That’s a key point. LLMs generate text based on their training data. Ask an LLM a question. It doesn’t ‘think’ about your question the way a person does. It tries to guess what words would have come next if your question had been in its training data. The wonder of LLMs is how well this simple trick approximates a thoughtful response.

PRINCIPLE
LLMs are predictive text generators. It is remarkable how many complex tasks can be performed in this way. But don’t let the impressive capabilities of LLMs lure you into thinking that they understand human experience or are capable of logical reasoning.

DISCUSSION
At first glance, a computer program that can autocomplete seems to be completely different from a computer program that holds a conversation, answers questions, or takes directions. Why do you think a program that simply tries to predict the most likely next word in a sequence would be good at these things?

Photo: Carl Bergstrom

Photo: Carl Bergstrom

VIDEO

PART 1
If LLMs are just fancy autocomplete machines, how can they do so many things so well?

PART 2
What is wrong with talking about "thinking" or "understanding" when it comes to large language models?