---
title: "Discussion on \"Why Next-Word Prediction Shouldn't Have Worked (But Somehow Did)\" | Hashnode"
description: "Discussion on \"Why Next-Word Prediction Shouldn't Have Worked (But Somehow Did)\". One of the most powerful technologies in history is built on an idea that sounds almost absurd: predict the next word. So how did that simple objective lead to coding assistants, AI tutors, and ChatGPT?"
url: "https://hashnode.com/posts/why-next-word-prediction-shouldn-t-have-worked-but-somehow-did/6a6cd530a50525eff25f9da8"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Why Next-Word Prediction Shouldn't Have Worked (But Somehow Did)](https://pulkitkushwaha.hashnode.dev/why-next-word-prediction-shouldn-t-have-worked-but-somehow-did?utm_source=hashnode&utm_medium=feed)

One of the most powerful technologies in history is built on an idea that sounds almost absurd: predict the next word. So how did that simple objective lead to coding assistants, AI tutors, and ChatGPT?

Jul 31 · 12 min read · pulkitkushwaha.hashnode.dev  
Updated Aug 29  
Read the article

-   [#artificial-intelligence](https://hashnode.com/tag/artificial-intelligence)
-   [#generative-ai](https://hashnode.com/tag/generative-ai)
-   [#machine-learning](https://hashnode.com/tag/machine-learning)
-   [#llm](https://hashnode.com/tag/llm)
-   [#chatgpt](https://hashnode.com/tag/chatgpt)
-   [#deeplearning](https://hashnode.com/tag/deeplearning)

## Written by

[Pulkit Kushwaha](https://hashnode.com/@pulkitkushwaha)

@pulkitkushwaha · Pune, India

  
[View profile](https://hashnode.com/@pulkitkushwaha)

I break things with AI agents, so you don't have to.

AI engineer. Been in this rabbit hole since before it was cool. I started with the math of deep learning when in college, now I ship enterprise-grade AI systems for a living. The obsession never changed, just the scale. Writing here so you don't have to learn everything the hard way.

## Responses 2

Markdown supported · ⌘↵ to post

[Josh Green](https://hashnode.com/@joshgreen)

[Aug 1](https://hashnode.com/posts/why-next-word-prediction-shouldn-t-have-worked-but-somehow-did/6a6cd530a50525eff25f9da8/comment/6a6db93090e91f46e072d2b9)

The compression-of-knowledge framing is the part that finally made this click for me too. What I keep bumping into on the practical side is that the 'it somehow works' surprise cuts both ways. I run these models locally on modest hardware, and the same thing that makes next-word prediction feel like magic also makes them weirdly brittle: a model that should fly on paper will crawl the moment the runtime or the quantization is slightly off. The understanding vs pattern-matching debate honestly matters less to me than the fact that the behaviour is emergent enough that you cannot fully reason about it from the arcitecture alone, you have to run it and watch. Good writeup, the library analogy is a keeper.

[Pulkit Kushwaha](https://hashnode.com/@pulkitkushwaha)

[Aug 1](https://hashnode.com/posts/why-next-word-prediction-shouldn-t-have-worked-but-somehow-did/6a6cd530a50525eff25f9da8/comment/6a6db93090e91f46e072d2b9#reply-6a6dc00c6e1e6e8ac059bf6a)

I really like your observation that you can't fully reason about these systems from the architecture alone, you have to run them and watch. I strongly agree with this.

That feels very different from traditional software engineering, where behavior is largely determined by logic we've explicitly written. With LLMs, the training objective may be simple, but the resulting behaviour can be surprisingly difficult to predict, especially once quantization, runtimes, context windows, and deployment constraints enter the picture.

I also agree that the understanding vs pattern-matching debate becomes less important when you're actually working with these models. At some point, the practical question shifts from "What should happen?" to "What actually happens?"

Appreciate the comment, and I'm glad the compression-of-knowledge and library analogies resonated with you. You can give my other articles a try, I am trying to write more about the interesting things about AI, apart from its technical usage, which we hear about in the corporate world like a mantra, haha. Really appreciate you dropping by.
