Language AI Handbook

Content from the Language AI Handbook, covering natural language processing, language models, and AI-powered language applications.

409 items · Page 5 of 9

Community

Learn with the community

Create a free account to keep your reading organized, join thoughtful discussions, and get more from every chapter.

  • Keep your place across books and articles
  • Ask questions and take part in discussions
  • Read with fewer interruptions

Free to join · Takes less than a minute

Why

I created this space so readers can learn together, ask questions, and make sense of difficult ideas.

Michael Brenndoerfer
From readers1 / 12
Machine LearningLanguage AI Handbook

DPO Variants: IPO, KTO, ORPO & cDPO for LLM Alignment

Jan 3, 2026·65 min read

DPO variants include IPO, KTO, ORPO, and cDPO. Compare their objectives, data requirements, computational costs, and suitable alignment tasks.

Open notebook
Language AI HandbookMachine LearningSoftware Engineering

DPO Implementation: PyTorch Training for LLM Alignment

Jan 2, 2026·56 min read

Implement Direct Preference Optimization in PyTorch. Topics include preference data formatting, loss computation, training loops.

Open notebook
Data, Analytics & AISoftware EngineeringMachine LearningLanguage AI Handbook

Planning: Task Decomposition and Goal-Directed LLM Agents

Jan 1, 2026·61 min read

Explains how LLM agents plan, decompose tasks, execute multi-step goals, and recover from failures using architectures like ReWOO, Tree-of-Thought.

Open notebook
Language AI HandbookMachine Learning

DPO Derivation: From RLHF Objective to Direct Optimization

Jan 1, 2026·45 min read

Derive the DPO loss function from first principles. Explains how the optimal RLHF policy leads to reward reparameterization and direct preference optimization.

Open notebook
Machine LearningLanguage AI Handbook

Direct Preference Optimization (DPO)

Dec 31, 2025·53 min read

Explains how DPO eliminates reward models from LLM alignment. Topics include the reward-policy duality that enables supervised preference learning.

Open notebook
Language AI HandbookMachine LearningSoftware Engineering

KL Divergence Penalty in RLHF: Theory & Implementation

Dec 30, 2025·69 min read

Explains how KL divergence prevents reward hacking in RLHF by keeping policies close to reference models.

Open notebook
Language AI HandbookMachine Learning

RLHF Pipeline: SFT, Reward Models, and PPO

Dec 29, 2025·61 min read

Covers RLHF pipeline with three stages: Supervised Fine-Tuning, Reward Model training, and PPO optimization. Topics include debugging techniques.

Open notebook
Language AI HandbookMachine LearningData, Analytics & AI

PPO for Language Models: Adapting RL to Text Generation

Dec 28, 2025·64 min read

Explains how PPO applies to language models. Topics include policy mapping, token action spaces, KL divergence penalties, and advantage estimation for RLHF.

Open notebook
Machine LearningLanguage AI Handbook

PPO Algorithm: Proximal Policy Optimization for Stable RL

Dec 27, 2025·71 min read

Covers PPO's clipped objective for stable policy updates. Topics include trust regions, GAE advantage estimation.

Open notebook
Machine LearningLanguage AI HandbookData, Analytics & AI

Policy Gradient Methods: REINFORCE Algorithm & Theory

Dec 26, 2025·59 min read

Covers policy gradient theory for language model alignment. Topics include REINFORCE algorithm, variance reduction with baselines, and foundations for PPO.

Open notebook
Language AI HandbookMachine LearningData, Analytics & AI

Reward Hacking: Why AI Exploits Imperfect Reward Models

Dec 25, 2025·68 min read

Examines reward hacking in RLHF where language models exploit proxy objectives. Topics include distribution shift, over-optimization, and mitigation strategies.

Open notebook
Language AI HandbookMachine Learning

Reward Modeling: Building Preference Predictors for RLHF

Dec 24, 2025·68 min read

Build neural networks that learn human preferences from pairwise comparisons. Topics include reward model architecture, Bradley-Terry loss.

Open notebook
Machine LearningLanguage AI Handbook

Bradley-Terry Model: Converting Preferences to Rankings

Dec 23, 2025·63 min read

Explains how the Bradley-Terry model converts pairwise preferences into consistent rankings. Foundation for reward modeling in RLHF and Elo rating systems.

Open notebook
Language AI HandbookMachine LearningData, Analytics & AI

Human Preference Data: Collection for LLM Alignment

Dec 22, 2025·67 min read

Collect and process human preference data for RLHF. Topics include pairwise comparisons, annotator guidelines, quality metrics, and interface design.

Open notebook
Language AI HandbookMachine LearningData, Analytics & AI

Alignment Problem: Making AI Helpful, Harmless & Honest

Dec 21, 2025·70 min read

Examines the AI alignment problem and HHH framework. Explains why training language models to be helpful, harmless, and honest presents fundamental challenges.

Open notebook
Language AI HandbookMachine LearningData, Analytics & AI

