Papers
Topics
Authors
Recent
Search
2000 character limit reached

Hierarchy Builder (HB) Framework

Updated 12 July 2026
  • Hierarchy Builder (HB) is a multi-domain design motif that organizes objects into layered and partially ordered structures, enabling flexible data representation.
  • In medical information extraction, HB transforms flat textual spans into compact, navigable DAGs using lexical and semantic merging strategies to reduce user effort.
  • HB also underpins adaptive model hierarchies for efficient multi-query computation and formalizes inheritance in categorical graph rewriting using Coq.

Hierarchy Builder (HB) is a name used for several technically distinct hierarchy-construction frameworks in recent research. In one usage, HB converts a flat list of extracted textual spans into a compact, navigable directed acyclic graph (DAG) for exploratory browsing in medical information extraction (Yair et al., 2023). In another, HB denotes an abstract framework of adaptive model hierarchies in which models M1,,MLM_1,\dots,M_L of increasing cost and decreasing error are queried until an a posteriori error criterion is met (Kleikamp et al., 2024). In a third, HB is a packed-class framework on top of Coq’s canonical structures for describing directed acyclic graphs of mathematical structures and inheritance relations, used to formalize adhesive category theory and categorical graph rewriting in Rocq (Arsac et al., 22 Sep 2025). The shared name therefore identifies a recurring design motif—the explicit organization of objects into layered or partially ordered form—rather than a single unified formalism.

1. Terminological scope

The expression “Hierarchy Builder” does not designate a unique standard architecture across the literature. The three uses summarized here differ in domain, object of organization, and correctness criterion. In the information-extraction setting, the organized objects are textual spans, and the target artifact is a navigable DAG whose structure is driven by lexical containment, semantic similarity, and taxonomic abstraction. In the adaptive-model setting, the organized objects are surrogate or reduced models ordered by fidelity, cost, and certifiable error. In the Rocq setting, the organized objects are mathematical structures and morphism classes arranged by forgetful inheritance inside a packed-class hierarchy.

A common misconception is to equate HB with tree construction. That characterization is inaccurate for two of the three usages. The information-extraction HB explicitly produces a DAG and preserves multiple inheritance; the Rocq HB likewise represents a directed acyclic graph of structures rather than a simple chain. Even in the adaptive-model framework, the operative object is not a tree but an ordered sequence of models together with switching rules and adaptation procedures. This suggests that “hierarchy” is the stable abstraction, while the concrete semantics of nodes and edges are domain-specific.

2. HB as a textual-span organizer

In “Hierarchy Builder: Organizing Textual Spans into a Hierarchy to Facilitate Navigation,” HB is a multi-stage pipeline that turns a flat list of textual spans into a compact, navigable DAG (Yair et al., 2023). The workflow begins with hundreds–thousands of extracted noun-phrases. Each phrase is expanded by extracting all meaningful sub-spans, including head nouns and modifiers. Every span ss is then preprocessed to remove stop-words, modal words, and quantities, and is lemmatized to define its lemma-bag L(s)L(s).

The first consolidation stage is lexical equivalence. Two spans s1,s2s_1,s_2 belong to the same initial group if L(s1)=L(s2)L(s_1)=L(s_2) up to small edit-distance matches and known spelling variants in UMLS/WordNet. This produces equivalence sets E1,,EnE_1,\dots,E_n. Every lexical equivalence set becomes a DAG node, and each span’s head noun or adjective is also introduced as an additional node to support co-mention grouping. A single artificial ROOT is added above all heads so that the graph is connected.

The initial edge relation is specificity by lemma-bag containment. Node BB is more specific than node AA when they are not equivalent and AA’s lemma bag is strictly contained in BB’s lemma bag. An edge ss0 is drawn only when there is no intermediate node ss1 with ss2, yielding what the paper calls a clean “containment DAG.” This graph is subsequently refined by semantic merging. For each equivalence set ss3, the average embedding is

ss4

The system traverses the DAG in depth-first order. Direct neighbors are merged when

ss5

and merging would not introduce a cycle. A second pass uses ss6 for merging a node with its direct child. Any UMLS-synonym pairs are also merged.

A further enrichment stage injects taxonomy. Each node, via its canonical span, is mapped into UMLS, and UMLS concepts that subsume at least two nodes are collected. If such a concept already appears as a node, the system connects it to descendants where missing, while avoiding cycles. Otherwise, it creates a new node labeled by its most similar synonym and hooks it above its descendant nodes. The resulting DAG is intentionally rich, but it is then pruned to reduce visual and navigational burden while preserving reachability of all original spans.

