Framework for fine-tuning LLMs on RAG-augmented datasets
Top 47.4% on sourcepulse
RAG-FiT is a modular Python framework designed to enhance Large Language Models (LLMs) for Retrieval Augmented Generation (RAG) tasks through fine-tuning. It targets researchers and developers looking to improve RAG performance by creating specialized RAG-augmented datasets, efficiently training models using Parameter-Efficient Fine-Tuning (PEFT), and evaluating the improvements with RAG-specific metrics.
How It Works
RAG-FiT employs a four-module architecture: Dataset Creation, Training, Inference, and Evaluation. The Dataset Creation module handles data processing, retrieval integration, and prompt templating to generate RAG-augmented datasets in a consistent format. The Training module leverages PEFT techniques and libraries like TRL for efficient model fine-tuning on these datasets. Inference generates predictions using fine-tuned or base models, and the Evaluation module assesses performance using a suite of RAG-aware metrics, including EM, F1, ROUGE, BERTScore, Deepeval, and RAGAS, which can utilize rich metadata beyond simple text.
Quick Start & Requirements
pip install -e .
pip install -e .[haystack]
or pip install -e .[deepeval]
Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
The framework is presented as a tool for enhancing LLMs for RAG tasks, implying that core LLM capabilities and RAG setup (retrievers, vector stores) are handled externally or through optional integrations. The effectiveness of fine-tuning is dependent on the quality and relevance of the generated RAG-augmented datasets.
2 months ago
1 day