Instructions to use AI45Research/REX-Intern-S2-Cyber-F3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AI45Research/REX-Intern-S2-Cyber-F3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="AI45Research/REX-Intern-S2-Cyber-F3") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("AI45Research/REX-Intern-S2-Cyber-F3") model = AutoModelForMultimodalLM.from_pretrained("AI45Research/REX-Intern-S2-Cyber-F3", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AI45Research/REX-Intern-S2-Cyber-F3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AI45Research/REX-Intern-S2-Cyber-F3" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AI45Research/REX-Intern-S2-Cyber-F3", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/AI45Research/REX-Intern-S2-Cyber-F3
- SGLang
How to use AI45Research/REX-Intern-S2-Cyber-F3 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 "AI45Research/REX-Intern-S2-Cyber-F3" \ --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": "AI45Research/REX-Intern-S2-Cyber-F3", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "AI45Research/REX-Intern-S2-Cyber-F3" \ --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": "AI45Research/REX-Intern-S2-Cyber-F3", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use AI45Research/REX-Intern-S2-Cyber-F3 with Docker Model Runner:
docker model run hf.co/AI45Research/REX-Intern-S2-Cyber-F3
REX-Intern-S2-Cyber-F3
Paper | Code | Collection
A REX checkpoint of Intern-S2 with WMDP-Cyber knowledge relocated into 8 removable experts per MoE layer (264 experts in total). Excising these experts together with their router rows yields A3, a standard 256-expert model with that knowledge removed.
This repository holds the expanded checkpoint F3: the REX model after 250M tokens of standard full-parameter SFT, with the removable experts still attached. A3 differs from F3 only by excision.
Quick start
git clone https://github.com/AI45Lab/REX.git && cd REX
UV_PROJECT_ENVIRONMENT="$PWD/.venv-cpu" uv sync --project envs/cpu --locked
.venv-cpu/bin/hf download AI45Research/REX-Intern-S2-Cyber-F3 --local-dir ./F3
REX_VENV="$PWD/.venv-cpu" bash scripts/excise_experts.sh ./F3 ./A3
CPU only and about 1 min, with at least 16 GiB RAM. Disk: 70 GiB for F3 plus 69 GiB for A3.
./A3 must not exist beforehand, and expert_expansion_manifest.json must stay
in ./F3. Load ./A3 with the model class named in its config.json.
Intern-S2 ships a custom tokenizer; inspect it before enabling trust_remote_code.
Results
| Benchmark | F3 (before excision) | A3 (after excision) |
|---|---|---|
| WMDP-Bio | 83.58 ± 1.04 | 82.95 ± 1.05 |
| WMDP-Cyber (target) | 55.81 ± 1.11 | 29.79 ± 1.03 |
| MMLU | 84.05 ± 0.29 | 84.04 ± 0.29 |
| ARC-Challenge (25-shot) | 73.72 ± 1.29 | 73.72 ± 1.29 |
| HellaSwag (10-shot) | 84.65 ± 0.36 | 84.27 ± 0.36 |
| GSM8K (5-shot, strict) | 86.50 ± 0.94 | 85.60 ± 0.97 |
| IFEval (strict prompt) | 79.11 ± 1.75 | 76.16 ± 1.83 |
Scores in %, ± standard error. lm-eval 0.4.12 with vLLM 0.19.1; IFEval uses the chat template with thinking off. WMDP is 4-way multiple choice (chance = 25%). Comparisons with nine unlearning baselines are in the paper.
Notes
- Base model: an internal Intern-S2 base checkpoint (Qwen3.5 architecture, Intern tokenizer), not the published Intern-S2-Preview.
- Training data is not released.
run.jsonis the redacted training record of F3. - Only text capabilities were evaluated.
License and citation
Apache-2.0, Copyright 2026 Shanghai AI Laboratory. Upstream model and tokenizer
licenses also apply; see NOTICE.
@misc{jin2026rex,
title = {Towards Architectural-Level Safety Control: Relocating Hazardous Knowledge into Removable Experts in Mixture-of-Experts Models},
author = {Jin, Cheng and Ma, Zhongtian and Wang, Xiao and Qi, Han and Wen, Xiaoyu and Wang, Xiang and Sun, Youbang and Hu, Xia and Zhou, Bowen and Lu, Chaochao and Zhang, Qiaosheng},
year = {2026},
eprint = {2610.25791},
archivePrefix = {arXiv},
primaryClass = {cs.CR},
url = {https://arxiv.org/abs/2610.25791}
}
- Downloads last month
- 8