README.md

May 11, 2026 ยท View on GitHub

๐ŸŽญ Multi-User Large Language Model Agents

arXiv HuggingFace Daily Paper Project Page License Python 3.10+

Stanford University ยท KAUST ยท University of Toronto ยท MIT

Official code for the paper: "Multi-User Large Language Model Agents"

LLM-based agents are increasingly capable of navigating complex environments, but prior work overwhelmingly assumes a single user with a single utility function. Real-world deployments involve multiple users with different roles, permissions, and preferences. Multi-User LLM provides a formal framework and benchmark to evaluate how LLM agents handle multi-user interactions.


๐Ÿ“‹ Overview

Multi-User LLM evaluates four fundamental capabilities of multi-user LLM agents:

CapabilityScenarioWhat It Tests
๐Ÿ” Privacy & Access ControlSecure Credential ManagementPermission enforcement, privacy-aware summarization, resistance to social engineering
๐Ÿ“… Sequential CoordinationMeeting SchedulingPreference elicitation, conflict resolution, scalable context management
โšก Resource OptimizationShared LLM Inference QueueFairness, queueing efficiency, incentive compatibility
๐Ÿ“ Instruction FollowingMulti-User InstructionsFollowing per-user constraints in multi-stakeholder settings

๐Ÿš€ Quick Start

Installation

git clone https://github.com/shuyhere/multi-user-llm.git
cd multi-user-llm
pip install -e .

Configuration

Create a .env file from the template:

cp .env.example .env

Edit .env with your API credentials:

# For OpenAI models
OPENAI_API_KEY=your-api-key-here
OPENAI_BASE_URL=https://api.openai.com/v1

# For Anthropic models
ANTHROPIC_API_KEY=your-api-key-here

# For other providers supported by LiteLLM
# See: https://docs.litellm.ai/docs/providers

Run a Scenario

python run.py \
    --scenario access_control \
    --data data/scenarios/access_control/test_datasets/controlled_exp_large/template_xml_attack_none_2_to_10_each_2.jsonl \
    --model gpt-4o-mini \
    --provider openai \
    --output results/ac_results.jsonl

Supported scenarios: access_control, meeting_scheduling, shared_queue, multiuser_instruction_following. See python run.py --help for all arguments.

๐Ÿ“Š Benchmark Datasets

All test data is in data/scenarios/. Each scenario provides ready-to-use JSONL files and a data builder script for generating custom datasets. See the data_builder/ directory under each scenario for details.

๐ŸŽ“ Training Multi-User LLM Agents

We provide a complete training pipeline for fine-tuning LLMs on multi-user conversations.

1. Generate Training Data

# Generate seed scenarios
python multiuser_llm_training/data_generation/scripts/generate_seeds.py

# Generate full conversations using a teacher model
python multiuser_llm_training/data_generation/scripts/generate_dataset.py

# Aggregate and format data
python multiuser_llm_training/data_generation/scripts/aggregate_data.py

2. Train

# Configure training paths in submit_training.sh, then:
sbatch multiuser_llm_training/training/submit_training.sh

# Or run directly
python multiuser_llm_training/training/train.py \
    --model_name_or_path <base-model> \
    --dataset_name <path-to-training-data> \
    --output_dir <output-dir>

3. Evaluate Trained Model

# Use vLLM provider with optional LoRA
python run.py \
    --scenario access_control \
    --data data/scenarios/access_control/test_datasets/controlled_exp_large/template_xml_attack_none_2_to_10_each_2.jsonl \
    --model <your-model-path> \
    --provider vllm \
    --lora-path <optional-lora-path> \
    --output results/trained_model_results.jsonl

๐Ÿ“ Project Structure

.
โ”œโ”€โ”€ run.py                  # Main entry point
โ”œโ”€โ”€ setup.py                # Package setup
โ”œโ”€โ”€ .env.example            # API credentials template
โ”œโ”€โ”€ LICENSE                 # Apache 2.0
โ”‚
โ”œโ”€โ”€ muses_bench/            # Core benchmark package
โ”‚   โ”œโ”€โ”€ core/               # User, Message, Context types
โ”‚   โ”œโ”€โ”€ agents/             # LLM agent + simulated users
โ”‚   โ”œโ”€โ”€ envs/               # Scenario environments
โ”‚   โ”œโ”€โ”€ evaluators/         # Scenario runners
โ”‚   โ”œโ”€โ”€ metrics/            # Metric computation
โ”‚   โ”œโ”€โ”€ tools/              # Tool interfaces
โ”‚   โ””โ”€โ”€ utils/              # Utilities
โ”‚
โ”œโ”€โ”€ data/                   # Benchmark data
โ”‚   โ””โ”€โ”€ scenarios/          # Per-scenario JSONL datasets + builders
โ”‚
โ”œโ”€โ”€ multiuser_llm_training/ # Training pipeline
โ”‚   โ”œโ”€โ”€ data_generation/    # Synthetic data generation
โ”‚   โ””โ”€โ”€ training/           # SFT training scripts
โ”‚
โ””โ”€โ”€ scripts/                # Batch evaluation helpers

๐Ÿ“„ License

This project is licensed under the Apache License 2.0.

๐Ÿ“ Citation

@article{yang2026multi,
  title={Multi-User Large Language Model Agents},
  author={Yang, Shu and Zhu, Shenzhe and Zhu, Hao and Enr{\'\i}quez, Jos{\'e} Ram{\'o}n and Wang, Di and Pentland, Alex and Bakker, Michiel A and Pei, Jiaxin},
  journal={arXiv preprint arXiv:2604.08567},
  year={2026}
}