Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Generative AI-Powered Conversational Interview Preparation System

Project Overview

This project is a Generative AI-powered conversational interview preparation system designed to simulate realistic technical interviews based on a candidate's resume and technical skills.

The system uses:

  • TinyLlama-1.1B-Chat
  • LoRA (Low-Rank Adaptation)
  • PEFT (Parameter-Efficient Fine-Tuning)
  • 4-bit Quantization (BitsAndBytes)
  • HuggingFace Transformers
  • PyMuPDF for Resume Parsing

The final system:

  1. Extracts text from resumes.
  2. Identifies technical skills.
  3. Generates personalized interview questions.
  4. Conducts conversational interviews.
  5. Generates automated feedback.
  6. Simulates AI-based interview platforms used in modern recruitment.

Project Objectives

  • Build a personalized AI interviewer.
  • Generate skill-aware technical questions.
  • Conduct conversational interviews.
  • Provide automated feedback.
  • Demonstrate practical use of Generative AI in interview preparation.

Technology Stack

Core AI Technologies

  • TinyLlama-1.1B-Chat
  • HuggingFace Transformers
  • PyTorch
  • PEFT
  • LoRA
  • TRL (SFTTrainer)
  • BitsAndBytes

NLP and Resume Processing

  • PyMuPDF
  • Regular Expressions (Regex)
  • Skill Extraction Logic

Development Environment

  • Kaggle Notebook
  • Tesla T4 GPU

Complete Project Workflow

Resume Upload ↓ PDF Text Extraction ↓ Resume Cleaning ↓ Skill Extraction ↓ Prompt Engineering ↓ Load TinyLlama Base Model ↓ Apply 4-bit Quantization ↓ Configure LoRA Adapters ↓ Fine-Tune Model ↓ Save LoRA Weights ↓ Load Fine-Tuned Model ↓ Generate Interview Questions ↓ Conversational Interview ↓ Response Evaluation ↓ Feedback Generation


Phase 1: Dataset Creation

Objective

Create a conversational interview dataset for fine-tuning.

Dataset Format

JSONL format

Example:

{
  "instruction": "Ask one technical interview question about Python.",
  "response": "What is the difference between lists and tuples in Python?"
}

Dataset Characteristics

  • Technical Interview Questions
  • Conversational Format
  • Multiple Domains
  • Resume-Oriented Prompts
  • Follow-up Questions

Phase 2: Model Training

Load Base Model

TinyLlama-1.1B-Chat is loaded using HuggingFace Transformers.

Purpose:

  • Base conversational capability
  • Foundation for interview specialization

Apply Quantization

4-bit NF4 Quantization is applied using BitsAndBytes.

Purpose:

  • Reduce GPU memory usage
  • Enable training on Tesla T4 GPU

Benefits:

  • Faster training
  • Lower memory consumption
  • Cost-efficient deployment

Configure LoRA

Target Modules:

["q_proj", "v_proj"]

LoRA Parameters:

r=16
lora_alpha=32
lora_dropout=0.05

Purpose:

  • Train only adapter weights
  • Keep TinyLlama frozen

Benefits:

  • Faster training
  • Smaller checkpoints
  • Lower GPU usage

Fine-Tuning using SFTTrainer

Trainer:

SFTTrainer

Purpose:

  • Supervised fine-tuning
  • Conversational adaptation

Training Configuration:

learning_rate = 2e-4
per_device_train_batch_size = 1
num_train_epochs = 1-3
max_seq_length = 512

Phase 3: Training Evaluation

Training Loss

Monitor:

trainer.state.log_history

Expected Result:

Initial Loss ≈ 4.13

Final Loss ≈ 0.56

Interpretation:

  • Model learned interview patterns
  • Stable convergence
  • Successful LoRA adaptation

Save Fine-Tuned Model

Save:

  • LoRA Adapters
  • Tokenizer

Artifacts:

adapter_model/
tokenizer/

