Glossary · Term

prefix tree merging

← all terms

Definition

Plain language

A speed trick where multiple AI runs that share the same opening context only compute that opening once.

As stated in the literature

In Forge, an exact (non-approximate) optimization that computes shared prompt prefixes once across many sampled rollouts and branches into divergent continuations, yielding up to ~40x training speedup.

Why it matters: Reusing shared prefixes turns wasted recomputation into pure speedup, dramatically lowering RL training cost without changing the math.

For example, 32 rollouts that share the same 4,000-token system prompt run that prompt through the model once instead of 32 times.

Related terms