LLM ENGINEERING · OFFLINE GUIDE

LLM Terminology: A Complete Beginner’s Guide

Build a solid understanding of layers, RNNs, FFNs, gradients, fine-tuning, LoRA, QLoRA, FLOPS, GPUs, and production inference.

EnglishTechnical GlossaryWorks OfflineInteractive LoRA Calculator

01 · The LLM Landscape

Large Language Models (LLMs) bring together neural networks, mathematics, training, fine-tuning, GPU computing, and inference deployment.

LLM (Large Language Model)GPT · Llama · Qwen
↓
Neural Network ArchitectureTransformer · Layer · Attention · FFN
Mathematical FoundationsTensor · Matrix · Gradient · Loss
Model TrainingBackpropagation · Optimizer · Epoch
Model Fine-tuningFine-tuning · LoRA · QLoRA
Compute PerformanceFLOPS · GPU · VRAM · BF16
Model InferenceInference · KV Cache · Quantization

02 · Neural Network Fundamentals

TermMeaningPurpose
Neural NetworkNeural networkCore computational architecture of a model
NeuronNeuronWeighted computations and nonlinear transformations
ParameterParameterValues learned by the model
WeightWeightControls the influence of input signals
BiasBiasShifts a neuron's output
LayerLayerA stage of computation
FNNFeedforward neural networkInformation flows forward through the network
RNNRecurrent neural networkProcesses sequences using previous hidden states
TransformerTransformer architectureDominant architecture for modern LLMs
AttentionAttention mechanismModels relationships among tokens
FFNFeedforward networkNonlinear transformation module in a Transformer

What is a Layer?

Think of a layer as a processing stage. A 70-layer Transformer usually means 70 Transformer blocks—not 70 individual neurons.

Input: I enjoy learning AI
↓
Embedding LayerConverts tokens into vectors
↓
Transformer Layer 1Models relationships between tokens
↓
Transformer Layer 2 … NProgressively transforms contextual representations
↓
Output LayerProduces scores and a probability distribution for the next token

A Transformer block typically contains attention, an FFN, normalization, and residual connections.

Comparing FNN, FFN, RNN, and Transformer

ArchitectureHow it worksRole
FNNData flows forward through the networkBasic network architecture
FFNMultilayer feedforward transformationModule inside a Transformer block
RNNPasses the previous hidden state to the next stepEarlier sequence-modeling approach
LSTMImproves RNNs using gatesCommon in earlier NLP systems
TransformerUses attention to model token relationshipsMainstream LLM architecture
FNN and FFN are sometimes used interchangeably. In Transformer discussions, FFN usually refers to the feedforward subnetwork inside a block.

03 · Mathematics and Model Training

TermMeaningExplanation
ScalarScalarA single numerical value
VectorVectorA one-dimensional collection of numbers
MatrixMatrixA two-dimensional array of numbers
TensorTensorMultidimensional numerical data
Matrix MultiplicationMatrix multiplicationA core operation in LLMs
GradientGradientHow sensitive the loss is to parameter changes
Loss FunctionLoss functionMeasures prediction error
BackpropagationBackpropagationComputes gradients for model parameters
Gradient DescentGradient descentUpdates parameters using gradients
Learning RateLearning rateControls the size of parameter updates
OptimizerOptimizerUpdates parameters, e.g., AdamW
Batch SizeBatch sizeNumber of training examples per batch
EpochEpochOne full pass through the training dataset
StepStepUsually one optimizer update

How Do Gradients Work?

Suppose the input is 1 + 1 =, and the correct answer is 2, but the model assigns 3 a higher probability. Training aims to reduce the loss.

Current weightsLower lossLossWeightIllustration: update weights along a local downhill direction to reduce loss.
Wnew = Wold − η · ∂L/∂W

W is the weight, η is the learning rate, L is the loss, and ∂L/∂W is the gradient.

A gradient does not update a model by itself. Backpropagation computes gradients; the optimizer uses them to update weights.

04 · Fine-tuning, LoRA, and QLoRA

TechniqueMeaningKey difference
Pre-trainingPre-trainingTrains a model from scratch on large datasets
Fine-tuningFine-tuningContinues training on task-specific data
Full Fine-tuningFull fine-tuningUpdates all or nearly all model parameters
PEFTParameter-efficient fine-tuningTrains a small set of added or selected parameters
LoRALow-rank adaptationRepresents weight updates with small matrices
QLoRAQuantized low-rank adaptationQuantizes the base model and trains LoRA adapters
SFTSupervised fine-tuningTrains on inputs paired with target responses
DPODirect preference optimizationImproves outputs using preference data
RLHFReinforcement learning from human feedbackUses human preference signals in reinforcement learning

Why Does LoRA Save Resources?

Suppose a weight matrix is 4096 × 4096, containing 16,777,216 parameters. LoRA freezes the original matrix and learns two smaller matrices instead.

W′ = W + BA
B: 4096 × 16 | A: 16 × 4096

With rank 16, trainable adapter parameters = 4096 × 16 + 16 × 4096 = 131,072。

Original matrix16.78M
Added LoRA parameters131K

In this single-matrix example, the LoRA adapter has only 0.78% of the original parameter count. The full-model ratio depends on which modules receive adapters.

LoRA vs QLoRA

