Not a Brain, Not a Database · AI & LLM Literacy
Ch 1 · What Is an AI Language Model? — card 2 of 2.
A common myth is that the AI "remembers facts" like a search engine. It doesn't store sentences to fetch later — it stores patterns as billions of numbers (called weights). Here's a tiny taste of next-word prediction using nothing but counting.
text = "the cat sat on the mat the cat ran"
words = text.split()
# Count what word tends to follow "the"
following = {}
for i in range(len(words) - 1):
if words[i] == "the":
nxt = words[i + 1]
following[nxt] = following.get(nxt, 0) + 1
print(following)
best = max(following, key=following.get)
print("most likely after 'the':", best)