The model, implemented explicitly
The architecture is built from framework-native PyTorch modules so each transformer mechanic stays inspectable and testable.
I implemented a 135M-parameter decoder-only language model in PyTorch, matched the reference model, then added optimized decoding, LoRA fine-tuning, and DPO preference alignment.
The architecture is built from framework-native PyTorch modules so each transformer mechanic stays inspectable and testable.
The fast path layers fused SDPA, native grouped-query attention, per-layer KV caching, and optional compilation behind parity checks.
LoRA adapts attention and MLP projections while DPO scores response tokens only, excluding prompt and padding tokens.