Instruction Following Evaluation: Benchmarks & LLM Judges

Dec 20, 2025·59 min read

Evaluate instruction-tuned LLMs using benchmarks like Alpaca Eval and MT-Bench, human evaluation protocols, and LLM-as-Judge automatic methods.

Open notebook
Machine LearningLanguage AI Handbook

Instruction Tuning Training: Data Mixing & Loss Masking

Dec 19, 2025·44 min read

Covers instruction tuning training with data mixing strategies, loss masking, and hyperparameter selection for effective language model fine-tuning.

Open notebook
Language AI HandbookMachine Learning

Instruction Format: Chat Templates and Roles

Dec 18, 2025·56 min read

Explains how chat templates, prompt formats, and role definitions structure conversations for language model instruction tuning and reliable inference.

Open notebook
Language AI Handbook

Self-Instruct: Bootstrap Instruction-Tuning Datasets

Dec 17, 2025·71 min read

Explains how Self-Instruct enables language models to generate their own training data through iterative bootstrapping from minimal human-written seed tasks.

Open notebook
Language AI HandbookMachine LearningData, Analytics & AI

Instruction Data Creation

Dec 16, 2025·64 min read

Covers practical techniques for creating instruction-tuning datasets. Topics include human annotation, template-based generation, seed expansion.

Open notebook
Language AI HandbookMachine Learning

Instruction Following

Dec 15, 2025·54 min read

Explains how instruction tuning transforms base language models into helpful assistants. Examines format design, data diversity, and quality principles.

Open notebook
Language AI HandbookMachine LearningData, Analytics & AI

PEFT Comparison: Choosing the Right Fine-Tuning Method

Dec 14, 2025·66 min read

Compare LoRA, QLoRA, Adapters, IA³, Prefix Tuning, and Prompt Tuning across efficiency, performance, and memory. Practical guide for choosing PEFT methods.

Open notebook
Machine LearningLanguage AI Handbook

Adapter Layers: Bottleneck Modules for Efficient Fine-Tuning

Dec 13, 2025·69 min read

Explains how adapter layers insert trainable bottleneck modules into transformers for parameter-efficient fine-tuning.

Open notebook
Machine LearningLanguage AI HandbookData, Analytics & AI

Prompt Tuning: Parameter-Efficient Fine-Tuning

Dec 8, 2025·61 min read

Covers prompt tuning for efficient LLM adaptation. Prepend trainable soft prompts to inputs while keeping models frozen. Scales to match full fine-tuning.

Open notebook
Language AI HandbookMachine LearningSoftware Engineering

Prefix Tuning: Steering LLMs with Learnable Virtual Tokens

Dec 7, 2025·64 min read

Explains how prefix tuning adapts transformers by prepending learnable virtual tokens to attention keys and values. A parameter-efficient fine-tuning method.

Open notebook
Language AI HandbookMachine LearningData, Analytics & AI

IA3: Parameter-Efficient Fine-Tuning with Rescaling Vectors

Dec 6, 2025·60 min read

Explains how IA3 adapts large language models by rescaling activations with minimal parameters. Compare IA3 vs LoRA for efficient fine-tuning strategies.

Open notebook
Language AI HandbookMachine Learning

AdaLoRA: Adaptive Rank Allocation for Efficient Fine-Tuning

Dec 5, 2025·61 min read

Explains how AdaLoRA dynamically allocates rank budgets across weight matrices using SVD parameterization and importance scoring for efficient model adaptation.

Open notebook
Language AI HandbookMachine Learning

QLoRA: 4-Bit Quantization for Efficient Fine-Tuning

Dec 4, 2025·54 min read

Covers QLoRA for fine-tuning large language models on consumer GPUs. Topics include NF4 quantization, double quantization.

Open notebook
Machine LearningLanguage AI Handbook

LoRA Hyperparameters: Rank, Alpha & Target Module Selection

Dec 3, 2025·57 min read

Covers LoRA hyperparameter selection for efficient fine-tuning. Topics include rank, alpha, target modules.

Open notebook
Machine LearningSoftware EngineeringLanguage AI Handbook

LoRA Implementation: PyTorch Code & PEFT Integration

Dec 2, 2025·55 min read

Implement LoRA adapters in PyTorch from scratch. Build modules, inject into transformers, merge weights, and use HuggingFace PEFT for production.

Open notebook
Machine LearningLanguage AI HandbookData, Analytics & AI

LoRA Mathematics: Low-Rank Adaptation Formulas & Gradients

Dec 1, 2025·67 min read

Covers LoRA's mathematical foundations including low-rank decomposition, gradient computation, rank selection.

Open notebook
Language AI HandbookMachine Learning

LoRA: Low-Rank Adaptation for Efficient Fine-Tuning

Nov 30, 2025·56 min read

Explains how LoRA reduces fine-tuning parameters by 100-1000x through low-rank matrix decomposition.

Open notebook
Language AI HandbookMachine LearningData, Analytics & AI

PEFT Motivation: Why Parameter-Efficient Fine-Tuning Matters

