- Introduction
- Getting Started
- 1. Installation
- 2. Quick Start
- 3. First Training Loop
- 4. Core Concepts
- Architecture
- 5. Overview
- 6. Design Philosophy
- 7. Module Organization
- 8. Type System
- 9. Memory Management
- Autograd Engine
- 10. What is Automatic Differentiation?
- 11. Tape-Based Computation Graphs
- 12. Tensor Operations
- 12.1. Matrix Multiplication
- 12.2. Activations (ReLU, GELU, Swish)
- 12.3. Layer Normalization
- 12.4. Attention Mechanism
- 13. Backward Pass
- 14. Gradient Computation
- 15. Finite Difference Validation
- Optimizers
- 16. Overview
- 17. Stochastic Gradient Descent (SGD)
- 18. Adam Optimizer
- 19. AdamW (Decoupled Weight Decay)
- 20. Learning Rate Schedulers
- 20.1. Cosine Annealing
- 20.2. Step Decay
- 20.3. Exponential Decay
- 21. Gradient Clipping
- 22. SIMD-Accelerated Updates
- 23. Optimizer Theory
- LoRA (Low-Rank Adaptation)
- 24. What is LoRA?
- 25. Parameter-Efficient Fine-Tuning
- 26. LoRA Layer Architecture
- 26.1. Low-Rank Matrices A and B
- 26.2. Scaling Factor (alpha/rank)
- 26.3. Merge and Unmerge
- 27. Target Module Selection
- 28. Gradient Flow Isolation
- 29. Adapter Persistence
- 29.1. Saving Adapters
- 29.2. Loading Adapters
- 29.3. Sharing Adapters
- QLoRA (Quantized LoRA)
- 30. Memory-Efficient Fine-Tuning
- 31. 4-bit Quantization
- 31.1. Block-Wise Quantization
- 31.2. Scale Factors
- 31.3. Quantization/Dequantization
- 32. QLoRA Layer
- 33. On-the-Fly Dequantization
- 34. Memory Benchmarks
- 34.1. LoRA vs QLoRA Comparison
- 34.2. Transformer Model Benchmarks
- 34.3. Compression Ratios
- 35. Trade-offs and Best Practices
- Model Merging
- 36. Overview
- 37. TIES Algorithm
- 38. DARE Algorithm
- 39. SLERP Algorithm
- 40. Multi-Model Ensembles
- 41. Merge Best Practices
- Knowledge Distillation
- 42. What is Distillation?
- 43. Temperature-Scaled KL Divergence
- 44. Multi-Teacher Ensemble
- 45. Progressive Layer-Wise
- 46. Distillation Loss Functions
- 47. Student-Teacher Architecture
- Training Loops
- 48. Trainer API
- 49. Train Config
- 50. Basic Training Loop
- 51. Batching and Data Loading
- 52. Loss Functions
- 53. Validation and Testing
- 54. Checkpointing
- 55. Early Stopping
- Model I/O
- 56. Overview
- 57. Save Models
- 58. Load Models
- 59. Model Metadata
- 60. Supported Formats
- 60.1. JSON Format
- 60.2. YAML Format
- 60.3. GGUF Format
- Command-Line Interface
- 61. CLI Reference
- Declarative Training
- 62. Overview
- 63. YAML Configuration
- 64. train_from_yaml Function
- 65. Configuration Schema
- 66. Optimizer Builders
- 67. Model Builders
- API Reference
- 68. Tensor API
- 69. Autograd Operations
- 70. Optimizer API
- 71. LoRA API
- 72. QLoRA API
- 73. Configuration System
- 74. Error Handling
- Examples
- 75. Linear Regression with Autograd
- 76. Training a Simple MLP
- 77. Fine-Tuning with LoRA
- 78. Memory-Efficient QLoRA
- 79. Custom Loss Functions
- 80. Learning Rate Scheduling
- 81. Gradient Clipping
- 82. Adapter Sharing
- Development Guide
- 83. Contributing
- 84. EXTREME TDD Methodology
- 85. Testing Strategy
- 85.1. Unit Tests
- 85.2. Property-Based Tests
- 85.3. Gradient Checking Tests
- 85.4. Mutation Testing
- 86. Quality Gates
- 86.1. Pre-Commit Hooks
- 86.2. Continuous Integration
- 86.3. Code Coverage
- 86.4. Clippy Linting
- 87. Benchmarking
- 88. PMAT Toyota Workflow
- Best Practices
- 89. Optimizer Selection
- 90. Learning Rate Tuning
- 91. LoRA Configuration
- 92. Memory Optimization
- 93. Gradient Stability
- 94. Debugging Training Issues
- 95. Performance Profiling
- Advanced Topics
- 96. Custom Backward Passes
- 97. Implementing New Optimizers
- 98. Custom LoRA Variants
- 99. Advanced Quantization
- 100. Distributed Training
- 101. Model Parallelism
- Specifications
- 102. Autograd Specification
- 103. Optimizer Specification
- 104. LoRA Specification
- 105. Quantization Specification
- 106. Academic Foundations
- Appendix
- 107. Glossary
- 108. Mathematical Notation
- 109. References
- 110. FAQ
- 111. Changelog
- 112. Migration Guide
- 113. Benchmarking Results