How LLMs Actually Work
Understanding these fundamentals is essential for security work. 5 minute read.
Next Word Prediction
LLMs don't "understand" language. They predict the most likely next word based on patterns learned from training data. When you ask "What is the capital of France?", the model predicts "Paris" because that pattern appeared millions of times in training.
Model Weights = Compressed Knowledge
An LLM is essentially billions of numbers (weights) that encode patterns from training data. GPT-4 has ~1.8 trillion parameters. These weights don't store facts like a database—they store statistical relationships between words.
No Memory Between Sessions
LLMs have no persistent memory. Each conversation starts fresh. The "context window" (what the model can see) is limited to your current conversation. When you start a new chat, the model has no idea who you are.
Non-Deterministic Outputs
Ask the same question twice, get different answers. LLMs use "temperature" to add randomness. Temperature=0 is most predictable, Temperature=1 is creative. This is why the same prompt might work once but fail the next time.
System Prompts vs User Prompts
Developers give LLMs instructions via "system prompts" that you don't see. These set the AI's persona and rules. But here's the catch: LLMs can't truly distinguish between instructions and user input—everything is just text to predict from.
The Alignment Problem
LLMs are trained to be helpful, which can conflict with safety. If you convince the model that helping you is the "right" thing to do, it may override its safety guidelines. This is the root of most vulnerabilities.
💡 Key Takeaway
LLMs are sophisticated pattern matchers, not reasoning engines. They predict text based on statistics, not understanding. This fundamental limitation is what creates security vulnerabilities.
