Memoryless Decomposition Pattern

Context

You need an LLM to produce a structured artifact, an ontology, a schema, a complex document, that must satisfy multiple discrete requirements. The requirements can be processed independently, but the final output needs to be coherent.

Problem

The intuitive approach is to feed each output back into context as you generate it, letting the model maintain consistency. But accumulated context becomes a distraction. The model tries to stay consistent with its previous outputs rather than focusing on the current requirement. Outputs degrade as context grows.

Solution

Process each requirement independently with minimal context:

  1. Isolate each subtask. Give the LLM only what it needs for the current requirement, the original problem statement, any shared context, but not previous outputs.

  2. Generate independently. Each subtask produces its own output without reference to others.

  3. Merge in post-processing. Combine outputs after generation. Resolve overlaps and inconsistencies through separate logic, not in-context.

  4. Accept some redundancy. Independent generation will produce duplicates. Plan for deduplication rather than trying to prevent it in-context.

Consequences

Benefits:

  • Higher accuracy per subtask (~60% context reduction improved results in ontology generation)
  • Predictable behavior as scale increases
  • Parallelization possible
  • Each output can be individually validated

Costs:

  • Requires post-processing merge logic
  • May produce redundant or conflicting elements
  • Loses any emergent consistency that cross-referencing might provide
  • Not suitable when subtasks genuinely depend on each other’s outputs

When to Apply

  • Structured output tasks (ontologies, schemas, code modules, form sections)
  • Requirements that are logically independent even if outputs need to be integrated
  • Situations where precision matters more than novelty
  • When you have reliable merge/deduplication capability

When to Avoid

  • Tasks where outputs genuinely build on each other (narrative, argument chains)
  • When consistency between elements is the primary quality criterion
  • When you lack post-processing capability to resolve conflicts

Related:, 05-atom—context-window-limitations