RAG-FiT  by IntelLabs

Framework for fine-tuning LLMs on RAG-augmented datasets

created 1 year ago
747 stars

Top 47.4% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

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

Highlighted Details

  • Supports PEFT for efficient fine-tuning.
  • Modular design with configuration-as-code via Hydra for workflow customization.
  • RAG-specific evaluation metrics that utilize retrieval results, reasoning, and citations.
  • Facilitates fast prototyping and experimentation across the RAG pipeline.

Maintenance & Community

  • Actively maintained by Intel Labs.
  • Welcomes comments, suggestions, issues, and pull requests.
  • Paper: RAG Foundry: A Framework for Enhancing LLMs for Retrieval Augmented Generation (arXiv:2408.02545).

Licensing & Compatibility

  • License: Apache 2.0 License.
  • Compatibility: Permissive license suitable for commercial use and integration with closed-source projects.

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.

Health Check
Last commit

2 months ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
14 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.