IntelLabs/RAG-FiT
Framework for enhancing LLMs for RAG tasks using fine-tuning.
What it solves
RAG-FiT (formerly RAG Foundry) addresses the challenge of improving how Large Language Models (LLMs) utilize external information. It provides a structured framework to fine-tune models specifically for Retrieval Augmented Generation (RAG) tasks, moving beyond simple prompt engineering to optimize the model's internal ability to process and reason over retrieved data.
How it works
The library is organized into four modular components that manage the entire RAG lifecycle:
- Dataset Creation: Processes raw data into RAG-augmented datasets, including retrieval, aggregation, and prompt formatting.
- Training: Uses Parameter-Efficient Fine-Tuning (PEFT) and TRL to train models on these augmented datasets.
- Inference: Generates predictions using the trained models.
- Evaluation: Assesses performance using a suite of RAG-specific metrics like RAGAS, BERTScore, and custom logic.
The framework uses Hydra for configuration-as-code, allowing users to manage complex experiments through hierarchical configuration files and CLI overrides.
Who it’s for
This tool is designed for researchers and developers who need to experiment with RAG configurations and improve LLM performance on knowledge-intensive tasks through fine-tuning.
Highlights
- Modular architecture covering the full pipeline from data preparation to evaluation.
- Native support for PEFT (Parameter-Efficient Fine-Tuning) to reduce training resource requirements.
- Extensive evaluation suite supporting RAGAS, Deepeval, and custom metrics.
- Configuration-driven workflow using Hydra, enabling reproducible experiments and integration with tools like SLURM and Ray.
Related
- Project
- Project
- Project
- Project
- Dispatch