---
title: Hierarchical Coreset (HierCore)
url: https://www.emergentmind.com/topics/hierarchical-coreset-hiercore
type: topic
---

# Hierarchical Coreset (HierCore)

Hierarchical Coreset, commonly abbreviated “HierCore,” denotes a family of hierarchical data summarization and subset-selection schemes in which a small weighted representation is organized across levels so that downstream objectives can be approximated without retaining the full dataset. In the classical coreset literature, this idea appears as the merge-and-reduce tree or coreset tree for streaming, distributed, and dynamic data, with guarantees defined over a query space $(P,w,X,f)$ and a weighted summary $C$ that preserves $f(P,Q)$ for every query $Q \in X$ [2011.09384]. More recent work uses the name or an equivalent construction in narrower settings, including hierarchy-aware subset construction based on RK-core strata and a hierarchical memory-bank framework for multi-class image anomaly detection that clusters semantic embeddings and then builds cluster-specific patch coresets [2310.12168, 2508.02477].

## 1. Formal definitions and conceptual scope

In the updated coreset survey, a query space is a tuple $(P, w, X, f)$ where $P$ is the input set, $w: P \to [0,\infty)$ is a weight function, $X$ is the set of queries, and $f: P \times X \to [0,\infty)$ is the loss. The total cost of a query $Q \in X$ on $P$ is
$$
f(P, Q) = \sum_{p\in P} w(p) f(p, Q).
$$
A coreset is a small weighted set $C$ with weights $u: C \to [0,\infty)$ such that, for every query $Q \in X$, the coreset cost
$$
f(C, Q) = \sum_{c\in C} u(c) f(c, Q)
$$
approximates $f(P,Q)$; the standard multiplicative guarantee is
$$
(1 - \epsilon) f(P, Q) \le f(C, Q) \le (1 + \epsilon) f(P, Q)
$$
for all $Q \in X$ [2011.09384]. The same survey distinguishes strong coresets, which approximate all $Q \in X$, from weak coresets, which approximate a restricted query family $X(C)$, and it identifies composability as the property that unions of coresets are themselves coresets for unions of inputs and can be recursively recompressed [2011.09384].

Within this classical usage, “HierCore” is effectively synonymous with a coreset tree or merge-and-reduce framework. The survey states this explicitly: “HierCore = coreset tree = merge-and-reduce framework” [2011.09384]. In this sense, hierarchy refers to the recursive organization of summaries across levels of a tree, not to semantic class structure.

A second, learning-centric definition appears in the 2025 coreset selection survey. There, the primary objective is to choose a subset $S$ of a training set $T$ such that a model trained on $S$ generalizes similarly to one trained on $T$:
$$
S^* = \arg\min_{S \subseteq T : |S|/|T| \le 1 - \alpha} \mathbb{E}_{(x,y)\sim P}[ L(x,y; \theta^S) ].
$$
That survey does not use the name “Hierarchical Coresets” or “HierCore,” but it frames hierarchical constructions through composable and multi-stage procedures in streaming, continual, distributed, and staged selection settings [2505.17799].

A third usage is more specialized. In the RK-core paper, hierarchical structure is induced by refined k-core decomposition over sample affinity graphs, and the resulting strata are used to motivate a hierarchy-aware coreset that preserves “hierarchical diversity” rather than selecting only the most representative points [2310.12168]. In the 2025 anomaly-detection paper, “Hierarchical Coreset (HierCore)” is the explicit name of a two-level semantic clustering and patch-memory-bank method for multi-class image anomaly detection [2508.02477].

## 2. Merge-and-reduce coreset trees

The canonical hierarchical construction partitions a dataset or stream into blocks, computes a small coreset for each block, and organizes these summaries in a tree. When two coresets of the same level are present, they are merged by weighted union and then reduced by recompressing the union into a new coreset of bounded size. The active nodes across all levels summarize all data seen so far [2011.09384].

The streaming update pattern is standard:
1. insert incoming points into a level-$0$ buffer;
2. when the buffer reaches size $B$, compute a coreset for that block;
3. whenever at least $a$ coreset nodes exist at the same level, merge their weighted unions and reduce to a new coreset at the next level;
4. optionally reduce the union of active nodes into a final top-level coreset [2011.09384].