Pruning is formulated as a set-cover problem. For each node ss7, let ss8 be the sets of original-span descendants covered by each child. HB chooses a minimal subcollection of children such that

ss9

Because minimum-cardinality set cover is NP-hard, the system uses the standard greedy set-cover approximation: at each step it picks the child covering the largest number of yet-uncovered spans. After pruning edges, any node with only one child is spliced out by connecting its parent directly to its grandchild.

Entry-point selection gives the hierarchy a browse-oriented top layer. Each candidate node L(s)L(s)0 is scored by

L(s)L(s)1

where L(s)L(s)2 are embeddings of original spans reachable from L(s)L(s)3. HB picks the top-scoring node, subtracts its covered spans’ affinities from the scores of remaining candidates, and repeats until L(s)L(s)4 entry nodes are chosen. In the front end, the user first sees the L(s)L(s)5 entry nodes plus an “Other” bucket. Clicking an entry node expands its children, each node is labeled by its best representative span, and each node shows the number of original-span leaves reachable beneath it. The shallow average depth, approximately L(s)L(s)6, and small average branching factor, approximately L(s)L(s)7–L(s)L(s)8, are presented as the structural basis for bird’s-eye browsing with only a few clicks.

3. Medical information extraction deployment and evaluation

The textual-span HB was evaluated on a medical information-extraction task involving causes, or etiologies, of two common conditions: jaundice and chest pain, extracted from approximately L(s)L(s)9M PubMed abstracts (Yair et al., 2023). Extraction used s1,s2s_1,s_20 syntactic patterns via SPIKE and yielded s1,s2s_1,s_21 raw strings for jaundice and s1,s2s_1,s_22 for chest pain, collapsing to s1,s2s_1,s_23 and s1,s2s_1,s_24 unique strings, respectively. After lexical grouping, these became s1,s2s_1,s_25 jaundice concepts and s1,s2s_1,s_26 chest-pain concepts. The known-etiology benchmarks contained s1,s2s_1,s_27 established causes for jaundice and s1,s2s_1,s_28 for chest pain.

Coverage was measured relative to both the flat extraction list and the hierarchy’s entry nodes. The flat list contained s1,s2s_1,s_29 jaundice causes and L(s1)=L(s2)L(s_1)=L(s_2)0 chest-pain causes. With L(s1)=L(s2)L(s_1)=L(s_2)1 entry nodes, the HB hierarchy made L(s1)=L(s2)L(s_1)=L(s_2)2 reachable for jaundice and L(s1)=L(s2)L(s_1)=L(s_2)3 for chest pain; with L(s1)=L(s2)L(s_1)=L(s_2)4, it yielded full coverage for jaundice, L(s1)=L(s2)L(s_1)=L(s_2)5, and L(s1)=L(s2)L(s_1)=L(s_2)6 for chest pain. At L(s1)=L(s2)L(s_1)=L(s_2)7, the jaundice DAG had L(s1)=L(s2)L(s_1)=L(s_2)8 nodes, depth at most L(s1)=L(s2)L(s_1)=L(s_2)9, average children approximately E1,,EnE_1,\dots,E_n0, and average entry-leaf distance approximately E1,,EnE_1,\dots,E_n1. The chest-pain DAG had E1,,EnE_1,\dots,E_n2 nodes, depth at most E1,,EnE_1,\dots,E_n3, average children approximately E1,,EnE_1,\dots,E_n4, and average entry-leaf distance approximately E1,,EnE_1,\dots,E_n5.

Human experts evaluated “effort” to locate known causes by comparing scanning a flat frequency-ranked list with navigating HB. The reported average outcome was that HB reduced effort drastically: most etiologies required far fewer clicks or scans in the DAG than positions in the flat list. Path quality was rated on a E1,,EnE_1,\dots,E_n6–E1,,EnE_1,\dots,E_n7 scale. Among E1,,EnE_1,\dots,E_n8 jaundice paths, E1,,EnE_1,\dots,E_n9 were rated BB0 (“excellent”), BB1 was rated BB2, and BB3 was rated BB4; for chest pain, BB5 were rated BB6, BB7 was rated BB8, and BB9 was rated AA0.

The deployment context was a demo in which biomedical researchers could pick a condition such as “chest pain” and browse hundreds of candidate causes in a compact DAG. Specialists reported that the hierarchy surfaces major categories of etiologies, hides near duplicates via merges, and preserves multiple inheritance when an item logically sits under two parents, as in “leg pain” under both Leg and Pain. The last point is important conceptually: the object produced by HB is not a taxonomic tree with unique parentage, but a DAG designed to retain semantically meaningful cross-classification.

4. HB as adaptive model hierarchies for multi-query computation

