instruction
stringlengths
206
259
context
stringclasses
1 value
question
stringlengths
621
850
completion
stringlengths
2.31k
13.7k
id
int64
1
252
source_file
stringclasses
1 value
Explain weight tying between embedding and output head in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates weight tying between embedding and output head -- sharing one matrix between input embedding and output projection -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_weight_...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
101
llm_v1.jsonl
Explain depth-scaled weight initialization in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates depth-scaled weight initialization -- shrinking init variance as layer count grows to keep training stable -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_weight_init_nan...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
102
llm_v1.jsonl
Explain next-token prediction loss in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates next-token prediction loss -- the cross-entropy loss that drives all LLM pretraining -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_cross_entropy_loss_nano.py Pipeline p...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
103
llm_v1.jsonl
Explain learning rate warmup + cosine decay in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates learning rate warmup + cosine decay -- the standard LLM learning-rate schedule -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_lr_schedule_nano.py Pipeline position: STEP...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
104
llm_v1.jsonl
Explain gradient clipping in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates gradient clipping -- capping the global gradient norm so one bad batch can't destabilize training -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_grad_clip_nano.py Pipeli...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
105
llm_v1.jsonl
Explain gradient checkpointing in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates gradient checkpointing -- trading extra recompute for lower memory usage across a deep stack -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_grad_checkpoint_nano.py Pipel...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
106
llm_v1.jsonl
Explain dropout regularization in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates dropout regularization -- randomly zeroing activations during training to reduce overfitting -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_dropout_nano.py Pipeline posi...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
107
llm_v1.jsonl
Explain batch construction for next-token training in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates batch construction for next-token training -- turning a flat token stream into shifted (input, target) pairs -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_batching_nano...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
108
llm_v1.jsonl
Explain mixed precision (bf16) training in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates mixed precision (bf16) training -- training in bf16 instead of fp32 for memory and speed -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_mixed_precision_nano.py Pipeline ...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
109
llm_v1.jsonl
Explain autoregressive generation loop in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates autoregressive generation loop -- sampling one token at a time and feeding it back in -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_generation_loop_nano.py Pipeline pos...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
110
llm_v1.jsonl
Explain temperature and top-k sampling in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates temperature and top-k sampling -- controlling how random or deterministic generated text is -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_sampling_strategies_nano.py Pi...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
111
llm_v1.jsonl
Explain perplexity as an evaluation metric in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates perplexity as an evaluation metric -- converting cross-entropy loss into the standard LLM quality metric -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_perplexity_nano.p...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
112
llm_v1.jsonl
Explain character-level tokenizer in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates character-level tokenizer -- the tokenizer stage: raw text turned into integer ids -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_tokenizer_char_small.py Pipeline positi...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
113
llm_v1.jsonl
Explain toy byte-pair-style subword tokenizer in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates toy byte-pair-style subword tokenizer -- merging frequent character pairs into subword units before training -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_bpe_toy_small...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
114
llm_v1.jsonl
Explain learned absolute positional embeddings in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates learned absolute positional embeddings -- giving the model a sense of token order via a learned position vector -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_pos_embed_...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
115
llm_v1.jsonl
Explain rotary positional embeddings (rope) in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates rotary positional embeddings (rope) -- encoding position by rotating Q/K instead of adding a position vector -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_rope_small.py...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
116
llm_v1.jsonl
Explain causal self-attention mask in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates causal self-attention mask -- why the model must never attend to future tokens -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_causal_mask_small.py Pipeline position: STE...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
117
llm_v1.jsonl
Explain multi-head attention in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates multi-head attention -- splitting the hidden dimension into independent attention heads -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_mha_small.py Pipeline position: ST...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
118
llm_v1.jsonl
Explain grouped query attention (gqa) in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates grouped query attention (gqa) -- sharing fewer K/V heads across more Q heads to cut inference memory -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_gqa_small.py Pipeline...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
119
llm_v1.jsonl
Explain multi-head latent attention (mla) basics in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates multi-head latent attention (mla) basics -- compressing K/V into a low-rank latent before caching -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_mla_basics_small.py Pipe...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
120
llm_v1.jsonl
Explain kv-cache for fast autoregressive inference in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates kv-cache for fast autoregressive inference -- reusing past keys/values instead of recomputing them every step -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_kv_cache_sma...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
121
llm_v1.jsonl
Explain position-wise feed-forward network in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates position-wise feed-forward network -- the per-token 'thinking' step inside each transformer block -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_ffn_small.py Pipeline po...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
122
llm_v1.jsonl
Explain layernorm vs rmsnorm in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates layernorm vs rmsnorm -- swapping LayerNorm for RMSNorm to stabilize activations -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_layernorm_rmsnorm_small.py Pipeline positi...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
123
llm_v1.jsonl
Explain residual (skip) connections in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates residual (skip) connections -- why deep stacks of layers remain trainable -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_residual_small.py Pipeline position: STEP 4 (Tra...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
124
llm_v1.jsonl
Explain changing the ffn activation function -- relu in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates changing the ffn activation function -- relu -- swapping the FFN activation in the model config to ReLU -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_activation_relu_sm...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
125
llm_v1.jsonl
Explain changing the ffn activation function -- silu/swish in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates changing the ffn activation function -- silu/swish -- swapping the FFN activation in the model config to SiLU -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_activation_s...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
126
llm_v1.jsonl
Explain changing the ffn activation function -- gated swiglu in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates changing the ffn activation function -- gated swiglu -- replacing the FFN with a gated SwiGLU layer -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_activation_swiglu_smal...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
127
llm_v1.jsonl
Explain comparing ffn activation functions side by side in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates comparing ffn activation functions side by side -- training with GELU, then comparing ReLU/GELU/SiLU output stats -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_activati...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
128
llm_v1.jsonl
Explain weight tying between embedding and output head in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates weight tying between embedding and output head -- sharing one matrix between input embedding and output projection -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_weight_...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
129
llm_v1.jsonl
Explain depth-scaled weight initialization in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates depth-scaled weight initialization -- shrinking init variance as layer count grows to keep training stable -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_weight_init_sma...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
130
llm_v1.jsonl
Explain next-token prediction loss in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates next-token prediction loss -- the cross-entropy loss that drives all LLM pretraining -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_cross_entropy_loss_small.py Pipeline ...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
131
llm_v1.jsonl
Explain learning rate warmup + cosine decay in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates learning rate warmup + cosine decay -- the standard LLM learning-rate schedule -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_lr_schedule_small.py Pipeline position: STE...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
132
llm_v1.jsonl
Explain gradient clipping in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates gradient clipping -- capping the global gradient norm so one bad batch can't destabilize training -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_grad_clip_small.py Pipel...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
133
llm_v1.jsonl
Explain gradient checkpointing in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates gradient checkpointing -- trading extra recompute for lower memory usage across a deep stack -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_grad_checkpoint_small.py Pipe...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
134
llm_v1.jsonl
Explain dropout regularization in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates dropout regularization -- randomly zeroing activations during training to reduce overfitting -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_dropout_small.py Pipeline pos...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
135
llm_v1.jsonl
Explain batch construction for next-token training in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates batch construction for next-token training -- turning a flat token stream into shifted (input, target) pairs -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_batching_smal...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
136
llm_v1.jsonl
Explain mixed precision (bf16) training in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates mixed precision (bf16) training -- training in bf16 instead of fp32 for memory and speed -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_mixed_precision_small.py Pipeline...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
137
llm_v1.jsonl
Explain autoregressive generation loop in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates autoregressive generation loop -- sampling one token at a time and feeding it back in -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_generation_loop_small.py Pipeline po...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
138
llm_v1.jsonl
Explain temperature and top-k sampling in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates temperature and top-k sampling -- controlling how random or deterministic generated text is -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_sampling_strategies_small.py P...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
139
llm_v1.jsonl
Explain perplexity as an evaluation metric in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates perplexity as an evaluation metric -- converting cross-entropy loss into the standard LLM quality metric -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_perplexity_small....
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
140
llm_v1.jsonl
Explain character-level tokenizer in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates character-level tokenizer -- the tokenizer stage: raw text turned into integer ids -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_tokenizer_char_medium.py Pipeline posit...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
141
llm_v1.jsonl
Explain toy byte-pair-style subword tokenizer in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates toy byte-pair-style subword tokenizer -- merging frequent character pairs into subword units before training -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_bpe_toy_mediu...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
142
llm_v1.jsonl
Explain learned absolute positional embeddings in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates learned absolute positional embeddings -- giving the model a sense of token order via a learned position vector -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_pos_embed_...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
143
llm_v1.jsonl
Explain rotary positional embeddings (rope) in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates rotary positional embeddings (rope) -- encoding position by rotating Q/K instead of adding a position vector -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_rope_medium.p...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
144
llm_v1.jsonl
Explain causal self-attention mask in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates causal self-attention mask -- why the model must never attend to future tokens -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_causal_mask_medium.py Pipeline position: ST...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
145
llm_v1.jsonl
Explain multi-head attention in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates multi-head attention -- splitting the hidden dimension into independent attention heads -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_mha_medium.py Pipeline position: S...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
146
llm_v1.jsonl
Explain grouped query attention (gqa) in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates grouped query attention (gqa) -- sharing fewer K/V heads across more Q heads to cut inference memory -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_gqa_medium.py Pipelin...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
147
llm_v1.jsonl
Explain multi-head latent attention (mla) basics in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates multi-head latent attention (mla) basics -- compressing K/V into a low-rank latent before caching -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_mla_basics_medium.py Pip...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
148
llm_v1.jsonl
Explain kv-cache for fast autoregressive inference in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates kv-cache for fast autoregressive inference -- reusing past keys/values instead of recomputing them every step -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_kv_cache_med...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
149
llm_v1.jsonl
Explain position-wise feed-forward network in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates position-wise feed-forward network -- the per-token 'thinking' step inside each transformer block -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_ffn_medium.py Pipeline p...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
150
llm_v1.jsonl
Explain layernorm vs rmsnorm in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates layernorm vs rmsnorm -- swapping LayerNorm for RMSNorm to stabilize activations -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_layernorm_rmsnorm_medium.py Pipeline posit...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
151
llm_v1.jsonl
Explain residual (skip) connections in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates residual (skip) connections -- why deep stacks of layers remain trainable -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_residual_medium.py Pipeline position: STEP 4 (Tr...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
152
llm_v1.jsonl
Explain changing the ffn activation function -- relu in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates changing the ffn activation function -- relu -- swapping the FFN activation in the model config to ReLU -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_activation_relu_me...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
153
llm_v1.jsonl
Explain changing the ffn activation function -- silu/swish in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates changing the ffn activation function -- silu/swish -- swapping the FFN activation in the model config to SiLU -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_activation_s...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
154
llm_v1.jsonl
Explain changing the ffn activation function -- gated swiglu in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates changing the ffn activation function -- gated swiglu -- replacing the FFN with a gated SwiGLU layer -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_activation_swiglu_medi...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
155
llm_v1.jsonl
Explain comparing ffn activation functions side by side in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates comparing ffn activation functions side by side -- training with GELU, then comparing ReLU/GELU/SiLU output stats -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_activati...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
156
llm_v1.jsonl
Explain weight tying between embedding and output head in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates weight tying between embedding and output head -- sharing one matrix between input embedding and output projection -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_weight_...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
157
llm_v1.jsonl
Explain depth-scaled weight initialization in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates depth-scaled weight initialization -- shrinking init variance as layer count grows to keep training stable -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_weight_init_med...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
158
llm_v1.jsonl
Explain next-token prediction loss in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates next-token prediction loss -- the cross-entropy loss that drives all LLM pretraining -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_cross_entropy_loss_medium.py Pipeline...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
159
llm_v1.jsonl
Explain learning rate warmup + cosine decay in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates learning rate warmup + cosine decay -- the standard LLM learning-rate schedule -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_lr_schedule_medium.py Pipeline position: ST...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
160
llm_v1.jsonl
Explain gradient clipping in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates gradient clipping -- capping the global gradient norm so one bad batch can't destabilize training -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_grad_clip_medium.py Pipe...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
161
llm_v1.jsonl
Explain gradient checkpointing in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates gradient checkpointing -- trading extra recompute for lower memory usage across a deep stack -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_grad_checkpoint_medium.py Pip...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
162
llm_v1.jsonl
Explain dropout regularization in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates dropout regularization -- randomly zeroing activations during training to reduce overfitting -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_dropout_medium.py Pipeline po...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
163
llm_v1.jsonl
Explain batch construction for next-token training in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates batch construction for next-token training -- turning a flat token stream into shifted (input, target) pairs -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_batching_medi...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
164
llm_v1.jsonl
Explain mixed precision (bf16) training in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates mixed precision (bf16) training -- training in bf16 instead of fp32 for memory and speed -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_mixed_precision_medium.py Pipelin...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
165
llm_v1.jsonl
Explain autoregressive generation loop in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates autoregressive generation loop -- sampling one token at a time and feeding it back in -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_generation_loop_medium.py Pipeline p...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
166
llm_v1.jsonl
Explain temperature and top-k sampling in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates temperature and top-k sampling -- controlling how random or deterministic generated text is -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_sampling_strategies_medium.py ...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
167
llm_v1.jsonl
Explain perplexity as an evaluation metric in a decoder-only transformer LLM by building a complete, runnable tiny language model end to end, and connect the mechanism to how a production-scale model implements it at billion-parameter scale.
None
Write the full, single-file, runnable tiny LLM code (STEP 1 through STEP 8) that isolates perplexity as an evaluation metric -- converting cross-entropy loss into the standard LLM quality metric -- and explain how this piece scales toward a production-scale (1.5B-parameter) configuration. File: llm_v2_perplexity_medium...
<think> The person wants a complete, trainable tiny LLM in one file, not an isolated snippet -- something they can literally run on a MacBook or a Windows laptop and see loss go down and real text come out, the same shape as the original tiny_llm.py. So every sample needs all eight pipeline stages present: tokenizer, c...
168
llm_v1.jsonl
Explain character-level tokenizer in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating character-level tokenizer, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_tokenizer_char_nano.py Pipeline position: STEP 1 (Data + Tokenizer) of the LLM pipeline, tier v1 (basic), concept: Character-Level Tokenizer. Toy confi...
<think> This sample isolates one concept -- the tokenizer stage: raw text turned into integer ids, the first step before any model math happens. It sits at STEP 1 (Data + Tokenizer) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size...
169
llm_v1.jsonl
Explain learned absolute positional embeddings in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating learned absolute positional embeddings, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_pos_embed_nano.py Pipeline position: STEP 2 (Config / Positional Encoding) of the LLM pipeline, tier v1 (basic), concept: Learned Absolute...
<think> This sample isolates one concept -- giving the model a sense of token order by adding a position vector to each token embedding. It sits at STEP 2 (Config / Positional Encoding) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_...
170
llm_v1.jsonl
Explain causal self-attention mask in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating causal self-attention mask, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_causal_mask_nano.py Pipeline position: STEP 3 (Self-Attention) of the LLM pipeline, tier v1 (basic), concept: Causal Self-Attention Mask. Toy config f...
<think> This sample isolates one concept -- why a language model must never attend to future tokens, and how the triangular mask enforces that. It sits at STEP 3 (Self-Attention) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16...
171
llm_v1.jsonl
Explain multi-head attention (split, attend, merge) in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating multi-head attention (split, attend, merge), and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_mha_nano.py Pipeline position: STEP 3 (Self-Attention) of the LLM pipeline, tier v1 (basic), concept: Multi-Head Attention (split, at...
<think> This sample isolates one concept -- splitting the hidden dimension into independent attention heads so the model can attend to different relationships in parallel. It sits at STEP 3 (Self-Attention) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=...
172
llm_v1.jsonl
Explain position-wise feed-forward network in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating position-wise feed-forward network, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_ffn_nano.py Pipeline position: STEP 4 (Transformer Block) of the LLM pipeline, tier v1 (basic), concept: Position-Wise Feed-Forward Network. T...
<think> This sample isolates one concept -- the per-token 'thinking' step inside each transformer block, expanding then projecting back down. It sits at STEP 4 (Transformer Block) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=1...
173
llm_v1.jsonl
Explain layernorm vs rmsnorm in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating layernorm vs rmsnorm, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_layernorm_rmsnorm_nano.py Pipeline position: STEP 4 (Transformer Block) of the LLM pipeline, tier v1 (basic), concept: LayerNorm vs RMSNorm. Toy config for ...
<think> This sample isolates one concept -- why most modern LLMs use RMSNorm instead of LayerNorm to stabilize activations. It sits at STEP 4 (Transformer Block) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (char-level, voc...
174
llm_v1.jsonl
Explain residual (skip) connections in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating residual (skip) connections, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_residual_nano.py Pipeline position: STEP 4 (Transformer Block) of the LLM pipeline, tier v1 (basic), concept: Residual (Skip) Connections. Toy config...
<think> This sample isolates one concept -- why deep stacks of transformer blocks remain trainable instead of the gradient vanishing. It sits at STEP 4 (Transformer Block) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (char-...
175
llm_v1.jsonl
Explain next-token prediction loss in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating next-token prediction loss, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_cross_entropy_loss_nano.py Pipeline position: STEP 6 (Training Loop) of the LLM pipeline, tier v1 (basic), concept: Next-Token Prediction Loss. Toy co...
<think> This sample isolates one concept -- the single loss function -- cross-entropy on the next token -- that drives all LLM pretraining. It sits at STEP 6 (Training Loop) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (cha...
176
llm_v1.jsonl
Explain autoregressive generation loop in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating autoregressive generation loop, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_generation_loop_nano.py Pipeline position: STEP 7 (Generation) of the LLM pipeline, tier v1 (basic), concept: Autoregressive Generation Loop. Toy ...
<think> This sample isolates one concept -- sampling one token at a time and feeding it back in as input for the next step. It sits at STEP 7 (Generation) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (char-level, vocab_size...
177
llm_v1.jsonl
Explain temperature and top-k sampling in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating temperature and top-k sampling, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_sampling_strategies_nano.py Pipeline position: STEP 7 (Generation) of the LLM pipeline, tier v1 (basic), concept: Temperature and Top-k Sampling. ...
<think> This sample isolates one concept -- controlling how random or deterministic generated text is by reshaping the probability distribution. It sits at STEP 7 (Generation) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (c...
178
llm_v1.jsonl
Explain weight tying between embedding and output head in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating weight tying between embedding and output head, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_weight_tying_nano.py Pipeline position: STEP 5 (Full Model) of the LLM pipeline, tier v1 (basic), concept: Weight Tying Between Em...
<think> This sample isolates one concept -- sharing one matrix between the input embedding table and the output projection to save parameters. It sits at STEP 5 (Full Model) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (cha...
179
llm_v1.jsonl
Explain learning rate warmup + cosine decay in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating learning rate warmup + cosine decay, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_lr_schedule_nano.py Pipeline position: STEP 6 (Training Loop) of the LLM pipeline, tier v1 (basic), concept: Learning Rate Warmup + Cosine De...
<think> This sample isolates one concept -- the standard LLM learning-rate schedule: ramp up gently, then decay smoothly to a floor. It sits at STEP 6 (Training Loop) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (char-level...
180
llm_v1.jsonl
Explain gradient clipping in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating gradient clipping, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_grad_clip_nano.py Pipeline position: STEP 6 (Training Loop) of the LLM pipeline, tier v1 (basic), concept: Gradient Clipping. Toy config for this sample: dim=3...
<think> This sample isolates one concept -- capping the global gradient norm so a single bad batch cannot destabilize training. It sits at STEP 6 (Training Loop) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (char-level, voc...
181
llm_v1.jsonl
Explain rotary positional embeddings (rope) in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating rotary positional embeddings (rope), and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_rope_nano.py Pipeline position: STEP 2 (Config / Positional Encoding) of the LLM pipeline, tier v1 (basic), concept: Rotary Positional Embedd...
<think> This sample isolates one concept -- encoding position by rotating query/key vectors instead of adding a separate position vector. It sits at STEP 2 (Config / Positional Encoding) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block...
182
llm_v1.jsonl
Explain kv-cache for fast autoregressive inference in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating kv-cache for fast autoregressive inference, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_kv_cache_nano.py Pipeline position: STEP 3 (Self-Attention (inference-time)) of the LLM pipeline, tier v1 (basic), concept: KV-Cache f...
<think> This sample isolates one concept -- avoiding recomputation of past keys/values at every generation step. It sits at STEP 3 (Self-Attention (inference-time)) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (char-level, ...
183
llm_v1.jsonl
Explain grouped query attention (gqa) in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating grouped query attention (gqa), and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_gqa_nano.py Pipeline position: STEP 3 (Self-Attention) of the LLM pipeline, tier v1 (basic), concept: Grouped Query Attention (GQA). Toy config for...
<think> This sample isolates one concept -- sharing fewer key/value heads across more query heads to cut KV-cache memory at inference time. It sits at STEP 3 (Self-Attention) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (ch...
184
llm_v1.jsonl
Explain multi-head latent attention (mla) basics in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating multi-head latent attention (mla) basics, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_mla_basics_nano.py Pipeline position: STEP 3 (Self-Attention) of the LLM pipeline, tier v1 (basic), concept: Multi-Head Latent Attention...
<think> This sample isolates one concept -- compressing keys and values into a small latent vector before caching, the mechanism the production model actually uses. It sits at STEP 3 (Self-Attention) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_la...
185
llm_v1.jsonl
Explain mixed precision (bf16) training in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating mixed precision (bf16) training, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_mixed_precision_nano.py Pipeline position: STEP 6 (Training Loop) of the LLM pipeline, tier v1 (basic), concept: Mixed Precision (bf16) Training....
<think> This sample isolates one concept -- training in bf16 instead of fp32 to cut memory and increase throughput on modern GPUs. It sits at STEP 6 (Training Loop) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (char-level, ...
186
llm_v1.jsonl
Explain gradient checkpointing in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating gradient checkpointing, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_grad_checkpoint_nano.py Pipeline position: STEP 6 (Training Loop) of the LLM pipeline, tier v1 (basic), concept: Gradient Checkpointing. Toy config for th...
<think> This sample isolates one concept -- trading extra recompute for lower memory usage across a deep stack of layers. It sits at STEP 6 (Training Loop) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (char-level, vocab_siz...
187
llm_v1.jsonl
Explain dropout regularization in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating dropout regularization, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_dropout_nano.py Pipeline position: STEP 6 (Training Loop) of the LLM pipeline, tier v1 (basic), concept: Dropout Regularization. Toy config for this sampl...
<think> This sample isolates one concept -- randomly zeroing activations during training to reduce overfitting, disabled at eval time. It sits at STEP 6 (Training Loop) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (char-lev...
188
llm_v1.jsonl
Explain toy byte-pair-style subword tokenizer in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating toy byte-pair-style subword tokenizer, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_bpe_toy_nano.py Pipeline position: STEP 1 (Data + Tokenizer) of the LLM pipeline, tier v1 (basic), concept: Toy Byte-Pair-Style Subword Tok...
<think> This sample isolates one concept -- merging frequent character pairs into subword units, the core idea behind production tokenizers. It sits at STEP 1 (Data + Tokenizer) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 ...
189
llm_v1.jsonl
Explain batch construction for next-token training in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating batch construction for next-token training, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_batching_nano.py Pipeline position: STEP 6 (Training Loop) of the LLM pipeline, tier v1 (basic), concept: Batch Construction for Next-...
<think> This sample isolates one concept -- turning a flat stream of token ids into (input, target) pairs where target is input shifted by one. It sits at STEP 6 (Training Loop) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 ...
190
llm_v1.jsonl
Explain perplexity as an evaluation metric in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating perplexity as an evaluation metric, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_perplexity_nano.py Pipeline position: STEP 8 (Test / Evaluation) of the LLM pipeline, tier v1 (basic), concept: Perplexity as an Evaluation Me...
<think> This sample isolates one concept -- converting cross-entropy loss into perplexity, the standard human-readable LLM quality metric. It sits at STEP 8 (Test / Evaluation) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size=16 (...
191
llm_v1.jsonl
Explain depth-scaled weight initialization in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating depth-scaled weight initialization, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_weight_init_nano.py Pipeline position: STEP 5 (Full Model) of the LLM pipeline, tier v1 (basic), concept: Depth-Scaled Weight Initialization. ...
<think> This sample isolates one concept -- why initialization variance must shrink as layer count grows, to keep the residual stream stable at depth. It sits at STEP 5 (Full Model) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the numbers are dim=32, n_heads=2, n_layers=2, block_size...
192
llm_v1.jsonl
Explain changing the ffn activation function -- relu in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating changing the ffn activation function -- relu, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_activation_relu_nano.py Pipeline position: STEP 4 (Transformer Block / Activation Function) of the LLM pipeline, tier v1 (basic), co...
<think> This sample isolates one concept -- swapping the FFN activation function in the model config to ReLU and observing the effect (hard zeroing of negative activations). It sits at STEP 4 (Transformer Block / Activation Function) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the n...
193
llm_v1.jsonl
Explain changing the ffn activation function -- silu / swish in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating changing the ffn activation function -- silu / swish, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_activation_swish_nano.py Pipeline position: STEP 4 (Transformer Block / Activation Function) of the LLM pipeline, tier v1 (b...
<think> This sample isolates one concept -- swapping the FFN activation function in the model config to SiLU (Swish), a smooth alternative to ReLU used in many production LLMs. It sits at STEP 4 (Transformer Block / Activation Function) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier th...
194
llm_v1.jsonl
Explain changing the ffn activation function -- gated swiglu in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating changing the ffn activation function -- gated swiglu, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_activation_swiglu_nano.py Pipeline position: STEP 4 (Transformer Block / Activation Function) of the LLM pipeline, tier v1 (...
<think> This sample isolates one concept -- replacing a plain activation with a gated SwiGLU feed-forward layer, the config choice used by many current production LLMs. It sits at STEP 4 (Transformer Block / Activation Function) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' tier the number...
195
llm_v1.jsonl
Explain comparing ffn activation functions side by side in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating comparing ffn activation functions side by side, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_activation_comparison_nano.py Pipeline position: STEP 4 (Transformer Block / Activation Function) of the LLM pipeline, tier v1 (b...
<think> This sample isolates one concept -- running ReLU, GELU, and SiLU through the same weights and input to see how the activation-function config choice changes output statistics. It sits at STEP 4 (Transformer Block / Activation Function) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'nano' ...
196
llm_v1.jsonl
Explain character-level tokenizer in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating character-level tokenizer, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_tokenizer_char_small.py Pipeline position: STEP 1 (Data + Tokenizer) of the LLM pipeline, tier v1 (basic), concept: Character-Level Tokenizer. Toy conf...
<think> This sample isolates one concept -- the tokenizer stage: raw text turned into integer ids, the first step before any model math happens. It sits at STEP 1 (Data + Tokenizer) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'small' tier the numbers are dim=64, n_heads=4, n_layers=3, block_siz...
197
llm_v1.jsonl
Explain learned absolute positional embeddings in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating learned absolute positional embeddings, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_pos_embed_small.py Pipeline position: STEP 2 (Config / Positional Encoding) of the LLM pipeline, tier v1 (basic), concept: Learned Absolut...
<think> This sample isolates one concept -- giving the model a sense of token order by adding a position vector to each token embedding. It sits at STEP 2 (Config / Positional Encoding) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'small' tier the numbers are dim=64, n_heads=4, n_layers=3, block...
198
llm_v1.jsonl
Explain causal self-attention mask in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating causal self-attention mask, and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_causal_mask_small.py Pipeline position: STEP 3 (Self-Attention) of the LLM pipeline, tier v1 (basic), concept: Causal Self-Attention Mask. Toy config ...
<think> This sample isolates one concept -- why a language model must never attend to future tokens, and how the triangular mask enforces that. It sits at STEP 3 (Self-Attention) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'small' tier the numbers are dim=64, n_heads=4, n_layers=3, block_size=3...
199
llm_v1.jsonl
Explain multi-head attention (split, attend, merge) in a decoder-only transformer LLM, starting from a minimal working example, and connect it to how a production-scale model implements the same mechanism at billion-parameter scale.
None
Write standalone runnable code demonstrating multi-head attention (split, attend, merge), and explain how it scales toward a production-scale (1.5B-parameter) configuration. File: llm_v1_mha_small.py Pipeline position: STEP 3 (Self-Attention) of the LLM pipeline, tier v1 (basic), concept: Multi-Head Attention (split, a...
<think> This sample isolates one concept -- splitting the hidden dimension into independent attention heads so the model can attend to different relationships in parallel. It sits at STEP 3 (Self-Attention) in the overall pipeline, the same numbering tiny_llm.py uses. At the 'small' tier the numbers are dim=64, n_heads...
200
llm_v1.jsonl