Error accumulation is controlled per level. For additive guarantees,
$$
|f(P, Q) - f(C_{\mathrm{final}}, Q)| \le \sum_{i=0}^{L} \epsilon_i.
$$
For multiplicative guarantees,
$$
f(C_{\mathrm{final}}, Q) \in f(P, Q)\cdot \prod_{i=0}^{L} (1 \pm \epsilon_i),
$$
so choosing $\epsilon_i \le \epsilon/L$ yields overall $(1\pm \epsilon \pm O(\epsilon^2))$ behavior [2011.09384]. Composability follows from additivity: if $C_1$ and $C_2$ approximate $P_1$ and $P_2$, then $C_1 \cup C_2$ approximates $P_1 \cup P_2$ [2011.09384].

The 2016 framework of Feldman, Schmidt, and Sohler refines the hierarchical picture by showing that sensitivity-based sampling can reduce coreset size from $O(t^2)$ to
$$
N = O\!\left(\frac{t}{\epsilon^2}\left(d\log t+\log\frac{1}{\delta}\right)\right),
$$
where $t$ is total sensitivity and $d$ is the VC-dimension of the induced function class. In a merge-and-reduce hierarchy with $L=O(\log n)$ levels, overall memory becomes $O(N\cdot L)$, and per-level errors $\epsilon'_\ell \approx \epsilon/L$ preserve end-to-end approximation [1612.00889]. For k-means and k-median, the same framework yields $t=O(k)$ and coreset sizes of order
$$
N = O\!\left(\frac{d}{\epsilon^2}\, k\log k\right)
$$
with probability at least $2/3$ [1612.00889].

This hierarchical model is directly suited to streaming computer vision. An early application proposed “a compact, constant size representation of all the data that was seen until a given moment,” constructed “using a parallelized algorithm,” then used a coreset tree to learn “an adaptive object appearance model” in “constant time and logarithmic space” for tracking-by-detection. The method reported results on “three standard datasets over more than 100 videos” and outperformed several algorithms on the TLD dataset, whose videos average 2685 frames [1511.06147].

## 3. Hierarchical diversity via RK-core

RK-core starts from a data-centric premise: when a dataset is modeled class-wise as a graph of sample-to-sample affinities, hierarchical structure can be exposed through coreness. Let $X=\{x_1,\ldots,x_N\}$ be the samples of one class, let $F=f_e\circ f_c$ be a pre-trained model, and let $z_n \in \mathbb{R}^C$ be the spatially averaged feature vector of sample $x_n$. Pairwise cosine affinity is
$$
a_{n,m} = \frac{\langle z_n, z_m\rangle}{\|z_n\|_2 \|z_m\|_2}.
$$
Thresholding at $\epsilon$ yields an undirected sparse graph $G=(V,E)$ [2310.12168].

Classical k-core decomposition defines the $k$-core $C_k$ as the maximal subgraph in which every vertex has degree at least $k$, and the coreness of a vertex $v$ is
$$
c(v) = \max\{k \mid v \in C_k\}.
$$
RK-core refines this by recording the pruning round $R(v)$ from onion decomposition and defining
$$
RD(v) = R(v) + \sum_{w \in N(v)} R(w),
$$
which breaks ties within a coreness level by incorporating neighborhood pruning information [2310.12168]. The peeling and neighbor updates are $O(|E|)$, and the additional pass for $RD$ is also $O(|E|)$.

The empirical motivation is representativeness. On CIFAR-10, class-balanced subsets containing $20\%$ per class and stratified by coreness gave:
- High coreness: $65.1 \pm 0.1$
- Medium coreness: $61.8 \pm 0.1$
- Low coreness: $46.2 \pm 0.2$

On CIFAR-100 with $100$ samples per class, the corresponding values were:
- High: $23.9 \pm 0.1$
- Medium: $21.3 \pm 0.1$
- Low: $13.8 \pm 0.1$ [2310.12168]

The same analysis shows that a high-quality coreset should not be concentrated solely at the highest coreness levels. The paper reports that existing coreset methods on CIFAR-10, including DeepFool, Uncertainty, k-Center Greedy, GraNd, Glister, and Random, select samples with a spread of coreness values. At $20\%$, for example, k-Center Greedy reaches $85.4 \pm 0.3$, whereas a “high-coreness-only” subset of the same budget reaches $65.1 \pm 0.1$ [2310.12168].

