Instructions to use tomhu/RL4TG-Qwen3-8B-Direct-GRPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tomhu/RL4TG-Qwen3-8B-Direct-GRPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tomhu/RL4TG-Qwen3-8B-Direct-GRPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tomhu/RL4TG-Qwen3-8B-Direct-GRPO") model = AutoModelForCausalLM.from_pretrained("tomhu/RL4TG-Qwen3-8B-Direct-GRPO", 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 tomhu/RL4TG-Qwen3-8B-Direct-GRPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tomhu/RL4TG-Qwen3-8B-Direct-GRPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tomhu/RL4TG-Qwen3-8B-Direct-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tomhu/RL4TG-Qwen3-8B-Direct-GRPO
- SGLang
How to use tomhu/RL4TG-Qwen3-8B-Direct-GRPO 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 "tomhu/RL4TG-Qwen3-8B-Direct-GRPO" \ --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": "tomhu/RL4TG-Qwen3-8B-Direct-GRPO", "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 "tomhu/RL4TG-Qwen3-8B-Direct-GRPO" \ --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": "tomhu/RL4TG-Qwen3-8B-Direct-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tomhu/RL4TG-Qwen3-8B-Direct-GRPO with Docker Model Runner:
docker model run hf.co/tomhu/RL4TG-Qwen3-8B-Direct-GRPO
RL4TG Qwen3-8B Direct GRPO
This model starts directly from Qwen3-8B and is trained with mutation-aware GRPO for Java unit-test generation. The repository name intentionally does not encode an internal checkpoint number.
Training configuration
| Setting | Value |
|---|---|
| Starting policy | Qwen/Qwen3-8B |
| Training examples | 1,582 mutation-applicable Defects4J training samples |
| Algorithm | GRPO, no KL term in reward |
| Epochs | 2 |
| Actor optimization precision | FP32 |
| Learning rate | 1e-6 |
| Global prompt batch | 32 |
| Rollouts per prompt | 8 |
| PPO prompt groups / expanded mini batch | 4 / 32 |
| GPUs / per-GPU micro batch | 2 / 2 |
| Gradient accumulation | 8 |
| Parameter and optimizer offload | enabled |
| Temperature | 1.0 |
| Entropy coefficient | 0.01 |
| Maximum prompt/response length | 4096 / 4096 tokens |
| Data shuffle / seed | enabled / 42 |
| Chat template | enabled; Qwen thinking disabled |
The reward is -1 for an invalid generated test. A valid test receives
0.4 * line_coverage + 0.6 * branch_coverage + mutation_score. Mutation
analysis samples up to three eligible failing mutants per rollout, with a
mutation weight of 1.0. Coverage credit is gated by focal-call, assertion, and
local focal-data provenance checks.
Intended use
The model is intended for research on Java unit-test generation and reinforcement learning for software engineering. Generated tests must be compiled and executed in an isolated environment before use.
- Downloads last month
- 20