Search

Try a topic

Vitor Sousa / Research journal

Notes on learning systems.

I’m Vitor. This is my notebook for working through machine-learning questions—from mathematical ideas to implementations and experiments.

Most of what I write is about transformers, evaluation, reinforcement learning, and recommendation systems. I try to be clear about what I’ve tested, what I think, and what I still don’t know.

Recent writing

All writing
  1. Engineering note

    A Transformer from Raw Tensors: What 112 Tests Taught Me

    What it took to verify a decoder-only transformer built from raw tensors, and the three properties that were easiest to get silently wrong.

  2. Explainer

    After GDPO: A Map of the GRPO Family

    Reading Dr. GRPO, DAPO, GSPO and GDPO as points along seven design axes of GRPO, with a guide to choosing between them.

    Updated Oct 31, 2026

  3. Explainer

    Building a Transformer: The Complete Forward Pass

    Normalization, residual connections, feed-forward layers, and a decoder-only transformer assembled piece by piece with tested code.

    Transformer Internals · Part 3

Selected investigations

All projects

A few projects where the code, method, and lessons are documented — with the status they actually have.

From the notebook

All notes
  1. Debugging

    Benchmark Your Benchmark

    A number without variance isn't a result — and a benchmark without a correctness gate isn't a benchmark.

  2. Code note

    GELU / SwiGLU from Scratch

    Why it matters: The gate is a content-dependent multiplier on each hidden unit — the FFN learns which features to let through, not just how to mix them.

  3. Code note

    Pre-Norm vs Post-Norm: Why It Matters

    Why it matters: In pre-norm the residual stream is never normalized, so every block has a clean identity gradient path back to the input — deep stacks (≥12 layers) train without…