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

huggingface.co
Total runs: 392
24-hour runs: 0
7-day runs: -18
30-day runs: -18
Model's Last Updated: May 13 2025
text-generation

Introduction of xgen-small-4B-instruct-r

Model Details of xgen-small-4B-instruct-r

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.

Model Series

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

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
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "Salesforce/xgen-small-4B-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
Category Task Llama 3.2-3B Gemma 3-4B Qwen2.5-3B xGen-small 4B Instruct
General Knowledge & Reasoning MMLU 61.8 56.0 65.3 61.4
General Knowledge & Reasoning MMLU-Pro 31.4 34.4 33.3 43.6
Chat Arena-Hard-v1.0 14.7 57.6 26.9 34.2
Chat MT-Bench 7.81 8.29 7.93 8.05
Math & Science GPQA 29.7 31.5 31.9 35.9
Math & Science GSM8K 72.3 90.7 86.3 92.0
Math & Science MATH 44.6 73.7 67.3 83.8
Math & Science AIME 2024 3.3 10.0 10.0 30.0
Coding HumanEval+ 48.8 63.4 67.7 74.4
Coding MBPP+ 52.1 66.9 61.9 52.6
Coding LiveCodeBench 7.4 13.6 10.1 32.6
Citation
@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.

Runs of Salesforce xgen-small-4B-instruct-r on huggingface.co

392
Total runs
0
24-hour runs
35
3-day runs
-18
7-day runs
-18
30-day runs

More Information About xgen-small-4B-instruct-r huggingface.co Model

More xgen-small-4B-instruct-r license Visit here:

https://choosealicense.com/licenses/cc-by-nc-4.0

xgen-small-4B-instruct-r huggingface.co

xgen-small-4B-instruct-r huggingface.co is an AI model on huggingface.co that provides xgen-small-4B-instruct-r's model effect (), which can be used instantly with this Salesforce xgen-small-4B-instruct-r model. huggingface.co supports a free trial of the xgen-small-4B-instruct-r model, and also provides paid use of the xgen-small-4B-instruct-r. Support call xgen-small-4B-instruct-r model through api, including Node.js, Python, http.

xgen-small-4B-instruct-r huggingface.co Url

https://huggingface.co/Salesforce/xgen-small-4B-instruct-r

Salesforce xgen-small-4B-instruct-r online free

xgen-small-4B-instruct-r huggingface.co is an online trial and call api platform, which integrates xgen-small-4B-instruct-r's modeling effects, including api services, and provides a free online trial of xgen-small-4B-instruct-r, you can try xgen-small-4B-instruct-r online for free by clicking the link below.

Salesforce xgen-small-4B-instruct-r online free url in huggingface.co:

https://huggingface.co/Salesforce/xgen-small-4B-instruct-r

xgen-small-4B-instruct-r install

xgen-small-4B-instruct-r is an open source model from GitHub that offers a free installation service, and any user can find xgen-small-4B-instruct-r on GitHub to install. At the same time, huggingface.co provides the effect of xgen-small-4B-instruct-r install, users can directly use xgen-small-4B-instruct-r installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

xgen-small-4B-instruct-r install url in huggingface.co:

https://huggingface.co/Salesforce/xgen-small-4B-instruct-r

Url of xgen-small-4B-instruct-r

xgen-small-4B-instruct-r huggingface.co Url

Provider of xgen-small-4B-instruct-r huggingface.co

Salesforce
ORGANIZATIONS

Other API from Salesforce

huggingface.co

Total runs: 115.3K
Run Growth: 20.1K
Growth Rate: 17.40%
Updated:February 03 2025
huggingface.co

Total runs: 80.1K
Run Growth: 80.0K
Growth Rate: 99.89%
Updated:April 12 2025
huggingface.co

Total runs: 1.5K
Run Growth: 1.4K
Growth Rate: 92.00%
Updated:January 21 2025
huggingface.co

Total runs: 250
Run Growth: -278
Growth Rate: -111.20%
Updated:January 15 2025
huggingface.co

Total runs: 150
Run Growth: -3
Growth Rate: -2.00%
Updated:November 05 2025
huggingface.co

Total runs: 146
Run Growth: -4.9K
Growth Rate: -3350.68%
Updated:October 04 2025