Blog

Paper breakdowns, frontier updates and engineering notes on large language models.

FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness

FlashAttention computes exact attention block by block in the GPU's on-chip SRAM, so the N×N score matrix never goes to GPU memory. HBM accesses fall from Θ(Nd+N²) to Θ(N²d²/M); BERT trains about 15% faster, GPT-2 3.0 to 3.5 times faster than HuggingFace. A breakdown of the paper.

Paper notes NeurIPS 2022

InstructGPT: Training Language Models to Follow Instructions with Human Feedback

OpenAI's 2022 InstructGPT paper: supervised fine-tuning on about 13,000 human demonstrations, a reward model trained on human rankings of about 33,000 prompts, then PPO. A 1.3B InstructGPT beat the 175B GPT-3 in labeler evaluations. This breakdown checks the data, loss and results, and their limits.

Paper notes NeurIPS 2022

LoRA: Freeze the Pretrained Weights, Train Only a Low-Rank Update

LoRA (Hu et al., 2021) freezes the pretrained weights and trains only a low-rank update ΔW=BA: about 10,000 times fewer trainable parameters on GPT-3 175B, a 350GB checkpoint shrinking to 35MB, no extra latency after merging, and quality on par with full fine-tuning. Method, experiments, caveats.

Paper notes ICLR 2022 2021

Decision Transformer: Reinforcement Learning as Conditional Sequence Modeling

Decision Transformer (Chen et al., 2021) recasts offline RL as conditional sequence modeling: a causal GPT trained on return, state and action tokens, prompted with a target return. We recompute its tables, rerun its shortest-path toy, and show where return conditioning fails.

Paper notes NeurIPS 2021 2021

RoFormer: Writing Position into the Attention Dot Product with Rotations

RoFormer's rotary position embedding (RoPE) rotates queries and keys by position, so their dot product depends only on relative position, with no extra parameters. It later became standard in open LLMs such as LLaMA. We check its formulas, its mixed small-scale results and its properties in code.

Paper notes arXiv (later Neurocomputing 2024) 2021

ViT: An Image Is Worth 16x16 Words, Fed Straight to a Transformer

ViT drops convolutions: it cuts an image into fixed-size patches, projects each into a token, adds position embeddings and feeds a standard Transformer encoder. It trails ResNets on small data but, pre-trained on JFT-300M, reaches 88.55% on ImageNet with about a quarter of BiT-L's compute.

Paper notes ICLR 2021 2020