This repository contains the implementation of assignments for the CS336 course (Spring 2025). The project covers various aspects of Large Language Models (LLMs), from basic Transformer architecture to systems, scaling laws, data processing, and alignment.
The repository is organized into five main assignments:
-
- Implementation of core Transformer components (Attention, BPE, etc.).
- Basics of language modeling.
-
- Distributed training techniques.
- Data Distributed Parallelism (DDP) and optimizer sharding.
-
- Investigation of scaling laws.
- Compute-optimal training (IsoFLOPs).
-
- Data processing pipelines for LLM pre-training.
- Deduplication, PII redaction, and quality filtering.
-
- Techniques for aligning LLMs with human intent.
- Supervised Fine-Tuning (SFT), DPO, and RLHF (GRPO).
This project uses uv for dependency management. Ensure you have uv installed.
Each assignment is a self-contained Python project. To work on a specific assignment, navigate to its directory and sync dependencies.
Example for Assignment 1:
cd assignment1-basics
uv sync
uv run pytestPlease refer to the README.md within each assignment directory for specific instructions and details.