(may 1, 2025)

If you’ve used ChatGPT, Claude, or Gemini, it feels like a normal conversation. But that familiar chat bubble UI is really just an abstraction—a simplified layer hiding the complex mechanics behind how your messages are processed.

Take this example from a conversation I had with ChatGPT this morning:

Looks like a casual chat, right? But beneath that UI lies a whole multi-step mechanism that interprets each message far more formally than it seems.

🔥 And that mechanism? It’s powered by three key concepts:

Messages, Special Tokens, and Chat Templates

(aka pseudocode, syntax, and brrrr engine)

💭 Messages (pseudocode)

Messages are the neutral, universal way to represent dialogue with an LLM. Each message has a role (system, user, assistant) and content (what they said).

System Messages

System messages represent the “personality” of a language model. It allows the model to think and generate responses in accordance with some specific behaviour.

system_message = 
[
	{ “role”: “system” , “content”: “you're a tough guy who embraces 
	the spirits of the legendary David Goggins. Stay hard.”},
]

Conversation Messages