Skip to main content
QUICK REVIEW

[Paper Review] Stealing User Prompts from Mixture of Experts

Itay Yona, Ilia Shumailov|arXiv (Cornell University)|Oct 30, 2024
Data Mining Algorithms and ApplicationsComputer Science3 citations
TL;DR

This paper introduces the MoE Tiebreak Leakage attack, a novel exploit that fully extracts a victim's private prompt from Mixture-of-Experts (MoE) models by manipulating batched inputs to trigger detectable tie-breaking signals in Expert-Choice-Routing. The attack requires only 𝒪(VM²) queries (with vocabulary size V and prompt length M), or ~100 queries per token on average, demonstrating a critical architectural vulnerability in MoE routing that compromises user input confidentiality.

ABSTRACT

Mixture-of-Experts (MoE) models improve the efficiency and scalability of dense language models by routing each token to a small number of experts in each layer. In this paper, we show how an adversary that can arrange for their queries to appear in the same batch of examples as a victim's queries can exploit Expert-Choice-Routing to fully disclose a victim's prompt. We successfully demonstrate the effectiveness of this attack on a two-layer Mixtral model, exploiting the tie-handling behavior of the torch.topk CUDA implementation. Our results show that we can extract the entire prompt using $O({VM}^2)$ queries (with vocabulary size $V$ and prompt length $M$) or 100 queries on average per token in the setting we consider. This is the first attack to exploit architectural flaws for the purpose of extracting user prompts, introducing a new class of LLM vulnerabilities.

Motivation & Objective

  • To identify and demonstrate a new class of vulnerability in MoE models arising from architectural design flaws in expert routing.
  • To show that user prompt confidentiality can be fully compromised when adversarial and victim queries are batched together in MoE models using Expert-Choice-Routing.
  • To expose the risk of cross-batch side-channel leakage due to deterministic tie-breaking in expert buffer allocation.
  • To propose defense strategies that preserve batch independence and introduce stochasticity to disrupt such attacks.

Proposed method

  • The attacker batches their queries with the victim’s query to influence the expert routing process in MoE layers.
  • By systematically guessing tokens in the victim’s prompt, the attacker monitors model outputs for detectable signals indicating a correct guess.
  • The attack exploits the tie-handling behavior of the torch.topk CUDA implementation, which deterministically resolves ties in expert capacity allocation.
  • A correct guess causes the victim’s token to be routed to a specific expert, creating a consistent output pattern that reveals the guessed token.
  • The attack uses a binary search-like strategy over the vocabulary to recover each token of the victim’s prompt with high confidence.
  • The method scales as 𝒪(VM²) queries to extract the full prompt, with a practical average of ~100 queries per token in the evaluated setting.
Figure 1 : High-level outline of the MoE Tiebreak Leakage Attack. The attacker and victim queries are batched together, affecting routing of each other. The attacker systematically guesses the next token in a victim’s confidential message. A correct guess triggers Expert-Choice-Routing tie-breaker,
Figure 1 : High-level outline of the MoE Tiebreak Leakage Attack. The attacker and victim queries are batched together, affecting routing of each other. The attacker systematically guesses the next token in a victim’s confidential message. A correct guess triggers Expert-Choice-Routing tie-breaker,

Experimental results

Research questions

  • RQ1Can an adversary fully extract a victim’s private prompt by manipulating batched inputs in MoE models?
  • RQ2How does Expert-Choice-Routing create a cross-batch side-channel that leaks input information?
  • RQ3What role does the deterministic tie-breaking in torch.topk play in enabling this attack?
  • RQ4Are other MoE routing strategies similarly vulnerable to such side-channel leaks?
  • RQ5What architectural or operational defenses can effectively mitigate this class of vulnerability?

Key findings

  • The MoE Tiebreak Leakage attack successfully extracts the entire victim prompt using only 𝒪(VM²) queries, where V is the vocabulary size and M is the prompt length.
  • The attack achieves an average of approximately 100 queries per token in practice, significantly reducing the query cost compared to brute-force approaches.
  • The attack exploits a previously unknown side-channel created by deterministic tie-breaking in the torch.topk CUDA kernel during expert routing.
  • The vulnerability arises specifically from the violation of implicit batch independence in Expert-Choice-Routing, where one user’s input can influence another’s routing decisions.
  • The attack is feasible on a real-world Mixtral-8x7B model, demonstrating that architectural design flaws can lead to full prompt disclosure.
  • Defenses such as introducing stochasticity in expert capacity, batch ordering, or routing decisions can disrupt the attack and mitigate the vulnerability.
Figure 2 : Step-by-step execution of the MoE Tiebreak Leakage attack. More details are provided in Section 3.3 .
Figure 2 : Step-by-step execution of the MoE Tiebreak Leakage attack. More details are provided in Section 3.3 .

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.