LoRA adapters for the extracted text decoder. Root is selected RL step 100; sft-baseline/, grpo-step010/, and grpo-step050/ preserve comparison checkpoints. These are not drop-in adapters for the upstream multimodal wrapper. Use the included text_decoder.load_text_model on a pinned upstream snapshot before PeftModel.from_pretrained.
A 10-step supervised warm-up on 39 accepted recipes (nod, left tilt, upward look), followed by 100 GRPO updates across 320 tasks / ten families. Eight A100 40 GB GPUs, BF16, rank-16 LoRA, four candidates per group, two paired generator seeds, 3,200 sampled RL completions. The flow generator is frozen. Checkpoints at steps 10/50/100 were selected on dev joint success; the final checkpoint won before the test was opened. SFT screening considered 3,840 candidates from bounded seed recipes and an earlier base-planner candidate pool.
Reward adds 2 for useful motion and 2 more for useful motion whose raw and played paths pass safety. Bounded penalties cover clearance, pose/rate limits, IK, downward pitch, delay stress, controller distortion and duration. Invalid recipes score -10. Two generator draws are aggregated as half their mean plus half their minimum. Upstream IK projection is omitted before scoring.
| Frozen test metric | Base | SFT | GRPO adapter | Merged BF16 model |
|---|---|---|---|---|
| Useful and safe before correction | 5.00% | 35.00% | 52.50% | 50.62% |
| Raw path safe | 5.00% | 46.25% | 83.12% | 80.00% |
| Played gesture predicate | 84.38% | 84.38% | 66.88% | 68.12% |
80 held-out tasks, two paired generator draws each. RL-minus-SFT joint success: 17.50 percentage points; paired, family-stratified bootstrap 95% interval [11.88, 23.12]. Correct-minus-permuted starting pose for the RL adapter: -0.62 points, interval [-5.62, 3.75].
This ablation does not establish a benefit from the correct starting pose in this pilot.
This is a numerical research pilot, not a robot-ready safety guarantee. Runtime guards remain required. The safety gain comes with lower gesture success. Metrics use the frozen flow generator, kinematics, clearance/rate checks and numerical playback; no physical robot was tested. The useful-and-safe metric requires the gesture before and after playback, duration <=8 seconds, and both raw and played safety. Primary played-path safety is 100% in all arms because existing guards correct trajectories.
Starting states are settled and mild: roll +/-4 degrees, pitch -7 to +2, body +/-10, head/body yaw offset +/-3, and zero translations. No velocity, interruption, arbitrary reachable-state coverage, human-rated naturalness or unseen gesture-family evaluation is included. Ten known gesture families have separate train/dev/test wording and poses. Confidence intervals condition on one training seed, the fixed policies, this state distribution and two fixed test generator seeds. Once public, these splits should be treated as a reproduction benchmark, not an unseen test for further development.
Model: https://huggingface.co/diwank/reachy-mini-motion-planner-4b-safety-grpo-20261116
Adapters: https://huggingface.co/diwank/reachy-mini-motion-planner-4b-safety-lora-20261116
Dataset: https://huggingface.co/datasets/diwank/reachy-mini-motion-safety-20261116
Use the exact system_message in prompt_contract.json; append \ncurrent_pose= plus sorted-key pose JSON to the instruction. Apply the tokenizer's chat template with enable_thinking=False, add_generation_prompt=True. Generate greedily, max 384 new tokens, with both EOS IDs in the contract. Output is JSON containing idea and recipe. Recipe angles are relative to the settled starting pose after anchoring; pose angles are degrees and translations are metres. The downstream generator's recipe height channel remains millimetres. This model alone does not produce motor commands.
Generator/DSL: https://github.com/pham-tuan-binh/reachy-motion-generator/tree/18ff98574a8f0652b21db32f204a8029f8930d88
import sys
from huggingface_hub import snapshot_download
from peft import PeftModel
adapter = snapshot_download('diwank/reachy-mini-motion-planner-4b-safety-lora-20261116')
sys.path.insert(0, adapter)
from text_decoder import load_text_model, load_tokenizer
base = snapshot_download('binhpham/reachy-mini-motion-planner-4b', revision='1b60d8f16b85473ceb20e3b62e464780c532b519')
model = PeftModel.from_pretrained(load_text_model(base), adapter).to('cuda').eval()
tokenizer = load_tokenizer(base)
For another included checkpoint, pass its subdirectory to PeftModel.from_pretrained. Use the prompt contract and EOS settings above.
adapter_model.safetensors 130 MBgrpo-step010/adapter_model.safetensors 130 MBgrpo-step050/adapter_model.safetensors 130 MBsft-baseline/adapter_model.safetensors 130 MBbinhpham/reachy-mini-motion-planner-4b