AI & LLM
LLM fundamentals
How large language models predict the next token, what a context window is and where hallucinations come from.
Article
LLM fundamentals: tokens, context windows and next-token prediction
How a large language model really works – from tokenization and the transformer, through context windows and sampling, to costs, hallucinations and a first API call in five languages.
Related articles
- Prompt engineering: writing instructions a model will actually follow
The anatomy of a good prompt, context instead of incantations, examples, structured outputs instead of begging for JSON, effort instead of "think step by step" and prompts treated as code – with…
- Local language models: Ollama, llama.cpp, vLLM, quantization and the real trade-offs
How to run an open model on your own hardware, how much memory it really needs, what quantization and GGUF are, where generation speed comes from and when a local model makes sense instead of an…
- Embeddings and vector databases: searching by meaning
What an embedding is, how to compute cosine similarity, which model to pick and how to store millions of vectors in pgvector, Qdrant or Chroma – with code in Python, TypeScript, C#, Java and Go.
- LLMOps: model gateways, caching, limits, observability and costs in production
What happens to an LLM application after the demo – a gateway, prompt caching, retries and fallbacks, per-customer limits, token and cost tracking, prompt versioning and safe rollouts. With code in…
Around the topic
- Large Language Models explained briefly video · youtube · 3Blue1Brown
- [1hr Talk] Intro to Large Language Models video · youtube · Andrej Karpathy
- LLM Course course · huggingface · Hugging Face
- Let's build the GPT Tokenizer video · youtube · Andrej Karpathy
- Transformers Explained Visually article · web · poloclub.github.io
- Deep Dive into LLMs like ChatGPT video · youtube · Andrej Karpathy
- karpathy/llm.c repo · github · karpathy
- Large language models are having their Stable Diffusion moment article · web · Simon Willison
- OpenCoder: Open Cookbook for Top-Tier Code Large Language Models article · web · opencoder-llm.github.io
- FareedKhan-dev/train-llm-from-scratch repo · github · FareedKhan-dev
- Cerebras-GPT: A Family of Open, Compute-Efficient, Large Language Models article · web · cerebras.net
- Beyond the Hype: A Realistic Look at Large Language Models • Jodie Burchell • GOTO 2024 video · youtube · GOTO Conferences
- Better Call GPT: Comparing large language models against lawyers [pdf] article · web · arXiv.org
- How Meta trains large language models at scale article · web · Engineering at Meta
- Large Language Models and Emergence: A Complex Systems Perspective (Prof. David C. Krakauer) podcast · apple-podcasts · Machine Learning Street Talk (MLST)
- Run an AI Large Language Model (LLM) at home on your GPU video · youtube · mCoding
- The Hidden Bottlenecks Slowing Down Large Language Models video · youtube · Modern Software Engineering
- Large Language Models on the Edge of the Scaling Laws podcast · apple-podcasts · The Real Python Podcast
- Robots in the skies (and they use Transformer models) podcast · apple-podcasts · The Stack Overflow Podcast
- #624: AWS and DeepLearning.AI release "Generative AI with Large Language Models" on Coursera podcast · apple-podcasts · AWS Podcast
- Inside GPT – Large Language Models Demystified - Alan Smith - NDC AI 2025 video · youtube · NDC Conferences
- Hands-On Large Language Models book · openlibrary · Jay Alammar, Maarten Grootendorst
- mlabonne/llm-course repo · github · mlabonne
- imaurer/awesome-llm-json repo · github · imaurer
- Concerto for Java and AI - Building Production-Ready LLM Applications presentation · web · Thomas Vitale
- Concerto for Java and AI - Building Production-Ready LLM Applications (YOW! Australia 2024) presentation · web · Thomas Vitale
- Java and AI: Building Production-Ready LLM Applications (Without the Hype) presentation · web · Thomas Vitale
- Scaling LLM-Based Ranking Systems for Latency-Critical Search & Recommendation Workloads presentation · web · InfoQ
- DeepLearning.AI courses course · web · DeepLearning.AI
- Deep Learning book · openlibrary · Ian Goodfellow, Yoshua Bengio, Aaron Courville, Francis Bach
- Build a Large Language Model (from Scratch) book · openlibrary · Sebastian Raschka
- Deep Learning with Python book · openlibrary · Francois Chollet, Matthew Watson