Introduction to LLM

This page provides an easy-to-understand guide on LLMs (Large Language Models) from basics to applications for AI enthusiasts.


Total of 34 articles available. | Currently on page 1 of 1.

Chapter 12 — Access Control and Identity

Twelfth post of the LLM Primer VII walkthrough. OAuth 2.0 + PKCE, ABAC vs ReBAC (Zanzibar), multi-tenant isolation, and token-bucket rate limits for LLM APIs.

2026-05-21

Chapter 11 — Observability, Logging, and Incident Response

Eleventh post of the LLM Primer VII walkthrough. Structured LLM logging with PII redaction, OpenTelemetry GenAI conventions, and the NIST SP 800-61 IR cycle adapted for probabilistic systems.

2026-05-20

Chapter 9 — Model Integrity and Supply Chain Risks

Ninth post of the LLM Primer VII walkthrough. Open-source model dependency risk, Sleeper Agents (Hubinger et al.), safetensors vs pickle, CVE-2024-3568, and the SLSA / Sigstore artifact-signing discipline.

2026-05-18

Chapter 8 — Adversarial Attacks on Models

Eighth post of the LLM Primer VII walkthrough. Adversarial examples in NLP (HotFlip, TextFooler), model extraction (Tramèr et al., Carlini et al.), and the defensive strategies for API-boundary abuse.

2026-05-17

Chapter 7 — Hallucinations and Reliability

Seventh post of the LLM Primer VII walkthrough. Why hallucinations occur, the confidence-vs-correctness gap, and hybrid verification architectures — anchored by the Moffatt v Air Canada and Mata v Avianca cases.

2026-05-16

Chapter 6 — Retrieval-Augmented Generation Risks

Sixth post of the LLM Primer VII walkthrough. Trust boundaries in RAG, malicious document injection, PoisonedRAG and BadRAG, and monitoring retrieval flows for the attacker's fingerprints.

2026-05-15

LLM Primer VII — Series Introduction & Index

Kicking off the chapter-by-chapter walkthrough of Book VII in the LLM Primer series — AI Security. Why in LLM systems code and data are the same string, and the schedule for the seventeen posts that follow, May 10 through May 26. This is the series finale.

2026-05-09

Chapter 15 — Serverless APIs vs Dedicated Infrastructure

Fifteenth post of the LLM Primer VI walkthrough. The breakeven math between serverless APIs and dedicated infrastructure, the hidden platform-engineering overhead each side takes on, and microVM sandboxes for agent code execution.

2026-05-07

Chapter 14 — Token Economics and API Pricing

Fourteenth post of the LLM Primer VI walkthrough. The input-vs-output token asymmetry, the hidden cost of conversation history, and the invisible reasoning tokens that quietly rewrite the daily bill.

2026-05-06

Chapter 13 — Autoscaling and Cold-Start Mitigation

Thirteenth post of the LLM Primer VI walkthrough. Why standard HPA fails for LLM serving, KEDA for TTFT-aware scaling, Knative scale-to-zero, and CRIU / CUDA graph caching for sub-5-second cold starts.

2026-05-05

Chapter 12 — Disaggregated Serving and Kubernetes

Twelfth post of the LLM Primer VI walkthrough. Why aggregating prefill and decode wastes compute, and how LeaderWorkerSet, NVIDIA Grove, and KAI Scheduler split them apart on Kubernetes.

2026-05-04

Chapter 11 — The Platform and Orchestration Layer

Eleventh post of the LLM Primer VI walkthrough. Engine vs platform — Ray Serve, KServe, BentoML, and NVIDIA Triton — and where each fits in a multi-model pipeline.

2026-05-03

Chapter 10 — The LLM Engine Layer

Tenth post of the LLM Primer VI walkthrough. vLLM as the safe default, TensorRT-LLM for peak NVIDIA-only throughput, SGLang for structured and agentic outputs, and TGI/Ollama for the rest.

2026-05-02

Chapter 9 — Speculative Decoding

Ninth post of the LLM Primer VI walkthrough. The draft-verify paradigm — EAGLE, Medusa, MTP, Lookahead, N-gram — and the verification bottleneck that decides real speedup.

2026-05-01

Chapter 8 — Next-Generation KV Cache Management

Eighth post of the LLM Primer VI walkthrough. PagedAttention, KV eviction algorithms (H2O, InfiniGen), and prefix caching for multi-turn conversations and multi-agent RAG.

2026-04-30

Chapter 7 — Advanced Batching Strategies

Seventh post of the LLM Primer VI walkthrough. Static vs dynamic vs continuous (in-flight) batching, iteration-level scheduling, and how a batch's slots actually progress on the GPU.

2026-04-29

Chapter 6 — Pruning and Knowledge Distillation

Sixth post of the LLM Primer VI walkthrough. Structured vs unstructured pruning, 2:4 sparsity on Hopper, and the distillation lineage from soft probabilities to Patient Knowledge Distillation and MiniLLM.

