commit 25afc3a387734ab66fc2b296ab5a362270dd8dcd Author: ducoterra Date: Tue May 5 05:55:46 2026 -0400 init diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d08ec97 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM docker.io/library/nginx:alpine +COPY . /usr/share/nginx/html +EXPOSE 8080 +CMD ["nginx", "-g", "daemon off;"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..c1207d8 --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ +# AI Cheat Sheet + +A pink-themed static web app โ€” your quick reference for artificial intelligence terminology, techniques, and real-world applications. + +## Pages + +| Page | Content | +| ------------------- | ------------------------------------------------------------------------------------ | +| **Home** | Overview and quick start | +| **Terminology** | 20+ key terms from ML, NLP, and model concepts, plus common acronyms | +| **Techniques** | Training, alignment, and optimization methods (RLHF, RAG, LoRA, quantization) | +| **Use Cases** | AI applications across 12 industries (healthcare, finance, coding, creative work...) | +| **Model Types** | Architecture families โ€” LLMs, CNNs, diffusion, GANs, MoE + comparison table | +| **Prompt Guide** | 7 prompt patterns with templates and best practices | +| **Math & Concepts** | Core ideas (attention, loss, sampling) explained simply, plus key formulas | + +## Run Locally + +Serve the files with any static file server: + +```bash +python3 -m http.server 8080 +``` + +Then open `http://localhost:8080`. + +## Podman + +Build and run with Podman: + +```bash +podman build -t alicia-ai-cheatsheet . +podman run -d --name alicai-ai-cheatsheet -p 9090:80 alicia-ai-cheatsheet +``` + +Then open `http://localhost:9090`. + +Stop and remove: + +```bash +podman stop alicai-ai-cheatsheet +podman rm alicai-ai-cheatsheet +``` + +## Structure + +``` +index.html Landing page +css/style.css All styles (pink theme) +pages/ + terminology.html + techniques.html + use-cases.html + model-types.html + prompts.html + math.html +Dockerfile Podman container image +``` + +## License + +MIT diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..954be5b --- /dev/null +++ b/css/style.css @@ -0,0 +1,295 @@ +:root { + --pink-50: #fff1f5; + --pink-100: #ffe4ef; + --pink-200: #ffcce0; + --pink-300: #ffa8c8; + --pink-400: #ff69b4; + --pink-500: #ff1493; + --pink-600: #e91082; + --pink-700: #d40e74; + --pink-800: #b80c65; + --pink-900: #9a0a55; + --pink-neon: #ff3ec4; + --white: #ffffff; + --shadow: 0 1px 3px rgba(255,20,147,0.15), 0 1px 2px rgba(255,20,147,0.08); + --shadow-lg: 0 10px 25px rgba(255,20,147,0.2), 0 4px 10px rgba(255,20,147,0.1); +} + +* { margin: 0; padding: 0; box-sizing: border-box; } + +body { + font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; + background: linear-gradient(180deg, var(--pink-50) 0%, var(--pink-100) 100%); + color: var(--pink-900); + line-height: 1.6; + min-height: 100vh; +} + +a { color: var(--pink-500); text-decoration: none; } +a:hover { color: var(--pink-700); text-decoration: underline; } + +/* Navigation */ +nav { + background: linear-gradient(90deg, var(--pink-600), var(--pink-500), var(--pink-600)); + padding: 0 2rem; + position: sticky; + top: 0; + z-index: 100; + box-shadow: 0 4px 20px rgba(255,20,147,0.3); +} + +.nav-inner { + max-width: 1100px; + margin: 0 auto; + display: flex; + align-items: center; + gap: 1rem; +} + +.nav-brand { + color: var(--white); + font-weight: 800; + font-size: 1.4rem; + letter-spacing: -0.5px; + padding: 1rem 0; +} + +.nav-links { display: flex; gap: 0.25rem; flex-wrap: wrap; } + +.nav-links a { + color: var(--pink-100); + padding: 0.6rem 1rem; + border-radius: 8px; + font-size: 0.9rem; + font-weight: 500; + transition: background 0.2s; +} + +.nav-links a:hover, +.nav-links a.active { + background: var(--pink-800); + color: var(--white); + text-decoration: none; + box-shadow: 0 0 10px rgba(255,62,196,0.3); +} + +/* Hero */ +.hero { + background: linear-gradient(135deg, var(--pink-500), var(--pink-600), var(--pink-700)); + color: var(--white); + text-align: center; + padding: 5rem 2rem; + position: relative; + overflow: hidden; +} + +.hero::before { + content: ''; + position: absolute; + top: -50%; + left: -50%; + width: 200%; + height: 200%; + background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%); + animation: heroShine 8s ease-in-out infinite; +} + +@keyframes heroShine { + 0%, 100% { transform: translate(0, 0); } + 50% { transform: translate(20%, 10%); } +} + +.hero h1 { font-size: 3rem; font-weight: 800; margin-bottom: 0.5rem; position: relative; } +.hero p { font-size: 1.2rem; opacity: 0.95; max-width: 600px; margin: 0 auto; position: relative; } + +/* Container */ +.container { + max-width: 1100px; + margin: 0 auto; + padding: 2rem 1.5rem 4rem; +} + +/* Cards grid */ +.cards { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); + gap: 1.5rem; + margin-top: 1.5rem; +} + +.card { + background: var(--white); + border-radius: 16px; + padding: 1.8rem; + box-shadow: var(--shadow-lg); + border: 2px solid var(--pink-300); + transition: transform 0.2s, box-shadow 0.2s; +} + +.card:hover { + transform: translateY(-4px); + box-shadow: 0 15px 35px rgba(255,20,147,0.25); + border-color: var(--pink-400); +} + +.card h3 { + color: var(--pink-600); + font-size: 1.2rem; + margin-bottom: 0.5rem; +} + +.card p { color: var(--pink-800); font-size: 0.95rem; } + +/* Section heading */ +h2.section-title { + font-size: 1.9rem; + color: var(--pink-700); + margin: 2.5rem 0 0.8rem; + border-bottom: 3px solid var(--pink-400); + padding-bottom: 0.5rem; +} + +/* Glossary table */ +.glossary-table { + width: 100%; + border-collapse: collapse; + margin-top: 1rem; + background: var(--white); + border-radius: 16px; + overflow: hidden; + box-shadow: var(--shadow-lg); + border: 2px solid var(--pink-200); +} + +.glossary-table thead { + background: linear-gradient(90deg, var(--pink-500), var(--pink-600)); + color: var(--white); +} + +.glossary-table th, +.glossary-table td { + padding: 0.9rem 1.2rem; + text-align: left; + font-size: 0.95rem; +} + +.glossary-table tbody tr { border-bottom: 1px solid var(--pink-200); } +.glossary-table tbody tr:hover { background: var(--pink-100); } +.glossary-table td:first-child { font-weight: 700; color: var(--pink-600); white-space: nowrap; } + +/* Definition card */ +.def-card { + background: var(--white); + border-radius: 16px; + padding: 1.5rem 2rem; + margin-bottom: 1rem; + box-shadow: var(--shadow-lg); + border-left: 5px solid var(--pink-500); + border: 2px solid var(--pink-200); + transition: border-color 0.2s; +} + +.def-card:hover { + border-color: var(--pink-400); +} + +.def-card h3 { + color: var(--pink-700); + font-size: 1.15rem; + margin-bottom: 0.3rem; +} + +.def-card .category { + display: inline-block; + background: linear-gradient(135deg, var(--pink-400), var(--pink-500)); + color: var(--white); + font-size: 0.72rem; + font-weight: 700; + padding: 0.2rem 0.7rem; + border-radius: 999px; + margin-bottom: 0.4rem; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +.def-card p { color: var(--pink-900); font-size: 0.95rem; } + +/* Example block */ +.example { + background: linear-gradient(135deg, var(--pink-100), var(--pink-200)); + border-radius: 10px; + padding: 0.8rem 1rem; + margin-top: 0.5rem; + font-family: 'Courier New', monospace; + font-size: 0.88rem; + color: var(--pink-900); + border: 1px solid var(--pink-300); +} + +.example strong { font-family: 'Segoe UI', system-ui, sans-serif; color: var(--pink-700); } + +/* Use-case grid */ +.use-grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); + gap: 1.5rem; + margin-top: 1.5rem; +} + +.use-card { + background: var(--white); + border-radius: 16px; + padding: 1.8rem; + box-shadow: var(--shadow-lg); + text-align: center; + border: 2px solid var(--pink-200); + transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; +} + +.use-card:hover { + transform: translateY(-4px); + box-shadow: 0 15px 35px rgba(255,20,147,0.25); + border-color: var(--pink-400); +} + +.use-card .icon { font-size: 2.8rem; margin-bottom: 0.5rem; } +.use-card h3 { color: var(--pink-700); margin-bottom: 0.4rem; } +.use-card p { color: var(--pink-900); font-size: 0.9rem; margin-bottom: 0.8rem; } + +/* Prompt examples */ +.prompt-block { + background: var(--white); + border-radius: 16px; + padding: 1.5rem 2rem; + margin-bottom: 1rem; + box-shadow: var(--shadow-lg); + border: 2px solid var(--pink-200); + transition: border-color 0.2s; +} + +.prompt-block:hover { + border-color: var(--pink-400); +} + +.prompt-block h3 { + color: var(--pink-700); + margin-bottom: 0.5rem; +} + +.prompt-block .label { + font-weight: 700; + color: var(--pink-500); + font-size: 0.85rem; + text-transform: uppercase; + letter-spacing: 0.5px; +} + +/* Footer */ +footer { + background: linear-gradient(90deg, var(--pink-700), var(--pink-600), var(--pink-700)); + color: var(--pink-200); + text-align: center; + padding: 1.8rem; + font-size: 0.9rem; + box-shadow: 0 -4px 20px rgba(255,20,147,0.3); +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..f73556a --- /dev/null +++ b/index.html @@ -0,0 +1,75 @@ + + + + + + AI Cheat Sheet + + + + + + +
+

AI Cheat Sheet

+

Your quick reference for artificial intelligence terminology, techniques, and real-world applications.

+
+ +
+

Browse Topics

+
+
+

๐Ÿ“– Terminology

+

Key AI terms from ML and NLP โ€” supervised learning, fine-tuning, tokens, embeddings, and more.

+
+
+

โš™๏ธ Techniques

+

How AI models are trained and improved โ€” backpropagation, RLHF, quantization, RAG, and more.

+
+
+

๐ŸŽฏ Use Cases

+

Where AI is used in the real world โ€” healthcare, finance, creative work, customer support, and more.

+
+
+

๐Ÿค– Model Types

+

LLMs, diffusion models, CNNs, GANs, transformers, and other AI architectures explained.

+
+
+

โœ๏ธ Prompt Engineering

+

How to write effective prompts โ€” zero-shot, few-shot, chain-of-thought, and structured prompts.

+
+
+

๐Ÿ“ Math & Concepts

+

Underlying concepts โ€” loss functions, attention, temperature, perplexity, and accuracy metrics.

+
+
+ +

Quick Start

+
+ Core Concept +

What is Artificial Intelligence?

+

AI refers to computer systems designed to perform tasks that normally require human intelligence โ€” including learning, reasoning, problem-solving, perception, and language understanding. Modern AI is powered by machine learning, where models learn patterns from data rather than following explicit rules.

+
+
+ Quick Fact +

LLM vs Traditional ML

+

Traditional ML models are built for one specific task (e.g., classify spam). Large Language Models are general-purpose โ€” trained on massive text corpora to understand and generate human language across countless tasks.

+
+
+ + + + + diff --git a/pages/math.html b/pages/math.html new file mode 100644 index 0000000..e42a8a8 --- /dev/null +++ b/pages/math.html @@ -0,0 +1,189 @@ + + + + + + Math & Concepts - Cheat Sheet + + + + + + +
+

Math & Concepts

+

The underlying ideas that make AI work โ€” explained simply.

+
+ +
+ +

Core Concepts

+
+ Architecture +

Attention Mechanism

+

A way for the model to weigh the importance of different parts of the input when processing each token. "Attention is all you need" โ€” the 2017 paper that launched the transformer revolution.

+
Analogy: When reading a sentence, you naturally pay more attention to certain words. "The cat that chased the mouse hid" โ€” you attend to "cat" when processing "hid".
+
+
+ Architecture +

Self-Attention

+

Each token in a sequence attends to every other token, creating rich contextual representations. The core of the transformer architecture.

+
Math: Attention(Q, K, V) = softmax(QKแต€ / โˆšdโ‚–) V
+
+
+ Architecture +

Multi-Head Attention

+

Running multiple self-attention operations in parallel, each learning different types of relationships. Like having multiple "lenses" to view the input.

+
+
+ Architecture +

Positional Encoding

+

Since transformers process all tokens simultaneously (unlike RNNs), position information must be added explicitly so the model knows word order.

+
+
+ Architecture +

Feed-Forward Network (FFN)

+

After attention, each token passes through a small neural network that transforms its representation. Usually two linear layers with a non-linearity in between.

+
+
+ Architecture +

Layer Normalization

+

A technique to stabilize training by normalizing the activations of each layer. Helps gradients flow more smoothly through deep networks.

+
+ +

Training Concepts

+
+ Training +

Loss Function

+

A mathematical measure of how far the model's predictions are from the correct answers. Training = minimizing this value. For language models, cross-entropy loss is standard.

+
Example: If the correct next word is "cat" but the model assigns it 10% probability, the loss is high. If it assigns 90%, the loss is low.
+
+
+ Training +

Gradient Descent

+

The optimization algorithm that adjusts model weights in the direction that reduces loss. "Descent" because you're moving down the loss surface toward a minimum.

+
+
+ Training +

Adam Optimizer

+

The most popular optimizer for training deep learning models. Combines momentum (acceleration) with adaptive learning rates (per-parameter tuning).

+
+
+ Training +

Gradient

+

A vector of partial derivatives showing the direction and rate of steepest increase of the loss. We move in the opposite direction to minimize loss.

+
+
+ Training +

Regularization

+

Techniques to prevent overfitting: dropout (randomly deactivating neurons), weight decay (penalizing large weights), and early stopping.

+
+
+ Training +

Batch Normalization

+

Normalizing layer inputs across each mini-batch. Reduces internal covariate shift and allows higher learning rates.

+
+ +

Generation & Sampling

+
+ Sampling +

Temperature

+

Controls randomness in text generation. Low (0.2) = focused and deterministic. High (0.9) = creative and varied. 1.0 = standard sampling.

+
Low temp: Technical documentation, code generation
+ High temp: Creative writing, brainstorming
+
+
+ Sampling +

Top-K Sampling

+

At each step, only consider the K most likely next tokens. Reduces weird or irrelevant outputs.

+
+
+ Sampling +

Top-P (Nucleus) Sampling

+

Only consider tokens whose cumulative probability reaches P. More adaptive than Top-K โ€” automatically adjusts the number of candidates.

+
Top-P = 0.9: Include the smallest set of tokens that together cover 90% probability mass.
+
+
+ Sampling +

Greedy Decoding

+

Always pick the most likely next token. Fastest but can get stuck in repetitive loops. Often produces the most coherent output for factual tasks.

+
+
+ Sampling +

Beam Search

+

Instead of picking the single best token at each step, keep the top B sequences and pick the best overall. Better quality but slower.

+
+
+ Sampling +

Logits

+

The raw, unnormalized scores the model outputs for each token before softmax. Can be adjusted for bias correction, repetition penalties, and custom sampling.

+
+ +

Evaluation Metrics

+
+ Metrics +

Perplexity

+

Measures how "surprised" the model is by test data. Lower is better. A perplexity of 100 means the model is as confused as choosing uniformly from 100 options.

+
Example: Perplexity 5 on a language model means, on average, it's as uncertain as picking from 5 equally likely options at each step.
+
+
+ Metrics +

Accuracy

+

Percentage of correct predictions. Simple but can be misleading for imbalanced datasets.

+
+
+ Metrics +

Precision & Recall

+

Precision = of all positive predictions, how many were correct? Recall = of all actual positives, how many did we find?

+
Spam filter: High precision = few legitimate emails flagged. High recall = few spam emails missed.
+
+
+ Metrics +

F1 Score

+

The harmonic mean of precision and recall. A single metric that balances both.

+
+
+ Metrics +

BLEU / ROUGE

+

Metrics for evaluating text generation quality by comparing model output to reference text. BLEU counts n-gram overlap (used for translation). ROUGE is similar but common for summarization.

+
+
+ Metrics +

Tokens per Second (TPS)

+

How many tokens the model generates per second. Measures inference speed. Typical range: 20-100+ TPS depending on model size and hardware.

+
+ +

Key Formulas

+ + + + + + + + + + + + + +
ConceptFormulaWhat it means
Attentionsoftmax(QKแต€/โˆšdโ‚–)VWeigh inputs by relevance
Cross-Entropy Loss-ฮฃ yแตข log(pแตข)Penalizes wrong predictions
Softmaxeหฃโฑ / ฮฃeหฃสฒConverts scores to probabilities
ReLUmax(0, x)Activation: passes positive values only
Layer Norm(x - ฮผ) / ฯƒ ร— ฮณ + ฮฒNormalizes per-sample activations
F1 Score2 ร— (Pร—R)/(P+R)Harmonic mean of precision & recall
Perplexity2^(cross-entropy)Effective branching factor
+ +
+ + + + + diff --git a/pages/model-types.html b/pages/model-types.html new file mode 100644 index 0000000..704fda3 --- /dev/null +++ b/pages/model-types.html @@ -0,0 +1,154 @@ + + + + + + Model Types - Cheat Sheet + + + + + + +
+

Model Types

+

Architectures and families of AI models โ€” what they are and what they do.

+
+ +
+ +

Language Models

+
+ Transformer +

LLM (Large Language Model)

+

Neural networks based on the transformer architecture, trained on massive text corpora. They predict the next token given a sequence, enabling fluency in language tasks.

+
Examples: GPT-4, Claude, Gemini, Llama 3, Mistral, Qwen
+
+
+ Transformer +

Encoder-Only Models

+

Transformers designed to understand input (not generate text). Used for classification, sentiment analysis, and embedding generation.

+
Examples: BERT, RoBERTa, DeBERTa
+
+
+ Transformer +

Decoder-Only Models

+

Transformers designed to generate text autoregressively โ€” the dominant architecture for modern LLMs.

+
Examples: GPT series, Claude, Llama, Mistral
+
+
+ Transformer +

Encoder-Decoder Models

+

Transformers with both encoder and decoder, used for tasks that transform input to output (translation, summarization).

+
Examples: T5, BART, Flan-T5
+
+ +

Vision Models

+
+ Vision +

CNN (Convolutional Neural Network)

+

Neural networks with layers that scan images with small filters, detecting edges, textures, and patterns hierarchically. The backbone of computer vision for years.

+
Examples: ResNet, EfficientNet, VGG
+
+
+ Vision +

ViT (Vision Transformer)

+

Applying the transformer architecture to images by treating image patches as tokens. Often outperforms CNNs at scale.

+
Examples: CLIP, DINOv2, ViT-Base
+
+
+ Vision +

Diffusion Models

+

Models that generate images by iteratively denoising random noise. The architecture behind most state-of-the-art image generators.

+
Examples: Stable Diffusion, DALL-E 3, Midjourney
+
+
+ Vision +

Multimodal Models

+

Models that process multiple input types โ€” text, images, audio โ€” and can generate outputs across modalities.

+
Examples: GPT-4V (vision), Claude 3, Gemini, Qwen-VL
+
+ +

Generative Models

+
+ Generative +

GAN (Generative Adversarial Network)

+

Two networks compete: a generator creates fake data, and a discriminator tries to detect fakes. Over time, both improve until the generator is indistinguishable from real data.

+
Example: Creating photorealistic faces that don't exist (StyleGAN).
+
+
+ Generative +

VQ-VAE (Vector Quantized VAE)

+

Combines autoencoders with discrete codebooks to learn compressed representations. Used as a foundation for autoregressive generation.

+
Example: MusicGen (music generation), SoundStream (audio compression)
+
+
+ Generative +

Flow Models

+

Models that learn a reversible transformation between data and noise, enabling exact likelihood computation and fast generation.

+
Examples: DALL-E 2 uses flow matching, Glow, RealNVP
+
+ +

Other Architectures

+
+ Architecture +

RNN / LSTM

+

Recurrent networks that process sequences step-by-step, maintaining a hidden state. Largely replaced by transformers but still used in some applications.

+
Use case: Time series prediction, speech recognition
+
+
+ Architecture +

Mixture of Experts (MoE)

+

A model with multiple "expert" subnetworks. A routing mechanism selects which experts to use for each input, enabling large models that are computationally efficient at inference.

+
Examples: Mixtral 8x7B, Google's PaLM-E
+
+
+ Architecture +

Retrieval Models

+

Models designed specifically for semantic search โ€” finding the most relevant documents for a query from a large corpus.

+
Examples: BGE, E5, Cohere embed models
+
+
+ Architecture +

Small Language Models (SLMs)

+

Compact language models (under 7B parameters) optimized for edge devices and low-latency applications. Getting remarkably capable.

+
Examples: Phi-3, Gemma 2B, Qwen 1.5B, MicroLlama
+
+ +

Model Comparison

+ + + + + + + + + + + + + + + + +
ModelTypeBest For
GPT-4 / GPT-4oDecoder LLMGeneral-purpose reasoning, coding, multimodal
Claude 3.5Decoder LLMLong-context analysis, coding, writing
Gemini 1.5 ProDecoder LLMMassive context windows, multimodal
Llama 3Decoder LLMOpen-source, self-hosting, fine-tuning
Mistral LargeMoE LLMEfficient inference, multilingual
Stable DiffusionDiffusionImage generation, open-source
CLIPEncoder (Vision+Text)Image-text matching, embeddings
BERTEncoderText classification, search, NLU
WhisperEncoder-DecoderSpeech recognition, transcription
TTS modelsDecoderText-to-speech, voice synthesis
+ +
+ + + + + diff --git a/pages/prompts.html b/pages/prompts.html new file mode 100644 index 0000000..7c640e7 --- /dev/null +++ b/pages/prompts.html @@ -0,0 +1,157 @@ + + + + + + Prompt Engineering - Cheat Sheet + + + + + + +
+

Prompt Engineering Guide

+

Techniques for getting the best results from language models.

+
+ +
+ +

Prompt Patterns

+
+ Zero-Shot +

Just ask โ€” no examples needed

+

The simplest approach: give the model a task directly. Works surprisingly well with capable models.

+
Prompt: "Translate the following English text to French: 'Hello, how are you?'"
+
+
+ Few-Shot +

Show examples to guide behavior

+

Include a few input-output examples in the prompt to teach the model the desired format or style.

+
Prompt:
+ "Classify the sentiment:
+ 'I love this!' โ†’ Positive
+ 'This is terrible.' โ†’ Negative
+ 'It's okay, I guess.' โ†’ ?"
+
+
+ Chain-of-Thought +

Think step by step

+

Asking the model to reason through a problem before answering improves accuracy on complex tasks.

+
Prompt: "A store has 50 apples. They sell 12 in the morning and receive 30 more. How many do they have?"
+
Without CoT: "80"
+ With CoT: "50 - 12 = 38. 38 + 30 = 68. Answer: 68"
+
+
+ Role Prompting +

Assign a persona

+

Telling the model to act as an expert in a domain primes it to use relevant knowledge and tone.

+
Prompt: "You are a senior Python developer. Review this code for best practices and security issues."
+
+
+ Structured Output +

Force a specific format

+

Specify the exact output format (JSON, CSV, markdown table) for programmatic use.

+
Prompt: "Extract all product names and prices from this text. Return as a JSON array with keys 'name' and 'price'."
+
+
+ Self-Consistency +

Ask multiple times, pick the best

+

Generate several answers and take the most common or highest-quality one. Improves reliability on reasoning tasks.

+
+
+ ReAct (Reason + Act) +

Think, act, observe, repeat

+

Alternate between reasoning about a problem and taking actions (searching, calculating) to gather information.

+
Prompt: "Thought: I need to find the population of Tokyo. Action: search('Tokyo population 2024')
Observation: Tokyo has 37 million people.
Thought: Now I can answer the question."
+
+ +

Prompt Tips

+
+ Best Practice +

Be specific and detailed

+

Vague prompts get vague answers. Specify format, length, tone, audience, and constraints.

+
โŒ "Write about AI."
+ โœ… "Write a 200-word blog post about AI in healthcare for a general audience. Use a friendly tone and include one real-world example."
+
+
+ Best Practice +

Use delimiters for clarity

+

Separate instructions from data using quotes, XML tags, or dashes to help the model distinguish them.

+
Prompt: "Summarize the text in <instructions> tags:
<data>{paste article here}</data>"
+
+
+ Best Practice +

Provide context

+

The more background you give, the better the model can tailor its response. Include relevant details, constraints, and goals.

+
+
+ Best Practice +

Iterate and refine

+

First prompts are rarely perfect. Try variations, add examples, adjust constraints, and combine techniques.

+
+
+ Anti-Pattern +

Avoid ambiguous instructions

+

"Make it better" or "fix this" without specifics leads to unpredictable results. State exactly what you want changed.

+
+
+ Anti-Pattern +

Don't overload the context window

+

Pasting entire books or massive documents wastes tokens and can cause the model to miss key information. Summarize or use RAG.

+
+ +

Template Examples

+
+ Analysis Template +

Structured analysis prompt

+
Prompt: + "Analyze the following text and provide: + 1. Key topics (bullet list) + 2. Overall sentiment (positive/negative/neutral) with reasoning + 3. Three most important quotes + 4. A one-sentence summary + Text: {text}"
+
+
+ Coding Template +

Code generation with constraints

+
Prompt: + "Write a {language} function that {task}. + Constraints: + - Handle edge cases + - Include type hints + - Add docstring + - Keep it under {N} lines + - No external dependencies"
+
+
+ Critique Template +

Self-reflection prompt

+
Prompt: + "Here is a draft response. Critique it for: + - Accuracy + - Clarity + - Completeness + - Tone + Then rewrite it incorporating your feedback."
+
+ +
+ + + + + diff --git a/pages/techniques.html b/pages/techniques.html new file mode 100644 index 0000000..170d44e --- /dev/null +++ b/pages/techniques.html @@ -0,0 +1,131 @@ + + + + + + AI Techniques - Cheat Sheet + + + + + + +
+

AI Techniques

+

How AI models are built, trained, and optimized.

+
+ +
+ +

Training Techniques

+
+ Training +

Backpropagation

+

The core algorithm for training neural networks. It calculates the gradient of the loss function with respect to each weight by chain rule, then adjusts weights to minimize error.

+
Analogy: Like adjusting a radio dial โ€” you turn it slightly, check if the signal is clearer, and keep adjusting in the right direction.
+
+
+ Training +

Epoch

+

One complete pass through the entire training dataset. Models typically train for many epochs.

+
+
+ Training +

Batch Size

+

The number of training examples processed before the model's weights are updated. Larger batches are more stable but use more memory.

+
+
+ Training +

Learning Rate

+

A hyperparameter that controls how much to adjust weights during each update. Too high โ†’ unstable training; too low โ†’ slow convergence.

+
+
+ Training +

Transfer Learning

+

Using a model trained on one task as the starting point for a model on a second task. Saves time and data.

+
Example: A model trained on Wikipedia text is fine-tuned for legal document analysis.
+
+
+ Training +

Data Augmentation

+

Artificially expanding a training dataset by applying transformations (e.g., rotation, flipping, synonym replacement) to create new training examples.

+
+ +

Alignment & Improvement

+
+ Alignment +

RLHF (Reinforcement Learning from Human Feedback)

+

A technique to align model outputs with human preferences. Humans rank model responses, and a reward model is trained on those rankings. The main model is then fine-tuned to maximize the reward.

+
Used by: ChatGPT, Claude, and other conversational AI systems to make them more helpful and harmless.
+
+
+ Alignment +

SFT (Supervised Fine-Tuning)

+

Fine-tuning a model on a dataset of input-output pairs to teach it a specific format or style of response.

+
Example: Training a model to respond in JSON format for API integration.
+
+
+ Alignment +

Prompt Tuning

+

Instead of changing model weights, carefully crafting prompts to guide the model's behavior. Zero-cost and reversible.

+
+
+ Alignment +

LoRA (Low-Rank Adaptation)

+

An efficient fine-tuning technique that adds small trainable matrices to a frozen pre-trained model, drastically reducing compute and memory needs.

+
+ +

Deployment & Optimization

+
+ Optimization +

Quantization

+

Reducing the precision of model weights (e.g., from 32-bit to 8-bit) to shrink model size and speed up inference with minimal accuracy loss.

+
Example: A 13GB model quantized to 4-bit becomes ~3.5GB, fitting on consumer GPUs.
+
+
+ Optimization +

Distillation

+

Training a smaller "student" model to mimic the behavior of a larger "teacher" model, capturing its knowledge in a more compact form.

+
+
+ Optimization +

Speculative Decoding

+

Using a small model to draft multiple tokens, then having the large model verify them in parallel โ€” speeding up generation.

+
+
+ Architecture +

RAG (Retrieval-Augmented Generation)

+

Augmenting a language model with an external knowledge retrieval step. The model first searches a knowledge base, then generates a response using both the retrieved info and its own training.

+
Example: A customer support bot that searches your product docs before answering questions โ€” no fine-tuning needed.
+
+
+ Architecture +

Agent / Tool Use

+

Giving an LLM the ability to call external tools (search, calculators, APIs) to accomplish multi-step tasks.

+
Example: An AI that searches the web, summarizes results, and writes a report โ€” all autonomously.
+
+
+ Architecture +

Chain-of-Thought

+

Asking a model to show its reasoning step-by-step before giving an answer. Dramatically improves performance on reasoning tasks.

+
Prompt: "Let's think step by step. First, ..."
+
+ +
+ + + + + diff --git a/pages/terminology.html b/pages/terminology.html new file mode 100644 index 0000000..6a5fd07 --- /dev/null +++ b/pages/terminology.html @@ -0,0 +1,167 @@ + + + + + + AI Terminology - Cheat Sheet + + + + + + +
+

AI Terminology

+

Essential terms every AI learner should know.

+
+ +
+ +

Machine Learning Basics

+
+ ML +

Machine Learning (ML)

+

A subset of AI where systems learn patterns from data to make decisions or predictions without being explicitly programmed for each task.

+
+
+ ML +

Supervised Learning

+

Training a model on labeled data โ€” each example has an input and a known correct output. The model learns to map inputs to outputs.

+
Example: Training on emails labeled "spam" or "not spam" to build a spam filter.
+
+
+ ML +

Unsupervised Learning

+

Training on unlabeled data โ€” the model finds hidden patterns or groupings on its own.

+
Example: Grouping customers by purchasing behavior without pre-defined categories.
+
+
+ ML +

Reinforcement Learning

+

An agent learns by interacting with an environment, receiving rewards for good actions and penalties for bad ones, optimizing for maximum cumulative reward.

+
Example: An AI learning to play chess by playing millions of games against itself.
+
+
+ ML +

Overfitting

+

When a model learns the training data too well โ€” including noise and outliers โ€” and performs poorly on new, unseen data.

+
+
+ ML +

Underfitting

+

When a model is too simple to capture the patterns in the data, performing poorly on both training and test data.

+
+ +

Natural Language Processing

+
+ NLP +

NLP (Natural Language Processing)

+

A field of AI focused on enabling computers to understand, interpret, and generate human language.

+
+
+ NLP +

Token

+

The smallest unit of text a model processes. Tokens can be words, subwords, or characters. A single word may be split into multiple tokens.

+
Example: "unhappiness" might become ["un", "happiness"] โ€” 2 tokens.
+
+
+ NLP +

Embedding

+

A numerical representation of text (or other data) in a continuous vector space, where similar items are closer together.

+
Example: "king", "queen", "man", "woman" are embedded so that queen - woman + man โ‰ˆ king.
+
+
+ NLP +

Context Window

+

The maximum number of tokens a model can process at once โ€” both input and output combined.

+
Example: A 128K context window means the model can read ~100,000 words in a single prompt.
+
+
+ NLP +

Paraphrasing

+

Restating text in different words while preserving the original meaning. LLMs excel at this task.

+
+
+ NLP +

Sentiment Analysis

+

Determining the emotional tone behind text โ€” positive, negative, or neutral.

+
Example: "This product is amazing!" โ†’ Positive
+
+ +

Model Concepts

+
+ Model +

LLM (Large Language Model)

+

A neural network with billions of parameters trained on massive text corpora to understand and generate human language. Examples: GPT-4, Claude, Gemini, Llama.

+
+
+ Model +

Pre-trained Model

+

A model that has already been trained on a large dataset and can be used as-is or fine-tuned for specific tasks.

+
+
+ Model +

Fine-tuning

+

Taking a pre-trained model and continuing to train it on a smaller, task-specific dataset to adapt its behavior.

+
Example: Fine-tuning GPT-4 on medical texts so it answers healthcare questions more accurately.
+
+
+ Model +

Parameters

+

The internal variables of a model that are adjusted during training. More parameters generally mean greater capacity to learn complex patterns.

+
Example: GPT-4 is estimated to have trillions of parameters.
+
+
+ Model +

Inference

+

The process of using a trained model to generate outputs for new inputs (as opposed to training the model).

+
+
+ Model +

Weights

+

The numerical values learned during training that determine how input signals are transformed as they pass through the network.

+
+ +

Common Acronyms

+ + + + + + + + + + + + + + + + + + + + + + +
AcronymMeaning
AIArtificial Intelligence
MLMachine Learning
DLDeep Learning
NLPNatural Language Processing
LLMLarge Language Model
RLHFReinforcement Learning from Human Feedback
RAGRetrieval-Augmented Generation
APIApplication Programming Interface
SFTSupervised Fine-Tuning
PoCProof of Concept
GANGenerative Adversarial Network
CNNConvolutional Neural Network
GANGenerative Adversarial Network
AGIArtificial General Intelligence
STT / ASRSpeech-to-Text / Automatic Speech Recognition
TTSText-to-Speech
+ +
+ + + + + diff --git a/pages/use-cases.html b/pages/use-cases.html new file mode 100644 index 0000000..da26c73 --- /dev/null +++ b/pages/use-cases.html @@ -0,0 +1,158 @@ + + + + + + AI Use Cases - Cheat Sheet + + + + + + +
+

AI Use Cases

+

Real-world applications of AI across industries.

+
+ +
+ +

Content & Creative

+
+
+
โœ๏ธ
+

Content Generation

+

Writing blog posts, marketing copy, emails, social media content, and creative stories at scale.

+
Prompt: "Write a 300-word product description for a noise-canceling headphone."
+
+
+
๐ŸŽจ
+

Image Generation

+

Creating images from text descriptions using diffusion models like DALL-E, Stable Diffusion, and Midjourney.

+
Prompt: "A watercolor painting of a cat astronaut floating in space, pink nebula background."
+
+
+
๐ŸŽฌ
+

Video & Audio

+

Generating videos from text, creating music, voice cloning, and dubbing across languages.

+
+
+
๐Ÿ“
+

Summarization

+

Condensing long documents, articles, meetings, or research papers into concise summaries.

+
Prompt: "Summarize this 50-page report in 5 bullet points."
+
+
+ +

Code & Development

+
+
+
๐Ÿ’ป
+

Code Generation

+

Writing code in any programming language from natural language descriptions. Tools: GitHub Copilot, Cursor.

+
Prompt: "Write a Python function to sort a list of dictionaries by a given key."
+
+
+
๐Ÿ›
+

Debugging & Review

+

Identifying bugs, explaining error messages, suggesting improvements, and reviewing code quality.

+
+
+
๐Ÿ“„
+

Documentation

+

Auto-generating API docs, README files, inline comments, and technical documentation from code.

+
+
+
๐Ÿ”„
+

Code Translation

+

Converting code from one language to another (e.g., JavaScript to Python, old Java to modern Java).

+
+
+ +

Business & Productivity

+
+
+
๐Ÿค–
+

Chatbots & Assistants

+

24/7 customer support agents that handle FAQs, triage issues, and escalate to humans when needed.

+
+
+
๐Ÿ“Š
+

Data Analysis

+

Writing SQL queries, analyzing spreadsheets, generating charts, and extracting insights from data โ€” no coding required.

+
Prompt: "Plot monthly revenue by region from this CSV."
+
+
+
๐Ÿ”
+

Research & Search

+

AI-powered search that reads and synthesizes multiple sources instead of just returning links.

+
+
+
๐ŸŒ
+

Translation

+

High-quality machine translation between 100+ languages, preserving tone and context.

+
+
+
๐Ÿ“ง
+

Email & Meeting Assistants

+

Drafting emails, scheduling, summarizing meetings, and extracting action items from conversations.

+
+
+
๐Ÿ“‹
+

Document Processing

+

Extracting structured data from invoices, contracts, forms, and receipts using OCR + AI.

+
+
+ +

Industry-Specific

+
+
+
๐Ÿฅ
+

Healthcare

+

Medical image analysis, drug discovery, clinical note generation, symptom triage, and personalized treatment plans.

+
+
+
๐Ÿ’ฐ
+

Finance

+

Fraud detection, algorithmic trading, risk assessment, credit scoring, and compliance monitoring.

+
+
+
๐Ÿš—
+

Automotive

+

Autonomous driving, predictive maintenance, route optimization, and in-car voice assistants.

+
+
+
๐ŸŽ“
+

Education

+

Personalized tutoring, automated grading, curriculum design, and interactive learning experiences.

+
+
+
๐Ÿญ
+

Manufacturing

+

Quality inspection via computer vision, supply chain optimization, predictive maintenance, and digital twins.

+
+
+
โš–๏ธ
+

Legal

+

Contract review, legal research, case prediction, document drafting, and compliance analysis.

+
+
+ +
+ + + + +