← home
mahdi@mit ~ $

mahdi afshari

MIT CS · systems, ML, building things that work

$ launch ./terminal

for the curious :3

$ cat education.txt

Education

Massachusetts Institute of Technology (MIT)

B.S. in Computer Science · GPA: 4.7/5.0

Sep 2023 – May 2027

-Coursework: ML, Computer Systems, Software Construction, Algorithms

Massachusetts Institute of Technology (MIT)

MEng in Computer Science

Sep 2026 – May 2028
$ cat research.txt

Research

Self-Adapting Language Models via Learned Acquisition & Injection

Jacob Andreas LabCSAIL, MIT

Jun 2026 – Present
  • -Designing an RL loop that trains a policy to acquire and inject task-relevant knowledge into a frozen LLM's context (later LoRA weights), scored by forced-choice accuracy gains over fixed-prompt and cold baselines on held-out questions.
  • -Built the ReST-EM training pipeline (candidate sampling → retention gating → SFT) with reward-reliability and train/eval leakage-safety gates required before any training run.
  • -Sole researcher on the implementation, with weekly meetings with the PI and Omar Khattab observing as a potential future collaborator.

LLM Ensemble Forecasting for Prediction Markets

Jacob Andreas, Steven HenryCSAIL, MIT

Feb – May 2026
  • -Built the Polymarket data pipeline (deduplication, side-flip filtering, resolution tracking) and a 35-configuration ablation harness spanning model, temperature, persona, and information-access axes, evaluated on 822 resolved binary questions.
  • -Found the best single LLM forecaster earned significantly higher ROI than the human-crowd aggregate (+4.0% vs. −0.5%, p=0.004) at statistically indistinguishable accuracy (77.9% vs. 79.9%).
  • -Showed that filtering to medium within-crowd agreement doubled ROI to +9.1%. Manuscript under review.

Diplomacy AI for Non-User-Mediated Multi-Agent LLMs

Jacob Andreas LabCSAIL, MIT

Oct 2025 – Jan 2026
  • -Built autonomous negotiation systems where LLM agents form alliances, trade resources, and coordinate without human mediation in Minecraft-like environments.
  • -Extended MCrafter with 4 social primitives (alliance, trade, truce, protection) enabling 10+ concurrent agents with competing goals to negotiate autonomously.
  • -Designed episodic memory and summarization layers to keep inference cost manageable while maintaining context across multi-turn negotiations.
  • -Built evaluation infrastructure tracking diplomacy outcomes (alliance stability, resource distribution fairness) and construction progress in multi-village scenarios.

Inferring Dynamics of Memory Encoding and Recall

Mehrdad Jazayeri LabMcGovern Institute, MIT

Jun – Dec 2024
  • -Designed and evaluated Drift Diffusion Models (DDMs) and their variants to capture behavioral patterns in short- and long-term memory tasks using data from 500+ trials per subject (human and non-human primates).
  • -Integrated Gaussian Process (GP) regression into the modeling pipeline to estimate time-varying latent parameters, enabling non-parametric inference of cognitive dynamics and uncertainty quantification across trials.
  • -Found that encoding dynamics degrade predictably with delay, but recall exhibits non-monotonic threshold shifts suggesting distinct neural mechanisms.
  • -Applied probabilistic modeling techniques to analyze response distributions, jointly fitting reaction times and accuracy under varying memory loads and delays. Implemented models in JAX for GPU-accelerated parameter estimation.

Hierarchical Modeling of Protein Structure for Predicting Function

Manolis Kellis LabCSAIL, MIT

Jan – May 2024
  • -Developed a novel approach to predict protein function from secondary structure as part of a team.
  • -Fine-tuned ESMFold embeddings for secondary structure inputs and implemented an iterative feedback loop that refines structure predictions by incorporating function prediction errors, creating a bidirectional refinement cycle between structure and function models.
  • -Improved function annotation accuracy by 15% on benchmark set using PyTorch and HuggingFace Transformers.
$ ls projects/

Projects

Oracle – Research-Grade Forecasting Pipeline for Kalshi MarketsOpen →

A blind-forecasting pipeline for Kalshi prediction markets with leakage-safe research tools and calibrated backtesting.

Python

Mizān – Local-First Personal Finance PlatformOpen →

