SZShibZ’ AI Memory Map

QUICK RECOLLECTION REFERENCE · AUGUST 2026

See the whole AI stack.
Remember how it connects.

A compact map from text → tokens → tensors → Transformer layers → output, and from architecture → parameters → file format → framework → inference engine → provider.

Your inputtext · image · audio
MODELarchitecture + parameters
ENGINEexecutes tensor operations
Outputtokens · embeddings · labels
Anchor idea: Architecture is the blueprint. Parameters are what it learned. A checkpoint stores those parameters. An engine executes them on hardware.
01

THE CORE LOOP

What inference actually does

A · PREFILL — read the prompt once

PromptExplain tensors
Token IDs[849, 312, 991…]
Vectorsnumbers + positions
Every decoder layerattention → FFN → residual/norm
KV cache + logitsmemory + scores
First output tokenselected probability

B · REPEATED DECODING — one new token per iteration

Newest tokenonly this is new
Every decoder layerconsult KV cache
Update cacheadd new K + V
Logits → samplingchoose next token
Append tokenstream to user
EOS / stop?NO ↺ repeat
YES ✓ finish
Is inference only steps 1–3?Almost. It is the whole forward-running process: input preparation + prefill + first-token choice + repeated decoding until stopping.
02

ENCODING

Words become model-readable numbers

TextTokenizerIDsEmbeddingsContextual hidden states

Encoding is not encryption or instant “understanding.” It is the transformations turning raw input into increasingly context-aware tensors. In decoder-only LLMs, this occurs during prefill.

03

BLUEPRINTS

Predominant model architectures

INPUT ↔ ↔ ↔ REPRESENTATION

Encoder-only

Looks both left and right. Best at understanding.

PROMPT → → → NEXT TOKEN ↺

Decoder-only

Looks backward. Best at open-ended generation.

ENCODE ⇢ MEANING ⇢ DECODE ↺

Encoder–decoder

Reads a source, then generates a target.

Architecture / traitInformation flowWhere it shinesExamplesRemember
Encoder-onlyWhole input, bidirectionallyUnderstanding, classification, embeddingsBERT, RoBERTa, DeBERTaUsually not long-form generation
Decoder-onlyCausal; predicts next tokenChat, writing, code, agentsGPT, Claude, Llama, Qwen, Mistral, DeepSeekDominant general-purpose LLM
Encoder–decoderEncoder reads; decoder writesTranslation, summarization, transformationsT5, FLAN-T5, BARTDistinct source and target sequences
Mixture of ExpertsRouter activates select expert FFNsMore capacity per active computeMixtral, DeepSeek-V3, Qwen3-MoE, Llama 4A Transformer routing design
MultimodalAdds modality encoders or unified tokensImages, audio, video and textGPT-4o, Gemini, Claude, Gemma 3nCapability—not one architecture
Diffusion / parallel textIteratively denoises positionsExperimental parallel generationLLaDA and research systemsNot the usual next-token loop

No universal “best” model: task, data, latency, context, hardware, license and cost determine the best fit. Benchmark on your actual workload.

04

MODEL SPECS

What the important numbers mean

7B / 70B parameters

Learned-number count—not layers. More capacity can help, but training and design matter.

32 layers

Repeated Transformer blocks. Every token passes through all of them.

4K–1M context

Maximum working token sequence; longer context increases cache and compute.

4096 hidden size

Width of each token’s internal vector.

32 attention heads

Parallel relevance subspaces; GQA/MQA share KV heads to save memory.

FP16 / INT8 / 4-bit

Number precision. Fewer bits shrink memory, sometimes with quality loss.

Dense vs MoE

Dense activates all weights; MoE routes tokens through selected experts.

Tokens / second

Decode speed; time-to-first-token is strongly affected by prefill.

Approximate raw weight memoryparameters × bits ÷ 87B × 4-bit ÷ 8 ≈ 3.5 GB, plus metadata, KV cache and runtime overhead.
05

DO NOT MIX THESE UP

The complete model software stack

1Architecture

Transformer · encoder · decoder · MoE · multimodal

blueprint
implemented with
2Framework

PyTorch · JAX · TensorFlow/Keras · MLX

tensor toolkit
exports / stores
3Model artifact

SafeTensors · PyTorch checkpoint · ONNX · GGUF · MLX

stored learning
loaded or converted for
4Inference engine

Transformers · vLLM · llama.cpp · TensorRT-LLM · ONNX Runtime

execution runtime
runs on
5Hardware / provider

CPU · GPU · Apple silicon · TPU · cloud API

compute + operations

Frameworks: where tensor code is created and executed

