CoolFace
Modelpublic

mjf-su/PhysicalAI-base-VLA

sourceHugging Facemitupdated 6mo agoView on Hugging Face
0likes16downloads
README.md126 linesDownload Raw Back to root
1---2base_model: Qwen/Qwen3-VL-4B-Thinking3library_name: transformers4model_name: PhysicalAI-reason-VLA5tags:6- generated_from_trainer7- sft8- trl9- vision-language10- autonomous-driving11- reasoning12license: mit13datasets:14- mjf-su/PhysicalAI-reason-US15---16 17# PhysicalAI-reason-VLA18 19A vision-language driving policy fine-tuned from [mjf-su/PhysicalAI-base-VLA](https://huggingface.co/mjf-su/PhysicalAI-base-VLA) (itself based on [Qwen/Qwen3-VL-4B-Thinking](https://huggingface.co/Qwen/Qwen3-VL-4B-Thinking)) using supervised fine-tuning with [TRL](https://github.com/huggingface/trl).20 21This model extends the base waypoint-prediction VLA with **structured chain-of-thought reasoning** and **discrete driving decisions**, trained on 10k Gemini-annotated driving scenes for 2 epochs.22 23---24 25## Input / Output26 27**Inputs**28- A forward-facing camera image29- Past ego-vehicle waypoints in the vehicle's relative frame30 31**Output**32 33```34<think>35{36  "scene": "2–3 sentence static scene description",37  "move_justification": "2–3 sentence causal explanation linking scene to decisions",38}39</think>40<action>41<longitudinal_token><lateral_token>42</action>43<wp>[x.xx,y.yy,t.tttt]</wp>44<wp>[x.xx,y.yy,t.tttt]</wp>45...46```47 48The model produces three outputs in sequence: a reasoning trace (`<think>`), discrete longitudinal and lateral driving decisions (`<action>`), and future trajectory waypoints (`<wp>`).49 50---51 52## Decision Tokens53 54Each `<action>` block contains exactly one longitudinal and one lateral token.55 56**Longitudinal** — `<stop>` · `<yield>` · `<follow>` · `<gap_search>` · `<pass>` · `<adapt>` · `<cruise>`57 58**Lateral** — `<turn_left>` · `<turn_right>` · `<lc_left>` · `<lc_right>` · `<merge>` · `<nudge_out_left>` · `<nudge_out_right>` · `<nudge_in_left>` · `<nudge_in_right>` · `<pull_over>` · `<abort>` · `<lane_keep>`59 60These are registered as genuine single tokens in the vocabulary (not subword decompositions), enabling efficient probability measurement over the full decision space with a single forward pass.61 62---63 64## Training65 66| | |67|---|---|68| **Base model** | [mjf-su/PhysicalAI-base-VLA](https://huggingface.co/mjf-su/PhysicalAI-base-VLA) |69| **Dataset** | [mjf-su/PhysicalAI-reason-US](https://huggingface.co/datasets/mjf-su/PhysicalAI-reason-US) |70| **Annotation** | Gemini batch API (chain-of-thought labels on real US driving data) |71| **Samples** | 10,000 |72| **Epochs** | 2 |73| **Method** | Completion-only SFT via TRL |74 75---76 77## Quick Start78 79```python80from transformers import AutoProcessor, AutoModelForImageTextToText81from PIL import Image82 83model_id = "mjf-su/PhysicalAI-reason-VLA"84processor = AutoProcessor.from_pretrained(model_id)85model = AutoModelForImageTextToText.from_pretrained(model_id, device_map="auto")86 87image = Image.open("forward_camera.jpg")88 89past_waypoints = "<wp>[0.00,0.00,0.0000]</wp>\n<wp>[0.51,0.00,0.0001]</wp>\n..."90 91messages = [92    {93        "role": "system",94        "content": [{"type": "text", "text": "You are a helpful AI assistant ..."}]95    },96    {97        "role": "user",98        "content": [99            {"type": "image"},100            {"type": "text", "text": f"[PAST-VEHICLE-MOTION]:\n{past_waypoints}"}101        ]102    }103]104 105prompt = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)106inputs = processor(text=[prompt], images=[image], return_tensors="pt").to(model.device)107outputs = model.generate(**inputs, max_new_tokens=512)108print(processor.batch_decode(outputs, skip_special_tokens=True)[0])109```110 111---112 113## Citation114 115```bibtex116@misc{vonwerra2022trl,117  title        = {{TRL: Transformer Reinforcement Learning}},118  author       = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching119                  and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul120                  and Quentin Gallou{\'e}dec},121  year         = 2022,122  journal      = {GitHub repository},123  publisher    = {GitHub},124  howpublished = {\url{https://github.com/huggingface/trl}}125}126```