The paper does not name a specific algorithm “HierCore,” but its analysis implies a recipe that balances representativeness and hierarchical coverage. The proposed hierarchy profile for a subset $S$ is defined over coreness bins $K=\{k_1,\ldots,k_M\}$ by
$$
p_S(k) = \frac{|\{v \in S : c(v)=k\}|}{|S|},
$$
with analogous $p_D(k)$ for the full dataset. Diversity and fidelity can then be quantified by
$$
H(p_S) = -\sum_{k \in K} p_S(k)\log p_S(k),
$$
$$
\mathrm{cov}(S) = \frac{|\{k \in K : p_S(k) > 0\}|}{|K|},
$$
and
$$
D_{KL}(p_S \,\|\, p_D) = \sum_{k \in K} p_S(k)\log \frac{p_S(k)}{p_D(k)}.
$$
A representative scoring function is
$$
s(v) = \alpha c(v) + \beta RD(v),
$$
and the coreset can then be selected to maximize representativeness subject to constraints such as $\|p_S-p_D\|_1 \le \delta$ and $\mathrm{cov}(S)\ge \gamma$ [2310.12168]. This formulation makes the hierarchical claim precise: preserving dataset structure means retaining multiple coreness strata rather than only the most central samples.

## 4. Aggregation trees and pseudo-cubes for relational data

A different hierarchical coreset construction appears in relational learning, where the data matrix is not materialized explicitly but defined by a join of $s$ relational tables. If
$$
P = T_1 \Join \cdots \Join T_s \subset \mathbb{R}^d,
$$
the empirical risk objective is
$$
F(\theta) = \frac{1}{n} \sum_{i=1}^n f(\theta, p_i),
$$
with a continuity assumption
$$
|f(\theta, p) - f(\theta, q)| \le \alpha \|p-q\|^z + \beta |f(\theta,q)|
$$
for constants $\alpha,z \ge 0$ and $\beta \in [0,1)$ [2210.04249].

The paper defines a weighted set $\tilde P = \{(c_i,w_i)\}$ to be an $(\epsilon_1,\epsilon_2)_z$-coreset if, for all $\theta \in \mathcal{H}$,
$$
\tilde F(\theta) \in (1 \pm \epsilon_1)F(\theta) \pm \epsilon_2 \Delta^z,
$$
where $\Delta$ is the diameter of $P$ and
$$
\tilde F(\theta) = \frac{1}{\sum_i w_i} \sum_i w_i f(\theta,c_i).
$$
This guarantee combines multiplicative and additive error terms [2210.04249].

The hierarchical structure is an aggregation tree built bottom-up. Each node $\nu$ carries a subset of represented tables $I_\nu \subseteq [s]$, a product subspace
$$
H_\nu = \prod_{i \in I_\nu} \hat D_i,
$$
and a set of $k$ centers $C_\nu = \{c_{\nu,1},\ldots,c_{\nu,k}\}\subset H_\nu$ [2210.04249]. The key geometric primitive is the pseudo-cube:
$$
PC_I(c,r) = \prod_{i \in I} \mathcal{B}(\mathrm{Proj}_{\hat D_i}(c), r).
$$
Because pseudo-cubes are Cartesian products of Euclidean balls in each participating subspace, their counts can be computed under acyclic joins without additive inequalities [2210.04249].

At the leaves, Gonzalez is run on $\mathrm{Proj}_{\hat D_i}(P)$ to produce $k$ centers per table. At an internal merge, two child center sets form a $k \times k$ grid $G = C_{\nu_i} \times C_{\nu_j}$. Empty grid points are removed by COUNT tests over products of pseudo-cubes, and Gonzalez is then run on the nonempty set $\hat G$ to compress back to $k$ centers. The per-level covering radius satisfies
$$
L_h = \sqrt{2^h \left(l_h + \sqrt{2}L_{h-1}\right)},
$$
and the paper proves
$$
L_h \le 3^h \cdot 2^{(h^2 + 3h + 8)/4}\cdot r_0,
\qquad
r_0 = \Delta/k^{1/\rho},
$$
where $\rho$ is the doubling dimension [2210.04249].

The resulting size theorem states that if
$$
k =
\left(
(\alpha/\epsilon_2)^{1/z}\cdot
3^{\lceil \log s \rceil}\cdot
2^{(\lceil \log s \rceil^2 + 3\lceil \log s \rceil + 8)/4}
\right)^{\rho},
$$
then the root centers with appropriate weights yield a $(\beta,\epsilon_2)_z$-coreset satisfying
$$
|\tilde F(\theta)-F(\theta)| \le \beta F(\theta) + \epsilon_2 \Delta^z
$$
for all $\theta$ [2210.04249]. Because pseudo-cubes can overlap, the paper adds a sampling-based overlap-resolution stage; if
$$
m \ge \Theta\!\left(\frac{k^2}{((\epsilon_1-\beta)^2\epsilon_1)} \log(k/\lambda)\right),
$$
then with probability at least $1-\lambda$ the final coreset satisfies the full $(\epsilon_1,\epsilon_2)_z$ guarantee [2210.04249].