In “Adaptive Model Hierarchies for Multi-Query Scenarios,” HB is an abstract framework for choosing among cheaper and more expensive models on a per-query basis (Kleikamp et al., 2024). The starting point is an expensive “truth” solution operator AA1, for example a PDE solve for parameter AA2. One constructs AA3 lower-fidelity models AA4 with strictly increasing cost

AA5

and strictly decreasing error

AA6

For each query AA7, HB tries models from lowest to highest fidelity and stops as soon as an a posteriori error criterion is met.

The mathematical formulation makes the switching rule explicit. For AA8, define AA9 or to some lower-dimensional AA0, with evaluation cost AA1 and error measure

AA2

Each level is equipped with an inexpensive error estimator AA3 satisfying

AA4

with AA5 a moderate constant. Given a global tolerance AA6, HB stops at level AA7 if

AA8

This makes the hierarchy adaptive per request rather than statically fixed at one fidelity level.

The same mechanism is integrated into larger computational loops. In optimization, many evaluations of an objective AA9 are required; HB returns certified approximations BB0 quickly, only calling the expensive model when needed. In Monte Carlo or uncertainty quantification, one draws BB1 samples BB2, and HB avoids calling BB3 on every sample by replacing most calls with fast surrogates such as BB4 or BB5. The framework also defines an adaptation routine: when a higher level BB6 with BB7 is actually evaluated, the pair BB8 is appended to a training set BB9, and once ss00, model ss01 is retrained and the training set may be cleared or pruned.

The performance analysis is likewise hierarchical. If ss02, then the average cost is approximately

ss03

Good hierarchies have ss04, so ss05 plus small overhead. With ss06 and ss07 for ss08, the average cost per query is ss09 with small ss10. Reported empirical speed-ups include a ss11–ss12 speed-up in total runtime for PDE-constrained optimization with two levels while meeting the same objective tolerance, up to ss13 reduction in expensive solves for a parabolic PDE Monte Carlo example with three levels, and ss14 fewer full-order solves for an optimal-control setting with three levels.

Implementation guidance in the same framework is concrete. Each ss15 is stored as an object with methods eval(μ) and update(D_ℓ). Training sets ss16 may be kept in a ring buffer or KD-tree for nearest-neighbor selection when pruning. Batch evaluation of many HB_Query calls can exploit GPUs or threads, and the error estimators ss17 can be accumulated before falling back one model at a time. A concrete one-iteration example sets ss18, ss19, and ss20, with ss21 a linear regression surrogate of cost approximately ss22 ms and ss23 a full PDE solver of cost approximately ss24 ms. For query ss25, the surrogate gives ss26 with ss27, so the system falls back to ss28 with true error approximately ss29, appends ss30 to ss31, and retrains ss32 by least squares when ss33 reaches ss34. In that illustrative scenario, after a few such iterations, ss35 of future ss36 values stop at level ss37, yielding a ss38 net speed-up compared to always using ss39.

5. HB as a packed-class hierarchy builder in Rocq

In “Adhesive category theory for graph rewriting in Rocq,” HB is a “packed-class” framework on top of Coq’s canonical structures for defining a directed acyclic graph of structures by specifying, for each node, the extra data or “mixin” that it adds and the lower nodes from which it inherits (Arsac et al., 22 Sep 2025). From these specifications, HB automatically generates a record type for each structure, canonical-structure instances, and coercions. The intended effect is that an adhesive category is also recognized as a category with pullbacks, and similar inheritance relations are reconstructed automatically.

Three design principles are central. First, inheritance is forgetful only: every structure bundles its own mixin together with the mixins of its ancestors, with no implicit ad hoc augmentation of older nodes. Second, builders and factories mediate logical implication between mixins. When one mixin implies another, as with regular mono implying mono, the user supplies a builder lemma so that declaring a regular mono automatically fills the mono data. Factories are “virtual” mixins that do not appear in final structures but allow multiple alternative presentations of the same concept. Third, coercions are user-controlled: HB tracks a single “index” for each hierarchy, namely the object-type in the category hierarchy and the underlying arrow in the morphism hierarchy.

The resulting library contains two parallel hierarchies. In the category-theory hierarchy, the levels are Quiver, PreCategory, Category, CatPb, CatRmPo, RmQAdhesive, RmAdhesive, CatMPo, and Adhesive. In the morphism hierarchy, the levels are Morphism, Iso, SplitMono, SplitEpi, RegMono, RegEpi, Mono, Epi, PreAdh, and Adh. Because HB allows only forgetful inheritance, adhesive morphisms lie above RegMono but below Iso, and the development introduces a separate ss40 that inherits from both Iso and Adh so that the primitive Iso mixin need not be rewritten.

