Zhang Yihao

Yihao Zhang张益豪

Third-Year Applied Mathematics PhD
School of Mathematical Sciences, Peking University

Currently @ Tencent Yuanbao Security Center

Primary Research Focus LLM Agent Safety
I research  |
LLM Agent Safety Formal Methods for LLM Agents Jailbreaking LLM Prompt Injection Mechanistic Interpretability Representation Engineering AI Safety & Verification Automated Theorem Proving

I am Yihao Zhang (张益豪), a Third-Year Applied Mathematics PhD at the School of Mathematical Sciences, Peking University. I am currently conducting research under the guidance of Professor Meng Sun and am a part of his research group.

I got my bachelor’s degree (Data Science, Math) from Peking University in 2024. I served as a visiting research assistant at Singapore Management University, from October 2023 to May 2024. My supervisor at Singapore Management University is Jun Sun.

My research interests include:

  • LLM Agent Safety
  • Formal Methods for LLM Agents
  • Jailbreaking LLM
  • Prompt Injection
  • Mechanistic Interpretability for Large Language Models
  • Representation Engineering in LLM
  • AI Safety, Verifying Robustness/Fairness/Trustworthy Related Issues in AI
  • Automated Interactive Theorem Proving, AI4ITP

I have published multiple papers at different international conferences with total google scholar .

If you wish to access my personal homepage before 2024, please click here.

💼 Experience

2026.03 — Present

Tencent Yuanbao Security CenterCurrent

腾讯元宝安全中心

2025.05 — 2025.12

ByteDance Flow Security

字节跳动 Flow 安全

🔥 News

2026.09
🎉 Our paper, AgentWorm: Self-Propagating Attacks Across LLM Agent Ecosystems, is accepted by NDSS 2027.
2026.09
🎉 Our paper, Automata Extraction from Transformers, is accepted by ICECCS 2026.
2026.09
🎉 Our paper, DocVerify: Constraint-Based Verification of LLM Outputs Against Document Knowledge, is accepted by ICECCS 2026.
2026.03
🏢 I joined Tencent Yuanbao Security Center (腾讯元宝安全中心).
2026.03
🎉 Our paper, On Mutation Testing of In-Context Learning Systems, is published in Journal of Systems Architecture.
2025.12
👋 I left ByteDance Flow Security.
2025.11
🏆 Our paper, Automata-Based Steering of Large Language Models for Diverse Structured Generation, won the Best Paper Award at ICFEM 2025!
2025.05
🏢 I joined ByteDance Flow Security (字节跳动 Flow 安全) via the Jindouyun Talent Program (筋斗云人才计划).
2025.04
🎉 Our paper, Boosting jailbreak attack with momentum is accepted as an Oral Paper in ICASSP 2025.
2025.03
2024.12
🎉 2 Papers (as first author and second-to-last author, respectively) accepted by ICASSP.
2024.11
✈️ We presented our paper in NeurIPS 2024 main conference (poster).
2024.10
🎉 We presented our paper in 2nd Frontier Ph.D Forum hosted in Peking University.
2024.09
🎉 1 Paper (as second author) accepted by SETTA 2024.
2024.09
✈️ I started my PhD career at Peking University!
2024.07
✈️ We presented our paper in ICML 2024 main conference (poster).
2024.06
🎉 I am graduating from Peking University and starting my Ph.D. My undergraduate thesis, Automata Extraction from Transformers, is posted on arxiv.
2024.04
🎉 I finished my paper, Adversarial Representation Engineering: A General Model Editing Framework for Large Language Models, which is posted on arxiv. Our repository has got 5 stars🌟 on GitHub!
2024.03
🎉 2 Papers (as first author and second-to-last author, respectively) accepted by ICLR 2024 R2-FM Workshop.
2023.12
💸 My application for the Beijing Natural Science Foundation Undergraduate "Initiating Research" Program has been approved.
2023.10
✈️ I am now going to Singapore Management University for a six-month exchange.
2023.05
🎉 Our paper, Sharpness-Aware Minimization Alone can Improve Adversarial Robustness, is accepted by 2nd AdvML-Frontiers@ICML 2023.
2023.04
🎉🎉 I have been accepted into the Applied Mathematics Elite Program by the School of Mathematical Sciences at Peking University (only 1 per year), which means that I am expected to spend five years here as a doctoral student.

📝 Selected Papers

