Qwen3-4B Materials TR Methods
Collection
Qwen3-4B teacher-regularized RL method collection for the Materials dataset. Includes GRPO-TR, RLSD-TR, SDPO-TR, and SRPO-TR models. • 5 items • Updated
How to use SeongryongJung/Qwen3-4B-Material-RLSD-TR with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="SeongryongJung/Qwen3-4B-Material-RLSD-TR")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("SeongryongJung/Qwen3-4B-Material-RLSD-TR")
model = AutoModelForCausalLM.from_pretrained("SeongryongJung/Qwen3-4B-Material-RLSD-TR")
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 SeongryongJung/Qwen3-4B-Material-RLSD-TR with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "SeongryongJung/Qwen3-4B-Material-RLSD-TR"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "SeongryongJung/Qwen3-4B-Material-RLSD-TR",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/SeongryongJung/Qwen3-4B-Material-RLSD-TR
How to use SeongryongJung/Qwen3-4B-Material-RLSD-TR with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "SeongryongJung/Qwen3-4B-Material-RLSD-TR" \
--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": "SeongryongJung/Qwen3-4B-Material-RLSD-TR",
"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 "SeongryongJung/Qwen3-4B-Material-RLSD-TR" \
--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": "SeongryongJung/Qwen3-4B-Material-RLSD-TR",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use SeongryongJung/Qwen3-4B-Material-RLSD-TR with Docker Model Runner:
docker model run hf.co/SeongryongJung/Qwen3-4B-Material-RLSD-TR
This repository contains the Qwen3-4B material RLSD_TR batch-size-32 run.
The repository root contains the best validation checkpoint, selected by validation mean@16. checkpoints/last/ contains the final checkpoint.
| Dataset | Method | Base model | Train batch size | Best val mean@16 | Best checkpoint | Final val mean@16 | Final checkpoint |
|---|---|---|---|---|---|---|---|
| Material / SciKnowEval material | RLSD_TR | Qwen3-4B | 32 | 76.86% | 100 | 76.86% | 100 |
| step | val_mean16 | percent |
|---|---|---|
| 10 | 0.652925531915 | 65.29% |
| 20 | 0.701462765957 | 70.15% |
| 30 | 0.725398936170 | 72.54% |
| 40 | 0.742021276596 | 74.20% |
| 50 | 0.747340425532 | 74.73% |
| 60 | 0.760638297872 | 76.06% |
| 70 | 0.766622340426 | 76.66% |
| 80 | 0.757978723404 | 75.80% |
| 90 | 0.763962765957 | 76.40% |
| 100 | 0.768617021277 | 76.86% |
| Section | Parameter | Value | Source |
|---|---|---|---|
| Run identity | Base model |
Qwen/Qwen3-4B |
queue/script override |
| Run identity | Dataset |
Material / SciKnowEval material |
run_qwen3_generalization.sh |
| Run identity | Method |
RLSD_TR |
run_qwen3_generalization.sh |
| Run identity | Config |
rlsd |
run_qwen3_generalization.sh |
| Run identity | Experiment |
qwen3gen-material-RLSD_TR-Qwen-Qwen3-4B-mbs8-decay0-tr0.1-train32-rollout8-lr1e-6-vllm0.8 |
run_qwen3_generalization.sh |
| Run identity | W&B run |
run-20260702_135403-jd6eugui |
wandb |
| Data | Train file |
datasets/sciknoweval/material/train.parquet |
script override |
| Data | Validation file |
datasets/sciknoweval/material/test.parquet |
script override |
| Data | Train batch size |
32 |
queue/script override |
| Data | Train max samples |
3200 |
queue/script override |
| Schedule | Total training steps |
100 |
queue/script override |
| Schedule | Validation before train |
False |
queue/script override |
| Schedule | Save frequency |
10 |
queue/script override |
| Schedule | Validation frequency |
10 |
queue/script override |
| Sequence | Max prompt length |
2048 |
queue/script override |
| Sequence | Max response length |
8192 |
queue/script override |
| Sequence | Max model length |
10240 |
queue/script override |
| Rollout | Train rollout n |
8 |
queue/script override |
| Rollout | Validation rollout n |
16 |
queue/script override |
| Rollout | vLLM GPU memory utilization |
0.8 |
queue/script override |
| Optimization | Learning rate |
1e-6 |
RLSD_TR method override |
| Optimization | Weight decay |
0.01 |
script override |
| PPO/GRPO | PPO mini batch size |
8 |
queue/script override |
| PPO/GRPO | Normalize GRPO advantages by std |
False |
baseline_grpo.yaml / script override |
| Rollout correction | Importance sampling mode |
token |
script override |
| Rollout correction | IS threshold |
2.0 |
script override |
| Checkpoint/Logging | Checkpoint root |
checkpoints/datasets/sciknoweval/material/qwen3gen-material-RLSD_TR-Qwen-Qwen3-4B-mbs8-decay0-tr0.1-train32-rollout8-lr1e-6-vllm0.8 |
script override |
| Checkpoint/Logging | Latest checkpointed iteration |
100 |
latest_checkpointed_iteration.txt |
| Checkpoint/Logging | External actor archive |
checkpoints/datasets/sciknoweval/material/qwen3gen-material-RLSD_TR-Qwen-Qwen3-4B-mbs8-decay0-tr0.1-train32-rollout8-lr1e-6-vllm0.8/_actor_archive |
preserve_actor_checkpoints.py |
| Checkpoint/Logging | Logger |
console, wandb |
ppo_trainer.yaml |
| RLSD_TR | Policy loss mode |
rlsd |
method override |
| RLSD_TR | Teacher regularization |
trust-region |
method override |
| RLSD_TR | Trust-region mix / teacher update rate |
0.1 |
queue/script override |
| RLSD_TR | Token reweight lambda |
0.5 |
queue/script override |
| RLSD_TR | Token reweight eps_w |
0.2 |
queue/script override |
| RLSD_TR | Token reweight decay steps |
0 |
queue/script override |
| RLSD_TR | Fused kernels |
False |
method override |
Raw result and artifact files:
results/validation_mean16.csvresults/training_scores.csvresults/hyperparameters.csvresults/training_score.pngresults/training_score.svgartifacts/config.yamlartifacts/wandb-summary.jsonartifacts/wandb-metadata.jsonartifacts/output.logartifacts/queue.logfrom transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "SeongryongJung/Qwen3-4B-Material-RLSD-TR"
tokenizer = AutoTokenizer.from_pretrained(repo_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
repo_id,
torch_dtype="auto",
device_map="auto",
trust_remote_code=True,
)
checkpoints/datasets/sciknoweval/material/qwen3gen-material-RLSD_TR-Qwen-Qwen3-4B-mbs8-decay0-tr0.1-train32-rollout8-lr1e-6-vllm0.8checkpoints/datasets/sciknoweval/material/qwen3gen-material-RLSD_TR-Qwen-Qwen3-4B-mbs8-decay0-tr0.1-train32-rollout8-lr1e-6-vllm0.8/global_step_100/actorcheckpoints/datasets/sciknoweval/material/qwen3gen-material-RLSD_TR-Qwen-Qwen3-4B-mbs8-decay0-tr0.1-train32-rollout8-lr1e-6-vllm0.8/global_step_100/actorrun-20260702_135403-jd6euguiartifacts/queue.log