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 52 articles available. | Currently on page 1 of 2.

Chapter 17 — Future Threats and Emerging Defenses

Seventeenth post of the LLM Primer VII walkthrough — and the series finale. Agent risks and the lethal trifecta, multimodal attack surfaces, deepfakes and C2PA provenance, plus a closing map of the whole LLM Primer arc and the Physical AI sister volume.

2026-05-26

Chapter 16 — Secure Fine-Tuning and Adaptation

Sixteenth post of the LLM Primer VII walkthrough. Why fine-tuning aligned models degrades safety (Qi et al.), poisoned fine-tuning data, and rollback disciplines that keep the safety envelope intact.

2026-05-25

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 10 — Designing Secure LLM Architectures

Tenth post of the LLM Primer VII walkthrough. Isolation boundaries, policy engines (OPA, Cedar), microVM sandboxes, and the "lethal trifecta" of agent + private data + untrusted content.

2026-05-19

Chapter 4 — Prompt Injection and Jailbreaks

Fourth post of the LLM Primer VII walkthrough. Prompt injection as a structural consequence, the jailbreak taxonomy (DAN, grandma, Zou et al. suffixes, Crescendo, Skeleton Key), and the four-layer mitigation matrix.

2026-05-13

Chapter 2 — Threat Modeling for LLM Systems

Second post of the LLM Primer VII walkthrough. Adapting STRIDE, PASTA, and attack trees to LLM systems — model, prompt, data, and infrastructure as assets, and MITRE ATLAS as the LLM-specific adversary catalog.

2026-05-11

Chapter 1 — Why AI Security Is Different

First post of the LLM Primer VII walkthrough. Why LLM security is structurally different from traditional security — the collapsed code/data boundary, the probabilistic core, and the OWASP LLM Top 10 as a working checklist.

2026-05-10

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 16 — Cost-Cutting Strategies in Production

Sixteenth and final post of the LLM Primer VI walkthrough. Intelligent model routing, context compaction, async batch APIs, and semantic caching — plus a look ahead to Volume VII on AI Security.

2026-05-08

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 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 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 — LLM Security and Guardrails

Seventh post of the LLM Primer V walkthrough. The OWASP LLM Top 10 as a working checklist, direct-versus-indirect prompt injection, and the four-layer mitigation matrix.

2026-04-20

Chapter 6 — AI Observability and Tracing

Sixth post of the LLM Primer V walkthrough. OpenTelemetry GenAI conventions, span design for LLM apps, cost tracking, and the loop back into the evaluation harness.

2026-04-19

Chapter 5 — Evaluating LLM Applications

Fifth post of the LLM Primer V walkthrough. The offline-online eval distinction, LLM-as-judge patterns, the RAG Triad, and trajectory tests for agents.

2026-04-18

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 3 — Retrieval-Augmented Generation

Third post of the LLM Primer V walkthrough. The RAG pipeline end to end — chunking, hybrid retrieval, query transformation, multimodal, and text-to-SQL — and where RAG fits versus fine-tuning and long context.

2026-04-16

Chapter 2 — Foundation Models & Prompt Engineering

Second post of the LLM Primer V walkthrough. Model tiering, sampling parameters, defensive prompt patterns, and structured outputs as engineering surfaces — the layer just inside the deterministic wrapper.

2026-04-15

LLM Primer V — Series Introduction & Index

Kicking off the chapter-by-chapter walkthrough of Book V in the LLM Primer series — Building Real-World LLM Applications. Why AI engineering is a discipline of its own, who this book is for, and the schedule for the eight posts that follow, April 14 through April 21.

2026-04-13

Chapter 14 — Benchmarking, Testing, and Performance

Fifteenth and final post of the LLM Primer IV walkthrough. The MCP-Universe Benchmark on real servers, the two systemic failure modes it exposed, the ten-times throughput gap between session-per-request and shared session pools, and the bridge to Volume V.

2026-04-12

Chapter 13 — Frameworks and Cloud Integration

Fourteenth post of the LLM Primer IV walkthrough. Strands with Bedrock, the AWS state-layer pattern, the Microsoft Agent Framework, LangChain, Semantic Kernel — and the three production integration shapes teams keep arriving at independently.

