CoolFace
Modelpublic

Salesforce/xgen-small-9B-instruct-r

sourceHugging Facecc-by-nc-4.0updated 1y agoView on Hugging Face
11likes66downloads
Model Card

Welcome to the xGen-small family!

xGen-small (blog, arXiv) is an enterprise-ready compact LM that combines domain-focused data curation, scalable pre-training, length-extension, and RL fine-tuning to deliver long-context performance at predictable, low cost. This model release is for research purposes only.

<p align="center"> <img width="60%" src="https://huggingface.co/Salesforce/xgen-small/resolve/main/xgen-small.png?download=true"> </p>

Model Series

xGen-small comes in two sizes (4B and 9B) with two variants (pre-trained and post-trained):

Model# Total ParamsContext LengthVariantDownload
salesforce/xgen-small-4B-base-r4B128kPre-trained๐Ÿค— Link
salesforce/xgen-small-4B-instruct-r4B128kPost-trained๐Ÿค— Link
salesforce/xgen-small-9B-base-r9B128kPre-trained๐Ÿค— Link
salesforce/xgen-small-9B-instruct-r9B128kPost-trained๐Ÿค— Link

Usage

python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "Salesforce/xgen-small-9B-instruct-r"
tokenizer = AutoTokenizer.from_pretrained(model_name)
device = "cuda" if torch.cuda.is_available() else "cpu"
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto"
).to(device)

prompt = "What is Salesforce?"
messages = [{"role": "user", "content": prompt}]
inputs = tokenizer.apply_chat_template(
    messages,
    add_generation_prompt=True,
    return_tensors="pt"
).to(model.device)

generated = model.generate(inputs, max_new_tokens=128)
output = tokenizer.decode(
    generated[0],
    skip_special_tokens=True,
)
print(output)

Evaluation

CategoryTaskLlama 3.1-8BGranite 3.3-8BQwen2.5-7BxGen-small 9B Instruct
General Knowledge & ReasoningMMLU68.362.772.472.4
General Knowledge & ReasoningMMLU-Pro43.243.556.757.3
ChatArena-Hard-v1.028.930.548.160.1
ChatMT-Bench8.258.578.568.90
Math & ScienceGPQA31.935.332.645.8
Math & ScienceGSM8K84.289.491.995.3
Math & ScienceMATH48.970.974.691.6
Math & ScienceAIME 20246.710.06.750.0
CodingHumanEval+61.665.974.478.7
CodingMBPP+55.360.368.863.8
CodingLiveCodeBench10.310.312.150.6

Citation

bibtex
@misc{xgensmall,
      title={xGen-small Technical Report}, 
      author={Erik Nijkamp and Bo Pang and Egor Pakhomov and Akash Gokul and Jin Qu and Silvio Savarese and Yingbo Zhou and Caiming Xiong},
      year={2025},
      eprint={2505.06496},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2505.06496}, 
}

Ethical Considerations

This release is for research purposes only in support of an academic paper. Our models, datasets, and code are not specifically designed or evaluated for all downstream purposes. We strongly recommend users evaluate and address potential concerns related to accuracy, safety, and fairness before deploying this model. We encourage users to consider the common limitations of AI, comply with applicable laws, and leverage best practices when selecting use cases, particularly for high-risk scenarios where errors or misuse could significantly impact people's lives, rights, or safety. For further guidance on use cases, refer to our AUP and AI AUP.

Model Licenses

The models are being released under CC-BY-NC-4.0, Copyright ยฉ Salesforce, Inc. All Rights Reserved.