A practical guide to large language models: from fine-tuning to RAG and agents
Shanghai Jiao Tong University (SJTU) has released an open course "Dive into LLMs" (动手学大模型) — a step-by-step guide to working with large language models: from fine-tuning and RAG to building agents and safety. The material is based on NLP and AI security lectures taught at the School of Computer Science and includes ready-to-run Jupyter notebooks for each stage — from environment setup to advanced techniques like RLHF alignment and steganography in generation.
What's inside the course
The course is split into 11 independent chapters, each a separate notebook with code and explanations. Introductory modules cover basic infrastructure: loading models via Hugging Face Transformers, efficient serving on vLLM, calling cloud LLM APIs. Next come practical blocks: prompt engineering with templates for chat, summarisation and fact extraction; LoRA/QLoRA fine-tuning of a 4B model on consumer hardware; building a RAG pipeline with vector databases (Milvus, Chroma, FAISS) and rerankers; developing agents on LangChain/LangGraph with tools, memory and the MCP protocol.
Advanced topics: safety and hidden capabilities
Dedicated chapters cover topics rarely seen in basic tutorials: knowledge editing without retraining, defence against jailbreaks and prompt injection, watermarks in generated text, steganography — embedding invisible marks in model outputs, RLHF alignment with PPO. All notebooks run on a single RTX 4090 (24 GB VRAM) or in free cloud environments like AutoDL / CodeWithGPU.
How to start
GitHub repository: Lordog/dive-into-llms (50k+ stars). Clone, pick a chapter of interest and run the notebook cells in order. For fine-tuning and RAG chapters you'll need a GPU — the README links to ready-made Docker images and instructions for renting cheap instances. The course is completely free, Apache-2.0 licensed, and PRs with fixes and new topics are welcome.
Source: GitHub — "动手学大模型" series
