Train Models
Factory provides a streamlined approach to fine-tuning small language models (LLMs) with minimal compute resources while achieving production-quality results. This guide explains how to train models efficiently using the Factory SDK.
Training Overview
The training process in Factory consists of four main components:
- Base Models - Pre-trained foundation models that serve as your starting point
- Datasets - Structured data containing examples for your specific task
- Recipes - Transformations that convert raw data into training examples
- Adapters - Lightweight components that modify only a fraction of model parameters
By focusing on parameter-efficient fine-tuning through adapters, Factory enables you to customize models for specific domains without the computational expense of full fine-tuning.
Key Training Features
Factory's training approach offers several advantages:
- Parameter-Efficient Fine-Tuning - Update less than 1% of model parameters
- Automatic Layer Selection - Train only the most impactful model layers
- Optimal Rank Determination - Automatically find the ideal adapter dimensions
- Memory-Efficient Training - Use 4-bit quantization to reduce memory requirements
Training Workflow
The typical training workflow involves:
- Loading a base model from Hugging Face or another source
- Preparing a dataset with training and test splits
- Creating a recipe to transform raw data into training examples
- Training an adapter with parameter-efficient techniques
- Evaluating results and comparing performance
- Deploying the fine-tuned model for inference
Getting Started
To start training your first model with Factory: