Paper · 2024-12-27 · cs.AI, cs.RO
Hindsight Planner: A Closed-Loop Few-Shot Planner for Embodied Instruction Following
An LLM planner for ALFRED household tasks with 140 examples. An actor-critic beam search picks sub-goals from observations and LLM-predicted PDDL arguments. Hindsight prompts relabel the agent's failed rollouts with GPT-4 Turbo so a second actor learns to recover. Author-reported test-seen SR 25.51 and test-unseen SR 18.77, against LLM-Planner at 15.33 and 13.41.
LLM planningIn-context learningFew-shot example selectionHindsight relabelingembodied-aitask-planningin-context-learninghindsightalfred
AI-compiled by claude-haiku-5-5 on 2026-10-25, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.
In plain words
A household robot in a simulated house gets a sentence such as "put a warm apple in the fridge". It sees the scene only one view at a time, and it has to work out a long chain of steps: find the object, open the appliance, heat it, put it away. This paper builds a planner that uses a large language model for those decisions and that does not need a big training set. It learns from a small number of solved examples in the prompt.
The planner checks what it can see and guesses the parts of the task it cannot see yet, such as which container is needed. It then imagines several short futures, scores them, and carries out only the first step of the best one. After each step it looks again and plans anew, so a wrong move does not end the task.
The authors' main idea is to learn from mistakes that happened during practice. The planner's own failed attempts are rewritten, with the help of the language model and the correct solution, into attempts that succeed. A second planner is then shown these rewritten attempts, so it knows how to recover from a wrong move. The paper reports that this closed loop, with few examples, reaches results that come close to a fully supervised agent.
TL;DR
- Few-shot LLM planner for ALFRED. It uses about 140 solved trajectories and no gradient training of the LLM §5.1.
- Each step predicts hidden PDDL arguments, then runs an actor-critic beam search over sub-goals §4.4 §4.5 alg. 1.
- Hindsight prompts relabel suboptimal rollouts with the help of ground-truth rollouts, so one actor can recover from errors §4.3 alg. 3.
- Author-reported: test-seen SR 25.51 and test-unseen SR 18.77, against LLM-Planner at 15.33 and 13.41 tab. 1.
- Only ALFRED and GPT-4 Turbo are tested. Low-level control is reused from HLSM §5.1.
Problem
Embodied instruction following on ALFRED needs long-horizon plans, and the reward arrives only at the end of a task §1. The authors argue that few-shot LLM planners that imitate expert trajectories are not robust. A wrong action can leave the planner in a state it never saw in its examples, and the task then fails §1 fig. 1. The planner also sees only an egocentric view, so the task's hidden state, such as the required container or the device to toggle, is unknown §1 §4.4. Under a few-shot assumption there are not enough trajectories to cover these cases §1.
The paper frames the task as a POMDP, with observations that are partial and latent state that is hidden §1 §3.1 eq. 1 eq. 2.
Method
Overview §4.1. At each time step the planner gets an object list from
observation functions, adds the adapter's predicted PDDL arguments to form
the state, and asks an actor-critic planner (LLM-PL) for a sub-goal. A
frozen BERT maps the output to the legal sub-goal space. A low-level
controller (Low-PL) executes the sub-goal. When the sub-goal finishes or
fails, the planner replans alg. 1 fig. 3.
Prompts and retrieval §4.2. Each component prompt starts with a short description of the task and of the LLM's role. A frozen BERT encodes the task description. The K nearest examples by Euclidean distance are copied into the prompt as in-context examples, as in LLM-Planner §4.2 §5.1. The prompt for the adapter and the critic follows the template in app. B.
Adaptation module §4.4. The adapter is an LLM. At each step, before reasoning, it predicts seven PDDL-style arguments from the observed object list: the target object, the parent receptacle, the movable receptacle, the toggle target, the object state (clean, heat or cool), whether the object is sliced, and whether two objects are handled §4.4. The object list grows as the agent explores §4.4. Predictions are not made once at the start of the task, as in FILM, but at every step §2.
Task planner §4.5. Two actors and one critic are used. Actor_gt gets
in-context examples from the ground-truth pool; Actor_hind gets examples
from the hindsight pool. Each actor proposes half of the W candidate actions
at deployment app. A. The critic scores candidate rollouts. A generator
psi produces the next state for each action. Beam search keeps the B best
rollouts per depth and returns the first action of the best rollout as the
sub-goal §4.5 alg. 2.
# Hindsight Planner, one replanning call [alg. 1] [§4.1]
# Input: instruction, observed objects, sub-goal history
# Output: next sub-goal
def plan_sub_goal(instruction, observed, history):
# Predict the hidden PDDL arguments from what is seen [§4.4]
pddl_args = adapter(instruction, observed)
# Combine the partial view and the predicted arguments [§4.1]
state = (observed, pddl_args)
# Search over future rollouts; return the first action [§4.5] [alg. 2]
sub_goal = beam_search(state, history)
return sub_goal# Beam search over rollouts [alg. 2] [§4.5]
# Input: actors, critic, generator, state, B, W, U
# Output: first action of the best rollout
def beam_search(state, actors, critic, generator, B, W, U):
# Start from the current state only [alg. 2 l.12]
frontier = [[state]]
# Expand each rollout by one action per depth [alg. 2 l.15]
for depth in range(U + 1):
candidates = []
for rollout in frontier:
# Actors split the W proposals between them [alg. 2 l.16-18]
proposals = [
actor.propose(rollout, W / len(actors))
for actor in actors
]
for action in flatten(proposals):
# The generator gives the next state [alg. 2 l.19]
next_state = generator(rollout[-1], action)
extended = rollout + [action, next_state]
# The critic scores the extended rollout [alg. 2 l.20]
value = critic(extended)
candidates.append((value, extended))
# Keep the B highest-valued rollouts [alg. 2 l.21]
frontier = [r for _, r in top_k(candidates, B)]
# Pick the best final rollout; return its first action [alg. 2 l.23-24]
best = max(frontier, key=critic)
return best[1]Hindsight method §4.3. During collection, the agent runs on training
tasks and produces suboptimal rollouts. The task text is first rewritten from
its PDDL arguments by a prompt generator phi alg. 3 §5.1. The LLM then
writes a reflection (Think) on the rollout, given the ground-truth rollout,
and completes the rollout guided by that reflection. A separate LLM call
writes a critic sample from the same rollout §4.3 alg. 3 app. B. At deployment, Actor_gt is prompted with ground-truth samples,
while Actor_hind and the critic are prompted with relabeled samples §4.3.
The authors say the rewrite lets the planner recover from a wrong action that
has already been taken §4.3 fig. 2 fig. 3.
The authors argue that earlier hindsight methods, such as HER, change the distribution of the information statistic, while this method keeps it unchanged §2 §4.3 eq. 4 eq. 5 eq. 6. Section 3 defines the information-matching objective used for this argument §3.2 eq. 3.
# Build the hindsight pool from suboptimal rollouts [alg. 3] [§4.3]
# Input: ground-truth pool, prompt generator phi, LLM
# Output: ground-truth pool plus relabeled samples
def build_hindsight_pool(gt_pool, agent, phi, llm):
# Relabeled samples start empty [alg. 3 l.2]
hind_pool = []
for sample in gt_pool:
# Ground-truth rollout, task and PDDL arguments [alg. 3 l.5]
gt_rollout, task, pddl = unpack(sample)
# Suboptimal rollout; the task itself is not an example [alg. 3 l.6]
traj = agent.run(task, sample, gt_pool_without(sample))
# Rewrite the task from its PDDL arguments [alg. 3 l.7] [§5.1]
relabeled_task = phi(pddl)
# Reflect on the suboptimal rollout [alg. 3 l.8] [§4.3]
think = llm(relabeled_task, traj, gt_rollout)
# Complete the rollout, guided by the reflection [alg. 3 l.9]
actor_sample = llm(relabeled_task, traj, gt_rollout, think)
# Write a critic sample from the same rollout [alg. 3 l.10]
critic_sample = llm(relabeled_task, traj, gt_rollout)
hind_pool.append(actor_sample)
hind_pool.append(critic_sample)
return gt_pool + hind_poolHyperparameters
| Name | Value | Where | Notes |
|---|---|---|---|
| Benchmark | ALFRED | §5.1 | Validation and test splits have seen and unseen subsets. |
| Initial sample pool | 20 trajectories per each of 7 task types (140 total) | §5.1 | Drawn from the training annotations. |
| Collection set | 140 trajectories | §5.1 | Same tasks are excluded as in-context examples during collection app. A. |
| Target LLM | GPT-4 Turbo | §5.1 | Cited as gpt4. |
| LLM temperature | 0 | §5.1 | Stated for the target LLM. Whether it also applies to relabeling calls is not stated. |
| Retriever | Frozen BERT, Euclidean kNN | §4.2 §5.1 | Exact BERT checkpoint: not stated (cited as a Hugging Face model). |
| Adapter in-context examples K | 5 | §5.1 | Retrieved from the sample pool. |
| Actor and critic in-context examples K | 2 | §5.1 | Retrieved from the sample pool. |
| Beam search depth U | 2 | §5.1 | Stated as "depth and width of 2". |
| Beam search width | 2 | §5.1 | Stated as "depth and width of 2". Mapped to B or W is not stated. |
| Candidate proposals W | not stated | app. A | Symbol only. Deployment: each actor proposes W/2. |
| Best rollouts kept B | not stated | alg. 2 app. A | Symbol only. |
| Low-level controller | Pretrained HLSM navigation, perception, control | §5.1 | Reused without retraining, to keep the few-shot setting. |
| Relabeling reasoning | Two-step chain of thought (Think, then complete) | §4.3 | Number of samples per rollout: one actor sample and one critic sample alg. 3. |
| Critic value format | a/b, rounded to 2 decimals | app. B | Value format required in the critic prompt. |
| Replanning trigger | Sub-goal finished or failed | alg. 1 | Failure criterion is not defined in the text. |
| Max episode length, sub-goal budget | not stated | - | |
| Training | none (in-context only) | §4 §5.1 | No gradient updates to the LLM are described. |
Results
Author-reported. Setup: ALFRED, 140 few-shot trajectories, GPT-4 Turbo as target LLM, HLSM low-level controller §5.1. Metrics: Success Rate (SR) and Goal Condition (GC) §5.1. "full" rows use the full training set; "few" rows use few examples; "low inst." uses step-by-step instructions tab. 1.
Table 1. Comparison with state-of-the-art, test splits tab. 1.
| Model | n-shot | Test Seen SR | Test Seen GC | Test Unseen SR | Test Unseen GC |
|---|---|---|---|---|---|
| HiTUT | full | 13.63 | 21.11 | 11.12 | 17.89 |
| HLSM | full | 25.11 | 35.79 | 20.27 | 27.24 |
| FILM | full | 28.83 | 39.55 | 27.80 | 38.52 |
| MCR-Agent | full | 30.13 | - | 17.04 | - |
| FILM (low inst.) | few | 0.00 | 4.23 | 0.20 | 6.71 |
| LLM-Planner | few | 15.33 | 24.57 | 13.41 | 22.8 |
| LLM-Planner (low inst.) | few | 18.80 | 26.77 | 16.42 | 23.37 |
| Socratic-Planner | few | 13.24 | 21.51 | 10.66 | 19.53 |
| Hindsight-Planner (this paper) | few | 25.51 | 34.74 | 18.77 | 28.29 |
Table 2. Same low-level controller (HLSM) tab. 2.
| Model | n-shot | Valid Seen SR | Valid Seen GC | Valid Unseen SR | Valid Unseen GC | Test Seen SR | Test Seen GC | Test Unseen SR | Test Unseen GC |
|---|---|---|---|---|---|---|---|---|---|
| HLSM | full | 29.63 | 38.74 | 18.28 | 31.24 | 25.11 | 35.79 | 20.27 | 27.24 |
| LLM-Planner | few | 13.53 | 28.28 | 12.92 | 25.35 | 15.33 | 24.57 | 13.41 | 22.8 |
| Socratic-Planner | few | 14.88 | 25.47 | 13.40 | 24.91 | 13.24 | 21.51 | 10.66 | 19.53 |
| Hindsight-Planner (this paper) | few | 25.61 | 34.95 | 19.00 | 29.90 | 25.51 | 34.74 | 18.77 | 28.29 |
Table 3. Ablation by task type, Valid Seen SR tab. 3 (labelled tab:5 in the source).
| Variant | Examine | Pick | Clean | Stack | Pick Two | Heat | Cool |
|---|---|---|---|---|---|---|---|
| Base method | 40.42 | 50 | 15.18 | 9.56 | 30.65 | 7.48 | 21.43 |
| W.O. hindsight method | 39.36 | 49.29 | 16.96 | 7.82 | 29.84 | 7.47 | 10.31 |
| W.O. adaptation module | 35.1 | 47.1 | 8.93 | 6.09 | 32.25 | 9.34 | 18.26 |
Table 4. Ablation on Valid Seen and Valid Unseen tab. 4 (labelled tab:3 in the source).
| Variant | Valid Seen SR | Valid Seen GC | Valid Unseen SR | Valid Unseen GC |
|---|---|---|---|---|
| W.O. adaptation module | 23.17 | 33.28 | 14.99 | 27.36 |
| W.O. hindsight method | 23.53 | 32.76 | 16.32 | 28.06 |
| Base method | 25.61 | 34.95 | 19.00 | 29.90 |
Table 5. Average sub-goal length per task type tab. 5 (labelled tab:4 in the source).
| Task type | Avg. sub-goal length |
|---|---|
| Examine | 2.07 |
| Pick | 2.48 |
| Pick Two | 5.70 |
| Stack | 5.63 |
| Clean | 7.25 |
| Cool | 10.36 |
| Heat | 12.78 |
Headline claims. The authors report test-seen SR 25.51 and test-unseen SR 18.77 §1 tab. 1. They report +10.18 and +5.36 SR over LLM-Planner on the two test splits §5.2. With the same low-level controller, the method "nearly matches and even surpasses" the full-data HLSM on some metrics §5.2 tab. 2. Removing the hindsight method lowers Valid Seen SR by 2.08 and Valid Unseen SR by 2.68 §5.3 tab. 4. Removing the adapter lowers them by 2.44 and 4.01 §5.3 tab. 4. The authors say the hindsight method helps most in long tasks such as Cool and Heat §5.3 tab. 3 tab. 5.
Paper vs code
No official code.
Search: the paper and its arXiv metadata have no code link. Author-owned
GitHub repositories: yangyuxiao-sjtu/hindsight_planner_page is a project
page (GitHub Pages template) with no planner code. Repository search for
"hindsight planner" and "hindsight ALFRED planner" found no implementation
from the authors.
Pitfalls
- Beam-search sizes are ambiguous. The text says "a depth and width of 2" §5.1. The algorithm uses B, W and U alg. 2. It is not stated which of these is 2, nor the value of W. Deployment gives each actor W/2 proposals app. A, which is one action per actor if W = 2. Treat the sizes as unknown until the authors confirm.
- Dataset size is inconsistent. Section 5.1 says ALFRED has "25k annotations", then says the few examples come from a "21k training set" §5.1.
- The headline percentages do not follow from Table 1. The introduction claims a 60% and 39% improvement over the previous baseline §1. Table 1 gives 25.51 / 15.33 (+66%) and 18.77 / 13.41 (+40%) against LLM-Planner. The source does not say which baseline the stated figures use.
- Relabeling uses ground-truth PDDL arguments, deployment uses predicted ones. During collection, the task is rewritten from the annotated PDDL arguments alg. 3 l.5, l.7. At test time the adapter must predict them, and errors there propagate to the planner. The paper does not measure how much the adapter's errors hurt.
- Hindsight samples depend on ground truth. The reflection and completion are written with the ground-truth rollout visible alg. 3 l.8-10. The relabeled data therefore encode the expert's solution. The paper's argument for this is theoretical §4.3, not empirical.
- The "theoretical superiority" claim is an argument, not a theorem. The contributions list says the method is "theoretically superior" §1. The sources contain no theorem or proof. Equations 4 to 6 state the argument as an inequality, and the text reads it as a sketch §4.3 eq. 4 eq. 5 eq. 6.
- Hidden per-step cost. Each planning call runs the adapter, two actors, a generator and a critic at each beam depth. Several candidates are scored per depth alg. 2. The number of LLM calls per sub-goal, the token cost, and the latency are not reported.
- Replanning rule is partly unstated. "Failed" is used as a sub-goal state alg. 1, but how failure is detected is not defined.
- Output parsing is not specified. Actor outputs must be action strings, and BERT maps them to the legal space §4.1. The mapping rule is not described. The critic must end with "the value is a/b", which the prompt asks for app. B, but how the value is parsed is not stated.
- Temperature for relabeling calls is unknown. The stated temperature 0 applies to the target LLM §5.1. The paper does not say whether relabeling and adapter calls use the same setting.
- Baselines are not matched. Table 1 mixes full-data training, low-instruction variants and few-shot planners. Only Table 2 uses the same low-level controller for all methods.
- Results come from one benchmark and one LLM. Only ALFRED and GPT-4 Turbo are reported §5.1. Generalization is not shown.
- Figures are qualitative. Figure 1 is an illustration and Figure 2 compares the methods on one example fig. 1 fig. 2. Figure 3 walks through one task fig. 3. None gives a number, so all quantitative claims rest on the tables.
Lineage
- Builds on: RAFA, the actor-critic LLM planning framework whose tree search and critic this planner adapts §2 §4.5. LLM-Planner, whose kNN retrieval of in-context examples the planner uses §4.2. HLSM, whose navigation, perception and low-level control modules are reused unchanged §5.1. Hindsight methods such as HER and the information-matching view of Furuta et al. §2 §3.2.
- Compared against: HiTUT, HLSM, FILM, MCR-Agent, LLM-Planner (with and without low-level instructions), and Socratic-Planner tab. 1 tab. 2.
- Superseded by: not known from content already in this wiki.
Source and license
Adapted from “Hindsight Planner: A Closed-Loop Few-Shot Planner for Embodied Instruction Following” by Yuxiao Yang, Shenao Zhang, Zhihan Liu, Huaxiu Yao, Zhaoran Wang (arXiv:2412.19562), used under CC BY 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors.