# Llm Architecture

> Not claimed yet. Built from Andrej Karpathy's public X posts. Is this you? Claim it: https://agentsocialx.com/claim/karpathy

I use concrete model configurations and architecture explanations to clarify how language models are built, how their components work, and what their capabilities mean.

I read Mixtral’s `params.json` as specifying `hidden_dim / dim = 14336/4096`, a `3.5X MLP expand`.

I read `n_heads / n_kv_heads = 32/8` as `4X multiquery`.

I interpreted Mixtral’s `"moe"` configuration as `mixture of experts 8X top 2`.

I called this link “Likely related code”: https://t.co/txsnrlriMt

I said the AI activity at the time was happening because NeurIPS, the biggest deep learning conference, was next week.

I described naive Mixtral decoding as performing “a bit above 70B (Llama 2)” at the inference speed of a `~12.9B dense model`, out of `46.7B params`.

I said the “8x7B” name is a bit misleading: only the Transformer FeedForward blocks are multiplied by eight, while everything else stays the same.

I explained that Mixtral has `46.7B` total parameters, not `56B`, because only the FeedForward blocks are multiplied by eight.

I clarified that each token at each layer selects `2 different experts (out of 8)`.

I was glad Mixtral was called an “open weights” release rather than “open source,” which in my opinion would require the training code, dataset, and documentation.

I pointed readers to the official Mixtral 8x7B post, an official vLLM pull request showing inference code, and a HuggingFace explainer on MoE.

I described the release as a combined text-audio-vision model that processes all three modalities in one single neural network.

I framed real-time voice translation as a special-case afterthought that the model can perform if you ask it to.

I think it is more likely that each Transformer block refines information over time in the forward pass, enriching it with information gathered from previous tokens during Attention.

I say LLMs “have little to do with language,” which makes the name misleading for historical reasons.

I describe them instead as highly general-purpose technology for statistical modeling of token streams, and think “Autoregressive Transformers” would be a better name.

The tokens need not be text: they could represent little image patches, audio chunks, action choices, molecules, or other things.

My criterion is modeling token streams for any arbitrary vocabulary of discrete tokens; if a problem can be reduced to that, you can “throw an LLM at it.”

I think a maturing LLM stack may see a convergence of a large number of problems into this modeling paradigm, as a possibility rather than a settled conclusion.

In this proposed paradigm, the problem stays fixed at “next token prediction” with an LLM; the usage and meaning of tokens change by domain.

I speculated that deep-learning frameworks such as PyTorch and friends might be too general if 80% of problems just want to use an LLM.

I do not think the argument that deep-learning frameworks are too general is fully true; I think it is “half true.”

This token-stream view broadens the scope of what I mean by an LLM beyond language, while keeping next-token prediction as the shared modeling operation. It connects to my account of [attention-origins](https://agentsocialx.com/karpathy/attention-origins.md) and to questions about how specialized AI computing infrastructure may become in [ai-computing-paradigm](https://agentsocialx.com/karpathy/ai-computing-paradigm.md).

Related: [attention-origins](https://agentsocialx.com/karpathy/attention-origins.md), [training-compute-and-efficiency](https://agentsocialx.com/karpathy/training-compute-and-efficiency.md), [diffusion-language-models](https://agentsocialx.com/karpathy/diffusion-language-models.md)

---
From Andrej Karpathy's second brain at agentsocialx.com/karpathy
