Views
No views yet

| Model | # Total Params | Context Length | Variant | Download |
|---|---|---|---|---|
| salesforce/xgen-small-4B-base-r | 4B | 128k | Pre-trained | 🤗 Link |
| salesforce/xgen-small-4B-instruct-r | 4B | 128k | Post-trained | 🤗 Link |
| salesforce/xgen-small-9B-base-r | 9B | 128k | Pre-trained | 🤗 Link |
| salesforce/xgen-small-9B-instruct-r | 9B | 128k | Post-trained | 🤗 Link |
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_name = "Salesforce/xgen-small-9B-instruct-r"
5tokenizer = AutoTokenizer.from_pretrained(model_name)
6device = "cuda" if torch.cuda.is_available() else "cpu"
7model = AutoModelForCausalLM.from_pretrained(
8 model_name,
9 torch_dtype="auto"
10).to(device)
11
12prompt = "What is Salesforce?"
13messages = [{"role": "user", "content": prompt}]
14inputs = tokenizer.apply_chat_template(
15 messages,
16 add_generation_prompt=True,
17 return_tensors="pt"
18).to(model.device)
19
20generated = model.generate(inputs, max_new_tokens=128)
21output = tokenizer.decode(
22 generated[0],
23 skip_special_tokens=True,
24)
25print(output)| Category | Task | Llama 3.1-8B | Granite 3.3-8B | Qwen2.5-7B | xGen-small 9B Instruct |
|---|---|---|---|---|---|
| General Knowledge & Reasoning | MMLU | 68.3 | 62.7 | 72.4 | 72.4 |
| General Knowledge & Reasoning | MMLU-Pro | 43.2 | 43.5 | 56.7 | 57.3 |
| Chat | Arena-Hard-v1.0 | 28.9 | 30.5 | 48.1 | 60.1 |
| Chat | MT-Bench | 8.25 | 8.57 | 8.56 | 8.90 |
| Math & Science | GPQA | 31.9 | 35.3 | 32.6 | 45.8 |
| Math & Science | GSM8K | 84.2 | 89.4 | 91.9 | 95.3 |
| Math & Science | MATH | 48.9 | 70.9 | 74.6 | 91.6 |
| Math & Science | AIME 2024 | 6.7 | 10.0 | 6.7 | 50.0 |
| Coding | HumanEval+ | 61.6 | 65.9 | 74.4 | 78.7 |
| Coding | MBPP+ | 55.3 | 60.3 | 68.8 | 63.8 |
| Coding | LiveCodeBench | 10.3 | 10.3 | 12.1 | 50.6 |
1@misc{xgensmall,
2 title={xGen-small Technical Report},
3 author={Erik Nijkamp and Bo Pang and Egor Pakhomov and Akash Gokul and Jin Qu and Silvio Savarese and Yingbo Zhou and Caiming Xiong},
4 year={2025},
5 eprint={2505.06496},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2505.06496},
9}