(*: Equal Contribution; ${}^\dagger$: Corresponding Author)

NDSS 2027
AgentWorm attack lifecycle

AgentWorm: Self-Propagating Attacks Across LLM Agent Ecosystems (NDSS 2027)

Yihao Zhang, Zeming Wei, Xiaokun Luan, Jiangrong Wu, Chengcan Wu, Zhixin Zhang, Haolin Wu, Huanran Chen, Jun Sun, Meng Sun

We present AgentWorm, a self-propagating attack that compromises persistent LLM agents and autonomously spreads across agent ecosystems. The work studies the full infection loop, its transferability, and practical defenses for deployed agent systems.

pdf arxiv

ICML 2024
sym

On the Duality Between Sharpness-Aware Minimization and Adversarial Training (ICML 2024)

Yihao Zhang*, Hangzhou He*, Jingyu Zhu*, Huanran Chen, Yifei Wang, Zeming Wei${}^\dagger$

Adversarial Training (AT), which adversarially perturb the input samples during training, has been acknowledged as one of the most effective defenses against adversarial attacks, yet suffers from a fundamental tradeoff that inevitably decreases clean accuracy. Instead of perturbing the samples, Sharpness-Aware Minimization (SAM) perturbs the model weights during training to find a more flat loss landscape and improve generalization. However, as SAM is designed for better clean accuracy, its effectiveness in enhancing adversarial robustness remains unexplored. In this work, considering the duality between SAM and AT, we investigate the adversarial robustness derived from SAM. Intriguingly, we find that using SAM alone can improve adversarial robustness. To understand this unexpected property of SAM, we first provide empirical and theoretical insights into how SAM can implicitly learn more robust features, and conduct comprehensive experiments to show that SAM can improve adversarial robustness notably without sacrificing any clean accuracy, shedding light on the potential of SAM to be a substitute for AT when accuracy comes at a higher priority. Code is available at this https URL.

pdf arxiv code

NeurIPS 2024
sym

Adversarial Representation Engineering: A General Model Editing Framework for Large Language Models (NeurIPS 2024)

Yihao Zhang, Zeming Wei, Jun Sun${}^\dagger$, Meng Sun${}^\dagger$

Since the development of Large Language Models (LLMs) has achieved remarkable success, understanding and controlling their internal complex mechanisms has become an urgent problem. Recent research has attempted to interpret their behaviors through the lens of inner representation. However, developing practical and efficient methods for applying these representations for general and flexible model editing remains challenging. In this work, we explore how to use representation engineering methods to guide the editing of LLMs by deploying a representation sensor as an oracle. We first identify the importance of a robust and reliable sensor during editing, then propose an Adversarial Representation Engineering (ARE) framework to provide a unified and interpretable approach for conceptual model editing without compromising baseline performance. Experiments on multiple model editing paradigms demonstrate the effectiveness of ARE in various settings. Code and data are available at this https URL.

pdf arxiv code

Other Publications

(*: Equal Contribution; ${}^\dagger$: Corresponding Author)

The Salami Slicing Threat: Exploiting Cumulative Risks in LLM Systems (Preprint, 2026)

Yihao Zhang, Kai Wang, Jiangrong Wu, Haolin Wu, Yuxuan Zhou, Zeming Wei, Dongxian Wu, Xun Chen, Jun Sun, Meng Sun

arxiv pdf

RACA: Representation-Aware Coverage Criteria for LLM Safety Testing (Preprint, 2026)

Zeming Wei, Zhixin Zhang, Chengcan Wu, Yihao Zhang, Xiaokun Luan, Meng Sun

arxiv pdf

Symbolic-Neural Soft-Logic Reasoning: Towards Robust and Verifiable Thinking Chains via Cooperative Evolution (Preprint, 2026)

Rui Wang, Zeming Wei, Yihao Zhang, Xiaokun Luan

arxiv pdf

On Mutation Testing of In-Context Learning Systems (Journal of Systems Architecture, 2026)

Zeming Wei, Guanzhang Yue, Yihao Zhang, Meng Sun

doi

Automata-Based Steering of Large Language Models for Diverse Structured Generation (ICFEM 2025 · Best Paper)

Xiaokun Luan, Zemin Wei, Yihao Zhang, Meng Sun

doi arxiv

Robust and Efficient Watermarking of Large Language Models Using Error Correction Codes (PETS 2025)