The total tree-construction time is
$$
O(sk^2\Psi(N,s,d) + sk^3),
$$
with
$$
\Psi(N,s,d) = O(sd^2N\log N)
$$
for acyclic counting, and overlap resolution costs $O(k^2md)$ [2210.04249]. The same framework is instantiated for k-means, k-median, k-center, logistic regression, and SVM. In this setting, hierarchical coreset construction is not merely a storage device; it is the mechanism that makes learning over unmaterialized joins tractable.

## 5. HierCore for multi-class image anomaly detection

In multi-class unsupervised image anomaly detection, the 2025 paper formally introduces Hierarchical Coreset (HierCore) as a hierarchical memory-bank method intended to satisfy two deployment requirements: training should be agnostic to class-label availability, and evaluation should maintain comparable performance whether class labels are available or not [2508.02477]. The paper distinguishes four scenarios: $K \to K$, $U \to K$, $K \to U$, and $U \to U$, where $K$ and $U$ denote known and unknown class labels at training or inference.

The method uses a pre-trained Wide-ResNet-50. Semantic embeddings are taken from the fourth layer,
$$
e = \{ \phi_{\mathrm{last}}(x_i) \mid x_i \in X_N \},
$$
while local patch features are taken from the second and third layers and then processed by a patch-extraction operator using a $3\times 3$ window with stride $1$ [2508.02477]. The hierarchy has two levels.

At Level 1, semantic embeddings of normal images are clustered by FINCH. The hierarchy level with the highest Silhouette score is selected, yielding $K$ clusters without pre-setting $K$. Cluster centroids are
$$
c_k = \frac{1}{N_k}\sum_{i=1}^{N_k} e_i,
$$
and image assignment uses Euclidean distance:
$$
k_i^* = \arg\min_{k \in \{1,\ldots,K\}} \|e_i - c_k\|_2.
$$

At Level 2, each semantic cluster has its own patch memory bank:
$$
M_k = \bigcup_{x_i \in X_{N,k}} P(\phi_j(x_i)).
$$
Redundancy is reduced by k-center coreset selection. The paper writes the Euclidean covering objective as
$$
M_{k,c}^* = \arg\min_{M_{k,c} \subset M_k} \max_{m \in M_k} \min_{n \in M_{k,c}} \|m-n\|_2,
$$
with a sampling ratio $r=10\%$ in the experiments [2508.02477].

Inference first assigns a test image to the nearest semantic centroid,
$$
\hat k(x) = \arg\min_k \|e(x)-c_k\|_2,
$$
then computes patchwise nearest-neighbor distances to the corresponding cluster-specific coreset memory:
$$
s_{\mathrm{patch}}(p) = \min_{n \in M_{\hat k}^*} \|f(p)-n\|_2.
$$
The patchwise anomaly map is upsampled bilinearly, and the image-level anomaly score is the maximum patch score:
$$
s_{\mathrm{image}}(x) = \max_{p \in \mathrm{patches}(x)} s_{\mathrm{patch}}(p).
$$
Known evaluation can use per-class thresholds $T_c$, whereas unknown evaluation can use a single global threshold $T_{\mathrm{global}}$. The paper also states that the architecture conceptually supports per-cluster thresholds $T_k$ via pseudo-class assignment, but the reported evaluation uses optimal thresholds chosen post hoc by
$$
\hat T = \arg\max_T \mathrm{F1\text{-}score}(T).
$$
It does not provide a label-free threshold estimation formula [2508.02477].

The reported complexity makes the hierarchical effect explicit. If $P$ is the total number of patches, $d$ the local feature dimension, $r$ the coreset sampling ratio, $N$ the number of images, and $P_i$ the number of patches in cluster $i$, then
$$
\Omega(\mathrm{PatchCore}) = P^2(d+3r),
$$
whereas
$$
\Omega(\mathrm{HierCore}) = \sum_{i=1}^{K} P_i^2(d+3r) + \Omega(N^2).
$$
The patch count is
$$
P = N\cdot (W + 2p - w + 1)\cdot (H + 2p - h + 1),
$$
and the paper remarks that typically $N \ll P$, so FINCH overhead is negligible relative to patch-level computations [2508.02477].

Empirically, the method is evaluated on MVTec AD, VisA, MPDD, and BTAD, using mean AUROC, mean AP, mean F1 at optimal threshold, mean AUPRO, and mean IoU at optimal threshold, with the aggregated score $mAD$ defined as the unweighted average of metrics in the corresponding block [2508.02477]. Under known evaluation, HierCore reports image-level and pixel-level $mAD$ values of:
- MVTec AD: image $0.992$, pixel $0.748$
- VisA: image $0.953$, pixel $0.649$
- MPDD: image $0.948$, pixel $0.655$
- BTAD: image $0.952$, pixel $0.652$

