⚑ IT Wisdom I put everything in the cloud. Now I just pray it doesn't rain.
Skilled Practitioner
4249 XP 1751 to Expert

Introduction

Generative AI models are systems trained to produce new content β€” text, images, audio, or code β€” rather than just classify or predict a label. On the AITECH exam, this topic covers the major model families, where they run, and the mechanics (context windows, tokens, RAG) that determine how well they perform in a real deployment. Understanding these basics matters because every later topic β€” prompting, agents, workflow automation β€” assumes you know what kind of model you're talking to and its limits.

Key Concepts

Large Language Models (LLMs) β€” Models trained on huge text corpora to predict the next token in a sequence. Used for summarization, content generation, code generation, and chat. Examples: GPT-family, Claude, Llama.

Diffusion Models β€” Models that generate images (and increasingly audio/video) by starting from random noise and iteratively "denoising" it into a coherent output, guided by a text prompt. Examples: Stable Diffusion, DALL-E.

Cloud-hosted models β€” Accessed via API (e.g., Anthropic API, OpenAI API, AWS Bedrock). No local hardware needed, scales automatically, but data leaves your network and you pay per token.

Locally hosted models β€” Run on your own hardware (e.g., via Ollama, LM Studio, or on-prem GPU servers). Better data privacy and no per-token cost, but you need GPU hardware, and capability/quality often lags behind the largest cloud models.

Context window β€” The maximum amount of text (measured in tokens) a model can "see" at once, including the prompt, conversation history, and the response it generates. Once a conversation exceeds the context window, the oldest content is dropped or must be summarized.

Token β€” A chunk of text (roughly ΒΎ of a word in English) that is the basic unit a model processes and bills by. Token limits constrain both input (what you can send) and output (how long a response can be).

Model hubs / repositories β€” Platforms like Hugging Face that host many pretrained models with metadata (parameter count, modality, license) to help you pick the right model for a task β€” e.g., a small fast model for classification vs. a large multimodal model for reasoning over images and text together.

Retrieval Augmented Generation (RAG) β€” A technique where the model's prompt is automatically supplemented with relevant text retrieved from an external knowledge source (e.g., your company docs) before generating a response, so the model can answer accurately about information it wasn't trained on.

Embeddings β€” A numeric vector representation of text (or other data) that captures its meaning, such that semantically similar pieces of text have vectors that are close together in that vector space.

Vector database β€” A database optimized to store embeddings and quickly find the ones most similar to a query embedding (nearest-neighbor search) β€” the retrieval half of RAG.

How It Works

  1. A user query comes in (e.g., "What's our refund policy?").
  2. The RAG pipeline converts the query into an embedding using an embedding model.
  3. The vector database searches for the stored document chunks whose embeddings are closest to the query embedding.
  4. The retrieved chunks are inserted into the LLM's prompt as context, alongside the original query.
  5. The LLM generates a response grounded in that retrieved context, rather than relying solely on what it memorized during training.
  6. If the conversation continues, the new question and response are added to the context window β€” once that window fills up, older turns are summarized or dropped.

Commands / Syntax / Key Values

  • Context windows are measured in tokens β€” common ranges seen in industry models: 8K, 32K, 128K, 200K+ tokens.
  • 1 token β‰ˆ ΒΎ of an English word, so a 200K-token window holds roughly 150,000 words.
  • Embeddings are typically vectors of several hundred to a few thousand dimensions (e.g., 1536-dim for many common embedding models).
  • Hugging Face Hub is the most commonly referenced model repository in exam-style questions.

⚠ Exam Traps

  • Confusing diffusion models with LLMs β€” diffusion models are for image/audio generation via iterative denoising; LLMs predict text tokens sequentially. Don't assume "generative AI" always means text.
  • Thinking RAG fine-tunes the model β€” RAG does not change the model's weights. It only changes what's in the prompt at inference time. The model itself is unmodified.
  • Assuming local hosting is always more private β€” it's more private from a third-party API standpoint, but if the local environment itself is poorly secured, that benefit is lost. Privacy is about the deployment, not just the location.
  • Confusing context window with model "memory" β€” a model has no persistent memory between separate API calls. Anything it "remembers" mid-conversation is just because it's re-reading the full context window each time, not because it stored anything.
  • Picking the biggest model by default β€” model hub selection should be use-case driven (e.g., a small model for simple classification is cheaper and faster); bigger/more capable is not always the right exam answer.

Practice Questions

Q1. Which model type is most appropriate for generating a photorealistic image from a text description? - A. Large Language Model - B. Diffusion Model - C. Vector Database - D. Embedding Model

Answer: B β€” Diffusion models generate images by iteratively denoising random noise guided by a prompt; LLMs are text-token predictors, not image generators.

Q2. What is the primary trade-off of using a cloud-hosted generative AI model instead of a locally hosted one? - A. Cloud-hosted models cannot generate code - B. Local models always outperform cloud models - C. Cloud-hosted models trade data residency/privacy and per-token cost for scalability and no hardware management - D. Local models cannot be updated

Answer: C β€” Cloud hosting offloads infrastructure and scales automatically but sends data off-premises and bills per token; local hosting keeps data on-prem at the cost of needing your own hardware.

Q3. In a RAG pipeline, what is the purpose of the vector database? - A. To store the model's fine-tuned weights - B. To store embeddings and retrieve the most semantically relevant text chunks for a query - C. To enforce token limits on the prompt - D. To log every API call for billing

Answer: B β€” The vector database holds embeddings of your knowledge source and performs nearest-neighbor search to find the chunks most relevant to the incoming query, which are then added to the prompt.

Summary

  • Know the difference between LLMs (text, sequential token prediction) and diffusion models (images, iterative denoising).
  • Context windows and tokens define how much a model can process at once β€” RAG and summarization exist specifically to work around this limit.
  • RAG augments the prompt with retrieved context at inference time; it does not retrain or fine-tune the model itself.
My Notes
Edit your saved notes here. Saving replaces what is stored.
Add More Notes
Paste new content here. It will be added below your existing notes β€” nothing gets overwritten.
← Back to Course Practice This Topic