FrameworkBest forWhy Python is not the bottleneckWhere it shines
PyTorchResearch, training, fine-tuning, flexible inferencePython orchestrates; compiled C++/CUDA/Triton kernels do heavy mathDefault for experimentation and Hugging Face
JAXAccelerator-scale researchXLA compilation + functional transformationsTPUs and highly vectorized research
TensorFlow / KerasEstablished production MLGraph/eager execution with compiled kernelsMature enterprise/deployment ecosystem
ONNX + ONNX RuntimePortable inference and cross-framework deploymentONNX stores the computation graph; ONNX Runtime executes it with optimized hardware backendsMoving trained models between PyTorch/TensorFlow and server, desktop, browser or edge
MLXApple-silicon workLazy arrays + unified memoryLocal Mac fine-tuning and inference
Why isn’t Python too slow?Python coordinates the work; large matrix operations execute in compiled C++/CUDA/Metal/XLA kernels. The expensive loop runs on the accelerator.

Checkpoint and deployment formats

FormatContainsMain purposePreferred situationImportant nuance
SafeTensorsWeights onlySafe, fast checkpointTraining, fine-tuning, Transformers inferenceNo arbitrary pickle execution
PyTorch .bin/.pt/.pthWeights or Python objectsGeneral/legacy serializationOlder checkpoints and research codeSupported—not universally deprecated; pickle can be unsafe
GGUFQuantized weights + metadataPortable local inferencellama.cpp ecosystem; CPU/GPU local useNot PyTorch-native training format
ONNXPortable graph + weightsFramework-neutral deploymentONNX Runtime: server, browser, edgeOperator export support varies
TensorRT engineCompiled optimized graphMaximum NVIDIA performanceSpecific production NVIDIA stackFast but less portable
MLXApple-oriented arrays/weightsUnified-memory executionApple-silicon training and inferencemacOS-focused ecosystem
Why PyTorch cannot directly run GGUF: GGUF is arranged for GGML/llama.cpp with its own quantization, naming, layout and metadata. PyTorch expects its own tensors and operators. Same learned values, different native packaging and kernels—convert it or use a GGUF-aware engine.

Popular inference engines

EngineTypical inputHardwareWhere it shines
llama.cppGGUFCPU, CUDA, Metal, VulkanLocal/offline and quantized models
vLLMUsually SafeTensors/Hugging FaceGPU serversHigh throughput, continuous batching, PagedAttention
TensorRT-LLMConverted/compiled artifactsNVIDIA GPUsMaximum optimized production performance
Transformers + PyTorchSafeTensors / PyTorchCPU/GPU/acceleratorsFlexible reference inference and debugging
ONNX RuntimeONNXCPU, GPU, NPU, browser/edgePortable deployment
MLX-LMMLX weightsApple siliconConvenient Mac inference/fine-tuning
Ollama / LM StudioOften GGUFDesktop/localFriendly model management and chat; wrappers, not formats
06

CHANGE KNOWLEDGE OR SUPPLY KNOWLEDGE?

Training, LoRA and RAG

WEIGHTS CHANGE

Full fine-tuning

Update most or all parameters. Maximum control, compute and storage.

dataset → loss → backprop → updated base
ADAPTER CHANGES

LoRA / QLoRA

Freeze the base and train small low-rank adapters. QLoRA holds a quantized base while training.

base + small adapter → specialized behavior
PROMPT CHANGES

RAG

Retrieve current/private information at inference. No weight update.

question → retrieve → augmented prompt → answer
Current/private facts?Use RAG.
Repeatable behavior/style?Use LoRA/fine-tuning.
Need both?Fine-tune behavior; retrieve changing knowledge.
Documents → Chunks → Embedding model → Vector DB → Similarity search → Passages + question → LLM answer
07

HOSTED INFERENCE

What an inference provider provides

You send an API request. It handles model loading, GPUs, the engine, batching, autoscaling, caching, security, observability and billing. Model creator, model host and provider can be different companies.

Your appAPI →PROVIDERengine · GPUs · scaling · metering→ tokensYour app
08

FAMILY TREE

How major model families evolved

Simplified lineage. Arrows show family progression; shared Transformer ancestry does not imply inherited proprietary weights.

20172018–222023202420252026
OpenAITransformerGPT-1 → 3 / ChatGPTGPT-4GPT-4o / o1GPT-5GPT-5.4 → 5.6
GoogleTransformerBERT / T5 / PaLMGemini 1Gemini 1.5 / GemmaGemini 2.5Gemini 3 → 3.5
MetaTransformerRoBERTa / OPTLLaMA / Llama 2Llama 3.xLlama 4Muse Spark
AnthropicTransformerClaude 1 / 2Claude 3.xClaude 4Claude 5 family
AlibabaTransformerQwen 1 / 1.5Qwen 2 / 2.5Qwen 3Qwen 3 variants
DeepSeekTransformerDeepSeek LLMV2V3 / R1V4
MistralTransformer7B / MixtralLarge / PixtralMagistral / Mistral 3Mistral 3 family

Updated from official family announcements through August 2026.

09

FAST LOOKUP

Searchable concept cards

THE 20-SECOND RECALL

Architecture defines the path. Parameters carry learning.
Formats store it. Engines run it. Providers operate it.

Prompt → Tokens → Embeddings → Prefill → First token → Decode ↺ → Answer

HIGH-RESOLUTION MEMORY MAP

Transformer architecture and inference mechanics

Transformer architecture and inference mechanics memory map