All checks were successful
Build and Push Container / build-and-push (push) Successful in 14s
157 lines
7.2 KiB
HTML
157 lines
7.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>AI Techniques - Cheat Sheet</title>
|
|
<link rel="stylesheet" href="../css/style.css">
|
|
</head>
|
|
<body>
|
|
|
|
<nav>
|
|
<div class="nav-inner">
|
|
<a href="/" class="nav-brand">AI Cheat Sheet</a>
|
|
<div class="nav-links">
|
|
<a href="/pages/terminology.html">Terminology</a>
|
|
<a href="/pages/techniques.html" class="active">Techniques</a>
|
|
<a href="/pages/use-cases.html">Use Cases</a>
|
|
<a href="/pages/model-types.html">Model Types</a>
|
|
<a href="/pages/prompts.html">Prompt Guide</a>
|
|
<a href="/pages/math.html">Math & Concepts</a>
|
|
<a href="/pages/chat.html">Chat</a>
|
|
</div>
|
|
<button class="dark-toggle" id="darkToggle" aria-label="Toggle dark mode">🌙</button>
|
|
</div>
|
|
</nav>
|
|
|
|
<script>
|
|
(function(){
|
|
var btn = document.getElementById('darkToggle');
|
|
var saved = localStorage.getItem('theme');
|
|
if(saved === 'dark' || (!saved && window.matchMedia('(prefers-color-scheme: dark)').matches)){
|
|
document.documentElement.setAttribute('data-theme','dark');
|
|
btn.textContent = '☀️';
|
|
}
|
|
btn.addEventListener('click', function(){
|
|
var isDark = document.documentElement.getAttribute('data-theme') === 'dark';
|
|
if(isDark){
|
|
document.documentElement.removeAttribute('data-theme');
|
|
btn.textContent = '🌙';
|
|
localStorage.setItem('theme','light');
|
|
} else {
|
|
document.documentElement.setAttribute('data-theme','dark');
|
|
btn.textContent = '☀️';
|
|
localStorage.setItem('theme','dark');
|
|
}
|
|
});
|
|
})();
|
|
</script>
|
|
|
|
<div class="hero">
|
|
<h1>AI Techniques</h1>
|
|
<p>How AI models are built, trained, and optimized.</p>
|
|
</div>
|
|
|
|
<div class="container">
|
|
|
|
<h2 class="section-title">Training Techniques</h2>
|
|
<div class="def-card">
|
|
<span class="category">Training</span>
|
|
<h3>Backpropagation</h3>
|
|
<p>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.</p>
|
|
<div class="example"><strong>Analogy:</strong> Like adjusting a radio dial — you turn it slightly, check if the signal is clearer, and keep adjusting in the right direction.</div>
|
|
</div>
|
|
<div class="def-card">
|
|
<span class="category">Training</span>
|
|
<h3>Epoch</h3>
|
|
<p>One complete pass through the entire training dataset. Models typically train for many epochs.</p>
|
|
</div>
|
|
<div class="def-card">
|
|
<span class="category">Training</span>
|
|
<h3>Batch Size</h3>
|
|
<p>The number of training examples processed before the model's weights are updated. Larger batches are more stable but use more memory.</p>
|
|
</div>
|
|
<div class="def-card">
|
|
<span class="category">Training</span>
|
|
<h3>Learning Rate</h3>
|
|
<p>A hyperparameter that controls how much to adjust weights during each update. Too high → unstable training; too low → slow convergence.</p>
|
|
</div>
|
|
<div class="def-card">
|
|
<span class="category">Training</span>
|
|
<h3>Transfer Learning</h3>
|
|
<p>Using a model trained on one task as the starting point for a model on a second task. Saves time and data.</p>
|
|
<div class="example"><strong>Example:</strong> A model trained on Wikipedia text is fine-tuned for legal document analysis.</div>
|
|
</div>
|
|
<div class="def-card">
|
|
<span class="category">Training</span>
|
|
<h3>Data Augmentation</h3>
|
|
<p>Artificially expanding a training dataset by applying transformations (e.g., rotation, flipping, synonym replacement) to create new training examples.</p>
|
|
</div>
|
|
|
|
<h2 class="section-title">Alignment & Improvement</h2>
|
|
<div class="def-card">
|
|
<span class="category">Alignment</span>
|
|
<h3>RLHF (Reinforcement Learning from Human Feedback)</h3>
|
|
<p>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.</p>
|
|
<div class="example"><strong>Used by:</strong> ChatGPT, Claude, and other conversational AI systems to make them more helpful and harmless.</div>
|
|
</div>
|
|
<div class="def-card">
|
|
<span class="category">Alignment</span>
|
|
<h3>SFT (Supervised Fine-Tuning)</h3>
|
|
<p>Fine-tuning a model on a dataset of input-output pairs to teach it a specific format or style of response.</p>
|
|
<div class="example"><strong>Example:</strong> Training a model to respond in JSON format for API integration.</div>
|
|
</div>
|
|
<div class="def-card">
|
|
<span class="category">Alignment</span>
|
|
<h3>Prompt Tuning</h3>
|
|
<p>Instead of changing model weights, carefully crafting prompts to guide the model's behavior. Zero-cost and reversible.</p>
|
|
</div>
|
|
<div class="def-card">
|
|
<span class="category">Alignment</span>
|
|
<h3>LoRA (Low-Rank Adaptation)</h3>
|
|
<p>An efficient fine-tuning technique that adds small trainable matrices to a frozen pre-trained model, drastically reducing compute and memory needs.</p>
|
|
</div>
|
|
|
|
<h2 class="section-title">Deployment & Optimization</h2>
|
|
<div class="def-card">
|
|
<span class="category">Optimization</span>
|
|
<h3>Quantization</h3>
|
|
<p>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.</p>
|
|
<div class="example"><strong>Example:</strong> A 13GB model quantized to 4-bit becomes ~3.5GB, fitting on consumer GPUs.</div>
|
|
</div>
|
|
<div class="def-card">
|
|
<span class="category">Optimization</span>
|
|
<h3>Distillation</h3>
|
|
<p>Training a smaller "student" model to mimic the behavior of a larger "teacher" model, capturing its knowledge in a more compact form.</p>
|
|
</div>
|
|
<div class="def-card">
|
|
<span class="category">Optimization</span>
|
|
<h3>Speculative Decoding</h3>
|
|
<p>Using a small model to draft multiple tokens, then having the large model verify them in parallel — speeding up generation.</p>
|
|
</div>
|
|
<div class="def-card">
|
|
<span class="category">Architecture</span>
|
|
<h3>RAG (Retrieval-Augmented Generation)</h3>
|
|
<p>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.</p>
|
|
<div class="example"><strong>Example:</strong> A customer support bot that searches your product docs before answering questions — no fine-tuning needed.</div>
|
|
</div>
|
|
<div class="def-card">
|
|
<span class="category">Architecture</span>
|
|
<h3>Agent / Tool Use</h3>
|
|
<p>Giving an LLM the ability to call external tools (search, calculators, APIs) to accomplish multi-step tasks.</p>
|
|
<div class="example"><strong>Example:</strong> An AI that searches the web, summarizes results, and writes a report — all autonomously.</div>
|
|
</div>
|
|
<div class="def-card">
|
|
<span class="category">Architecture</span>
|
|
<h3>Chain-of-Thought</h3>
|
|
<p>Asking a model to show its reasoning step-by-step before giving an answer. Dramatically improves performance on reasoning tasks.</p>
|
|
<div class="example"><strong>Prompt:</strong> "Let's think step by step. First, ..."</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<footer>AI Cheat Sheet — A learning reference for artificial intelligence</footer>
|
|
|
|
</body>
|
|
</html>
|