Skip to main content

Learning path · Beginner

AI and large language models

How machines learn, what's inside a chatbot, and how to build with one.

The ideas behind machine learning, the pieces of a large language model, the techniques for getting good answers out of it, and the agents built on top.

41 pages4 chaptersabout 1.5 hours of reading

  • AI & Machine Learning
  • Security

Not started yet0/41 read

Start with Artificial Intelligence

Progress comes from your reading history, kept only in this browser.

Chapter 1How machines learn

  1. 1Artificial IntelligenceAI & Machine Learning, p. 4Artificial intelligence (AI) is the field of computer science that builds systems able to do tasks that normally require human intelligence.
  2. 2Machine LearningAI & Machine Learning, p. 27Machine learning is a branch of artificial intelligence in which computers learn patterns from data to make predictions instead of following hand-written rules.
  3. 3Training DataAI & Machine Learning, p. 48Training data is the set of examples a machine learning model learns from, and its quality, size, and coverage largely determine how well the model performs.
  4. 4Supervised LearningAI & Machine Learning, p. 43Supervised learning is machine learning where a model learns from labeled examples, inputs paired with correct answers, to predict outputs for new data.
  5. 5Unsupervised LearningAI & Machine Learning, p. 50Unsupervised learning is machine learning in which a model finds patterns, groups, or structure in unlabeled data, without being given the correct answers.
  6. 6Neural NetworkAI & Machine Learning, p. 33A neural network is a machine learning model made of layers of connected artificial neurons that learn patterns from data by adjusting numeric weights.
  7. 7Deep LearningAI & Machine Learning, p. 14Deep learning is a subset of machine learning that uses neural networks with many layers to learn complex patterns from raw data such as images and text.
  8. 8Gradient DescentAI & Machine Learning, p. 22Gradient descent is an optimization algorithm that trains machine learning models by repeatedly nudging their parameters in the direction that reduces error.
  9. 9BackpropagationAI & Machine Learning, p. 6Backpropagation is the algorithm that trains neural networks by measuring how much each weight added to the error and nudging every weight to reduce it.
  10. 10OverfittingAI & Machine Learning, p. 34Overfitting happens when a machine learning model learns its training data so closely, including its noise, that it performs poorly on new, unseen data.

Chapter 2Inside a language model

  1. 11Natural Language ProcessingAI & Machine Learning, p. 32Natural language processing is the field of AI that teaches computers to read, understand, and generate human language in the form of text or speech.
  2. 12TransformerAI & Machine Learning, p. 49A transformer is a neural network architecture that uses attention to weigh how each token in a sequence relates to the others, and it powers most modern LLMs.
  3. 13Attention MechanismAI & Machine Learning, p. 5The attention mechanism is a neural network technique that lets a model decide, for each token, which other parts of the input matter most and focus on them.
  4. 14LLMAI & Machine Learning, p. 25An LLM is a machine learning model trained on huge amounts of text that generates language by repeatedly predicting the next most likely piece of text.
  5. 15GPTAI & Machine Learning, p. 21GPT (Generative Pre-trained Transformer) is OpenAI's family of large language models that generate text by predicting the next token.
  6. 16TokenAI & Machine Learning, p. 46A token is the basic unit of text that an LLM reads and generates, usually a whole word, part of a word, or a punctuation mark, mapped to a numeric ID.
  7. 17EmbeddingAI & Machine Learning, p. 16An embedding is a list of numbers, called a vector, that represents the meaning of text, images, or other data so that similar items end up close together.
  8. 18Context WindowAI & Machine Learning, p. 12A context window is the maximum amount of text, measured in tokens, that an LLM can consider at once, including the prompt, conversation history, and its reply.
  9. 19Model ParametersAI & Machine Learning, p. 30Model parameters are the internal numbers, such as weights and biases, that a machine learning model learns in training and uses to turn inputs into outputs.
  10. 20Mixture of ExpertsAI & Machine Learning, p. 28A mixture of experts (MoE) is a neural network design that sends each input to only a few of many small experts, so a huge model costs far less to run.

