https://github.com/huggingface/smol-course
A course on aligning smol models.
https://github.com/huggingface/smol-course
Last synced: 5 months ago
JSON representation
A course on aligning smol models.
- Host: GitHub
- URL: https://github.com/huggingface/smol-course
- Owner: huggingface
- License: apache-2.0
- Created: 2024-11-25T19:22:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-10-01T10:19:13.000Z (5 months ago)
- Last Synced: 2025-10-12T15:05:46.843Z (5 months ago)
- Language: Jupyter Notebook
- Size: 10.7 MB
- Stars: 6,441
- Watchers: 45
- Forks: 2,288
- Open Issues: 74
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- StarryDivineSky - huggingface/smol-course - course 是一个关于对齐小型语言模型的教程项目。它旨在帮助用户理解和实践如何使小型模型更好地遵循人类指令和意图。该教程可能涵盖了微调、强化学习、奖励建模等对齐技术,并可能提供代码示例和实践指导。通过学习本课程,用户可以掌握训练和对齐更安全、更有用的小型语言模型的方法。该项目可能包含数据集、训练脚本和评估指标,以方便用户进行实验和验证。课程内容可能涉及指令遵循、有害内容过滤和价值观对齐等关键方面。该项目适合对小型语言模型对齐感兴趣的研究人员、开发者和爱好者。它可能提供了一种低成本、易于上手的方式来探索和改进语言模型的行为。该课程的重点是让小型模型在特定任务上表现出色,并避免产生不良行为。 (A01_文本生成_文本对话 / 大语言对话模型及数据)
- awesome-repositories - huggingface/smol-course - A course on aligning smol models. (Jupyter Notebook)
README

# a smol course
This is a practical course on aligning language models for your specific use case. It's a handy way to get started with aligning language models, because everything runs on most local machines. There are minimal GPU requirements and no paid services. The course is built around the [SmolLM3](https://huggingface.co/blog/smollm3) and [SmolVLM2](https://huggingface.co/blog/smolvlm2) models, but the skills you'll learn can be applied to larger models or other small LLMs/VLMs as well.
smol course v2 is live!
This course is open and peer reviewed. To get involved with the course open a pull request and submit your work for review. Here are the steps:
- Follow the Hugging Face Hub org
- Read the material, make changes, do the exercises, add your own examples.
- Submit a model to the leaderboard
- Climb the leaderboard
This should help you learn and to build a community-driven course that is always improving.
## Future of this course
This course will soon be re-released on Hugging Face Learn! Stay tuned for updates.
## Course Outline
This course provides a practical, hands-on approach to working with small language models, from initial training through to production deployment.
| # | Topic | Description | Released |
| - | ----- | ----------- | -------- |
| 1 | Instruction Tuning | Supervised fine-tuning, chat templates, instruction following | ✅ |
| 2 | Evaluation | Benchmarks and custom domain evaluation | ✅ |
| 3 | Preference Alignment | Aligning models to human preferences with algorithms like DPO. | ✅ |
| 4 | Vision Language Models | Adapt and use multimodal models | ✅ |
| 5 | Reinforcement Learning | Optimizing models with based on reinforcement policies. | October 2025 |
| 6 | Synthetic Data | Generate synthetic datasets for custom domains | November 2025 |
| 7 | Award Ceremony | Showcase projects and celebrate | December 2025 |
## Why Small Language Models?
While large language models have shown impressive capabilities, they often require significant computational resources and can be overkill for focused applications. Small language models offer several advantages for domain-specific applications:
- **Efficiency**: Require significantly less computational resources to train and deploy
- **Customization**: Easier to fine-tune and adapt to specific domains
- **Control**: Better understanding and control of model behavior
- **Cost**: Lower operational costs for training and inference
- **Privacy**: Can be run locally without sending data to external APIs
- **Green Technology**: Advocates efficient usage of resources with reduced carbon footprint
- **Easier Academic Research Development**: Provides an easy starter for academic research with cutting-edge LLMs with less logistical constraints
## Prerequisites
Before starting, ensure you have the following:
- Basic understanding of machine learning and natural language processing.
- Familiarity with Python, PyTorch, and the `transformers` library.
- Access to a pre-trained language model and a labeled dataset.
## v1 of the course
The first version of the course used GithHub markdown and Jupyter notebooks. You can find it in the [v1](./v1) directory.