Phase 4: Resume Processing

Resume Upload

Input:

PDF Resume


Text Extraction

Library:

PyMuPDF

Extract:

  • Skills
  • Projects
  • Education
  • Experience

Resume Cleaning

Process:

  • Remove special characters
  • Normalize spaces
  • Prepare text for NLP

Phase 5: Skill Extraction

Purpose

Identify candidate technologies.

Example Output:

[
 "Python",
 "SQL",
 "React",
 "MongoDB",
 "Machine Learning"
]

Used For:

  • Personalized interviews
  • Skill-aware questioning

Phase 6: Demo Execution

Load Base Model

AutoModelForCausalLM

Load LoRA Weights

PeftModel.from_pretrained()

Purpose:

Apply interview-specific knowledge.


Build Interview Context

Input:

  • Resume Text
  • Skills
  • Previous Conversation

Output:

Interview Prompt


Generate Questions

Model Generates:

  • Technical Questions
  • Follow-up Questions
  • Contextual Questions

Interview Flow

Example:

AI: What is the difference between lists and tuples?

User: Lists are mutable while tuples are immutable.

AI: Can you explain a scenario where tuples are preferred?


Phase 7: Feedback Generation

Evaluation Parameters

  • Technical Depth
  • Communication Quality
  • Clarity
  • Completeness

Example Feedback

Strengths:

  • Good understanding of Python.

Weaknesses:

  • Limited explanation depth.

Suggestions:

  • Provide real-world examples.

Performance Analysis

Resume Extraction

Result:

Successfully extracts:

  • Skills
  • Projects
  • Education
  • Experience

Skill Extraction

Performance:

High relevance to resume content.


Question Relevance

Fine-Tuned Model:

  • Resume-aware
  • Skill-focused

Base Model:

  • Generic
  • Less contextual

Conversational Quality

Fine-Tuned Model:

  • Better context retention
  • More realistic interviews

GPU Efficiency

Environment:

Tesla T4

Technique:

4-bit Quantization + LoRA

Benefits:

  • Low memory usage
  • Fast inference

Results Obtained

Improvements After Fine-Tuning

Metric Base Model Fine-Tuned Model
Question Relevance Moderate High
Context Awareness Moderate High
Interview Realism Moderate High
Personalization None High
Feedback Quality Moderate Good

Research Contributions

  • Resume-aware interview generation.
  • Lightweight LLM fine-tuning.
  • Conversational AI interviewer.
  • Automated interview feedback.
  • Efficient deployment using LoRA and Quantization.

Common Issues and Fixes

Repetitive Questions

Cause:

Weak conversation memory.

Solution:

  • Store conversation history.
  • Maintain asked question set.
  • Use follow-up prompting.

Irrelevant Questions

Cause:

Prompt too generic.

Solution:

Force:

Generate ONE interview question about {skill} only.

CUDA Out Of Memory

Solution:

  • Enable 4-bit quantization.
  • Reduce batch size.
  • Use LoRA.

Viva Questions

Why TinyLlama?

Lightweight and efficient conversational LLM.

Why LoRA?

Trains only adapter weights.

Why PEFT?

Reduces training cost and memory.

Why Quantization?

Allows efficient GPU usage.

Why SFTTrainer?

Provides supervised fine-tuning pipeline.

What is Training Loss?

Error between generated and expected output during training.

What Was Achieved?

A personalized conversational AI interviewer capable of generating technical interviews and automated feedback based on candidate resumes.


Future Scope

  • Voice-based interviews.
  • Speech-to-text integration.
  • Emotion detection.
  • Multilingual support.
  • Real-time scoring.
  • ATS compatibility.
  • Cloud deployment.

Author

Himanshu Patro

Institute of Technical Education and Research (ITER) SOA University

Project: Generative AI-Powered Conversational Interview Preparation System

About

tinyllama model for an ai bot takibng personalized resume interview

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages