Smart MCQ Solver
NLP-based MCQ answering system using Transformers, RAG, semantic retrieval, FAISS, and Cross-Encoder reranking, with leakage-aware validation and modular ML pipelines.
- PyTorch
- PyTorch Lightning
- RAG
- Transformers
- Hugging Face
- W&B
🧠Smart MCQ Solver
An AI-powered Multiple Choice Question Answering system that predicts the Top-3 most probable answers for challenging MCQs using deep learning, transformer models, and Retrieval-Augmented Generation (RAG).
Built for the Smart MCQ Solver Challenge, where submissions are evaluated using Mean Average Precision at 3 (MAP@3).
Try it out on [Hugging Face Spaces](https://huggingface.co/spaces/dhruvbansalup/dl-genai-project-26-t2-smart-mcq-solver).
📄 [View Project Report](./reports/Project%20Report.pdf)
📌 Overview
Smart MCQ Solver is an experimental framework for solving multiple-choice questions using modern Natural Language Processing techniques.
The project explores multiple approaches ranging from classical machine learning models to state-of-the-art transformer architectures and Retrieval-Augmented Generation (RAG), comparing their performance on the same benchmark.
The objective is not only to predict the correct answer but to rank the three most likely answers, maximizing the MAP@3 evaluation metric.
✨ Features
-
Classical ML baseline
-
Custom BiLSTM model
-
Fine-tuned Transformer models
-
BERT
-
RoBERTa
-
DeBERTa-v3
-
-
Retrieval-Augmented Generation (RAG)
-
FAISS vector search
-
Cross-Encoder reranking
-
PyTorch Lightning training pipeline
-
Weights & Biases experiment tracking
-
Automatic inference pipeline
-
Kaggle submission generation
📂 Dataset
Each sample consists of:
| Column | Description |
|---------|-------------|
| id | Question ID |
| prompt | Question statement |
| A-E | Five answer choices |
| answer | Correct option (training only) |
The test dataset excludes the answer column, requiring models to predict the top three most probable answer labels. :contentReference[oaicite:2]{index=2}
📊 Evaluation Metric
The competition evaluates submissions using:
> Mean Average Precision @ 3 (MAP@3)
The model predicts three ranked answer labels.
Example:
```
Correct Answer:
A
Prediction:
A B C ✅ Highest score
B A C ✅ Lower score
C D A ✅ Lowest score
```
🤖 Models Implemented
1. TF-IDF + LightGBM
A classical machine learning baseline using TF-IDF features with a LightGBM classifier.
2. BiLSTM
A custom Bidirectional LSTM model trained on tokenized MCQ text.
Features:
-
Embedding Layer
-
Bidirectional LSTM
-
Dropout
-
Fully Connected Classifier
3. Transformer Models
Fine-tuned HuggingFace transformers:
-
BERT (
bert-base-uncased) -
RoBERTa (
roberta-base) -
DeBERTa-v3 (
microsoft/deberta-v3-base)
Training performed using PyTorch Lightning.
4. Retrieval-Augmented Generation (RAG)
The RAG pipeline enhances transformer predictions using external context retrieved from the training corpus.
Components:
-
SentenceTransformer embeddings
-
FAISS vector search
-
CrossEncoder reranker
-
Transformer classifier
🛠Tech Stack
-
Python
-
PyTorch
-
PyTorch Lightning
-
HuggingFace Transformers
-
Sentence Transformers
-
FAISS
-
Scikit-learn
-
LightGBM
-
Pandas
-
NumPy
-
Weights & Biases