LangChain 101 Course (updated 2024 with LCEL)

Ivan Reznikov, PhD
4 min readOct 13, 2023

Welcome to the LangChain 101 course! This course was “really liked” by LangChain themselves :)

The LangChain Course

This article is the collection and short previews of all my LangChain 101 course sessions. All code is on GitHub.

The course is under development. These are the covered lectures so far:

· LangChain Course
· Part 1. Simple Q&A App.
· Part 2. Large Language Models
Bonus: How LLM Generates Next Token and What is Quantization?
· Part 3. Talking to Documents

Feel free to download the latest LangChain cheatsheet on a single page:

Part 1. Simple Q&A App.

Part 1 is about building a Q&A app with LangChain and showing the capabilities of LangChain. The article discusses the concept of LangChain and the different components that make it up. It also details the role of each component while developing a simple Q&A app.

Part 2. Large Language Models

Part 2 is dedicated to LLMs, short for Large Language Models.

Part 2ab discusses what LLMs are, how they work, and how they are used. The article shows how large amounts of text data can be used to train a model. The article also goes into detail about how LLMs are implemented in LangChain.

Part 2c is about fine-tuning large language models. It discusses why fine-tuning LLMs is useful. It also details three specific fine-tuning techniques: PEFT, LORA, and reinforcement learning. Some of the important points from this article are that fine-tuning LLMs can make them more efficient and accurate and that a variety of fine-tuning techniques are available.

Part 2d discusses using human feedback to fine-tune the large language models. We go through different finetuning techniques and discuss modern architectures of RLHF pipelines. We compare the ChatGPT and LLAMA pipelines and wrap everything up by creating a feedback dataset and setting up our own reinforcement learning pipeline.

Bonus: How LLM Generates Next Token and What is Quantization?

There are several bonus articles published to understand LLMs better.

The first article discusses how large language models (LLMs) generate text. The article concentrates on the decoding part of text generation. There are several decoding strategies, including greedy sampling, beam search, and random sampling. The decoding strategy choice affects the generated text's randomness and creativity. The article answers many questions about parameters used for training, for example, temperature, top_p, top_n, etc.

The second article discusses how to reduce the memory footprint of large language models. It details the challenges of using LLMs on small devices. The article then explains the technique for reducing the memory footprint of LLMs: quantization, which involves converting the LLM’s weights into a lower-precision format.

Part 3. Talking to Documents

Part 3 is dedicated to speaking with your data.

Part 3a covers the document loaders — how to upload data from local files, cloud providers or across the web and splitters — how to chunk your data to be processed more efficiently. We’re also building simple RAG pipelines to see how splitting affect the results

Part 3b covers the embedding models— from how they work to what embedding models to choose and vectorstores — how to choose one, how are they different to traditional databases, etc. I’ll also share some tips and tricks on how to configure you're vectorstore setup for most efficient RAG. Of course, as usual, everything is supported in code with Github and Colab!

to be continued (02/24)

Reminder: The complete code is available on GitHub.

Clap and follow me, as this motivates me to write new parts and articles :) Plus, you’ll get notified when the new part will be published.

--

--