What Is LoRA? Low-Rank Adaptation Explained for Fine-Tuning LLMs
LoRA fine-tunes a large language model by freezing its weights and training two small matrices per layer. Learn how it works, the parameter math, what rank means, and its limits.
Research · Guides · Explainers
Independent AI research & technical writing
The RAMGPT library / 46 articles
Clear explanations of the concepts behind modern AI systems.
LoRA fine-tunes a large language model by freezing its weights and training two small matrices per layer. Learn how it works, the parameter math, what rank means, and its limits.
The UK's 2026 cyber review predicts AI-assisted ransomware against critical infrastructure. A source-led audit separates forecasts from incidents and maps defensible controls.
Move beyond agent test scores: learn how release gates, staged autonomy, approvals, canary trials, monitoring, and rollback decisions work together.
AI Foundations #38 teaches how to build agent evaluations with tasks, trials, deterministic checks, human review, and safe side-effect verification.
AI Foundations #37 explains when a specialist should take over a conversation, when a manager should call one as a tool, and how to test ownership, privacy boundaries, and final results.
AI Foundations #36 covers multi-step agent loops, working state, tool observations, checkpoints, retries, and why a saved model summary is not verified ground truth.
AI Foundations #35 explains the tool-calling loop, function schemas, structured arguments, execution permissions, tool results, and why valid JSON is not authorization.
AI Foundations #34 explains token masks, grammars, JSON Schema, why syntax constraints are not factual guarantees, and what engineers should test when serving structured model outputs.
AI Foundations #33 explains why LLM servers may separate prompt processing from token generation, how KV state moves, and the trade-offs between latency, throughput and operational cost.
AI Foundations #32 explains the four major ways inference workloads are split across GPUs, what each one replicates or shards, and why communication changes the trade-off.
AI Foundations #31 explains draft-and-verify generation, acceptance and rejection, why the target distribution can be preserved, and when speculative decoding actually reduces latency.
AI Foundations #30 explains why variable-length KV caches fragment GPU memory, how paging divides cache into blocks, how logical token positions map to physical memory, and why this helps serving throughput.
AI Foundations #29 explains prefix caching, KV reuse, exact token matching, cache hits, eviction, prompt-template effects, and why reuse reduces prefill work without caching the answer.
AI Foundations #28 explains static batching, continuous batching, request scheduling, chunked prefill, head-of-line blocking, fairness, and why server throughput and user latency can pull in opposite directions.
AI Foundations #27 explains time to first token, time per output token, prefill, decode, batching, throughput, context length, and why one tokens-per-second number can hide the real user experience.
AI Foundations #26 explains production monitoring, data and concept drift, feedback loops, human review, and why a model that passed evaluation can still fail after deployment.
AI Foundations #25 explains alignment, preference training, guardrails, instruction hierarchy, runtime policy, and why capability and safe system behavior are different goals.
AI Foundations #24 explains tool use, function calling, agents, action loops, observations, permissions, failure modes, and why an LLM does not execute a tool by itself.
AI Foundations #23 explains retrieval-augmented generation, embeddings, chunking, retrieval, context injection, citations, failure modes, and why RAG is different from training.
AI Foundations #22 explains test sets, metrics, benchmark design, sampling variance, contamination, and why a fair model comparison must control more than one score.
AI Foundations #21 explains reasoning tokens, inference-time compute, reward signals, RLHF, PPO, and how reinforcement-learning post-training changes model behavior.
AI Foundations #20 builds a practical mental model of multimodal AI: how text, image, audio, and video representations are converted, aligned, and fed into transformer-style systems.
AI Foundations #19 follows tokens through an MoE router and explains expert selection, active versus total parameters, load balance, memory, and inference cost.
AI Foundations #18 explains post-training weight quantization, scale and rounding error, memory estimates, mixed precision, kernels, and quality tradeoffs.
AI Foundations #17 follows KV state through prefill, decoding, prefix reuse, edited prompts, and request completion, explaining when cached work remains valid.
AI Foundations #16 uses one probability distribution to show how greedy decoding, temperature, top-k, and top-p select the next token.
AI Foundations #15 follows one language-model request through tokenization, prefill, decoding, sampling, and the memory used along the way.
AI Foundations #14 explains how fine-tuning continues gradient-based training from pretrained weights, using narrower data to change model behavior without relearning language from scratch.
A practical research playbook for reconstructing CVE-centric remediation event logs from change, incident, request, and vulnerability records before forming hypotheses.
AI Foundations #13 connects the Transformer architecture to the training objective that turns random parameters into a useful language model.
AI Foundations #12 assembles attention, residual connections, normalization, and MLP layers into the repeating Transformer block behind modern language models.
AI Foundations #11 follows tokenization and embeddings into attention: queries, keys, values, similarity scores, softmax weights, and context-dependent representations.
AI Foundations #10 connects embeddings to tokenization: how text is split into tokens, mapped to vocabulary IDs, and then looked up as learned vectors.
AI Foundations #9 explains embeddings as learned vectors that give neural networks a useful numerical space for tokens and other objects.
AI Foundations #8 explains backpropagation as repeated chain-rule bookkeeping that carries loss information backward through a neural network to every trainable parameter.
AI Foundations #7 explains gradient descent as the rule that turns loss into a direction for changing weights, using one small numerical example before backpropagation.
AI Foundations #6 compares predictions with targets, calculates squared and absolute loss, aggregates a batch, and explains what loss can and cannot measure.
AI Foundations #5 calculates a complete two-layer forward pass and distinguishes parameters, activations, nonlinearities, inference, and training.
A cybersecurity research report on the gap between fast-moving exploitation and slow enterprise remediation, and why compensating controls should be measured by survival rather than deployment alone.
AI Foundations #4 explains tensor rank, shape, dtype, device, stride, element count, and memory through image and language-model examples.
AI Foundations #3 counts the weights and biases in a small layer, shows how they change its output, and connects parameter count to model memory.
AI Foundations #1 separates artificial intelligence, machine learning, neural networks, deep learning, generative AI, LLMs, models, runtimes, and applications.
AI Foundations #2 follows one parameter update to show how training data, a model, a loss function, gradients, and an optimizer create machine learning.
Learn what LLM context length means, what counts toward the context window, how tokens, chat history, KV cache, VRAM, truncation, and long-context models work.
Learn how LLM quantization reduces model memory, what FP16, INT8 and INT4 mean, and how GGUF, AWQ, GPTQ, scales, groups, and quality trade-offs work.
Learn what an LLM KV cache stores, why it speeds up token generation, how to estimate its VRAM use, and how context length and quantization affect memory.