Text Generation
Transformers
Safetensors
gemma2
alienlm
alien-adaptation-training
tokenizer-bijection
instruction-tuned
conversational
text-generation-inference
Instructions to use dsba-lab/gemma2-9b-it-random-bijection with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dsba-lab/gemma2-9b-it-random-bijection with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dsba-lab/gemma2-9b-it-random-bijection") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dsba-lab/gemma2-9b-it-random-bijection") model = AutoModelForCausalLM.from_pretrained("dsba-lab/gemma2-9b-it-random-bijection", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use dsba-lab/gemma2-9b-it-random-bijection with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dsba-lab/gemma2-9b-it-random-bijection" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dsba-lab/gemma2-9b-it-random-bijection", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/dsba-lab/gemma2-9b-it-random-bijection
- SGLang
How to use dsba-lab/gemma2-9b-it-random-bijection with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "dsba-lab/gemma2-9b-it-random-bijection" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dsba-lab/gemma2-9b-it-random-bijection", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "dsba-lab/gemma2-9b-it-random-bijection" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dsba-lab/gemma2-9b-it-random-bijection", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use dsba-lab/gemma2-9b-it-random-bijection with Docker Model Runner:
docker model run hf.co/dsba-lab/gemma2-9b-it-random-bijection
| library_name: transformers | |
| pipeline_tag: text-generation | |
| tags: | |
| - alienlm | |
| - alien-adaptation-training | |
| - tokenizer-bijection | |
| - instruction-tuned | |
| datasets: | |
| - Magpie-Align/Magpie-Pro-300K-Filtered | |
| - Magpie-Align/Magpie-Reasoning-V1-150K | |
| model-index: | |
| - name: Gemma 2 9B IT Random Bijection | |
| results: [] | |
| license: gemma | |
| base_model: google/gemma-2-9b-it | |
| # Gemma 2 9B IT Random Bijection | |
| This repository contains the `Gemma 2 9B IT Random Bijection` weights used in the AlienLM experiments. | |
| AlienLM is a client-side text obfuscation approach for black-box LLM APIs: it maps natural text into an alienized | |
| token space, adapts the model with AAT, and recovers text on the client side. | |
| Links: | |
| - Lab: [DSBA Lab](https://huggingface.co/dsba-lab) | |
| - Paper: [arXiv](https://arxiv.org/abs/2601.22710) | |
| - Official repo: [KimJaehee0725/AlienLM](https://github.com/KimJaehee0725/AlienLM) | |
| ## Model Table | |
| | Uploaded model | Base model | Description | HF Models | | |
| |---|---|---|---| | |
| | Gemma 2 9B IT AlienLM Full | Gemma 2 9B IT | Full AlienLM adaptation | [dsba-lab/gemma2-9b-it-alienlm-full](https://huggingface.co/dsba-lab/gemma2-9b-it-alienlm-full) | | |
| | Gemma 2 9B IT Random Bijection | Gemma 2 9B IT | Random bijection baseline | [dsba-lab/gemma2-9b-it-random-bijection](https://huggingface.co/dsba-lab/gemma2-9b-it-random-bijection) | | |
| | Llama 3 8B Instruct AlienLM Full | Llama 3 8B Instruct | Full AlienLM adaptation | [dsba-lab/llama3-8b-instruct-alienlm-full](https://huggingface.co/dsba-lab/llama3-8b-instruct-alienlm-full) | | |
| | Llama 3 8B Instruct AlienLM Ratio 20 | Llama 3 8B Instruct | Partial alienization ratio 20 | [dsba-lab/llama3-8b-instruct-alienlm-ratio-20](https://huggingface.co/dsba-lab/llama3-8b-instruct-alienlm-ratio-20) | | |
| | Llama 3 8B Instruct AlienLM Ratio 40 | Llama 3 8B Instruct | Partial alienization ratio 40 | [dsba-lab/llama3-8b-instruct-alienlm-ratio-40](https://huggingface.co/dsba-lab/llama3-8b-instruct-alienlm-ratio-40) | | |
| | Llama 3 8B Instruct AlienLM Ratio 60 | Llama 3 8B Instruct | Partial alienization ratio 60 | [dsba-lab/llama3-8b-instruct-alienlm-ratio-60](https://huggingface.co/dsba-lab/llama3-8b-instruct-alienlm-ratio-60) | | |
| | Llama 3 8B Instruct AlienLM Ratio 80 | Llama 3 8B Instruct | Partial alienization ratio 80 | [dsba-lab/llama3-8b-instruct-alienlm-ratio-80](https://huggingface.co/dsba-lab/llama3-8b-instruct-alienlm-ratio-80) | | |
| | Llama 3 8B Instruct Random Bijection | Llama 3 8B Instruct | Random bijection baseline | [dsba-lab/llama3-8b-instruct-random-bijection](https://huggingface.co/dsba-lab/llama3-8b-instruct-random-bijection) | | |
| | Qwen 2.5 14B Instruct AlienLM Full | Qwen2.5 14B Instruct | Full AlienLM adaptation | [dsba-lab/qwen25-14b-instruct-alienlm-full](https://huggingface.co/dsba-lab/qwen25-14b-instruct-alienlm-full) | | |
| | Qwen 2.5 14B Instruct Random Bijection | Qwen2.5 14B Instruct | Random bijection baseline | [dsba-lab/qwen25-14b-instruct-random-bijection](https://huggingface.co/dsba-lab/qwen25-14b-instruct-random-bijection) | | |
| | Qwen 2.5 7B Instruct AlienLM Full | Qwen2.5 7B Instruct | Full AlienLM adaptation | [dsba-lab/qwen25-7b-instruct-alienlm-full](https://huggingface.co/dsba-lab/qwen25-7b-instruct-alienlm-full) | | |
| | Qwen 2.5 7B Instruct Random Bijection | Qwen2.5 7B Instruct | Random bijection baseline | [dsba-lab/qwen25-7b-instruct-random-bijection](https://huggingface.co/dsba-lab/qwen25-7b-instruct-random-bijection) | | |
| ## Example | |
| <table> | |
| <tr> | |
| <th>Natural text</th> | |
| <th>Alien text</th> | |
| </tr> | |
| <tr> | |
| <td><pre>All happy families are alike; each unhappy family is unhappy in its own way.</pre></td> | |
| <td><pre> Dhaka בגCLS patriot Dude ブラウンanova 교neti estufa 교ಟ FestivalsDocumentation bekanntenroquia</pre></td> | |
| </tr> | |
| <tr> | |
| <th>Original token IDs</th> | |
| <th>Alien token IDs</th> | |
| </tr> | |
| <tr> | |
| <td><pre>[2430, 4915, 9160, 708, 28368, 235289, 1853, 42056, 2730, 603, 42056, 575, 1277, 1997, 1703, 235265]</pre></td> | |
| <td><pre>[118082, 85241, 174135, 184646, 114599, 58746, 48064, 71689, 147487, 81724, 71689, 163116, 23867, 77693, 75944, 217666]</pre></td> | |
| </tr> | |
| </table> | |
| ## Variant | |
| - Variant: Random bijection baseline, seed 42 | |
| - Base model: `Gemma 2 9B IT` | |
| - Upload source: `/data2/AlienLM/outputs/Gemma2-9b-it-random42` | |
| - Tokenizer check: The local tokenizer produced different token IDs from the base tokenizer for the test sentence. Base tokenizer ids: [2430, 4915, 9160, 708, 28368, 235289, 1853, 42056, 2730, 603, 42056, 575, 1277, 1997, 1703, 235265] | |
| ## Notes | |
| - Served files only: weights, config, tokenizer, and README. | |
| - Training checkpoints and optimizer artifacts are excluded. | |
| - Intended for research evaluation, not production privacy guarantees. | |
| ## BibTeX | |
| ```bibtex | |
| @article{kim2026alienlm, | |
| title={AlienLM: Alienization of Language for API-Boundary Privacy in Black-Box LLMs}, | |
| author={Kim, Jaehee and Kang, Pilsung}, | |
| journal={arXiv preprint arXiv:2601.22710}, | |
| year={2026} | |
| } | |
| ``` | |