Learn generative AI: 20 free interactive lessons
Short lessons with tiny, transparent models running next to you: watch text turn into tokens, words get probabilities, meaning become numbers, and documents and tools turn a model into a useful assistant.
Do it in the browser: a real generative AI tool, a short mission and instant feedback. No install. Optional certificate at the end of the course.
Open the courseLessons
- TokensModels do not read letters or words: they read tokens, small pieces of text with an id.
- Predicting the next wordA language model gives a probability to every possible next token, picks one and repeats.
- Temperature and samplingLow temperature picks the safest word; high temperature takes more risks. Same model, different personality.
- The context windowA model only sees a limited number of tokens at once. What falls outside is simply gone.
- Clear instructionsThe model cannot read your mind: say who it is for, what you want and how it should look.
- Learning from examplesShow two or three examples and the model copies the pattern: format, labels and style.
- Structured outputAsk for JSON with named fields so a program, not a person, can use the answer.
- Step-by-step reasoningFor multi-step problems, let the model work through the steps before giving the answer.
- EmbeddingsAn embedding is a list of numbers that places a word or sentence on a map of meaning.
- Measuring similarityCosine similarity compares the direction of two vectors: 1 means the same idea, 0 means unrelated.
- Semantic searchKeyword search needs the same words; semantic search finds the same meaning. The best systems use both.
- Chunking documentsLong documents are split into chunks before embedding, so search can return just the relevant part.
- Retrieval-augmented generationFind the relevant documents first, put them in the prompt, then let the model answer from them.
- Grounding and hallucinationsA model without the facts invents plausible ones. Grounding means answering only from given sources, and saying «I don’t know».
- Tool useModels can ask your code to run functions (check stock, place an order) and use the results in their answer.
- AgentsAn agent repeats think → act → observe until the goal is reached, choosing its own steps.
- EvaluationMeasure quality with a fixed set of test cases before and after every change.
- Prompt injectionText from web pages, e-mails or files can carry hidden instructions. Treat it as data, never as commands.
- Privacy and biasSend models only the data they need, and check that answers are fair for every group of people.
- Cost and latencyEvery token costs money and time. Pick the right model size, trim prompts and cache what repeats.