Generative AI Cheat Sheet HTML
Generative AI Cheat Sheet HTML
Bestseller #5
Generative AI · cheat sheet (with exaMples)

🤖 generative AI
cheat sheet

📋 with exaMples M is capital
prompt patterns code & outputs models LLM · diffusion · embedding
📝

text generation

GPT, Claude, Llama

Autoregressive next‑token prediction. zero-shot / few-shot

EXAMPLE – few-shot prompting
Q: What is gravity?
A: A force that attracts objects with mass.

Q: Explain 'quantum entanglement'.
A: Particles linked so state changes instantly.

→ generate answer for: "What is a black hole?" output: region with infinite density …

ChatGPTtemperature=0.7top-p
⌨️

code generation

Copilot, CodeLlama, GPT-4

EXAMPLE – generate python function
# prompt: "function to compute fibonacci recursively"
def fib(n):
if n <= 1: return n
return fib(n-1) + fib(n-2)

👉 also: explain this code, add types, refactor

instructioncode‑completion
🎨

image generation

DALL·E, Stable Diffusion, Midjourney

EXAMPLE – text‑to‑image prompt
"a serene library in space, nebula clouds, hyperrealistic, digital art, 8k —ar 16:9"

negative prompt: blurry, ugly, watermark → latent diffusion

🖼️ img2img example: sketch → detailed concept
🧩

RAG / embeddings

retrieval-augmented generation

EXAMPLE – context + query
CONTEXT (retrieved chunks):
"Einstein won Nobel prize for photoelectric effect."

QUERY: "Why did Einstein win Nobel?"
GENERATION: "For discovery of photoelectric effect."
text-embedding-3-small · cosine similarity
🎙️

audio / speech

Whisper, ElevenLabs, MusicGen

EXAMPLE – speech‑to‑text
audio input → whisper-1 
"Um actually the weather today is ..."
→ transcription + timestamps

text‑to‑speech example: “Hello world” → 🎵 emotional voice

🖼️🔍

vision‑language

GPT-4V, LLaVA, CLIP

EXAMPLE – image reasoning
input: image of bar chart + "summarize trends"
output: "Sales increased in Q2 by 12% ..."
📷 also: generate captions, visual Q&A
⚙️

prompt patterns

chain‑of‑thought, self‑consistency

EXAMPLE – COT (chain of thought)
Q: A ball costs $1.10. Bat costs $1 more. 
How much ball?
A: Let's think step by step...

→ total = 1.10, bat = ball+1 → 2*ball+1=1.10 → ball=0.05

🧠

fine‑tuning

LoRA, PEFT, instruct tuning

EXAMPLE – dataset format (openAI)
{"messages": [
{"role": "user", "content": "tag this review"},
{"role": "assistant", "content": "positive"}]}

LoRA rank=8 → train only 0.1% params

📊

vector storage

Pinecone, Chroma, Weaviate

EXAMPLE – query with embedding
vector = embed("generative ai tutorials")
db.similarity_search(vector, k=3)
🎬

video / 3D

Sora, Runway, Point·E

EXAMPLE – text‑to‑video
"golden retriever playing in ocean, cinematic"
→ 4s clip, consistent style
💬

chat structure

system / user / assistant

EXAMPLE – role prompting
system: "You are a helpful botanist."
user: "Why are leaves green?"
assistant: "Chlorophyll reflects green..."
📐

structured generation

JSON mode · regex · grammar

EXAMPLE – force JSON
{"brand": "Nike", "items": 3, "in_stock": true}

use response_format={ "type": "json_object" }


M exaMples spot capital M for “Models & Methods”
📄

sumMarization exaMple

Long text: "In recent years, generative AI ..." 
➜ "TL;DR: generative models create text, images, code."
🧾

transforMation exaMple

"Rewrite this formally: 'gimme data'" 
➜ "Could you please provide the dataset?"
🖼️➡️📝

iMage2text exaMple

[diagram of water cycle] → "Evaporation, condensation..."
⭐ exaMple-driven generation, chat, embedding, diffusion, code 🎯 updated 2025
🔥 prompt exaMple playground: “write a python script to …” “a photo of astronaut riding horse” “summarize: meeting notes”

⚡ generative AI · from text to video · every card contains explicit exaMple (capital M on purpose) · v1.0

Bestseller #1
Bestseller #5

Leave a Reply

Your email address will not be published. Required fields are marked *