YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
- Mistral Technical Interview QA (LoRA + RAG)
Mistral Technical Interview QA (LoRA + RAG)
π Overview
This model is a fine-tuned version of Mistral-7B-Instruct designed to answer technical interview questions in core Computer Science domains. It is trained on a curated dataset of technical questionβanswer pairs and evaluated under multiple experimental setups including vanilla LLM, fine-tuning, Retrieval-Augmented Generation (RAG), and hybrid approaches.
The goal of this project is to investigate the effectiveness of parameter-efficient fine-tuning and retrieval augmentation for improving technical question answering in low-resource settings.
π Key Features
Fine-tuned using LoRA (Low-Rank Adaptation) for memory-efficient training
Supports Retrieval-Augmented Generation (RAG)
Focused on Computer Science domains:
- Data Structures and Algorithms
- Operating Systems
- Computer Networks
- Databases
- OOP and Core CS fundamentals
Lightweight adapter weights for fast deployment
Evaluated using BLEU, ROUGE, BERTScore, and Exact Match
π§ Base Model
- Model:
mistralai/Mistral-7B-Instruct-v0.2 - Architecture: Decoder-only transformer
- Training method: Supervised fine-tuning with LoRA
π Dataset
The dataset consists of approximately 2,000 technical questionβanswer pairs covering multiple Computer Science domains.
Dataset preparation:
- Initial seed dataset manually curated
- Extended using synthetic augmentation
- Duplicate and semantic filtering applied
- Train / validation / test splits created
- Format: JSONL
β οΈ Note: Some data samples were generated using LLM-based augmentation and manually filtered for quality.
βοΈ Training Details
Fine-tuning approach:
- Parameter-efficient LoRA tuning
- Frozen base model weights
- Adapter-only training
Configuration:
- LoRA rank: 8
- Learning rate: 1e-4
- Epochs: 3
- Sequence length: 384
- Precision: FP16
- Gradient accumulation used
Training was performed on an NVIDIA RTX 3090 (24GB VRAM).
π Retrieval-Augmented Generation (RAG)
A semantic retriever was implemented using:
- Sentence Transformers (
all-MiniLM-L6-v2) - FAISS vector database
- Top-k semantic search
Retrieved context is injected into the prompt before generation.
π Evaluation
The model was evaluated under four experimental settings:
- Vanilla Mistral
- RAG + Vanilla
- Fine-tuned Mistral
- RAG + Fine-tuned
Metrics used:
- BLEU-4
- ROUGE-L
- BERTScore
- Exact Match
Results showed that:
- Fine-tuning improves answer quality and domain specificity
- RAG improves factual grounding
- The hybrid approach provides the best performance
π§ͺ Intended Use
This model is designed for:
- Interview preparation
- Educational tools
- Technical tutoring
- Research in retrieval-augmented systems
It is not intended for:
- Medical or legal decision-making
- Safety-critical systems
β οΈ Limitations
- Dataset size is relatively small
- Synthetic data may introduce bias
- Performance may vary for unseen or highly specialized domains
- Retrieval quality depends on the vector database
π Ethical Considerations
The dataset does not contain personally identifiable or sensitive information. The model may generate incorrect or outdated information and should be used with human oversight.
π¦ How to Use
Load merged model:
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("yourusername/repo-name")
tokenizer = AutoTokenizer.from_pretrained("yourusername/repo-name")
Load LoRA version:
from transformers import AutoModelForCausalLM
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2")
model = PeftModel.from_pretrained(base, "yourusername/repo-name")
π Future Work
- Larger and more diverse dataset
- Multi-hop retrieval
- Improved retriever training
- Reinforcement learning for answer quality
- Human evaluation
hookup
π¨βπ» Author
Final-year Computer Science project focused on applied LLM systems, parameter-efficient fine-tuning, and retrieval-augmented generation.
π License
Please refer to the base model license (Mistral AI).