Xiaokun Luan, Zeming Wei, Yihao Zhang, Meng Sun

doi

When Thinking LLMs Lie: Unveiling the Strategic Deception in Representations of Reasoning Models (Preprint, 2025)

Kai Wang, Yihao Zhang, Meng Sun

arxiv pdf

Mitigating Fine-tuning Risks in LLMs via Safety-Aware Probing Optimization (Preprint, 2025)

Chengcan Wu, Zhixin Zhang, Zeming Wei, Yihao Zhang, Meng Sun

arxiv pdf

Towards Formal Modeling and Verification of the Stellar Consensus Protocol in Z3 (QRS Companion 2025)

Feiran Lei, Yihao Zhang, Xuefei Tong, Shuaida Wu, Meng Sun

doi

MedTiny Code Generation for Enhancing RegLang Smart Contract Reliability (SAC 2025)

Xiaokun Luan, Yihao Zhang, Meng Sun

doi

Component Composition in MedTiny: Multi-Level Constructs and Operational Semantics (SEKE 2025)

Xiangyu Li, Yihao Zhang, Meng Sun

doi

Boosting jailbreak attack with momentum (ICASSP 2025 Oral, ICLR 2024 R2-FM Workshop)

Yihao Zhang*, Zeming Wei*${}^\dagger$

pdf arxiv code

Exploring the robustness of in-context learning with noisy labels (ICASSP 2025, ICLR 2024 R2-FM Workshop)

Chen Cheng*, Xinzhi Yu*, Haodong Wen*, Jinsong Sun, Guanzhang Yue, Yihao Zhang, Zeming Wei${}^\dagger$

pdf arxiv code

Automata Extraction from Transformers (ICECCS 2026)

Yihao Zhang, Zeming Wei, Meng Sun${}^\dagger$

pdf arxiv code

DocVerify: Constraint-Based Verification of LLM Outputs Against Document Knowledge (ICECCS 2026)

Yihao Zhang, Zeming Wei, Xiaokun Luan, Meng Sun

MILE: A Mutation Testing Framework of In-Context Learning Systems (SETTA 2024)

Zeming Wei, Yihao Zhang, Meng Sun${}^\dagger$

pdf arxiv code

MedTiny: Enhanced Mediator Modeling Language for Scalable Parallel Algorithms (QRS 2023)

Xiangyu Li, Yihao Zhang, Xiaokun Luan, Xiaoyong Xue, Meng Sun${}^\dagger$

pdf

Sharpness-aware minimization alone can improve adversarial robustness (ICML 2023 AdvML-Frontiers Workshop)

Zeming Wei*${}^\dagger$, Jingyu Zhu*, Yihao Zhang*

pdf arxiv code

Using Z3 for Formal Modeling and Verification of FNN Global Robustness (SEKE 2023)

Yihao Zhang, Zeming Wei, Xiyue Zhang, Meng Sun${}^\dagger$

pdf arxiv code

Weighted automata extraction and explanation of recurrent neural networks for natural language tasks (JLAMP, Vol 136)

Zeming Wei, Xiyue Zhang, Yihao Zhang, Meng Sun${}^\dagger$

pdf arxiv code

🎖 Honors and Awards

  • President’s Scholarship, Peking University, 2025
  • Huaixin Bachelor (怀新学士, Honours Degree), 2024
  • Selected for the Elite Program (拔尖计划, Graduate) in the School of Mathematical Sciences, Peking University.
  • University Scholarship, Peking University, 2023
  • Second prize, Chinese Mathematics Competitions for Undergraduates (Beijing Division), 2023

📖 Educations

  • 2023.10 - 2024.05, Research Assistant, School of Computing and Information Systems, Singapore Management University.
  • 2020.09 - 2024.06, Undergraduate Student, School of Mathematical Sciences, Peking University.
  • 2024.09 - 2028.06 (expected), PhD, School of Mathematical Sciences, Peking University.

💬 Talks

💻 Projects

  • 2026-2029, Safety Assurance of LLM-Driven Agents, Key Member, NSFC General Program.
  • 2025-2027, LLM Feature Reconstruction & Manipulation, Key Member, Industry Collaboration.
  • 2023-2025, Study on the interpretability of large language model architecture and algorithm, Program Director.
  • 2022-2025, Trustworthy guarantee of deep learning system, Member.

👨‍🏫 Advisors

🔗 Links