By Daniel Medina, Suneel Nadipalli, Sri Veerisetti, Dominique Buford
Deployed URL: https://aipi-chatbot-frontend.vercel.app/
Project frontend: https://github.com/medinardaniel/aipi-chatbot-frontend
Project backend: https://github.com/medinardaniel/aipi-chatbot-flask
This project involves creating a chatbot assistant designed to answer questions for potential or admitted students of the Duke Masters in Artificial Intelligence program. The assistant covers a wide range of topics related to the program, utilizing advanced AI and machine learning techniques.
-
Web Scraping & FAQ Document Compilation
- Extract relevant data and FAQs from multiple sources to cover extensive topics related to the Duke AI program.
-
Generate and Store GIST Embeddings
- Utilize GIST embeddings to represent scraped data, storing these embeddings in a MongoDB collection for efficient retrieval.
-
Question and Answer Generation
- Employ GPT 3.5 to generate dynamic Questions and Answers based on the scraped data and compiled documents.
- Dataset: Composed of [Context, Question, Answer]
- Process:
- Format the prompt into a template suitable for model input.
- Tokenize the formatted prompt.
- Load in the base Mistral-7B model.
- Set up a BitsandBytes config to enable quantization.
- Convert model to PEFT (Parameter Efficient Fine-Tuning) format.
- Set LORA (Low-Rank Adaptation) parameters and general model parameters.
- Fine-Tune the Mistral-7B model.
- Model configurations/parameters can be found in configs/config.ini
- Frontend: Built with Next.js, handles user interactions.
- Backend: A Flask application deployed on Heroku to manage data processing and model interactions.
- Data Handling:
- GIST model endpoint in Hugging Face embeds the user message.
- MongoDB Atlas vector search retrieves similar data chunks.
- A dedicated fine-tuned model endpoint in Hugging Face processes the most similar chunk and user message to generate responses.
- GIST Embedding API: $0.5/hr
- Fine-Tuned Q&A Model API: $0.5/hr
- Frontend Deployment: $0/hr
- Backend Deployment: $0/hr
Overall, it would cost $24/day.
In order to minimize costs, we used the cheapest GPU option available on HuggingFace.
- Average Precision: 57.7%
- Average Recall: 59%
- Average F1-Score: 54.7%
-
Stringent Factual Accuracy:
- Cosine Similarity: Average 60%, Max 95.5%, Min 33.4% across 4 sample questions.
- Human Evaluation: 78%
-
Similar Question Consistency:
- Average Cosine Similarity: 53.1%
-
Language Structure Testing:
- Average Cosine Similarity: 61%
This chatbot assistant is tailored to effectively support inquiries regarding the Duke Masters in AI program, leveraging cutting-edge AI techniques to provide accurate and relevant information. The system's architecture and evaluation metrics ensure that the assistant performs efficiently and reliably across various types of user queries.