The definitional backbone is categorical. For a precategory or category ss41, objects ss42, and morphisms ss43, ss44, a pullback square is defined by

ss45

For equalizers, with ss46 and ss47,

ss48

A regular mono is then

ss49

The higher levels specialize these notions. An rm-quasiadhesive category is one with all pullbacks and such that for every regular mono ss50 and ss51, the pushout of ss52 and ss53 exists, is stable, and is a pullback. An rm-adhesive category is an ss54 category in which regular subobjects are closed under binary union. An adhesive category is an ss55 category in which every mono is regular and all pushouts along monos exist, are stable, and are pullbacks. At the interface level, HB jargon treats every structure as a sequence of mixins; for example, regular monos are defined through a mixin record IsRegMono whose field is rm_prop : isRegMono m, and RegMono is declared as inheriting both Mono and IsRegMono, with a builder instance deriving IsMono from IsRegMono.

6. Instances, implementation trade-offs, and graph-rewriting formalization

The Rocq development uses HB to instantiate a range of concrete categorical settings (Arsac et al., 22 Sep 2025). The category of extensional Coq types, TypeCat, is given an AdhesiveCategory instance by supplying pullbacks and constructing pushouts via quotients by the smallest congruence; the proof uses two axioms, predicate_extensionality and constructive_definite_description. SetoidCat is also given an AdhesiveCategory instance. No axioms are needed to show it rm-quasiadhesive; to show it rm-adhesive one needs “ss56”; to show it fully adhesive one needs constructive indefinite description. The category of finite types, finType, is obtained by transport along the full-and-faithful forgetful functor finType → TypeCat, and because that functor preserves pullbacks, monos, and related structure, one obtains an axiom-free Adhesive instance on finType.

Other examples delimit the scope of adhesivity. A simple graph is represented as ss57, and a homomorphism preserves edges. SimpleGraphCat is shown rm-quasiadhesive by reduction to TypeCat, but it is not rm-adhesive because of a counter-example pushout that fails to be a pullback. Slice and functor categories inherit structure pointwise: if ss58 has pullbacks, or is adhesive, then ss59 and ss60 inherit the same structure. In particular, presheaf categories ss61 are (rm-)adhesive.

The implementation choices are explicitly trade-off driven. The library adopts setoid-enrichment rather than strict categories with propositional equality: all hom-sets are setoids, and composition and identity respect the equivalence. This avoids the need for axioms for quotients and for suppressing computational content of “regular mono,” but it requires many Proper and CMorphisms.Proper instances so that rewriting works up to setoid equivalence in Type. The library also maintains both bundled and unbundled forms. Categories, monos, and pullbacks are bundled records, but proofs often need predicate forms such as isMono f : Prop or isPullback f g p q : Type; conversion lemmas support movement between the two. Duality is encoded by assigning each structure ss62 a dual ss63 obtained by swapping sources and targets and reversing composites. Since ss64 and ss65 are propositionally but not definitionally equal, occasional casts are necessary, and an alias catop : Type→Type with notation C^op is introduced to disambiguate canonical-structure inference.

The stated limitations of HB are equally important for understanding the framework. There is no universe polymorphism, so small and large setoids must be duplicated. HB does not allow adding new downward inheritance edges after the fact, which is why a separate ss66 was created to sit above Adh. Dynamic collapse of classes, such as Mono ≡ AdhesiveMono in an adhesive category, is not automatic; promotions must be invoked explicitly via factories and builders. These are not incidental engineering details but structural constraints on the expressivity of the hierarchy description mechanism.

The principal application is the formalization of double-pushout graph rewriting. A linear production is a span of regular monos ss76 and a derivation is represented by two pushout squares. Using the abstract library, the development formalizes the Local Church–Rosser theorem and the Concurrency Theorem from Lack and Sobociński. For Local Church–Rosser (Theorem 7.7), the equivalence “parallel independence ⇔ sequential independence” occupies ss67 pages with ss68 objects per diagram in the paper proof, and ss69 lines of Coq statements plus ss70 lines of proof in Rocq+HB. For the Concurrency Theorem (Theorem 7.10), the paper proof occupies ss71 pages with ss72 objects per diagram, and the Rocq+HB version uses ss73 lines of statements plus ss74 lines of proof. Because the abstract library itself is axiom-free, with axioms entering only when instantiating the Type category or lifting disjunctions in Setoids, these theorems hold in every rm-quasiadhesive instance without further assumption. The overall development, approximately ss75 k LOC, presents HB as a modular mechanism for declaring large intertwined hierarchies of structures while supporting nontrivial reusable formalization in categorical graph rewriting.

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 Hierarchy Builder (HB).