Anthropic/hh-rlhf
Viewer • Updated • 169k • 34.2k • 1.93k
How to use W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337")
model = AutoModelForCausalLM.from_pretrained("W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337", 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]:]))How to use W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337
How to use W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337" \
--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": "W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337" \
--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": "W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337 with Docker Model Runner:
docker model run hf.co/W-61/llama-3-8b-base-margin-dpo-hh-harmless-4xh200-batch-64-20260417-222337
This model is a fine-tuned version of llama-3-8b-base-sft-hh-harmless-4xh200-batch-64 on the Anthropic/hh-rlhf dataset. It achieves the following results on the evaluation set:
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Margin Dpo/beta | Margin Dpo/loss Margin Mean | Margin Dpo/beta Margin Mean | Margin Dpo/beta Margin Std | Margin Dpo/beta Margin Grad Mean | Margin Dpo/beta Margin Grad Std | Margin Dpo/margin Mean | Margin Dpo/margin Std | Logps/chosen | Logps/rejected | Logps/ref Chosen | Logps/ref Rejected | Logits/chosen | Logits/rejected |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1.3344 | 0.1512 | 100 | 0.6553 | 0.1000 | 1.4293 | 0.1429 | 0.4977 | -0.4668 | 0.1122 | 1.4293 | 4.9768 | -79.7080 | -85.8269 | -74.8595 | -79.5490 | 0.2576 | 0.2201 |
| 0.9172 | 0.3023 | 200 | 0.5443 | 0.1000 | 7.4892 | 0.7489 | 1.2567 | -0.3638 | 0.2218 | 7.4892 | 12.5667 | -86.6174 | -98.7961 | -74.8595 | -79.5490 | 0.3528 | 0.3042 |
| 0.9647 | 0.4535 | 300 | 0.5349 | 0.1000 | 9.3620 | 0.9362 | 1.4964 | -0.3434 | 0.2418 | 9.3620 | 14.9643 | -93.1728 | -107.2244 | -74.8595 | -79.5490 | 0.4092 | 0.3577 |
| 1.0864 | 0.6047 | 400 | 0.5335 | 0.1000 | 8.8675 | 0.8867 | 1.4359 | -0.3489 | 0.2335 | 8.8675 | 14.3590 | -91.3162 | -104.8732 | -74.8595 | -79.5490 | 0.3888 | 0.3372 |
| 1.0094 | 0.7559 | 500 | 0.5270 | 0.1000 | 9.5291 | 0.9529 | 1.5070 | -0.3422 | 0.2379 | 9.5291 | 15.0704 | -92.2392 | -106.4577 | -74.8595 | -79.5490 | 0.3944 | 0.3425 |
| 1.0508 | 0.9070 | 600 | 0.5256 | 0.1000 | 9.3760 | 0.9376 | 1.4808 | -0.3434 | 0.2353 | 9.3760 | 14.8082 | -92.1130 | -106.1785 | -74.8595 | -79.5490 | 0.3868 | 0.3352 |