Treewalker checks the alternative token probabilities at each generated position, pruning any candidate whose logprob percentage falls below the configured threshold before executing branch completions.

flowchart TD
    subgraph Main["Primary Generation Path"]
        T1["Token 1: 'Best' (92%)"] --> T2["Token 2: 'SEO' (55%)"]
        T2 --> T3["Token 3: 'Platform' (88%)"]
    end

    subgraph Alternatives["Alternative Tokens at Position 2"]
        T2 -->|35% Logprob| B1["Branch A: 'Agency'"]
        T2 -->|6% Logprob| B2["Branch B: 'Service'"]
    end

    subgraph Threshold["Threshold Filter (10% Cutoff)"]
        B1 -->|Above Threshold| P1["Explore Branch"]
        B2 -->|Below Threshold| P2["Prune Branch"]
    end