Skip to content

About

A comparison of LLM accuracy between Retrieval Augmented Generation (RAG)-based approach and a baseline zero-shot approach.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

10-701-Project-Implementation: Assessing Factuality of Generated Answers using RAG-based Question Answering Pipeline

RAG-based pipeline for Question Answering

This repository contains the implementation of a pipeline for Question Answering using the RAG model. The pipeline is based on the following steps:

  • Indexing: Index a corpus of documents using an embedding model and vector store.
  • Retrieval: Retrieve relevant documents from a corpus using a retriever model.
  • Reading: Read the retrieved documents and extract the answer to the question using a reader model.
  • Generation: Generate an answer to the question using the retrieved documents and the question.
  • Evaluation: Evaluate the generated answer by comparing it to the ground truth answer and assessing its quality using an evaluator model.

The pipeline is implemented in Python using the Hugging Face Transformers library and the Faiss library for similarity search.

Experiments

We evaluate the pipeline on the Hugging Face documentation question answering dataset using the following metrics:

  • Accuracy: Percentage of questions for which the generated answer matches the ground truth answer (corresponding to an evaluation score above 4/5).
  • F1 Score: F1 score of the generated answer compared to the ground truth answer.
  • BLEU Score: BLEU score of the generated answer compared to the ground truth answer.

We test configurations of the pipeline by modifying the following parameters:

  • Number of Retrieved Documents: Number of documents retrieved by the retriever model -> [5, 10, 20, 40].
  • Chunk Size: Size of the document chunks stored in the index in tokens -> [128, 256, 512, 1024].

About

A comparison of LLM accuracy between Retrieval Augmented Generation (RAG)-based approach and a baseline zero-shot approach.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages