The article clarifies that RAG and fine-tuning are complementary rather than competing techniques for LLM development. RAG works by retrieving external information at inference time, which enables models to access new data and provide citable answers without changing the model weights. In contrast, fine-tuning adjusts a model's internal weights to improve its behavior, such as tone or adherence to specific output formats like JSON.
- RAG provides dynamic knowledge retrieval for accuracy and traceability.
- Fine-tuning improves task performance, style, and formatting consistency.
- Combining both methods allows developers to manage both what a model knows and how it communicates.
A light-weight codebase that enables memory-efficient and performant finetuning of Mistral's models. It is based on LoRA, a training paradigm where most weights are frozen and only 1-2% additional weights in the form of low-rank matrix perturbations are trained.
"The paper introduces a technique called LoReFT (Low-rank Linear Subspace ReFT). Similar to LoRA (Low Rank Adaptation), it uses low-rank approximations to intervene on hidden representations. It shows that linear subspaces contain rich semantics that can be manipulated to steer model behaviors."