Nirav Diwan
· 5 previous affiliations
- University of Illinois Urbana-ChampaignSince 2022
- Doctor of Philosophy - PhD, Computer Science · 2024–2028
- Current
- Master of Science - MS, Computer Science · 2022–2024
- Research Intern · 2024
- Ema Unlimited2023
- Machine Learning Research Intern · 2023
- Prodigal2021–2022
- Machine Learning Engineer · 2021–2022
- Research Intern · 2019–2022
- Undergrad student · 2017–2021
Research Overview
Nirav Diwan focuses on the security and alignment of foundation models, specifically investigating vulnerabilities in model deployment and developing robust safety mechanisms for code generation. His trajectory spans adversarial evasion tactics in visual systems to preference learning and alignment algorithms for large language models. Currently, his work emphasizes deliberative reasoning approaches to ensure cybersafety and mitigate malicious exploitation in generative AI.
Research Trajectory
Diwan's research initially examined adversarial threats against security infrastructure, demonstrating how generative models can be weaponized to bypass established defenses. In 2024, he explored this in the context of visual security, investigating how diffusion models could be utilized to evade detection systems in It Doesn't Look Like Anything to Me: Using Diffusion Model to Subvert Visual Phishing Detectors.
Concurrently, his research expanded into the foundational alignment of large language models (LLMs), focusing on improving how models learn from human preferences. He introduced a novel sampling strategy for Direct Preference Optimization (DPO) in Clear Preferences Leave Traces: Reference Model-Guided Sampling for Preference Learning. Recognizing that DPO's effectiveness relies heavily on the quality of training data, he demonstrated that the probability space of a reference model can naturally identify high-quality training samples. This insight yielded a sampling approach that achieved consistent performance improvements on alignment benchmarks while requiring significantly fewer data points than standard methods.
In 2025, Diwan's focus shifted toward the intersection of LLM alignment and software security, particularly examining the vulnerabilities of code-generating models. He collaborated on the development of an extensive evaluation framework in MOCHA: Are Code Language Models Robust Against Multi-Turn Malicious Coding Prompts?. This work revealed that even advanced frontier models struggle to reject malicious requests when harmful tasks are broken down into seemingly benign, decomposed steps over a conversation. This research contributes to the broader area of Multi-Turn Intent Decomposition for LLM Jailbreaking and highlights the necessity for rigorous evaluation in the domain of Execution Based Security Validation for Code Agents.
Alongside his work on generative AI security, Diwan has also contributed to traditional systems security. He investigated techniques for analyzing non-standard executables in You Can't Judge a Binary by Its Header: Data-Code Separation for Non-Standard ARM Binaries Using Pseudo Labels, addressing the specific challenges of data-code separation in ARM binaries through the use of pseudo-labels.
Building on his insights into both model alignment and code security vulnerabilities, Diwan co-led the development of a reasoning model specifically designed for cybersafety. In PurpCode: Reasoning for Safer Code Generation, he and his collaborators introduced an open-source post-training recipe that combines explicit security rule learning with a novel reinforcement learning pipeline. The resulting model generates secure code and resists malicious exploitation while minimizing the over-refusal of benign coding tasks. This contribution advances several critical research directions, including Deliberative Safety Alignment for Large Reasoning Models and Deep Safety Alignment through Introspective Reasoning. Furthermore, by addressing the risks associated with generating syntactically correct but insecure software, this work directly tackles challenges in the area of The Security Blind Spot of Functionally Correct Code and explores methods for Internalizing Safety Constraints through Intervention Penalties.
Current Directions
The most recent papers in the evidence indicate a strong focus on the security and alignment of code-generating foundation models. Recent work investigates how to instill robust cybersafety mechanisms into large language models without compromising their utility for benign programming tasks. This involves developing deliberative reasoning pipelines that allow models to introspectively evaluate the security implications of their outputs before finalizing them. Additionally, current research addresses the vulnerabilities of conversational agents to multi-turn jailbreaking, where malicious intents are obfuscated through decomposed prompts. By combining advanced reinforcement learning techniques with explicit security constraints, this ongoing work aims to close the gap between functionally correct code generation and secure software development.
Profile updated
Loading new papers…
Other researchers whose papers cluster into the same research directions — a proxy for overlapping technical interests and shared intellectual neighborhoods.
See something wrong? Report a mistake