Archilles' Heel in Semi-open LLMs: Hiding Bottom against Recovery Attacks

Hanbo Huang, Yihan Li, Bowen Jiang, Lin Liu, Ruoyu Sun, Zhuotao Liu, Shiyu Liang

Abstract

Privacy-sensitive users require deploying large language models (LLMs) within their own infrastructure (on-premises) to safeguard private data and enable customization. However, vulnerabilities in local environments can lead to unauthorized access and potential model theft. To address this, prior research on small models has explored securing only the output layer within hardware-secured devices to balance model confidentiality and customization. Yet this approach fails to protect LLMs effectively. In this paper, we discover that (1) query-based distillation attacks targeting the secured top layer can produce a functionally equivalent replica of the victim model; (2) securing the same number of layers, bottom layers before a transition layer provide stronger protection against distillation attacks than top layers, with comparable effects on customization performance; and (3) the number of secured layers creates a trade-off between protection and customization flexibility. Based on these insights, we propose SOLID, a novel deployment framework that secures a few bottom layers in a secure environment and introduces an efficient metric to optimize the trade-off by determining the ideal number of hidden layers. Extensive experiments on five models (1.3B to 70B parameters) demonstrate that SOLID outperforms baselines, achieving a better balance between protection and downstream customization.

Introduction

Deploying Large Language Models (LLMs) on-premises is a necessity for organizations in privacy-sensitive sectors like healthcare or law. While this ensures data remains local, it creates a significant security risk: model intellectual property (IP) theft via distillation attacks. In these scenarios, a malicious user queries the model and records its outputs to train a smaller "replica" that mimics the original's behavior.

Previous attempts to secure on-premises models often relied on Trusted Execution Environments (TEEs) to hide the entire model—which is computationally prohibitive—or hiding only the final output layer. As illustrated in Figure 1, securing only the top layer (the "Secure Last Only" baseline) fails to prevent attackers from creating a functionally equivalent replica, as the distilled model's performance remains nearly identical to the victim's across various reasoning and knowledge benchmarks.

Overview of the threat model and the failure of top-layer security in semi-open LLM deployment.

The SOLID Framework

To address these vulnerabilities, we introduce SOLID (Semi-Open Local Infrastructure Deployment). Our framework is built upon three core technical insights:

  1. The Bottom-Layer Advantage: We demonstrate that securing the initial layers of a transformer (those closest to the input) provides exponentially better protection than securing the final layers.
  2. Rank-One Degeneration: We provide theoretical and empirical evidence that securing bottom layers causes the distilled model's internal representations to collapse into "rank-one" matrices, effectively poisoning the attacker's ability to learn complex features.
  3. The Distillation Difficulty (DD) Metric: To avoid the high cost of testing every layer combination, we developed the DD metric. Using a Taylor expansion of the loss function, it predicts how difficult a model will be to distill based on which layers are hidden, allowing for an optimized security-performance balance.

Experimental Evaluation

SOLID was evaluated across five models ranging from 1.3B to 70B parameters. The researchers utilized extensive datasets to test both security and utility:

  • Attack Datasets: Combinations of MMLU and Alpaca 52k, scaled up to 500,000 samples to test defense robustness.
  • Customization Benchmarks: Domain-specific fine-tuning tasks including HumanEval (Code), GSM8K (Math), Medical MMLU, and LegalBench.
  • General Functionality: 16 standard benchmarks (e.g., PIQA, Hellaswag) to track the performance of the unauthorized replicas.

Results and Analysis

The most significant discovery is the impact of layer placement on security. As shown in Figure 6(a), securing layers at the beginning of the model (low placement index) results in a drastically lower Average Distillation Ratio (ADR), meaning the thief's model fails to replicate the victim. Conversely, securing top layers (high placement index) offers almost no protection.

The effect of secured layer placement and set size on distillation difficulty (ADR) and model accuracy (ACC).

Key findings include:

  • Superior Protection: On Llama2-70B, SOLID achieved an ADR of ~21%, providing security comparable to full-model encryption while only securing 1.25% to 6.25% of the parameters.
  • Customization Wins: Unlike noise-based defenses (like SAP-DP) that degrade model quality, SOLID allows for customization that is nearly identical to full-parameter fine-tuning. For instance, SOLID improved Law domain scores by 10% over existing baselines.
  • Scale-Proof Security: Even when attackers increased their query dataset by 10x, SOLID's protection remained stable, with only a negligible 0.5% increase in the distillation ratio.

Conclusion

SOLID effectively resolves the "catch-22" of on-premises LLM deployment by identifying the bottom layers as the model's true Achilles' heel for distillation attacks. By securing a tiny fraction of these foundation layers, vendors can protect their IP without sacrificing the customization flexibility required by end-users. Future work will focus on refining the DD metric for smaller models and addressing secondary threats like Membership Inference Attacks.

Summary updated

BibTeX
@misc{huang2024archilles,
  author = {Hanbo Huang and Yihan Li and Bowen Jiang and Lin Liu and Ruoyu Sun and Zhuotao Liu and Shiyu Liang},
  title = {{Archilles' Heel in Semi-open LLMs: Hiding Bottom against Recovery Attacks}},
  year = {2024},
  eprint = {2410.11182},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.11182},
}
Figure