MLCrack

    LLMS & TRANSFORMERS ยท INTERVIEW QUESTION

    What are Large Language Models (LLMs) and how do they work?

    ๐ŸŸข beginner ยท Transformer Architecture

    Hint: Think about the scale of parameters, training data, and the autoregressive generation process.

    Answer

    LLMs are neural networks (typically transformer-based) trained on massive text corpora with billions of parameters. They learn statistical patterns of language via next-token prediction: given a sequence of tokens, predict the most likely next token. At inference, they generate text autoregressively โ€” producing one token at a time and feeding it back as input.

    Key ingredients:

    1. Transformer architecture with self-attention
    2. Massive pre-training data (web text, books, code)
    3. Scale (billions of parameters)
    4. Emergent capabilities at scale (reasoning, few-shot learning).

    Examples: GPT-4, Claude, LLaMA, Gemini.

    Likely follow-up: What emergent abilities appear only at very large scale?