2026-04-11

Chapter 12 — Protocol Hardening and Defenses

Thirteenth post of the LLM Primer IV walkthrough. The four defense clusters — cryptographic attestation, OAuth scope discipline with bounded sessions, runtime sandboxing, and human-in-the-loop gates — compose into a posture that does not depend on the model behaving correctly under adversarial conditions.

2026-04-10

Chapter 11 — Attack Surfaces and Protocol Vulnerabilities

Eleventh post of the LLM Primer IV walkthrough. The classical attacks adapted to MCP — Confused Deputy, Token Passthrough, Session Hijacking — the protocol-level flaws around capability escalation and unauthenticated sampling, and the implicit trust propagation that makes context poisoning a structural problem rather than a hygiene one.

2026-04-09

Chapter 10 — Long-Horizon Task Memory

Tenth post of the LLM Primer IV walkthrough. Short-term memory through windows and ReAct scratchpads, long-term memory through episodic vectors and semantic stores, and the compaction techniques that keep an agent productive over hours and days.

2026-04-08

Chapter 9 — Managing the Attention Budget

Ninth post of the LLM Primer IV walkthrough. Context rot, the lost-in-the-middle cliff, tool-loadout rot, and the three architectural answers — MCP, RAG, fine-tuning — to the question of where a model's missing knowledge actually belongs.

2026-04-07

Chapter 8 — Architectural Deployment Layouts

Eighth post of the LLM Primer IV walkthrough. The three deployment layouts that have emerged in the MCP ecosystem — reusable agent, strict purity, hybrid — and the four binding constraints that determine which one fits which project.

2026-04-06

Chapter 7 — Advanced Collaborative and Dynamic Patterns

Seventh post of the LLM Primer IV walkthrough. Roundtable consensus, handoff routing, and magentic orchestration — the patterns that emerge when the topology has to be built per request, with the failure modes (non-termination, mis-routing, runaway planning) the simpler patterns avoid.

2026-04-05

Chapter 6 — Fundamental Orchestration Strategies

Sixth post of the LLM Primer IV walkthrough. The two foundational orchestration shapes — sequential pipelines and concurrent scatter-gather — and the prior question every team should ask: is a multi-agent system the right answer at all?

2026-04-04

Chapter 5 — Transport Protocols and Discovery

Fifth post of the LLM Primer IV walkthrough. The three transports MCP supports, the .well-known discovery layer with Server Cards, and the boring operational concerns — CORS, origin validation, caching — that decide whether a server is a cooperative network citizen or a liability.

2026-04-03

Chapter 4 — Client Primitives: Agentic Behaviors and Control

Fourth post of the LLM Primer IV walkthrough. Sampling, Roots, and Elicitation are the three small, controlled holes MCP punches through the host-server wall — each a capability granted back, each a risk accepted on the user's behalf.

2026-04-02

Chapter 3 — Server Primitives: Exposing Context and Capabilities

Third post of the LLM Primer IV walkthrough. The three nouns an MCP server can offer — Resources (read state), Prompts (reusable scaffolding), Tools (write actions) — their schemas, their lifecycles, their error models, and the discipline of choosing the right primitive.

2026-04-01

Chapter 2 — Unveiling the Model Context Protocol (MCP)

Second post of the LLM Primer IV walkthrough. What MCP actually standardizes, the three-role split of Host, Client, and Server, why dynamic discovery and bidirectional messaging differ from REST in the cases that matter, and the session lifecycle that opens with capability negotiation.

2026-03-31

Chapter 1 — The AI Integration Crisis and the Rise of Agentic Architecture

First post of the LLM Primer IV walkthrough. Why monolithic agents fray as system prompts grow, the N times M integration problem hiding underneath, and the move from prompt engineering to context engineering that MCP was built to enable.

2026-03-30

LLM Primer IV — Series Introduction & Index

Kicking off the chapter-by-chapter walkthrough of Book IV in the LLM Primer series — Designing AI Cognition with MCP. Why agents need a protocol layer to scale past demoware, who this book is for, and the schedule for the fourteen posts that follow, March 30 through April 12.

