# Instruction-driven history-aware policies for robotic manipulations

Hiveformer uses one transformer over language, camera views and history for robot manipulation

Pierre-Louis Guhur, Shizhe Chen, Ricardo Garcia, Makarand Tapaswi, Ivan Laptev, Cordelia Schmid · arXiv · 2022-9-11

- **Problem** Most instruction-following robot policies decide each action from the current frame alone. They miss the history and fine object details that manipulation tasks need.
- **Method** Hiveformer turns instruction words and multi-camera patches into one token sequence, so a transformer can attend across language, views and earlier steps. Unlike separate per-modality inputs, it models all of them jointly.
- **Results** Hiveformer averages 88.4 on 10 single-task RLBench tasks. Auto-λ scores 55.0 on the same tasks.

![Figure 2: Hiveformer jointly models instructions, views from multiple cameras, and past actions and observations with a multimodal transformer for robotic mani…](https://refivu.com/papers/f165e0f3-57f4-459b-aadd-c12aee638ce4/figures/figure-d708aeab4aeef089bfe007c9e7481701.png?thumb=512)

**Figure 2** : Hiveformer jointly models instructions, views from multiple cameras, and past actions and observations with a multimodal transformer for robotic manipulation.

[Original paper](https://arxiv.org/abs/2209.04899v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Pierre-Louis Guhur, Shizhe Chen, Ricardo Garcia, Makarand Tapaswi, Ivan Laptev, Cordelia Schmid · Instruction-driven history-aware policies for robotic manipulations · Original paper figure · Extracted the figure area from page 4 of the original PDF.

## Why stateless instruction policies stall

Many instruction-following policies decide each action from the current frame alone, and that is where the trouble starts. A policy that sees only the present frame has no direct way to learn that memory, and this behaviour is hard to model with methods that mainly rely on current observations.

Precision is the second gap, because fine positioning with a single view struggles under visual occlusions and when objects differ in size. Several recent approaches fuse multiple cameras by converting images into a unified 2D/3D space or by a late fusion of multi-view predictions. Learning representations for multiple camera views nonetheless remains an open research problem.

Cross-modal alignment is a third gap, since training and test tasks can differ in objects and in the order of actions.

The authors' answer is to model language, views and history jointly, instead of treating each as a separate input. Their Hiveformer converts instructions into language tokens and combines visual tokens for past and current observations and proprioception. A multimodal transformer then models the dependencies between current and past observations, and the spatial relations among views.

## Turning instructions and views into tokens

Hiveformer puts instruction words, camera patches and earlier steps into one token sequence, so attention can link them directly. The episode length is counted in macro steps, which keeps the history short. The multimodal transformer then takes this whole sequence as its input.

Each instruction word passes through the CLIP language encoder, which stays frozen during training. A linear layer projects each word embedding and adds a type embedding, giving x̂l = LN(Wx x̃l) + ExT. The type embedding ExT tells instruction tokens apart from visual tokens. The authors chose CLIP over BERT because its vision-and-language pre-training differentiates vision-related semantics such as colors better.

With K = 3 cameras and 128 by 128 images, each camera's RGB image is concatenated with a binary gripper map. A UNet encoder turns that concatenation into a feature map. The feature map is joined with mean-pooled point clouds, giving Fkt = \[CNN(\[Ikt; Akt\]); MeanPool(Pkt)\]. Each patch therefore carries 3D information from the point cloud. Each patch then becomes its own visual token after adding embeddings for camera id, step id, patch location and visual nature.

## Letting views attend to instructions and history

The multimodal transformer decides which context matters by applying attention in a fixed sequence of layers. The first step is a cross-attention layer, where the current camera tokens G\_t query the context tokens C\_t. Here C\_t consists of the instruction tokens and the history tokens, so the views can pull in both the words and the earlier steps.

Written out, the step is tilde G\_t = CA(G\_t, C\_t) = Attn(G\_t, C\_t, C\_t), following the paper's Equation 5. The authors don't use one generic self-attention over all tokens, as prior work \[75\] does. Instead, they use different attention layers for different kinds of relations, so the role of the context stays clear.

After the cross-attention, a self-attention layer mixes the patch tokens across all camera views. This step captures the intra-modal relations among views from multiple cameras. A feed-forward network with two linear layers, W1 and W2, follows the self-attention. It applies a GeLU between them and a layer normalization at the end, giving hat G\_t = LN(W2 GeLU(W1 SA(tilde G\_t))).

The layers run in this fixed order, so the output is a contextualized version of the current views.

This contextualized output G\_t is what the action prediction module later uses. The output is concatenated with the original visual features F\_t, which keeps the direct view information next to the context. The model reshapes the result into a feature map H\_t, which feeds the rotation and gripper branch. The position branch works separately, using the point clouds to predict where the gripper goes.

## Predicting the next gripper action

The transformer output is reshaped into a feature map that keeps the spatial layout of each camera. That feature map is concatenated with the original encoded visual representations along the channel dimension. Hiveformer predicts the next action as a position, a rotation and a gripper state, written as a single vector. The authors give position its own module, because some RLBench tasks need accurate fine-grained positioning.

The rotation and gripper state branch is kept separate from the position branch, which uses the point clouds.

For rotation and gripper state, the feature map is flattened across cameras and fed into a CNN decoder. Average pooling over the spatial dimensions then reduces the output, and a linear layer regresses a 5-dimension vector. That vector holds the quaternion rotation q(t+1) and the gripper state c(t+1), so the branch has no point-cloud input.

The CNN decoder itself is described in Section A of the appendix.

The predicted position is split into an expected point on the point clouds and an offset. Each camera k has a CNN with an upsampling layer that predicts an attention map B over its point cloud P. Each value in B is the probability of reaching the matching point, so the expected position is a weighted sum over all cameras. The expected point is p^e(t+1) = sum over k, h, w of B(k,t,h,w) times P(k,t,h,w).

The offset lets the model predict a virtual point outside the convex hull of the point cloud, such as the spot just above an object before the touch. The task id is predicted from the mean of the instruction word embeddings with a softmax over N\_tau tasks.

Training then uses behavioral cloning on N successful demonstrations per task generated in RLBench. The loss adds a mean-square error on the gripper action to a cross-entropy term on the task classification. Each demonstration gives a sequence of at most T macro-steps with observations, actions, task and instruction.

## Training by cloning demonstrations

Hiveformer is trained with behavioral cloning on scripted demonstrations generated in RLBench. Each demonstration contains a sequence of at most T macro-steps, with observations, actions, a task label and an instruction. The loss sums a mean-square error on the gripper action with a cross-entropy term on task classification over a batch of demonstrations.

The batch B is drawn from the set D of N successful demonstrations collected for each task. The cross-entropy term pushes the instruction-based task predictor Pr(m) toward the true task m\*, which also supervises the offset branch.

Training uses the Adam optimizer with a learning rate of 5× 10−5. Each batch holds 32 demonstrations, and the model trains for 100,000 iterations. The authors also apply jitter on RGB images and a random crop of the images, point clouds and proprioception, keeping them aligned. Training runs on one NVIDIA Tesla V100 SXM2 GPU inside a Singularity container with headless rendering.

A risk with this setup is that the model can copy the current frame and ignore history whenever that frame is informative. To counter this, the current observation is masked with probability 0.1 during training. The masking zeros out randomly selected patch features of the current observation. Because the masked content is missing, the model must recover it from the past observations and actions.

## Which parts of the model earn their keep

The ablation table isolates each architectural change in the single-task setting, reporting mean and variance on unseen episodes. The baseline R1 is a UNet similar to Auto-λ, conditioned on instructions, and scores 72.9 with a variance of 4.1. Adding a self-attention multimodal transformer in R2 raises the score only to 73.1, which shows that the transformer alone adds little.

Adding point clouds and gripper position in R3 and R4 brings the score to 77.1 and then 78.1.

![Table 1: Success rate on the single-task setting. We report mean and variance for unseen episodes](https://refivu.com/papers/f165e0f3-57f4-459b-aadd-c12aee638ce4/figures/figure-93faee548520352dd3c7dd2bfecae6bd.png?thumb=512)

**Table 1** : Success rate on the single-task setting. We report mean and variance for unseen episodes.

[Original paper](https://arxiv.org/abs/2209.04899v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

The history information lifts the score from 78.1 in R4 to 81.8 in R5, a gain of 4.5% absolute. Masking the current observation with probability 0.1 moves the score from 81.8 in R5 to 82.3 in R6, a gain of 0.5%. The masking forces the model to fill the zeroed patches from history, because the unmasked current observation can be sufficient on its own.

Cross-attention conditions the visual tokens on the instruction and history context, instead of letting all tokens attend to each other. The R8 variance is ±4.9, which is lower than the ±6.4 of R7. Because every row shares one setup, each gain can be read as the effect of the single change in that row.

## How the policy compares on RLBench

On the 10 RLBench tasks in the single-task setting, Hiveformer averages 88.4, against 55.0 for Auto-λ. The authors compare with ARM and Auto-λ, and they report a consistent improvement on every listed task. Each task trains on 100 demonstrations unless stated otherwise, and the authors score 500 unseen episodes per task. Auto-λ uses a UNet network with late fusion over the views, so it is the closest prior setup to Hiveformer.

With one model covering all 10 tasks, Hiveformer reaches an average of 83.3, while Auto-λ reaches 69.3. Auto-λ dynamically adjusts the weights of different tasks during training. Hiveformer gives every task equal weight, and it still beats Auto-λ by 14%. The authors attribute this gap to their architecture rather than to the weighting. Removing the instruction from the input drops the average to 64.2, so the instruction carries real task information.

The single multi-task model stays only slightly below the individual per-task models.

Across 74 tasks grouped into 9 categories, the full model averages 65.4, compared to 44.0 for Auto-λ run with the authors' code. The full model beats Auto-λ on all types of tasks in this single-task evaluation. Removing history gives 60.9, and using one camera gives 40.1, so both history and multi-view input carry weight. In the Long-term group, the score is 10.0 without history and 16.9 with it.

The one-view variant takes the best of the three cameras for each task, so it serves as a strong single-camera reference. The authors note that Long-term tasks with more than 10 steps remain weak for the model.

## Generalizing to new variations and wording

The multi-variation test uses Push Buttons and Tower, each with 100 training variations and 100 different unseen test variations. With 100 demonstrations per variation, the push buttons model scores 100 on seen variations and 86.4 on unseen ones with synthetic instructions. On Tower, the unseen score is 56.4 with synthetic instructions and 24.2 with human-written ones.

For push buttons, the human-written score on unseen variations is 74.0. The Tower task asks the robot to stack colored cubes in the order given by the instruction, so the order must come from language.

![Table 4: Success rate (%) in the multi-variation setting for seen or unseen variations and synthetic or human-written instructions](https://refivu.com/papers/f165e0f3-57f4-459b-aadd-c12aee638ce4/figures/figure-c4c4f53912b61363d27f8e9d7f044d17.png?thumb=512)

**Table 4** : Success rate (%) in the multi-variation setting for seen or unseen variations and synthetic or human-written instructions.

[Original paper](https://arxiv.org/abs/2209.04899v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)

Instructions are needed here, because the scene alone can't tell red-green-blue from blue-red-green. The authors trained with only 10 demonstrations per variation and still reached 71.1% on unseen push buttons variations. Hiveformer reached 49.8% on unseen tower variations with only 10 demonstrations per variation. Human-written instructions came from 8 native English speakers, giving 162 instructions in total.

Human instructions were more varied, with unseen verbs, formulations and color references than the synthetic ones.

Encoder choice matters: on unseen push-buttons variations with synthetic instructions, CLIP gives 86.3, compared to 40.2 for BERT. Averaged embeddings give a 0.97 cosine similarity for instructions with the same actions in different orders. Averaging word embeddings, as in BC-Z-style global vectors, therefore loses the order that the policy needs.

## Moving the policy to a real UR5 arm

The real-robot study runs the push buttons task on a 6-DoF UR5 arm with a 2-finger Robotiq RG2 gripper. Two cameras sit on each side of the scene, so the setup has two views instead of the three used in simulation.

The two models compared are one trained from scratch on real-robot demonstrations and one pretrained on RLBench and then fine-tuned. Without pretraining, the success rate is 86.7 on seen variations and 13.3 on unseen variations. With pretraining, the success rate rises to 92.2 on seen variations and 85.7 on unseen variations. The gain is largest on unseen variations, where pretraining lifts the score from 13.3 to 85.7.

The model without pretraining overfits to the seen variations, which the authors take as the reason for its weak generalization.

The authors conclude that the policy benefits from simulator pretraining even though the domain gap is large. Their setup details and further analysis are given in Section E of the appendix. The limitations section notes that the model is trained only on synthetic instructions and performs worse on human-written ones.

## Limits and open questions

The computational cost of Hiveformer grows quadratically with the input sequence length, because the model is a transformer. This matters most for long-term tasks, where the input sequence is longest. The authors attribute the weak results on these tasks to distribution shift and accumulated errors. The model is trained with behavioral cloning, which the authors note may suffer from exposure bias.

Long-term tasks with more than 10 steps score poorly, for example take shoes out of box. The long-term group contains 4 tasks, and the group's score is 16.9 for the full model. Training used only synthetic instructions, so the model performs worse on human-written instructions. On push buttons, the success rate drops from 86.4 for unseen synthetic instructions to 74.0 for human instructions with 100 demonstrations.

The authors suggest that training on human-written, automatically generated instructions could improve this gap. They didn't test finetuning on human instructions themselves, and they only expect further improvements from it.

Of the 106 supported RLBench tasks, the authors could not produce demonstrations for 32 of them. So the evaluation covers 74 tasks, grouped into 9 categories.

## Paper info

- **Authors**: Pierre-Louis Guhur, Shizhe Chen, Ricardo Garcia, Makarand Tapaswi, Ivan Laptev, Cordelia Schmid
- **Venue**: arXiv · Preprint
- **First published**: 2022-9-11
- **Added**: 2026-11-4
- **Updated**: 2022-12-17
- **Version**: v3
- **arXiv**: 2209.04899
- **Category**: cs.RO · cs.AI · cs.CL · cs.CV · cs.LG
- **Original paper terms**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **What we show**: Paper info, commentary and permitted figures from the original paper

[Original paper ↗](https://arxiv.org/abs/2209.04899v3) · [PDF ↗](https://arxiv.org/pdf/2209.04899v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Abstract

In human environments, robots are expected to accomplish a variety of manipulation tasks given simple natural language instructions. Yet, robotic manipulation is extremely challenging as it requires fine-grained motor control, long-term memory as well as generalization to previously unseen tasks and environments. To address these challenges, we propose a unified transformer-based approach that takes into account multiple inputs. In particular, our transformer architecture integrates (i) natural language instructions and (ii) multi-view scene observations while (iii) keeping track of the full history of observations and actions. Such an approach enables learning dependencies between history and instructions and improves manipulation precision using multiple views. We evaluate our method on the challenging RLBench benchmark and on a real-world robot. Notably, our approach scales to 74 diverse RLBench tasks and outperforms the state of the art. We also address instruction-conditioned tasks and demonstrate excellent generalization to previously unseen variations.

## Quote from the paper

Pierre-Louis Guhur, Shizhe Chen, Ricardo Garcia, Makarand Tapaswi, Ivan Laptev, Cordelia Schmid (2022). Instruction-driven history-aware policies for robotic manipulations. arXiv:2209.04899v3. https://arxiv.org/abs/2209.04899v3

**BibTeX**

```
@misc{guhur2022instruction,
  title = {{Instruction-driven history-aware policies for robotic manipulations}},
  author = {Pierre-Louis Guhur and Shizhe Chen and Ricardo Garcia and Makarand Tapaswi and Ivan Laptev and Cordelia Schmid},
  year = {2022},
  eprint = {2209.04899},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2209.04899v3}
}
```

## Other paper commentary

- [Perceiver-Actor: A Multi-Task Transformer for Robotic Manipulation](https://refivu.com/en/papers/36489f39-2d0a-49d5-8c29-68447645c8d7-perceiver-actor-a-multi-task-transformer-for-robotic.md)
- [Equivariant Descriptor Fields: SE(3)-Equivariant Energy-Based Models for End-to-End Visual Robotic Manipulation Learning](https://refivu.com/en/papers/46f6ef1f-5422-4a62-939d-fb8970138aff-equivariant-descriptor-fields-se-3-equivariant-energy-based.md)
- [RoboCat: A Self-Improving Generalist Agent for Robotic Manipulation](https://refivu.com/en/papers/b6495492-d71b-4904-97d1-2d044bfa800b-robocat-a-self-improving-generalist-agent-for-robotic.md)
- [Seeing Through the Illusion: Test-Time Scaling for World Action Models](https://refivu.com/en/papers/acce6a4d-042b-4465-88b1-f168246c6849-seeing-through-the-illusion-test-time-scaling-for.md)
- [Safe-Ballbot: Tilt-Consistent MPC with Control Barrier Functions for Ballbot Navigation](https://refivu.com/en/papers/dd5b3378-644c-4e61-8f14-eff7412d7ce1-safe-ballbot-tilt-consistent-mpc-with-control-barrier.md)
- [ForceLDM: A Force-aware Latent Dynamics Model for Contact-Rich Manipulation](https://refivu.com/en/papers/bb99f5b0-1f95-4a4b-a231-31e5cda0c97b-forceldm-a-force-aware-latent-dynamics-model-for.md)
- [Radiance Fields from Photons](https://refivu.com/en/papers/ed7d1310-158a-45ed-8fca-e4e7e9def0f5-radiance-fields-from-photons.md)
- [LiveSVG: Zero-Shot SVG Animation via Video Generation](https://refivu.com/en/papers/d392af01-fe45-4961-98d4-140d42ebd9d1-livesvg-zero-shot-svg-animation-via-video-generation.md)
- [Automated, auditable dating of the Babylonian Astronomical Diaries with language models and astronomical tools](https://refivu.com/en/papers/51aebcff-2cce-44cd-b0eb-96190a580ff4-automated-auditable-dating-of-the-babylonian-astronomical.md)
- [An actively trained neural operator for near-explicit atmospheric chemistry](https://refivu.com/en/papers/eb9dbfd4-7716-4343-a72e-4db0b3540a9c-an-actively-trained-neural-operator-for-near-explicit.md)
- [When is early stopping beneficial under label noise? A phase diagram for kernel gradient flow](https://refivu.com/en/papers/bb22b69d-e82d-4182-9e12-3e35db072d10-when-is-early-stopping-beneficial-under-label-noise.md)

## Terms in this paper

- [self-attention](https://refivu.com/en/terms/426589b81077-self-attention)
- [CLIP](https://refivu.com/en/terms/b5b5b48d5f4e-clip)
- [cross-attention](https://refivu.com/en/terms/83e3067f3ffa-cross-attention)
- [behavioral cloning](https://refivu.com/en/terms/101aca4bbdf9-behavioral-cloning)
- [UNet](https://refivu.com/en/terms/0da000173b9b-unet)
- [RLBench](https://refivu.com/en/terms/fd082b3b30c8-rlbench)
- [visual tokens](https://refivu.com/en/terms/25cccc1b82d2-visual-tokens)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/f165e0f3-57f4-459b-aadd-c12aee638ce4-instruction-driven-history-aware-policies-for-robotic)
