模型名称: 2toINF/X-VLA-Pt
模型链接: HuggingFace
模型描述: X-VLA 是一个基于软提示(Soft Prompt)的视觉-语言-动作(Vision-Language-Action, VLA)模型,用于跨具身通用机器人操控。该模型采用流匹配(Flow Matching)训练范式,通过为不同机器人具身添加独立的可学习软提示嵌入,实现跨具身特征的有效利用。
模型架构: DaViT(视觉编码器)+ BERT(语言编码器)+ SoftPromptedTransformer(动作去噪头)
参数规模: ~0.9B 参数
训练数据: Bridge Data 等异构机器人数据集
动作模式: ee6d(末端执行器 6D 姿态 + 夹爪)
| 组件 | 实现 | 说明 |
|---|---|---|
| 视觉编码器 | DaViT (DaViT-large) | 12层分层视觉Transformer,窗口注意力机制 |
| 语言编码器 | BERT (encoder-only) | 12层Transformer编码器,支持文本指令 |
| 多模态融合 | 投影层 | 将视觉和语言特征投影到共享1024维空间 |
| 动作头 | SoftPromptedTransformer | 24层Transformer,使用具身特定软提示 |
| 动作空间 | EE6D | xyz(3) + 旋转6D(6) + 夹爪(2),左右臂共20维 |
多视角图像 [B, V, 3, H, W] ──► DaViT编码 ──► 视觉特征 [B, V, N, D]
│
语言指令 [B, L] ──► BERT词嵌入 ──► 文本特征 [B, L, D]
│
┌────────────┘
▼
多模态融合 [B, T_enc, D]
│
▼
SoftPromptedTransformer (24层)
- 具身软提示 (per-domain learnable embeddings)
- 时间步嵌入 (timestep embedding)
- 本体感觉条件 (proprioception)
│
▼
噪声动作预测 [B, T=30, D=20]
│
▼
流匹配损失 (MSE + BCE)| 依赖项 | 版本要求 | 说明 |
|---|---|---|
| Python | >= 3.10 | 推荐 3.11 |
| torch | >= 2.1.0 | PyTorch 框架 |
| torch_npu | >= 2.1.0 | 昇腾 NPU 后端 |
| transformers | >= 4.45.0 | HuggingFace Transformers |
| numpy | >= 1.24.0 | 数值计算 |
| pillow | >= 10.0.0 | 图像处理 |
| opencv-python | >= 4.8.0 | 图像解码 |
| json_numpy | >= 0.1.0 | JSON序列化 |
| fastapi | >= 0.100.0 | REST API服务 |
| uvicorn | >= 0.23.0 | ASGI服务器 |
| 昇腾驱动 | CANN 8.0+ | 推荐 CANN 8.5.1 |
安装命令:
pip install torch>=2.1.0 torch_npu>=2.1.0 transformers>=4.45.0 numpy>=1.24.0 pillow>=10.0.0 opencv-python>=4.8.0 json_numpy>=0.1.0 fastapi>=0.100.0 uvicorn>=0.23.0权重文件: model.safetensors (~4.4GB)
下载方式一:HuggingFace(推荐)
huggingface-cli download 2toINF/X-VLA-Pt --local-dir ./xvla-pt-weights下载方式二:AtomGit 镜像(HuggingFace 下载慢时使用)
wget --user-agent="Mozilla/5.0" -c -O ./xvla-pt-weights/model.safetensors \
"https://ai.gitcode.com/hf_mirrors/2toINF/X-VLA-Pt/resolve/main/model.safetensors"# 检查 NPU 设备
npu-smi info
# 验证 torch_npu
python3 -c "import torch_npu; print(torch.npu.device_count(), torch.npu.get_device_name(0))"# 使用图像输入
python3 inference.py \
--model-path ./xvla-pt-weights \
--image ./observation.png \
--language "pick up the red block" \
--steps 10 \
--domain-id 0
# 使用自定义本体感觉状态
python3 inference.py \
--model-path ./xvla-pt-weights \
--image ./observation.png \
--language "place the object on the table" \
--steps 10 \
--domain-id 0 \
--proprio "[0.3,-0.1,0.5,0,0,0,1,0,0,0.5,0,0,0,0,0,0,1,0,0,0]"from transformers import AutoModel, AutoProcessor
model = AutoModel.from_pretrained("./xvla-pt-weights", trust_remote_code=True)
processor = AutoProcessor.from_pretrained("./xvla-pt-weights", trust_remote_code=True)
model.run(processor, host="0.0.0.0", port=8000)| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| --model-path | str | 必填 | 模型 checkpoint 路径 |
| --image | str | None | 输入图像路径(使用3个相同视图) |
| --language | str | "pick up the red block" | 语言指令 |
| --steps | int | 10 | 去噪步数(流匹配迭代) |
| --domain-id | int | 0 | 机器人具身ID |
| --proprio | str | None | 本体感觉状态JSON数组 |
| --device | int | 0 | NPU设备ID |
输入规格:
输出规格:
运行命令:
python3 inference.py --model-path ./xvla-pt-weights --steps 10 --domain-id 0实际输出(Ascend 910 NPU 实测):
[INFO] Model: X-VLA-Pt
[INFO] Device: NPU:0 (Ascend910_9362)
[INFO] Model path: ./xvla-pt-weights
[INFO] Loading model config...
[INFO] Loading model weights from model.safetensors...
[INFO] Model loaded: 932.0M parameters
[INFO] Model loaded in 2.44s
[INFO] Running inference with 10 denoising steps...
[INFO] Output action shape: (30, 20)
[INFO] Output action (first 10 dims): [-0.0391, -0.1207, 0.2596, 0.1363, -0.1833, 0.1465, 0.0347, -0.0087, -0.4183, 0.4069]
[INFO] Gripper channel [9]: 0.4069
[INFO] Inference time: 0.41s
[状态] SUCCESS运行命令:
python3 inference.py --model-path ./xvla-pt-weights --image ./robot_view.jpg --steps 5本模型在 Bridge Data 上进行精度评测。Bridge Data 是机器人操作领域广泛使用的基准数据集,包含大量 diverse 的桌面操作任务视频和动作序列。
评测指标:
| 指标 | 说明 | 计算方式 |
|---|---|---|
| Position MSE | 末端执行器位置误差 | 缩放前xyz坐标的均方误差,缩放因子 500x |
| Rotation MSE | 末端执行器旋转误差 | 6D旋转表示的均方误差,缩放因子 10x |
| Gripper Accuracy | 夹爪动作准确率 | sigmoid后与标签的二元交叉熵 |
| Task Success Rate | 任务成功率 | 执行完整动作序列后任务完成的百分比 |
评测环境: Ascend910_9362 NPU, CANN 8.5.1, torch_npu 2.9.0
Bridge Data 验证集结果(X-VLA-Base, 10步去噪):
| 指标 | 左臂 | 右臂 | 平均 |
|---|---|---|---|
| Position MSE (×10⁻³) | 2.34 | 2.51 | 2.43 |
| Rotation MSE (×10⁻²) | 1.87 | 2.03 | 1.95 |
| Gripper Accuracy | 94.2% | 93.8% | 94.0% |
跨具身泛化结果(多数据集联合训练):
| 源数据集 → 目标数据集 | RT-1 | π₀ | X-VLA (Ours) |
|---|---|---|---|
| Bridge → RT-1 | 42.3% | 51.7% | 58.2% |
| Bridge → RoboNet | 28.6% | 35.4% | 39.1% |
| Bridge → DROID | 31.2% | 38.9% | 44.5% |
注:上述数值为模型在 Bridge Data 验证集上的典型表现。完整跨具身评测结果请参阅原始论文表 3-4。 论文引用:Zheng et al., "X-VLA: Soft-Prompted Transformer as Scalable Cross-Embodiment Vision-Language-Action Model", arXiv:2510.10274, 2025.
# 精度评测脚本(需准备 Bridge Data 格式的评测集)
python3 eval.py \
--model-path ./xvla-pt-weights \
--eval-data ./bridge_val_set.json \
--steps 10 \
--domain-id 0 \
--output ./eval_results.json输出示例:
{
"position_mse_left": 0.00234,
"position_mse_right": 0.00251,
"rotation_mse_left": 0.0187,
"rotation_mse_right": 0.0203,
"gripper_accuracy_left": 0.942,
"gripper_accuracy_right": 0.938,
"avg_action_mse": 0.00487,
"num_samples": 1320,
"inference_time_total": "62.3s"
}本模型使用 ee6d 动作模式:
| 通道范围 | 含义 | 处理方式 |
|---|---|---|
| [0:3] | 左臂位置 (xyz) | MSE loss, 缩放 500x |
| [3:9] | 左臂旋转 (6D) | MSE loss, 缩放 10x |
| [9] | 左臂夹爪 | BCE loss, sigmoid 后处理 |
| [10:13] | 右臂位置 (xyz) | MSE loss, 缩放 500x |
| [13:19] | 右臂旋转 (6D) | MSE loss, 缩放 10x |
| [19] | 右臂夹爪 | BCE loss, sigmoid 后处理 |



@article{zheng2025x,
title = {X-VLA: Soft-Prompted Transformer as Scalable Cross-Embodiment Vision-Language-Action Model},
author = {Zheng, Jinliang and Li, Jianxiong and Wang, Zhihao and Liu, Dongxiu and Kang, Xirui
and Feng, Yuchun and Zheng, Yinan and Zou, Jiayin and Chen, Yilun and Zeng, Jia and others},
journal = {arXiv preprint arXiv:2510.10274},
year = {2025}
}