Design it step by step
Check the taxonomy assumption
Invented tree: development→API/data→first call/extraction. Give nodes stable IDs and definitions. Truly multi-topic documents may need a primary class plus tags instead of a forced single path.
Choose among direct children
Provide source text and the current path. Choice compares the direct children with an uncertainty outcome. Keep full distributions; language is not topic.
See how greedy errors become irreversible
Invented root probabilities 0.52 versus 0.48 leave little separation. Greedy search keeps one path and may never reach the correct data/extraction branch. It saves exploration but loses alternatives.
Keep bounded alternatives when useful
The official recipe explores K paths with beam search. Test a budget such as K=2 rather than assuming improvement. State the path-scoring and length-normalization rules; a heuristic score is not global correctness probability.
Stop at a reliable parent if needed
Return a broad class with unresolved refinement. Log node decisions, model and taxonomy versions, and error locations. Replay fixed tests after tree changes and handle unknown topics explicitly.
Worked example · Invented by this site
| Observation | Judgment | Application action |
|---|---|---|
| Root 0.52/0.48; deeper extraction evidence | Early preference is weak | Keep two paths if budget permits |
| Clear parent, close leaves | Only the parent is established | Return parent with review |
| Two genuine topics | Single-label assumption fails | Separate primary class and tags |
A copyable design draft
Original examples. JSON illustrates request or input structure; Python calculates invented scores without an API call. Verify current interfaces and task policy before integrating.
# Invented taxonomy input; no model calls.
{
"taxonomy_version": "tutorial-v1",
"node_id": "development",
"children": {"api": "API integration", "data": "Data processing"},
"fallback": "development:needs_review",
"exploration_budget": {"max_paths": 2, "max_depth": 3}
}Design a decisionCommon mistakes
- Assuming a local maximum is a global optimum.
- Calling path scores calibrated probabilities.
- Changing taxonomy without versions.
TRY / THINK / COMPARE
Think first, then compare
The parent is clear but two leaves tie. Force a leaf?
Show explanation
No. Keep the parent and review or obtain context if a leaf is required.
Before handing it over
- Stable node IDs and definitions.
- Distributions and paths logged.
- Budget, unknowns, and parent fallback defined.
- Tree updates replay fixed cases.
Common questions
Is beam always better?
No. Compare accuracy and cost on the same cases.
Is a product of edge scores confidence?
No. Path heuristics differ from answer confidence.
Sources and further reading
Inspired by official patterns and Datawhale practice topics. Explanations, examples, and exercises are independently written. These are teaching designs, not live API runs or benchmarks.