wikillm

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

arXivPDFMarkdown11 min read

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.

Pseudocode
# 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
Pseudocode
# 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.

Pseudocode
# 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_pool

Hyperparameters

NameValueWhereNotes
BenchmarkALFRED§5.1Validation and test splits have seen and unseen subsets.
Initial sample pool20 trajectories per each of 7 task types (140 total)§5.1Drawn from the training annotations.
Collection set140 trajectories§5.1Same tasks are excluded as in-context examples during collection app. A.
Target LLMGPT-4 Turbo§5.1Cited as gpt4.
LLM temperature0§5.1Stated for the target LLM. Whether it also applies to relabeling calls is not stated.
RetrieverFrozen BERT, Euclidean kNN§4.2 §5.1Exact BERT checkpoint: not stated (cited as a Hugging Face model).
Adapter in-context examples K5§5.1Retrieved from the sample pool.
Actor and critic in-context examples K2§5.1Retrieved from the sample pool.
Beam search depth U2§5.1Stated as "depth and width of 2".
Beam search width2§5.1Stated as "depth and width of 2". Mapped to B or W is not stated.
Candidate proposals Wnot statedapp. ASymbol only. Deployment: each actor proposes W/2.
Best rollouts kept Bnot statedalg. 2 app. ASymbol only.
Low-level controllerPretrained HLSM navigation, perception, control§5.1Reused without retraining, to keep the few-shot setting.
Relabeling reasoningTwo-step chain of thought (Think, then complete)§4.3Number of samples per rollout: one actor sample and one critic sample alg. 3.
Critic value formata/b, rounded to 2 decimalsapp. BValue format required in the critic prompt.
Replanning triggerSub-goal finished or failedalg. 1Failure criterion is not defined in the text.
Max episode length, sub-goal budgetnot stated-
Trainingnone (in-context only)§4 §5.1No 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.

Modeln-shotTest Seen SRTest Seen GCTest Unseen SRTest Unseen GC
HiTUTfull13.6321.1111.1217.89
HLSMfull25.1135.7920.2727.24
FILMfull28.8339.5527.8038.52
MCR-Agentfull30.13-17.04-
FILM (low inst.)few0.004.230.206.71
LLM-Plannerfew15.3324.5713.4122.8
LLM-Planner (low inst.)few18.8026.7716.4223.37
Socratic-Plannerfew13.2421.5110.6619.53
Hindsight-Planner (this paper)few25.5134.7418.7728.29

Table 2. Same low-level controller (HLSM) tab. 2.

Modeln-shotValid Seen SRValid Seen GCValid Unseen SRValid Unseen GCTest Seen SRTest Seen GCTest Unseen SRTest Unseen GC
HLSMfull29.6338.7418.2831.2425.1135.7920.2727.24
LLM-Plannerfew13.5328.2812.9225.3515.3324.5713.4122.8
Socratic-Plannerfew14.8825.4713.4024.9113.2421.5110.6619.53
Hindsight-Planner (this paper)few25.6134.9519.0029.9025.5134.7418.7728.29

Table 3. Ablation by task type, Valid Seen SR tab. 3 (labelled tab:5 in the source).

VariantExaminePickCleanStackPick TwoHeatCool
Base method40.425015.189.5630.657.4821.43
W.O. hindsight method39.3649.2916.967.8229.847.4710.31
W.O. adaptation module35.147.18.936.0932.259.3418.26

Table 4. Ablation on Valid Seen and Valid Unseen tab. 4 (labelled tab:3 in the source).

VariantValid Seen SRValid Seen GCValid Unseen SRValid Unseen GC
W.O. adaptation module23.1733.2814.9927.36
W.O. hindsight method23.5332.7616.3228.06
Base method25.6134.9519.0029.90

Table 5. Average sub-goal length per task type tab. 5 (labelled tab:4 in the source).

Task typeAvg. sub-goal length
Examine2.07
Pick2.48
Pick Two5.70
Stack5.63
Clean7.25
Cool10.36
Heat12.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.