Self-hosted finance app syncing bank/crypto accounts with AES-256-GCM credential encryption and zero telemetry.

TypeScriptNext.jsSQLite

LLM Agent Memory in Repeated Social DilemmasOpen →

How much memory do LLM agents really need to sustain cooperation in a repeated public-goods game?

Final project for 6.7960 - Deep Learning

Python

Straggler-Aware Scheduler for Distributed TrainingOpen →

Persistence-filtered straggler detection and adaptive rate allocation for gradient synchronization.

Final project for 6.5820 - Computer Networks

PythonPyTorchGlooDistributed Systems

Interplanetary Delay-Tolerant Network Protocol (MAUSA)Open →

Routing protocol design for deep-space communication with extreme latency and intermittent connectivity.

Final project for 6.1800 - Computer Systems Engineering

Systems DesignNetworkingProtocol Design

PPG-Based Heart Rate & Hydration MonitorOpen →

Non-invasive physiological monitoring using photoplethysmography signal analysis from video recordings.

PythonOpenCVSciPyFirebaseNumPy

Ambient AI Assistant (InvisibleGPT)Open →

Multi-modal input system with priority-based output routing for seamless AI interaction workflows.

PythonOpenAI APILaTeX

Dual-Role Healthcare Platform (TeddyCare)Open →

Patient and doctor dashboards with wearable integration and fine-tuned GPT-4o for medical conversations.

🏆 $1,000 Tune AI Sponsor Award - HackMIT 2023
Next.js 14PrismaClerkTerra APIPostgreSQLVercel
$ cat skills.txt

Skills

ml/dlpytorch, jax, huggingface transformers, peft/lora, vllm, rl post-training (grpo, rest-em, rejection sampling), gaussian processes
languages & systemspython, typescript (next.js/react/node), c, risc-v assembly, bluespec/minispec, distributed training (gloo, ring all-reduce), docker, linux, slurm
toolsgit, postgresql, sqlite, prisma, vercel, openai/anthropic/perplexity apis
$ cat experience.txt

Experience

Teaching Assistant for Computation Structures (6.1910)

MIT EECS

Feb 2025 – Present
  • -Teaching digital logic design, Verilog, and Minispec (Bluespec derivative) to 200+ students in weekly labs and office hours.
  • -Debug student processors in real-time-pipelined CPUs, cache hierarchies, hazard detection-with average fix time under 10 minutes.
  • -Release labs, write quizzes, and maintain course infrastructure (grading scripts, lab checkoff systems, debugging tools).
  • -Help students understand not just how to write Verilog but why their designs work (or don't)-timing, synthesis, hardware intuition.

International Students Association President

MIT

Feb 2024 – Sep 2025
  • -Led MIT's largest cultural umbrella organization, representing 1000+ international students across 15+ cultural groups.
  • -Organized 4 large-scale events with 300–1100 attendees each ($50k+ total budget): cultural showcases, networking mixers, orientation programs.
  • -Designed coordination framework for 15+ organizations-shared calendars, budget allocation system, conflict resolution processes-now used campus-wide.
  • -Shipped new constitution establishing clear governance structure, term limits, and transition protocols for future leadership.
  • -Built mentor network connecting 200+ incoming international students with upperclassmen, faculty, and startup founders for career guidance.

AI Music Recommender (AIM Labs)

AI@MIT

Oct – Dec 2023
  • -Built Siamese network for music similarity on 10k+ track dataset in a selected collaborative team of five.
  • -Optimized triplet loss training pipeline, improving recommendation accuracy from 60% to 78% in blind A/B tests with 50 users.
  • -Integrated Spotify API for metadata retrieval and React frontend for user interaction.
$ cat awards.txt

Awards

🏆 33rd International Biology OlympiadIranian National Team

2022

Gold Medal, ranked #7 globally among 300+ participants from 75+ countries in Yerevan, Armenia; practicals spanned PCR, gel electrophoresis, microscopy, plant anatomy, and ecological sampling.

🏆 23rd National Biology Olympiad

2020

Gold Medal.

🏆 5th & 6th National Stem Cell and Regenerative Medicine Olympiad

2020, 2021

Top 40 and Gold Medal.

🏆 5th & 7th National Brain Bee Neuroscience Competition

2019, 2021

Bronze and Silver Medal.