Chapter 3Working with LLMs

  1. 21PromptAI & Machine Learning, p. 35A prompt is the input text or instructions you give an AI model, such as an LLM, to tell it what task to perform and what kind of answer you want.
  2. 22System PromptAI & Machine Learning, p. 44A system prompt is the instructions an app gives a language model before the conversation starts, setting its role, rules, tone and what it should know.
  3. 23Prompt EngineeringAI & Machine Learning, p. 36Prompt engineering is the practice of designing, testing, and refining the instructions given to an AI model so it produces accurate, consistent, useful output.
  4. 24Few-Shot LearningAI & Machine Learning, p. 18Few-shot learning is getting an AI model to perform a task from just a handful of examples, most often by placing a few sample inputs and outputs in the prompt.
  5. 25Chain-of-Thought PromptingAI & Machine Learning, p. 7Chain-of-thought prompting is a technique that asks an LLM to reason through intermediate steps before its final answer, improving accuracy on complex tasks.
  6. 26Reasoning ModelAI & Machine Learning, p. 39A reasoning model is a language model trained to work through a problem step by step before answering, spending extra computation to do better on hard tasks.
  7. 27TemperatureAI & Machine Learning, p. 45Temperature is a setting that controls how random an LLM's output is, from focused and predictable at low values to more varied and creative at high values.
  8. 28HallucinationAI & Machine Learning, p. 23A hallucination is when an AI model, such as an LLM, confidently produces information that sounds plausible but is false, invented, or unsupported by sources.
  9. 29Fine-tuningAI & Machine Learning, p. 19Fine-tuning is the process of taking a pretrained machine learning model and training it further on a smaller, specific dataset to adapt it to one task.
  10. 30RLHFAI & Machine Learning, p. 41RLHF (reinforcement learning from human feedback) trains a language model to be more helpful and safe using people's judgments of which answers are better.
  11. 31RAGAI & Machine Learning, p. 38RAG is a technique that makes an LLM answer using relevant documents retrieved at question time, so its responses are grounded in current, specific data.
  12. 32Vector DatabaseAI & Machine Learning, p. 51A vector database is a database designed to store embeddings and quickly find the vectors most similar to a query, which powers semantic search and RAG.

Chapter 4Agents and beyond

  1. 33ChatbotAI & Machine Learning, p. 8A chatbot is a program that converses with people in text or speech, answering questions or helping with tasks, using scripted rules or a language model.
  2. 34Tool CallingAI & Machine Learning, p. 47Tool calling is an LLM feature in which the model asks the application to run a specific function with structured arguments, then uses the result in its answer.
  3. 35AI AgentAI & Machine Learning, p. 2An AI agent is a system that uses an LLM to plan and carry out multi-step tasks by deciding which tools to call, observing the results, and acting again.
  4. 36Prompt InjectionSecurity, p. 29Prompt injection is an attack on LLM apps where attacker-written text is treated as instructions, so the model ignores its rules, leaks data or misuses tools.
  5. 37Model Context ProtocolAI & Machine Learning, p. 29The Model Context Protocol is an open standard that defines how AI applications connect to external tools, data sources, and prompts through a shared interface.
  6. 38Multimodal AIAI & Machine Learning, p. 31Multimodal AI is artificial intelligence that can understand or generate several types of data, such as text, images, audio, and video, in a single model.
  7. 39Generative AIAI & Machine Learning, p. 20Generative AI is artificial intelligence that creates new content, such as text, images, code, or audio, based on patterns learned from existing data.
  8. 40AI AlignmentAI & Machine Learning, p. 3AI alignment is the field of making AI systems pursue the goals and values their designers intend, so they behave helpfully, honestly, and safely.
  9. 41AGIAI & Machine Learning, p. 1AGI (artificial general intelligence) is a hypothetical AI system that could learn and do any intellectual task a person can, not just a narrow set of tasks.

Along the way, compare

Pairs on this path that are easy to mix up, side by side.

More

Settings