Selected work
Projects built end-to-end.
Retrieval systems, agent workflows, and model-compression research — every one measured, tested, and documented on GitHub.
Metrics are quoted from each project's own evaluation runs — RAGChecker, MTEB, perplexity benchmarks, and hand-graded student sessions.
01RAG · Offline
Python · LangChain · FAISS · Sentence Transformers · Ollama · FastAPI · Next.js
- Offline RAG over a secondary-level physics textbook: two dense retrieval paths, FAISS indexing, candidate merging, cross-encoder re-ranking, relevance filtering, and follow-up question reformulation with local Gemma 2 via Ollama.
- Evaluated retrieval and generation on ~4,000 textbook QA pairs with RAGChecker — 0.86 F1 and 0.82 faithfulness on mathematical questions — plus manual testing with 12 students.
- Served the pipeline through FastAPI and built a Next.js chat client with per-session state and Server-Sent Events for streamed responses.
0.86 F1math QA · RAGChecker · 4k pairs
02AI Agent
TypeScript · Next.js 15 · LangChain · LangGraph · Convex · SSE · OpenRouter
- PDF-grounded generator producing MCQ, true/false, short-answer, and essay questions from source material and user-defined marks, difficulty, and question types.
- Five specialized stages — Extractor, Creator, Analysis, Decider, Formatter — separate requirements, generation, quality checks, revision decisions, and formatting.
- Convex-backed file storage, OpenRouter model access, Markdown output, and real-time Server-Sent Events streaming.
5-stageLangGraph pipeline · SSE streaming
03Research
Python · PyTorch · Transformers · Poincaré Embeddings · Contrastive Learning
- Hierarchy-aware embedding model that represents inputs from coarse intent to fine-grained meaning via a frozen Transformer backbone, learned token-attention pooling, and iterative hierarchical refinement.
- Maps each level into Poincaré space at increasing radial scales, trained with a coarse-to-fine hyperbolic NCE objective that encodes semantic granularity directly in the geometry.
- Hyperbolic-distance retrieval evaluated over 11 MTEB tasks with Hits@K, Recall@K, NDCG, MRR, and MAP, plus a cosine-similarity baseline.
11MTEB retrieval tasks evaluated
04Health · Conversational AI
Next.js · Convex · OpenAI GPT-4.1 (STT/TTS) · LLM Evaluation
- Text-and-voice conversational screening support that tracks which ADHD symptom indicators are covered — no fixed questionnaire flow.
- Post-session evidence extraction and structured domain-level scoring from transcripts; on a 10-sample eval set: 83–94% item alignment, 79–86% question coverage, 82–86% response mapping accuracy.
83–94%item alignment · 10-sample eval
05LLM Compression
Python · PyTorch · Transformers · N:M Structured Sparsity · Low-Rank SVD
- Post-training pruning toolkit supporting magnitude, Wanda, SparseGPT, RIA, and an activation-aware ClearCut criterion, with unstructured and hardware-oriented N:M sparsity.
- Channel reallocation and SVD low-rank decomposition for attention projections; perplexity and zero-shot eval across WikiText-2, C4, PTB, BoolQ, RTE, HellaSwag, ARC-Challenge, and MNLI.
- At 50% sparsity on WikiText-2: 6.78 perplexity on LLaMA-2-7B and 11.44 on OPT-6.7B — below the SparseGPT, Wanda, and RIA baselines.
6.78 pplLLaMA-2-7B @ 50% sparsity
06ML Pipeline
Python · Logistic Regression · SVM · Random Forest · XGBoost
- Full ML pipeline over Rawalpindi road traffic accidents targeting injury severity and post-accident patient status.
- Benchmarked classical and ensemble classifiers with accuracy, precision, recall, F1, and confusion matrices, plus diagnostic learning curves for key hyperparameters.
6classifiers benchmarked