Robustness to label availability is one of the central claims. In the $U \to K$ versus $U \to U$ comparison, the Diff. Ratio (Unknown/Known F1) is:
- MVTec AD: image $100.0\%$, pixel $100.1\%$
- VisA: image $100.0\%$, pixel $100.0\%$
- MPDD: image $99.9\%$, pixel $100.5\%$
- BTAD: image $100.0\%$, pixel $100.0\%$

In the $K \to K$ versus $K \to U$ comparison, the corresponding Diff. Ratios are:
- MVTec AD: image $100.0\%$, pixel $99.6\%$
- VisA: image $100.0\%$, pixel $99.2\%$
- MPDD: image $100.0\%$, pixel $95.2\%$
- BTAD: image $100.0\%$, pixel $100.0\%$ [2508.02477]

Efficiency gains relative to PatchCore are also reported. On MVTec AD, memory-bank construction decreases from $317$ minutes to $25$ minutes, evaluation time from $196$s to $96$s, and FPS increases from $8.82$ to $17.98$. On VisA, memory-bank construction decreases from approximately $1{,}886$ minutes to $156$ minutes, evaluation time from $462$s to $131$s, and FPS increases from $4.67$ to $16.51$. Averaged across datasets, the paper reports approximately $12$–$13\times$ faster memory-bank construction, approximately $3.5\times$ faster inference, and approximately $3.5\times$ higher FPS [2508.02477].

## 6. Terminological range, related hierarchies, and limitations

The literature does not use “HierCore” in a single uniform sense. In survey-style coreset theory, the term denotes the classical merge-and-reduce tree over weighted summaries [2011.09384]. In the RK-core setting, it denotes a hierarchy-preserving subset strategy derived from coreness strata and refined rankings, and the paper explicitly argues that “a high-quality coreset should exhibit hierarchical diversity instead of solely opting for representative samples” [2310.12168]. In relational learning, the hierarchy is an aggregation tree with pseudo-cubes over joins [2210.04249]. In anomaly detection, the term is the proper name of a specific semantic-clustering and cluster-specific memory-bank framework [2508.02477].

The 2025 survey of coreset selection literature places these usages in a broader context of composable, dynamic, and multi-stage pipelines. Although it does not use the name “Hierarchical Coresets” or “HierCore,” it treats hierarchical behavior as arising in composable streaming and distributed coresets, filter-then-select pipelines such as FASS, PRISM, and SIMILAR, label-free staged strategies such as ELFS, and bilevel continual-learning or streaming methods such as those of Borsos et al. and Wang et al. [2505.17799]. In that survey, the theoretical guarantees are typically per stage rather than global hierarchy-wide formulas: submodular maximization retains the greedy bound
$$
f(S_g) \ge (1 - 1/e) f(S^*),
$$
while CRAIG-style gradient approximation is controlled by
$$
\max_{\theta \in W}\left\|
\sum_{i\in T}\nabla_\theta L_i -
\sum_{j\in S}\gamma_j \nabla_\theta L_j
\right\| \le \epsilon
$$
[2505.17799].

Several misconceptions can therefore be excluded. Hierarchical coresets are not restricted to one objective class: the cited literature covers clustering, subspace approximation, regression, SVM, logistic regression, tracking-by-detection, active learning, continual learning, semi-supervised learning, and anomaly detection [2011.09384, 2210.04249, 2505.17799]. Nor does hierarchy necessarily mean class labels; the anomaly-detection HierCore is designed precisely to operate “even without class labels,” using semantic clustering to estimate pseudo-classes [2508.02477]. Conversely, hierarchy does not automatically solve thresholding or robustness problems: the anomaly-detection paper reports optimal thresholds selected post hoc and does not specify a label-free threshold estimation formula, and the relational framework depends on acyclic joins, low intrinsic dimension, and sufficient sampling to resolve pseudo-cube overlap [2210.04249, 2508.02477].

Taken together, the term “Hierarchical Coreset” refers to a common structural principle—multi-level compression that preserves task-relevant structure—implemented in materially different ways across classical coreset theory, hierarchy-aware subset selection, relational learning, and multi-class anomaly detection. The common thread is recursive or stratified reduction; the differences lie in what defines a level of the hierarchy, what objective is preserved, and what approximation or deployment guarantees are available.

Source: https://www.emergentmind.com/topics/hierarchical-coreset-hiercore