~/fba-lab/lab/speedrun/journey/tyler-06

FBALab

Code · architecture · study mode

AboutRoadmapSpeedrun
FBALab

Study mode — no GPU required.

Interactive LLM training & inference lab.

Qwen CAboutContactTermsPrivacyCookiesCommunity

© 2026 FBA Lab

Contact · contact@bubblspace.com · +91 75061 55016

Speedrun›Teaching arc›#3 Longer Context
Act 1Model Training FundamentalsAct 2AI Systems OptimizationAct 3World-Record Training Optimization
Step 7 of 28Skill: Model Training Fundamentals
← #2.4 Logit Soft-cappingProfiler Overview →
TRAINING SIMULATION

Speedrun — #3 Longer Context

running
◷train_gpt2.py▸sequence_length 32768◎learner⌁06-longer-sequence$no GPU
baseline
GPT-2 d12
Starting architecture and training loop.
step 01
train
optimize
Speedrun step
Architecture diffs and optimizer changes.
steps 02–05
loss
active
target
val loss 3.28
Cumulative loss timeline and finale.
step 06
1/3
Blocks
Quick summary

Context window jumps from 1024 to 32768 — 32× more tokens per forward.

Full explanation below the code →

fba-lab — train_gpt2.py · sequence_length 32768executing
// block: sequence_length 32768 · lines 10–20$ study train_gpt2.py --block seq_lengthContext window jumps from 1024 to 32768 — 32× more tokens per forward. ✓
Explanation

Context window jumps from 1024 to 32768 — 32× more tokens per forward.

Think about

How does memory scale with sequence length for attention?

// architecture

Live diagram

100%
speedrun journey013.28→023.28→033.28→043.28→053.27→063.27Updated T bounds assertAllow 32K sequences in training loop.val loss11.00 → 3.27 (-7.72)◉ before/after1,024 tokens (step 01–05)before32,768 tokens (step 06)Attention memory ∝ T²1024²32× longer context → ~1000× more attention memoryflex attentionblock-sparse patterns
← #2.4 Logit Soft-cappingProfiler Overview →

What changed vs 05-softcap

+ from contextlib import contextmanager

What it bought

Learn this step, your way

WatchReadDeep Dive

🎬 Video lesson coming soon

This step's video hasn't been recorded yet. The text lesson and Rune's deep-dives cover the same ground in the meantime.