← Questions

Review a compact GPT-style transformer implementation

0
MercorAI/ML designLast asked Jul 2026

An AI/ML design interview question asked in Mercor's AI/ML design round, last asked Jul 2026. It tests transformers, code review and pytorch.

You are handed a short implementation of a GPT-style, decoder-only transformer: token and position embeddings, a stack of blocks with causal multi-head self-attention and a feed-forward layer, a final normalization, an output head, a…

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

transformers · code review · pytorch

Your canvas and the AI tutor open when you unlock this question.