Unlocking the Magic of Language Models
A Journey Through Jay’s LLM Universe
What if you could learn how ChatGPT works — without being a math genius or coding wizard? That’s exactly what Jay, an Engineering Fellow at Cohere and author of Hands-On Large Language Models, aims to do.
In a world where AI often feels like magic, Jay plays the role of the translator — someone who can talk to the gods (the AI systems) and explain it all to us mere mortals.
In this post, we’ll walk through the main ideas from Jay’s book and podcast appearance — from how large language models (LLMs) actually work, to how they’re used in real life, and why they’re more than just fancy chatbots.
📖 What’s the Book About?
Jay’s book is like a visual crash course in LLMs, packed with 300+ diagrams to help you see how things work, not just read about them.
It’s split into 3 parts:
- Understanding Language Models — What are LLMs, and how did we get here?
- Applications — How can regular people and companies use LLMs?
- Training & Fine-tuning — How do companies build and improve these models?
Let’s go through each part.
🧩 Part 1: Understanding Language Models
🧱 What Are Tokens and Embeddings?
To computers, text isn’t text — it’s tokens. These are chunks of words like “I,” “love,” and “pizza.” The LLM breaks your sentence into these chunks using a tokenizer.
But words aren’t enough. The model needs numbers.
That’s where embeddings come in. They turn tokens into vectors — rows of numbers that capture the meaning of the word in context. Think of embeddings as the “brain language” of the model.
Example: “Paris” and “France” might have similar embeddings because they often appear together.
🔄 From Bag-of-Words to Transformers
Before Transformers, AI models read words like a bag of Scrabble tiles — no order, no nuance.
Then came Transformers, which introduced the concept of attention — a way for the model to focus on what really matters in a sentence, like a human skimming for important info.
“The cat sat on the mat” vs. “The mat was sat on by the cat” — Transformers get the context.
Most modern LLMs, like GPT, are decoder-only Transformers. They read your input and predict one word at a time, looping until they reach the end.
⚙️ Efficiency Tricks
LLMs are big and expensive to run. To make them faster:
- KV caching: Reuses parts of previous calculations.
- Grouped Query Attention: Makes attention faster at scale.
- Rotary Embeddings: Improve how models understand word positions.
These tweaks make the same architecture smarter, faster, and cheaper.
🛠️ Part 2: How LLMs Are Used in Real Life
This is where things get fun. Jay says most people won’t train their own models — they’ll just use them through APIs or open-source tools.
Here are some real-world applications:
✨ Prompt Engineering
You shape the model’s output by carefully designing your input (the prompt).
Prompt: “Explain AI to a 5-year-old”
Result: A simple, cute answer instead of jargon.
🔍 Semantic Search & RAG
Forget keyword search. Semantic search finds meaning, not just words.
- Dense retrieval: Finds related ideas using embeddings.
- Reranking: Reorders search results using LLMs for better relevance.
This powers RAG (Retrieval Augmented Generation) — a hot industry trend.
🔁 What Is RAG?
Instead of letting the LLM make things up (“hallucinate”), RAG gives it a curated knowledge base to pull from.
Example: “What’s Apple’s latest revenue?”
RAG looks up the real answer from your docs or a database.
Why RAG matters:
- Less hallucination
- More trust (because it can cite sources)
- Easier updates (you change the data, not the model)
- Better control and privacy (e.g., internal company docs)
🧠 How Advanced RAG Works
RAG is evolving fast:
- Query rewriting: The model rewrites vague questions into better ones.
- Multi-query RAG: Searches multiple angles of a complex question.
- Query routing: Sends HR queries to internal docs, sports questions to the web.
- Multi-hop RAG: Chains multiple searches together to build a deep answer.
This turns the model into an agent — capable of making decisions, solving multi-step problems, and even writing & executing code (e.g., drawing graphs using Python).
🧪 Part 3: How LLMs Are Trained and Fine-tuned
Training an LLM is like building a rocket ship — huge, complex, and expensive.
Here’s the typical process:
1. Pretraining
- The model learns language from massive text data.
- This gives it general knowledge, but it’s still rough.
2. Supervised Fine-tuning
- Teach the model to follow instructions:
“When asked a question, give a direct answer.”
This is called instruction tuning.
3. Preference Tuning (RLHF)
- Humans (or LLMs pretending to be humans) score the model’s answers.
- A reward model is trained to prefer good responses.
- The model learns to generate outputs people like.
All post-training steps help align the model with human expectations — like being helpful, not offensive, and staying on-topic.
🌎 Cohere’s Focus: Enterprise AI
Cohere isn’t trying to build another ChatGPT. They focus on enterprise solutions:
- Private deployments: Run models inside a company’s systems.
- Multilingual support: For global teams.
- Ranking & search: To power better internal knowledge tools.
They also prioritize safety:
- Start with internal tools (less risky).
- Use LLMs for reliable tasks like search and classification.
- Be cautious with public-facing bots (until safety improves).
🎓 Jay’s Advice to Students and Learners
Want to break into AI? Jay says:
“Follow your curiosity and learn in public.”
That means:
- Blog about what you learn.
- Share experiments on GitHub.
- Post insights on LinkedIn.
This builds your personal brand and shows employers you’re both curious and capable.
🧠 Final Thoughts: LLMs Are Just Getting Started
Jay’s message is clear: you don’t need to be a PhD to understand or use LLMs. With the right mindset and curiosity, you can start exploring today.
From smart searches to powerful agents, the world of LLMs is moving fast — but books like Jay’s help us keep up.
So whether you’re a student, a developer, or just plain curious, remember: the future of AI isn’t just about machines — it’s about how humans use them.
Have a nice day,
— AR
