# stanford-cs336/assignment1-basics

Student version of Assignment 1 for Stanford CS336 - Language Modeling From Scratch

Repository: https://github.com/stanford-cs336/assignment1-basics
Canonical: https://ross.abutalabs.com/products/assignment1-basics
Homepage: https://cs336.stanford.edu
Language: Python
License: MIT
License Family: permissive
Last push: 2026-04-07T20:49:12+00:00

## Health v2 (maintenance only)
Score: 57/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 76, release rhythm 45, longevity 37
- inputs: {"age_days": 518, "days_push": 148, "days_rel": 157, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2652, forks 2709 (observed 2026-08-28T04:07:07.058206+00:00)

## What it is
The student starter code for Stanford CS336 Assignment 1, where learners implement language model basics (tokenizer, transformer, training loop) from scratch in Python. It includes unit tests, adapters, and data download scripts for TinyStories and OpenWebText samples.

## Use cases
- learn to build a language model from scratch
- implement a BPE tokenizer in Python
- practice training a transformer on TinyStories
- coursework for Stanford CS336 language modeling
- hands-on LLM pretraining exercises

## When to choose
- you want to understand LLM internals by implementing them yourself
- you are following the CS336 course and need the assignment scaffold
- you prefer minimal scaffolding with tests to guide implementation

## When to avoid
- you need a production-ready training framework
- you want prebuilt models or high-level APIs like Hugging Face
- you are not prepared to write substantial code yourself

## Facets
- artifact type: learning-resource
- maturity: active
- function: machine-learning, llm-training, testing
- domain: large-language-models, deep-learning, education
- platform: python, cross-platform
- tags: course-assignment, transformer, language-modeling, stanford-cs336, educational, natural-language-processing

## Member repositories
- stanford-cs336/assignment1-basics (main) score 57

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:07.058206+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:18:41.171685+00:00, confidence not recorded.
  - readme: https://github.com/stanford-cs336/assignment1-basics (fetched 2026-08-28T04:07:07.058206+00:00, sha db60e0d41d8c)
  - homepage: https://cs336.stanford.edu (fetched 2026-08-29T10:01:30.775035+00:00, sha d5664b3be462)
- Data as of 2026-08-30T08:39:29.467469+00:00.
