Text Generation
Transformers
Safetensors
English
llama
model-raising
synthetic-persona-pretraining
spp
alignment
safety
conversational
text-generation-inference
Instructions to use epfl-dlab/spp-mt-3b-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use epfl-dlab/spp-mt-3b-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="epfl-dlab/spp-mt-3b-base") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("epfl-dlab/spp-mt-3b-base") model = AutoModelForCausalLM.from_pretrained("epfl-dlab/spp-mt-3b-base", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use epfl-dlab/spp-mt-3b-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "epfl-dlab/spp-mt-3b-base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "epfl-dlab/spp-mt-3b-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/epfl-dlab/spp-mt-3b-base
- SGLang
How to use epfl-dlab/spp-mt-3b-base 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 "epfl-dlab/spp-mt-3b-base" \ --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": "epfl-dlab/spp-mt-3b-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "epfl-dlab/spp-mt-3b-base" \ --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": "epfl-dlab/spp-mt-3b-base", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use epfl-dlab/spp-mt-3b-base with Docker Model Runner:
docker model run hf.co/epfl-dlab/spp-mt-3b-base
File size: 3,286 Bytes
074a96a d9d5214 074a96a 3fbb4a6 074a96a 3ee605a 074a96a eacbb26 6b79330 eacbb26 54d4d7a eacbb26 54d4d7a 6b79330 54d4d7a eacbb26 6b79330 eacbb26 074a96a 57ecf15 074a96a d9d5214 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | ---
license: other
language:
- en
library_name: transformers
pipeline_tag: text-generation
tags:
- model-raising
- synthetic-persona-pretraining
- spp
- alignment
- safety
---
# SPP-MT — Base (3B)
**Type:** base (pretrained) model. Not instruction-tuned and ships no chat template.
The Vanilla model receives the same reflection-focused midtraining stage as SPP-T0-MT, so SPP reflections are introduced only at midtraining and never during the main pretraining run.
## Synthetic Persona Pretraining (SPP)
**Synthetic Persona Pretraining (SPP)** installs a target value persona during pretraining rather than only during alignment. Value-laden, first-person reflections, generated against a constitution, are appended to a subset of pretraining documents after a special `<assistant>` token. Attention masking and RoPE position aliasing keep the reflection from changing the continuation of the original document. This model is trained with SPP.
Instruction-tuned counterpart: [`epfl-dlab/spp-mt-3b-instruct`](https://huggingface.co/epfl-dlab/spp-mt-3b-instruct).
## Model details
- **Architecture:** Llama-3.2-3B-shaped, trained from scratch.
- **Tokenizer:** the SmolLM2 tokenizer extended with an `<assistant>` marker and constitution tokens (vocabulary 49280).
- **Pretraining:** ~500B tokens on a subset of the Olmo 3 Dolma 3 mixture; SPP reflections are applied only during a subsequent reflection-focused midtraining stage, on the safety-annotated documents.
## Training checkpoints
Intermediate checkpoints are published as git revisions on this repo, so any point in the trajectory can be loaded by passing `revision=`:
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
repo = "epfl-dlab/spp-mt-3b-base"
tok = AutoTokenizer.from_pretrained(repo) # identical at every revision
model = AutoModelForCausalLM.from_pretrained(
repo, revision="step-0", dtype=torch.bfloat16, device_map="auto"
)
```
| Revision | Midtraining step | LR phase |
|---|---|---|
| `step-0` | 0 / 72,895 | — (init from `spp-vanilla-3b-base` step 225,000) |
| `step-25000` | 25,000 / 72,895 | linear decay |
| `step-50000` | 50,000 / 72,895 | linear decay |
| `step-72895` | 72,895 / 72,895 | linear decay — same weights as `main` |
`main` always holds the finished model (step 72,895).
Only model weights are published — optimizer and RNG state are not included, so these revisions support evaluation, probing, and fine-tuning, but not exact resumption of the original run.
Steps are counted from the start of **midtraining**. Midtraining resumed from pretraining step 225,000, so the earlier part of this model's history is the pretraining trajectory in [`epfl-dlab/spp-vanilla-3b-base`](https://huggingface.co/epfl-dlab/spp-vanilla-3b-base) (revisions `step-25000` … `step-225000`). Those checkpoints are shared and are not duplicated here; `step-0` is the exact fork point.
## Intended use
Research on alignment and safety. As a base model it is meant for continuation, probing, or further fine-tuning; it is not instruction-tuned and can produce incorrect or unsafe content.
## Links
- Paper: _to be released_
- Collection: https://huggingface.co/collections/epfl-dlab/spp-synthetic-persona-pretraining
_License: to be finalised._
|