Nov 29, 2025·53 min read

Explains why PEFT is essential for LLMs. Analyze storage costs, training memory requirements, and how adapter swapping enables efficient multi-task deployment.

Open notebook
Language AI HandbookMachine LearningData, Analytics & AI

Fine-tuning Data Efficiency: Few-Shot Learning, Augmentation

Nov 28, 2025·46 min read

Covers few-shot fine-tuning techniques for language models. Topics include PET, SetFit, and data augmentation to achieve strong results.

Open notebook
Machine LearningLanguage AI Handbook

Fine-tuning Learning Rates: LLRD, Warmup & Decay Strategies

Nov 27, 2025·57 min read

Covers learning rate strategies for fine-tuning transformers. Topics include discriminative fine-tuning, layer-wise decay, warmup schedules, and decay methods.

Open notebook
Machine LearningLanguage AI Handbook

Catastrophic Forgetting in Fine-Tuning: Causes & Mitigation

Nov 26, 2025·66 min read

Why neural networks lose earlier capabilities during fine-tuning, with mitigation methods including EWC, L2-SP regularization, replay, and adapters.

Open notebook
Machine LearningLanguage AI Handbook

Full Fine-tuning: Hyperparameters & Learning Rate Schedules

Nov 25, 2025·66 min read

Covers full fine-tuning of pre-trained models. Topics include optimal learning rates, batch sizes, warmup schedules, and gradient accumulation techniques.

Open notebook
Language AI HandbookMachine LearningData, Analytics & AI

Transfer Learning: Pre-training and Fine-tuning for NLP

Nov 24, 2025·60 min read

Explains how transfer learning enables pre-trained models to adapt to new NLP tasks. Topics include pre-training, fine-tuning, layer representations.

Open notebook
Language AI HandbookMachine Learning

Switch Transformer: Top-1 Routing at Scale

Nov 20, 2025·64 min read

Explains how Switch Transformer simplifies MoE with top-1 routing, capacity factors, and training stability for trillion-parameter language models.

Open notebook
Machine LearningLanguage AI Handbook

Expert Parallelism: Distributed Computing for MoE Models

Nov 19, 2025·58 min read

Explains how expert parallelism distributes MoE experts across devices using all-to-all communication, enabling efficient training of trillion-parameter models.

Open notebook
Machine LearningLanguage AI Handbook

Router Z-Loss: Numerical Stability for MoE Training

Nov 18, 2025·61 min read

Explains how z-loss stabilizes Mixture of Experts training by penalizing large router logits. Topics include formulation, coefficient tuning.

Open notebook
Language AI HandbookMachine Learning

Auxiliary Balancing Loss: Preventing Expert Collapse in MoE

Nov 17, 2025·49 min read

Explains how auxiliary balancing loss prevents expert collapse in MoE models. Topics include loss formulations, coefficient tuning, and PyTorch implementation.

Open notebook
Language AI HandbookMachine LearningData, Analytics & AI

MoE Load Balancing: Token Distribution & Expert Collapse

Nov 16, 2025·57 min read

Explains how load balancing prevents expert collapse in Mixture of Experts models. Examines token fractions, load metrics.

Open notebook
Machine LearningLanguage AI Handbook

Top-K Routing: Expert Selection in Mixture of Experts Models

Nov 15, 2025·54 min read

Explains how top-K routing selects experts in MoE architectures. Topics include top-1 vs top-2 trade-offs, implementation details.

Open notebook
Language AI HandbookMachine Learning

Gating Networks: Router Architecture in Mixture of Experts

Nov 14, 2025·38 min read

Examines gating networks in MoE architectures. Topics include router design, softmax gating, Top-K selection, training dynamics.

Open notebook
Language AI HandbookMachine LearningSoftware Engineering

Expert Networks: MoE Architecture & FFN Implementation

Nov 13, 2025·57 min read

Explains how expert networks power Mixture of Experts models. Examines FFN-based experts, capacity factors, expert counts, and transformer placement strategies.

Open notebook
Data, Analytics & AISoftware EngineeringMachine LearningLanguage AI Handbook

Sparse Models: Conditional Computation & Efficiency

Nov 12, 2025·43 min read

Explains how sparse models decouple capacity from compute using conditional computation and mixture of experts to achieve efficient scaling.

Open notebook
Machine LearningLanguage AI HandbookData, Analytics & AI

Grokking: How Neural Networks Suddenly Learn to Generalize

Nov 11, 2025·78 min read

Examines grokking: how neural networks suddenly generalize long after memorization. Topics include phase transitions, theories, and training implications.

Open notebook
Community

Learn with the community

Create a free account to keep your reading organized, join thoughtful discussions, and get more from every chapter.

  • Keep your place across books and articles
  • Ask questions and take part in discussions
  • Read with fewer interruptions

Free to join · Takes less than a minute

Why

I created this space so readers can learn together, ask questions, and make sense of difficult ideas.

Michael Brenndoerfer
From readers1 / 12