Papers
Topics
Authors
Recent
Search
2000 character limit reached

Online Learning of HTN Methods

Updated 14 June 2026
  • Online learning of HTN methods is a technique that dynamically acquires and generalizes task decomposition strategies using LLM-generated plans.
  • It leverages a two-stage process with plan proposal and refinement, followed by lifting and regression to create provably sound, reusable HTN methods.
  • Empirical evaluations in logistics and search and rescue domains demonstrate reduced LLM calls and enhanced planning coverage.

Online learning of Hierarchical Task Network (HTN) methods addresses the challenge of dynamically acquiring and generalizing task decomposition strategies within the HTN planning paradigm, particularly when integrated with LLMs. In this context, the system learns new methods online when facing novel compound tasks for which no existing HTN method is applicable. The paradigm not only memorizes LLM-generated decompositions for specific task instances but also generalizes from single examples to construct reusable HTN methods. These generalized methods are provably sound and reduce the need for repeated, costly LLM invocations while maintaining or improving domain-level planning completeness and solution quality (Xu et al., 17 Nov 2025).

1. HTN Planning and the Problem Setting

HTN planning is formalized as constructing a sequence of primitive actions in order to achieve high-level objectives by recursively decomposing compound tasks. Formally, an HTN planning problem is a 4-tuple:

Π=(T,s0,M,O)\Pi = (T, s_0, M, O)

where:

  • TT is the initial task list, containing primitive or compound first-order terms.
  • s0s_0 is the set of grounded atoms representing the initial state.
  • MM is a set of methods m=(tm,pm,stm)m = (t_m, p_m, st_m) with tmt_m a compound task schema, pmp_m a set of precondition literals, and stmst_m an ordered subtask list.
  • OO is the set of operators, each o=(to,po,addo,delo)o = (t_o, p_o, add_o, del_o) specifying a primitive task, preconditions, add-list, and delete-list.

A method TT0 is applicable to TT1 if there exists TT2 such that TT3 and TT4. The planner reduces compound tasks by applying applicable methods and executes primitive tasks by applying operators. Manually authoring a complete set of methods TT5 is labor-intensive. ChatHTN addresses method incompleteness by integrating LLMs (specifically ChatGPT) to synthesize a primitive sequence decomposition for compound tasks lacking applicable methods, based on the task, preconditions, effects, current state, and available operators (Xu et al., 17 Nov 2025).

2. Online Method-Learning Algorithm

When the current compound task TT6 in state TT7 has no applicable method, the system queries ChatGPT in two prompt stages (plan proposal and refinement). The LLM-generated plan TT8 consists of primitive tasks whose corresponding operators are verified for applicability in sequence through intermediate states.

A baseline memoization caches the exact decomposition for TT9 pairs but fails to generalize across varying states or variable instantiations. The online learning extension generalizes decompositions into reusable HTN methods via:

  1. Lifting: Constants in s0s_00, s0s_01, and effects are replaced by fresh variables; e.g., s0s_02.
  2. Regression: Preconditions s0s_03 are computed as the weakest conditions on s0s_04 ensuring the desired effects s0s_05 hold after applying s0s_06. This is done recursively: s0s_07, and for s0s_08 down to 1,

s0s_09

yielding MM0, followed by lifting to variable form MM1.

  1. The learned method is MM2, which is added to MM3.

This approach ensures that future encounters with the same compound task schema benefit from previously learned decompositions, with generalization beyond mere instance-level reuse.

3. Theoretical Properties and Guarantees

The online HTN method-learning framework exhibits several formal guarantees:

  • Soundness preservation: Regression computes the weakest set of preconditions necessary for the primitive sequence to achieve the annotated effects. Thus, any plan using MM4 remains correct.
  • Finite-time learning: Each novel compound task instance triggers at most one LLM call and results in at most one method addition. The set MM5 thus grows monotonically up to the finite number of task schemas in the domain.
  • LLM call reduction: The number of LLM queries is bounded above by MM6, where MM7 is the initial method base. This is substantially fewer than the baseline, which may require repeated LLM queries per task instance.
  • Relative completeness: The integrated system solves any problem solvable by ChatHTN operating solely via online decomposition, as failed LLM decompositions merely trigger backtracking or retries, replicating ChatHTN behavior (Xu et al., 17 Nov 2025).

4. Empirical Evaluation

Experiments were conducted in two benchmark domains:

  • Logistics Transportation: Moving packages using a fleet of trucks and airplanes across cities, interleaving intra- and intercity transport.
  • Search and Rescue: A drone scans zones, detects survivors, and transports each to a safe haven.

The empirical protocol involved manually constructing a full HTN method base MM8, selectively removing methods to simulate incompleteness, and applying the planner to randomly generated problem instances. For each removed method, 10 problem instances were solved and repeated three times, with learned methods reset after each run.

The following table summarizes core results:

Domain Avg. LLM Calls (No-Learn) Avg. LLM Calls (Learn) % Solved (No-Learn) % Solved (Learn)
Logistics Transportation 24.8 10.2 76% 88%
Search and Rescue 18.3 8.7 82% 90%

These results indicate that online learning of HTN methods consistently halves the number of LLM calls and yields improved or maintained problem-solving coverage across the tested domains. Success rates remained high even as method knowledge was intentionally ablated, with fewer LLM re-queries reducing exposure to LLM errors. When top-level methods were removed, overall success rates dropped for all systems, reflecting the intrinsic difficulty of top-level task decomposition for LLMs (Xu et al., 17 Nov 2025).

5. Limitations and Open Challenges

Online learning in its current form induces only methods consisting of sequences of primitive tasks; it cannot learn decompositions containing recursive or compound subtasks. This precludes the induction of methods requiring branching, recursion, or loops, such as those needed for arbitrarily repeated tasks (e.g., rescuing an unbounded number of survivors).

Performance depends on the correctness of LLM-proposed decompositions. Incorrect outputs are detected and discarded via a verification step, but frequent high-level mistakes limit the efficacy of the approach in those regions of the problem space.

Future research directions and extensions include:

  • Supporting mixed primitive/compound decompositions to induce hierarchical structure and recursion.
  • Integrating online and offline LLM-driven method authoring for richer initial method sets.
  • Generalizing beyond regression, such as inducing conditional or looping constructs.
  • Developing dynamic caching strategies to combine the benefits of memoization and generalized method learning, potentially addressing both identical and similar state/task pairs (Xu et al., 17 Nov 2025).

6. Contextual Significance and Comparison

This line of research, as implemented in ChatHTN and its online learning extension, occupies a pivotal role in bridging symbolic hierarchical planning and data-driven LLM synthesis. The approach enables planners to incrementally acquire, generalize, and reuse planning knowledge in real time, accommodating method incompleteness in a principled, sound manner with explicit generalization via regression and variable lifting.

Unlike pure memoization strategies, generalized method learning provides broader task coverage and better amortization of LLM costs, marking a direction distinct from black-box LLM reasoning or static offline method induction. A plausible implication is that, for domains where method knowledge is costly to author or where planners must operate in open, evolving environments, online HTN method-learning strategies can yield scalable, self-improving planning agents with well-characterized soundness and efficiency properties (Xu et al., 17 Nov 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Online Learning of HTN Methods.