ComparisonLoRAQLoRA
Base model weightsUsually BF16 / FP16Usually 4-bit
Trainable weightsLoRA adapterLoRA adapter
VRAMHigherLower
Training speedTypically more straightforwardMay incur dequantization overhead
QualityDepends on data and settingsCan approach LoRA quality; not guaranteed
Best suited forSufficient GPU memoryLimited GPU memory
QLoRA generally freezes the quantized base model and uses backpropagation to train LoRA adapters. It does not directly update all 4-bit base weights.

05 · GPUs, FLOPS, VRAM, and Precision

TermMeaningMeaning
FLOPFloating-point operationOne floating-point operation
FLOPSFloating-point operations per secondComputational throughput
TFLOPSTeraFLOPS10¹² FLOPS
PFLOPSPetaFLOPS10¹⁵ FLOPS
VRAMGPU video memoryStores weights and intermediate data
CUDANVIDIA parallel computing platformGPU software ecosystem
Tensor CoreTensor CoreAccelerates matrix computations
FP3232-bit floating pointHigher precision
FP1616-bit floating pointLower memory requirements
BF16Brain Floating PointCommonly used in training
INT88-bit integerQuantized representation
INT44-bit integerEven lower memory usage
HBMHigh-bandwidth memoryUsed by high-end AI GPUs
Memory BandwidthMemory bandwidthData transfer rate

Theoretical Weight Storage for a 70B Model

PrecisionTheoretical weight size
FP32280 GB
FP16 / BF16140 GB
INT870 GB
INT435 GB
Sizes use decimal GB and include only model weights—not quantization metadata, KV cache, activations, optimizer states, or CUDA workspace. High FLOPS do not guarantee fast single-request inference: decoding can be limited by memory bandwidth.

06 · Inference Terminology

TermMeaningPurpose
InferenceInferenceGenerates results with a trained model
TokenTokenBasic unit of text processing
TokenizerTokenizerConverts text into token IDs
EmbeddingEmbeddingConverts tokens into numerical vectors
Context WindowContext windowMaximum supported token context
PrefillPrefillProcesses input tokens and builds the KV cache
DecodeDecodeGenerates tokens incrementally
KV CacheKey/value cacheAvoids recomputing previous tokens' keys and values
TTFTTime to first tokenTime from request to first output token
TPSTokens per secondGeneration speed or system throughput
LatencyLatencyTime between request and response
ThroughputThroughputWork completed per unit time
QuantizationQuantizationReduces numerical precision
Continuous BatchingContinuous batchingDynamically batches inference requests
Speculative DecodingSpeculative decodingSpeeds up generation using a draft model or related methods

07 · End-to-End Training and Inference

Training DataText / Code / Documents
↓
Tokenizer → EmbeddingConverts text to tokens, then vectors
↓
Transformer × N Layers
AttentionQ / K / V
FFNLinear + Activation
Layer Norm · Residual · Matrix Multiplication
↓
Prediction → LossPredicts tokens and computes error
↓
TrainingBackward → Gradient → Optimizer → Weight Update
InferencePrefill → Decode → Token Output

Training repeatedly updates weights. Inference generates outputs with trained weights and does not perform ordinary weight updates.

08 · Interactive LoRA Rank Calculator

Adjust the rank to see how the number of trainable parameters changes for a single 4096 × 4096 matrix. All calculations run locally in your browser.

LoRA Rank (r)16
43264128
Trainable LoRA parameters0.131M
Percentage of original matrix0.78%
Original matrix16.78M
LoRA adapter0.131M

4096 × 16 + 16 × 4096 = 131,072

A higher rank generally increases adapter capacity, memory use, and compute cost, but does not guarantee better quality.

09 · Advanced LLM Terms

CategoryTermPurpose
ArchitectureMoE (Mixture of Experts)Multiple expert subnetworks
ArchitectureGQA (Grouped Query Attention)Reduces KV cache overhead
ArchitectureRoPEEncodes token positions
ArchitectureRMSNormNormalizes hidden states
ArchitectureSwiGLUCommon FFN activation
TrainingGradient AccumulationAccumulates gradients across microbatches
TrainingGradient CheckpointingTrades extra compute for lower memory usage
TrainingMixed PrecisionUses multiple numerical precisions
Distributed trainingDDPDistributed data parallelism
Distributed trainingFSDP / ZeROShards model states
InferenceFlashAttentionEfficient attention computation
InferencePagedAttentionPaged KV cache management
InferenceTensor ParallelismSplits tensor computation across GPUs
InferencePipeline ParallelismRuns different model layers on different GPUs
ApplicationsRAGRetrieves external information to support generation
ApplicationsEmbedding ModelConverts content into vectors
ApplicationsVector DatabaseVector storage and search

10 · Recommended Learning Roadmap

01
Mathematical Foundations

Vector → Matrix → Tensor → Matrix Multiplication

02
Neural network

Weight → Bias → Layer → FFN → Activation

03
Model Training

Forward → Loss → Gradient → Backpropagation → Optimizer

04
Transformer

Embedding → Q/K/V → Attention → FFN → Layer

05
Model Fine-tuning

Fine-tuning → PEFT → LoRA → QLoRA → DPO

06
GPUs and Performance

FLOPS → VRAM → HBM → Precision → Quantization

07
Production Inference

Prefill → Decode → KV Cache → Batching → Parallelism

Training(Training)Gradient · Optimizer · GPU Compute · Training Memory
Inference(Inference)Token Generation · KV Cache · Memory Bandwidth · Latency · Throughput