2026-03-29

Chapter 10 — Leading Evaluation Frameworks

Tenth post of the LLM Primer III walkthrough. A field guide to the frameworks that turn the Evaluation Triad into something a team can actually run — RAGAS, TruLens, DeepEval on one side, Braintrust, LangSmith, Phoenix, Galileo, Opik on the other, and the Evaluation Gap none of them has yet closed.

2026-03-27

Chapter 6 — RAG Threat Models and Vulnerabilities

Sixth post of the LLM Primer III walkthrough. The expanded attack surface of retrieval — corpus poisoning, adversarial chunks, indirect prompt injection, embedding inversion, and the confused-deputy problem in agentic RAG. Concrete attacks, each demonstrated, each reproducible.

2026-03-23

Chapter 4 — Selecting the Right Vector Database

Fourth post of the LLM Primer III walkthrough. The architectural split between purpose-built vector databases and Postgres-style extensions, the managed leaders (Pinecone, Vertex), the open-source field (Qdrant, Milvus, Weaviate), the embedded options, and the three operational axes — residency, ops, cost — that decide the real choice.

2026-03-21

Chapter 2 — Intelligent Document Parsing

Second post of the LLM Primer III walkthrough. Why a PDF is not a text file, what layout-aware parsers actually preserve, the current tool landscape (LlamaParse, Docling, Unstructured, Marker-PDF, Firecrawl, DeepSeek-OCR), and the multimodal track that retrieves over page images directly.

2026-03-19

Chapter 1 — The Evolution of RAG Architecture

First post of the LLM Primer III walkthrough. The four architectural postures of RAG — Naive, Advanced, Modular, Agentic — read as a story about handing more agency to the LLM one decision at a time, and the honest answer to when fine-tuning is the better tool than retrieval.

2026-03-18

Chapter 11 — Evaluation, Calibration, and Inference

Eleventh post of the LLM Primer II walkthrough. Perplexity, calibration, the error bars that every benchmark score should carry, and the mathematics of measuring hallucination — the chapter where we ask how anyone can measure a machine that can say anything.

2026-03-13

Chapter 2 — LLMs in Context: Concepts and Background

Second post of the LLM Primer II walkthrough. What an LLM actually is, the three things "pretraining, parameters, scale" really stand for, the unusual nature of language as a data source, and why the transformer rewrote the field in a single year.

2026-03-04

Chapter 12 — Building Your Own LLM System: From Datasets to Production

Chapter 12 of the LLM Primer I series. The final chapter. What it actually takes to build an LLM-powered system end to end — dataset licensing, training pipelines, evaluation frameworks, the integrated application stack, and the case-study patterns that distinguish successful deployments from failed pilots.

2026-03-01

Chapter 8 — Using LLMs in Applications: Chatbots, Code, Extraction, and Agents

Chapter 8 of the LLM Primer I series. The application patterns that actually ship in production — chatbots, summarization, code assistants, structured extraction, and the rise of agentic systems where the model drives a tool-use loop. Plus the benchmarks every engineer should recognize by name.

2026-02-25

Chapter 4 — The Transformer Architecture: Inside the Engine of Modern AI

Chapter 4 of the LLM Primer I series. A tour of the Transformer block — how self-attention, positional encoding, and stacked layers combine to produce the architecture every modern LLM is built on. Includes a clear explanation of why scaling Transformers works, and what it costs.

2026-02-21

Chapter 1 — What Is a Large Language Model? (Beyond the Headlines)

Chapter 1 of the LLM Primer I series. We unpack what 'Large,' 'Language,' and 'Model' actually mean, walk through the move from rule-based systems to neural networks, and address the three biggest misconceptions about how modern LLMs work. A clear, accessible foundation for everything that follows.

2026-02-18

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.2 Basics of Probability for Language Generation

An intuitive, beginner-friendly guide to probability in Large Language Models. Learn how LLMs represent uncertainty, compute conditional probabilities, apply the chain rule, and generate text through sampling. This chapter builds the mathematical foundation for entropy and information theory in Section 1.3.

2025-09-05