2026-04-28

Chapter 3 — Data Center GPUs for Generative AI

Third post of the LLM Primer VI walkthrough. The NVIDIA lineup (H100, H200, B200, L40S) vs AMD MI300X — and why HBM bandwidth matters more than FLOPs for decoding.

2026-04-25

Chapter 2 — The KV Cache Challenge

Second post of the LLM Primer VI walkthrough. The KV cache formula, the attention-variant trade-offs (MHA vs GQA vs MQA), and the memory-fragmentation problem PagedAttention solves.

2026-04-24

Chapter 1 — The Mechanics of Token Generation

First post of the LLM Primer VI walkthrough. The autoregressive bottleneck, the prefill/decode split, and why a high-end GPU is 99.7% idle while serving a single user.

2026-04-23

LLM Primer VI — Series Introduction & Index

Kicking off the chapter-by-chapter walkthrough of Book VI in the LLM Primer series — Scaling AI Systems. Why inference is the discipline that decides whether an LLM app survives real users, and the schedule for the sixteen posts that follow, April 23 through May 8.

2026-04-22

Chapter 4 — AI Agents and Tool Calling

Fourth post of the LLM Primer V walkthrough. ReAct loops, tool schemas as contracts, and the three memory layers agents actually need in production.

2026-04-17

Chapter 11 — Continuous Updates and Pipeline Optimization

Eleventh and final post of the LLM Primer III walkthrough. CDC and incremental indexing keep the corpus fresh, semantic caching and model tiering keep latency down, and a four-stage feedback loop closes the gap between what production tells the team and what the team actually changes — plus a bridge to Volume IV on Model Context Protocol.

2026-03-28

Chapter 9 — Performance, Scaling, and Costs: The Real Engineering Trade-offs

Chapter 9 of the LLM Primer I series. The operational realities of running LLMs at scale — model size vs capability, the latency–throughput trade-off, cost economics, quantization, and edge deployment. Why frontier-tier models are often the wrong choice even when you can afford them.

2026-02-26

A Chapter-by-Chapter Walkthrough of LLM Primer I — Series Introduction & Index

Introduction and index for the twelve-part chapter-by-chapter walkthrough of LLM Primer I: How Generative AI Works. One post per day, Feb 18 through March 1, 2026. Read them in order or pick the chapter that matters most to you. All twelve are listed and linked here.

2026-02-17

The LLM Primer Series — A Field Guide to Generative AI, Built One Volume at a Time

The LLM Primer Series — a completed seven-volume field guide to generative AI by Sho Shimoda. From foundations to security. Includes Physical AI as sister volume. All 7 volumes available on Amazon.

2026-02-15

1.3 Entropy and Information: Quantifying Uncertainty

A clear, intuitive exploration of entropy, information, and uncertainty in Large Language Models. Learn how information theory shapes next-token prediction, why entropy matters for creativity and coherence, and how cross-entropy connects probability to learning. This section concludes Chapter 1 and prepares readers for the conceptual foundations in Chapter 2.

2025-09-06

1.1 Getting Comfortable with Mathematical Notation

A clear and accessible guide to understanding the mathematical notation used in Large Language Models. Learn how tokens, sequences, functions, and conditional probability expressions form the foundation of LLM reasoning. This chapter prepares readers for probability, entropy, and information theory in later sections.

2025-09-04

4.4 How LLMs Write Code: The Rise of AI-Powered Programming Assistants

Explore how large language models (LLMs) generate and complete code from natural-language prompts, and what it means for the future of software development.

2024-09-27

2.0 The Basics of Large Language Models (LLMs): Transformer Architecture and Key Models

Learn about the foundational elements of Large Language Models (LLMs), including the transformer architecture and attention mechanism. Explore key LLMs like BERT, GPT, and T5, and their applications in NLP.

2024-09-06

1.3 Differences Between Large Language Models (LLMs) and Traditional Machine Learning

Understand the key differences between Large Language Models (LLMs) and traditional machine learning models. Explore how LLMs utilize transformer architecture, offer scalability, and leverage transfer learning for versatile NLP tasks.

2024-09-05

1.2 The Role of Large Language Models (LLMs) in Natural Language Processing (NLP)

Discover the impact of Large Language Models (LLMs) on natural language processing tasks. Learn how LLMs excel in text generation, question answering, translation, summarization, and even code generation.

2024-09-04

1.0 What is an LLM? A Guide to Large Language Models in NLP

Discover the basics of Large Language Models (LLMs) in natural language processing (NLP). Learn how LLMs like GPT and BERT are trained, their roles, and how they differ from traditional machine learning models.

2024-09-02

A Guide to LLMs (Large Language Models): Understanding the Foundations of Generative AI

Learn about large language models (LLMs), including GPT, BERT, and T5, their functionality, training processes, and practical applications in NLP. This guide provides insights for engineers interested in leveraging LLMs in various fields.

2024-09-01