SecureLLM: Using Compositionality to Build Provably Secure Language Models for Private, Sensitive, and Secret Data

Abdulrahman Alabdulakreem, Christian M. Arnold, Yerim Lee, Pieter M. Feenstra, Boris Katz, Andrei BarbuarXiv 2024 · DOI

Introduction

Large Language Models (LLMs) are increasingly integrated into enterprise environments where they handle a mix of public, private, and highly sensitive data. However, traditional LLM training methods—where all data is compressed into a single set of weights—create significant security risks. This paper introduces SecureLLM, a framework designed to bring robust access-control security to LLMs by rethinking their architecture as a composition of isolated "information silos."

The Challenge of LLM Data Leakage

LLMs are inherently "leaky." When a single model is trained on a heterogeneous dataset containing both public and secret information, it becomes vulnerable to prompt injection or membership inference attacks. Traditional security relies on physical or logical isolation; if a user lacks the credentials for a specific database, they simply cannot access it. In contrast, LLMs typically merge all "files" into a monolithic model, making it difficult to guarantee that a user won't inadvertently (or maliciously) extract unauthorized data.

The authors identify a critical gap: how can we provide users access to specific subsets of data silos (such as private APIs or sensitive documents) and allow the model to reason across them without the prohibitive cost of training an exponential number of models for every possible permission combination?

The SecureLLM Framework

SecureLLM addresses this by proposing a compositional approach to model security. Instead of one large model, the system utilizes a base model augmented by specialized adapters.

The SecureLLM architecture: Information silos are fine-tuned into separate adapters and composed at inference based on user permissions.

The framework operates in three stages:

  1. Siloed Fine-tuning: For every distinct information silo (e.g., a specific SQL database), a dedicated LoRA (Low-Rank Adapter) is trained. This adapter captures only the knowledge specific to that silo.
  2. Dynamic Composition: At runtime, the system verifies the user's permissions and dynamically "plugs in" only the authorized LoRAs to a base model, such as Llama-2-7B. Because unauthorized weights are never loaded into the inference session, data leakage is mathematically prevented.
  3. Advanced Composition Operators: The authors found that simple weight summation (like LoraHub) fails on complex logic tasks. They introduced Logit Composition, where the model runs independent forward passes for each permitted adapter and selects the maximum logit value for each token. This ensures the most "confident" silo-specific knowledge drives the final output.

Benchmarking with NL-to-SQL

To evaluate SecureLLM, the authors developed a rigorous natural-language-to-SQL (NL-to-SQL) benchmark. This task is ideal for testing security because it requires precise understanding of database schemas. The datasets included:

  • CFG-Generated Dataset: 100,000 pairs of questions and SQL queries per silo, generated via a custom Context-Free Grammar to ensure structural variety.
  • ChatGPT-4 Paraphrased Set: 300 realistic, human-like queries per silo to test generalization.
  • Obfuscated Dataset: A stress test where schema names are replaced with random words (e.g., "sloth" instead of "teacher_id"), forcing the model to rely on learned logic rather than semantic guessing.

Results and Analysis

The performance was measured using Normalized Tree Edit Distance, where a lower score indicates a generated SQL structure closer to the ground truth.

Performance comparison on CFG-generated data using Normalized Tree Edit Distance (lower is better).

SecureLLM (using Logit Composition) demonstrated significant improvements over existing methods. On the CFG-generated data, it achieved a tree edit distance of 0.21, vastly outperforming LoraHub (1.88) and PEM Addition (0.78). Notably, SecureLLM often outperformed a "Generalized Baseline" trained on all silos simultaneously, suggesting that isolating knowledge into silos reduces cross-schema confusion.

The framework also proved robust under extreme conditions. On the Obfuscated dataset, SecureLLM maintained a high performance level (0.36 edit distance), whereas other composition methods failed to produce usable SQL code.

Conclusion and Future Work

SecureLLM demonstrates that security does not have to be a post-hoc safety filter; it can be baked into the model's structural design. By ensuring that sensitive weights are physically absent from unauthorized sessions, the framework provides provable security.

While highly effective, the current implementation of Logit Composition introduces computational overhead by requiring multiple forward passes. Future work will focus on optimizing this process for environments with hundreds of silos and exploring "negative adapters" to explicitly suppress specific topics or behaviors inherited from the base model's pre-training.

Summary updated

BibTeX
@misc{alabdulakreem2024securellm,
  author = {Abdulrahman Alabdulakreem and Christian M. Arnold and Yerim Lee and Pieter M. Feenstra and Boris Katz and Andrei Barbu},
  title = {{SecureLLM: Using Compositionality to Build Provably Secure Language Models for Private, Sensitive, and Secret Data}},
  year = {2024},
  eprint = {2405.09805},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.09805},
}
Figure