Run this model with HF Jobs
Run HuggingFaceBio/Carbon-3B on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/HuggingFaceBio/Carbon-3B. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/HuggingFaceBio/Carbon-3B on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/HuggingFaceBio/Carbon-3B. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/HuggingFaceBio/Carbon-3B. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use HuggingFaceBio/Carbon-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HuggingFaceBio/Carbon-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HuggingFaceBio/Carbon-3B")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("HuggingFaceBio/Carbon-3B") model = AutoModelForCausalLM.from_pretrained("HuggingFaceBio/Carbon-3B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HuggingFaceBio/Carbon-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HuggingFaceBio/Carbon-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceBio/Carbon-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/HuggingFaceBio/Carbon-3B
- SGLang
How to use HuggingFaceBio/Carbon-3B 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 "HuggingFaceBio/Carbon-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceBio/Carbon-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "HuggingFaceBio/Carbon-3B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceBio/Carbon-3B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use HuggingFaceBio/Carbon-3B with Docker Model Runner:
docker model run hf.co/HuggingFaceBio/Carbon-3B
Update README.md
Browse files206 unmodified lines2072082092102112122132142152162172182192202212222232242252262272282 unmodified lines23123223323423523623723850 unmodified lines289290291292293294206 unmodified lines### Downstream tasks| Category | Metric (%) | Carbon 3B | GENERator-v2 3B | Evo2 7B (1M) ||---|---|---|---|---|| Generative | SR eukaryote | **61.50** | 55.72 | <u>59.80</u> || Variant effect prediction | BRCA2 AUROC | **84.64** | 80.57 | <u>83.52</u> || | TraitGym Mendelian AUPRC by-chrom | <u>34.24</u> | 20.68 | **37.36** || | ClinVar coding AUROC, 48 kb | <u>93.30</u> | 91.98 | **93.70** || | ClinVar non-coding AUROC, 48 kb | **91.56** | <u>90.61</u> | 90.03 || Perturbation | TATA v2 | **65.94** | 49.82 | <u>63.78</u> || | SYN v2 | <u>82.78</u> | 74.08 | **84.90** |Carbon-3B is competitive with Evo2-7B while being much faster to run.> TODO: update TATA v2 and SYN v2 scores with the new results### Long-context retrieval (Genome-NIAH)[Genome-NIAH](https://huggingface.co/datasets/HuggingFaceBio/genome-niah) is a long context benchmark, inspired from NIAH and RULER benchmarks for English. The model needs to retrieves a random 24 bp VALUE planted in a real-genome haystack at one of five depths, evaluated at six context lengths from 24 kbp to 786 kbp. The benchmark contains 500 examples per (task, context) cell.Below are the scores on `niah`:| Context length | Carbon 3B 32k (native / YaRN 4Γ) | GENERator-v2 3B | Evo2-7B |2 unmodified lines| 32 k tokens (196 kbp) | 0.55 / 0.90 | β | 0.95 || 64 k tokens (393 kbp) | β / 0.79 | β | 0.80 |Sample sizes: Carbon & GENERator n=500. Evo2-7B n=150 at 16k, n=100 at 32k, n=20 at 64k due to the slow inference speed.> TODO: run more 64k samples for Evo2 7B- **4Γ longer effective context than Generator-v2-3B.** Generator-v2-3B caps at 16 k tokens (β 98 kbp). Carbon-3B has a native context of 32 k tokens (β 197 kbp) and extends to 65,536 tokens (β 393 kbp) at inference time with YaRN. It matches Generator-v2-3B on `niah` at 98 kbp.- **Matches Evo2-7B (1 M context) on `niah` at 393 kbp** (64 k tokens) under YaRN, despite being substantially smaller.50 unmodified lines## Limitations- **Primarily eukaryotic training.** Carbon-3B is trained mostly on eukaryotic genomic and transcript sequence; the pre-training mixture deliberately includes a smaller prokaryotic component (GTDB bacterial genomes) so that continual pre-training on prokaryotic data remains straightforward. Despite this modest prokaryotic share, we observed consistent gains on prokaryotic sequence recovery throughout training, and Carbon-3B already **matches [GENERator-v2-prokaryote-3B](https://huggingface.co/GenerTeam/GENERator-v2-prokaryote-3b-base)** β a model trained specifically on prokaryotes β on the prokaryote sequence-recovery split. We expect that a short continued-training phase on prokaryotic data would deliver substantially stronger prokaryote-specific performance.- **YaRN beyond 64 k tokens degrades.** YaRN reliably extends Carbon-3B to 65,536 tokens (β 393 kbp) at inference time with `factor=4`. Pushing further to 128 k tokens (β 786 kbp) causes retrieval quality to drop sharply in our long-context benchmarks.206 unmodified lines2072082092102112122132142152162172182192202212222232242252262272 unmodified lines23023123223323423523650 unmodified lines287288289290291292293206 unmodified lines### Downstream tasks| Category | Metric (%) | Carbon 3B | GENERator-v2 3B | Evo2 7B ||---|---|---|---|---|| Generative | Sequence Recovery eukaryote | **61.54** | 58.56 | <u>59.86</u> || Variant effect prediction | BRCA2 | **84.63** | 81.93 | <u>83.52</u> || | TraitGym Mendelian | <u>33.65</u> | 27.91 | **37.78** || | ClinVar coding (24 kb) | <u>92.89</u> | 91.55 | **93.33** || | ClinVar non-coding (24 kb) | **91.14** | <u>90.13</u> | 89.79 || Perturbation | Nucleotide triplet-expansion | <u>85.20</u> | 83.06 | **88.43** || | Synonymous codon | <u>88.89</u> | 87.03 | **91.59** |Carbon-3B is competitive with Evo2-7B while being much faster to run.### Long-context retrieval (Genome-NIAH)[Genomic-NIAH](https://huggingface.co/datasets/HuggingFaceBio/genomic-niah) is a long context benchmark, inspired from NIAH and RULER benchmarks for English. The model needs to retrieves a random 24 bp VALUE planted in a real-genome haystack at one of five depths, evaluated at six context lengths from 24 kbp to 786 kbp. The benchmark contains 500 examples per (task, context) cell.Below are the scores on `niah`:| Context length | Carbon 3B 32k (native / YaRN 4Γ) | GENERator-v2 3B | Evo2-7B |2 unmodified lines| 32 k tokens (196 kbp) | 0.55 / 0.90 | β | 0.95 || 64 k tokens (393 kbp) | β / 0.79 | β | 0.80 |Sample sizes: Carbon & GENERator n=500. Evo2-7B n=150 at 16k, n=100 at 32k, n=100 at 64k due to the slow inference speed.- **4Γ longer effective context than Generator-v2-3B.** Generator-v2-3B caps at 16 k tokens (β 98 kbp). Carbon-3B has a native context of 32 k tokens (β 197 kbp) and extends to 65,536 tokens (β 393 kbp) at inference time with YaRN. It matches Generator-v2-3B on `niah` at 98 kbp.- **Matches Evo2-7B (1 M context) on `niah` at 393 kbp** (64 k tokens) under YaRN, despite being substantially smaller.50 unmodified lines## Limitations- β οΈ **Genetic data is highly sensitive.** Depending on how this model is used (local download, inference API/endpoints, third-party inference providers, Spaces demos or others), input and output data may be processed or handled differently by different providers or space owners. Please make sure you understand and agree with how your data is handled before using the model.- **Primarily eukaryotic training.** Carbon-3B is trained mostly on eukaryotic genomic and transcript sequence; the pre-training mixture deliberately includes a smaller prokaryotic component (GTDB bacterial genomes) so that continual pre-training on prokaryotic data remains straightforward. Despite this modest prokaryotic share, we observed consistent gains on prokaryotic sequence recovery throughout training, and Carbon-3B already **matches [GENERator-v2-prokaryote-3B](https://huggingface.co/GenerTeam/GENERator-v2-prokaryote-3b-base)** β a model trained specifically on prokaryotes β on the prokaryote sequence-recovery split. We expect that a short continued-training phase on prokaryotic data would deliver substantially stronger prokaryote-specific performance.- **YaRN beyond 64 k tokens degrades.** YaRN reliably extends Carbon-3B to 65,536 tokens (β 393 kbp) at inference time with `factor=4`. Pushing further to 128 k tokens (β 786 kbp) causes retrieval quality to drop sharply in our long-context benchmarks.
README.md+12-13