Greedy Algorithms with Pruning
- Greedy algorithm with pruning is an iterative scheme that makes local optimal decisions while discarding unpromising candidates to keep the search tractable.
- It is applied in areas such as symbolic regression, transformer compression, CNN filter removal, and submodular maximization to approximate global solutions efficiently.
- The method balances forward selection and backward elimination using adaptive criteria and dynamic recomputation to enforce structural invariants and guarantee performance.
Searching arXiv for relevant papers on greedy algorithms with pruning across symbolic regression, transformer compression, submodular optimization, sparse recovery, and theoretical guarantees. A greedy algorithm with pruning is an iterative optimization scheme in which each step makes a locally optimal addition or deletion while simultaneously eliminating candidates, paths, parameters, or ground-set elements judged to be unpromising by an explicit criterion. In the literature, this pattern appears in symbolic regression, transformer compression, CNN filter pruning, boosted decision-tree training, sparse signal recovery, and submodular maximization. The greedy move can be formulated as removing the single edge whose deletion causes the smallest increase in a data-fit loss, pruning the lowest-scoring attention head, selecting the layer whose removal leaves the largest remaining validation score, or adding the neuron that most reduces loss; the pruning move can be a beam restriction, a path cutoff, an interval-based discard rule, or a ground-set reduction step. Across these settings, pruning is used to keep the search tractable, but the resulting solution is generally an approximation rather than a global optimum (Wu et al., 2024, Peer et al., 2021, Chen et al., 8 May 2026, Nath et al., 2024).
1. Core algorithmic pattern
The common structure is a two-part loop. First, a greedy criterion ranks immediate actions by a local objective such as current validation performance, marginal gain, residual reduction, or loss increase. Second, a pruning rule removes options that are already dominated, exceed a threshold, have nonpositive marginal contribution, or fall outside a fixed beam. This coupling of local choice with candidate elimination is what distinguishes greedy-with-pruning procedures from plain greedy selection.
The literature also distinguishes backward elimination from forward selection. Backward methods start from a dense model or full candidate set and iteratively remove components; PruneSymNet removes linear connections, Greedy-Gnorm removes attention heads, Greedy-layer Pruning removes transformer layers, and FP-Backward removes CNN filters (Wu et al., 2024, Guo et al., 4 Feb 2026, Peer et al., 2021, Purohit et al., 2024). Forward methods start from an empty or sparse structure and add components; the Forward Selection algorithm for subnetworks adds the neuron that most reduces loss, and orthogonal matching pursuit-based filter pruning grows the kept filter set one filter at a time (Ye et al., 2020, Purohit et al., 2024). A third pattern is adaptive candidate pruning, in which exact greedy optimality is preserved by ruling out candidates with certified lower and upper bounds, as in boosted decision-tree training (Aziz et al., 2018).
| Algorithm | Object | Greedy / pruning rule |
|---|---|---|
| PruneSymNet (Wu et al., 2024) | ordinary edges | remove the single edge whose deletion causes the smallest increase in the data-fit term of |
| Greedy-Gnorm (Guo et al., 4 Feb 2026) | attention heads | prune the head with smallest |
| GLP (Peer et al., 2021) | transformer layers | remove the layer maximizing |
| TMP (Lee et al., 2014) | search-tree paths | prune a path when its approximated cost exceeds |
| Adaptive-Pruning Boost (Aziz et al., 2018) | stumps / features | discard a stump once |
| GreedyWithPruning (Chen et al., 8 May 2026) | active-set elements | remove if |
This suggests that “pruning” is not a single operation but a family of admissibility tests. In some cases the test is heuristic but loss-aware, in others it is derived from exact interval bounds, and in still others it is coupled to a structural invariant, such as positivity of all nonempty subsets of the current active set (Chen et al., 8 May 2026).
2. Symbolic regression and model-structure pruning
In symbolic regression, PruneSymNet embeds a combinatorial expression space into a differentiable network whose activation function consists of common elementary functions and operators. Each subnetwork corresponds to an expression, and a “minimalist” subnetwork is obtained by pruning extra linear connections one by one, starting from the output node and proceeding backward through layers. Training uses
with , while pruning evaluates only the data-fit term because the regularizer is constant once training stops. The greedy rule preserves the edge with the least loss in each pruning, and beam search of width is added because greedy algorithm often can not get the optimal solution. Two additional heuristics are reported: in the first two layers, top-0 selection may be replaced by a softmax over 1, and if at least 2 of beam members remain identical to their parents, the SGD learning-rate is bumped and the network is retrained briefly before the next prune (Wu et al., 2024).
Transformer pruning instantiates the same pattern at different structural granularities. Greedy-Gnorm prunes attention heads by dynamically recalculating head importance after each pruning step. For head 3, the score is the element-wise product of the 4-norms of its Q/K/V gradient blocks,
5
estimated from a hold-out validation set for the current partially pruned model 6. Heads with smaller scores are pruned next. The central design choice is recomputation: static rankings are treated as stale once the model has changed (Guo et al., 4 Feb 2026).
Greedy-layer Pruning applies greedy deletion at the layer level. Given a pre-trained Transformer encoder of depth 7, the formal objective is to choose 8, 9, maximizing the downstream performance measure 0. Exhaustive search over 1 candidates is replaced by removing exactly one further layer whose removal gives the largest remaining score. Because the method computes a nested removal sequence 2, model size can be adapted dynamically to a desired performance/speedup tradeoff without additional pre-training phases (Peer et al., 2021).
CNN whole-network filter pruning extends the greedy-with-pruning pattern hierarchically. At the lower level, FP-OMP performs forward greedy selection of kept filters from a sparse-approximation objective, while FP-Backward starts with all filters and removes one at a time using a closed-form error criterion 3. At the higher level, HBGS greedily selects the next layer to prune by layer-wise relative reconstruction error, whereas HBGTS uses final classification error as the global pruning criterion. The explicit separation between filter-selection and layer-selection turns pruning fractions into adaptive outputs rather than fixed per-layer inputs (Purohit et al., 2024).
A distinct variant is Greedy Adversarial Pruning, which removes the most important model parameters based on the gradient on adversarial inputs rather than the least important parameters for clean accuracy. The importance score is
4
and global thresholding produces the mask 5. Here the greedy objective is not compression alone but resistance to transfer attacks from the uncompressed model (Weiss et al., 2022).
3. Search trees, exact split selection, and ground-set reduction
In sparse signal recovery, Lee et al.’s Matching Pursuit with Tree Pruning (TMP) addresses the standard weakness of single-candidate greedy pursuit: myopic support decisions. TMP first performs pre-selection to restrict attention to a small subset 6, then grows a search tree of depth 7. For each partial path, it computes a causal residual, appends a rough noncausal completion, evaluates the residual norm of the resulting full candidate, and prunes paths whose approximated cost exceeds a running threshold 8. The effect is to explore multiple promising candidates via the tree search while curbing combinatorial blow-up (Lee et al., 2014).
Adaptive-Pruning Boost uses pruning to compute exact greedy-optimal decision stumps more efficiently. After evaluating a stump 9 on the first 0 heaviest examples, it maintains exact intervals
1
for the true weighted error 2. If 3, stump 4 cannot be optimal and is discarded. The algorithm then behaves like a best-arm identification procedure, alternately refining the current best arm and its strongest competitor until all others are certifiably inferior. The pruning is therefore not heuristic: it preserves exact greedy optimality while reducing feature–example assessments (Aziz et al., 2018).
For submodular maximization, pruning can occur before or during greedy selection. Submodular Sparsification builds a directed submodularity graph with edge weights
5
samples a probe set 6 of size 7, computes 8, and prunes a 9 fraction of nodes at each step. The downstream greedy algorithm is then run on a reduced set 0 (Zhou et al., 2016).
QuickPrune addresses billion-scale ground sets for knapsack-constrained maximization of a monotone, 1-submodular function. In QuickPrune-Single, each element 2 is processed once, kept only if 3 exceeds a threshold proportional to 4, and old snapshots 5 are occasionally forgotten when 6 has grown enough. QuickPrune-Multi runs several such instances in parallel for budgets 7 and returns the union. The pruned universe is then fed to a standard greedy maximizer (Nath et al., 2024).
In “Curvature Beyond Positivity,” pruning is interleaved directly with greedy selection. The algorithm picks an element of maximal marginal gain 8; if the gain is non-positive it stops, and after each addition it repeatedly removes any 9 with 0. This pruning loop is part of the approximation proof for arbitrary submodular functions, including negative-valued objectives (Chen et al., 8 May 2026).
4. Guarantees, rates, and complexity
Greedy-with-pruning methods range from exact algorithms with aggressive screening to approximate algorithms with explicit structural guarantees. In Adaptive-Pruning Boost, the interval rule yields exact greedy-optimal decision trees while visiting many fewer feature–example pairs; the subroutine at a tree node never visits any feature–example pair more than twice (Aziz et al., 2018). In contrast, Greedy-Gnorm is explicitly described as a greedy approximation to an NP-hard subset-selection problem, although dynamic recomputation is reported to close much of the gap between greedy and global optimality (Guo et al., 4 Feb 2026).
Several papers provide explicit complexity reductions. PruneSymNet with beam width 1 performs up to 2 forward passes per operator node, for total cost roughly 3, and memory 4; in practice 5 and 6 are small, with 7 and 8 (Wu et al., 2024). Greedy-Gnorm has overall cost 9, with score aggregation 0 per iteration and termination after at most 1 iterations (Guo et al., 4 Feb 2026). Greedy-layer Pruning reduces exhaustive 2 search to at most 3 fine-tuning runs, with worst-case 4; for a 12-layer BERT pruned by 6 layers, this becomes 5 fine-tunes rather than 6 (Peer et al., 2021). FP-Backward has overall cost approximately 7 and is reported as 8–9 orders of magnitude faster than repeated OMP calls (Purohit et al., 2024). Submodular Sparsification has total time 0 after the final greedy stage is included (Zhou et al., 2016).
The strongest formal rate results come from subnetwork selection and submodular analysis. Ye et al. prove that the discrepancy between a pruned network and the original decays at an exponentially fast rate with respect to the size of the pruned network, 1, so to achieve discrepancy at most 2 it is enough to keep 3 neurons under boundedness and Lipschitz assumptions (Ye et al., 2020). The Forward Selection framework proves 4 in general and 5 under an over-parameterization assumption, and it is explicitly contrasted with backward elimination, for which no 6 or 7 bound holds in general (Ye et al., 2020). For arbitrary submodular functions, GreedyWithPruning returns an active set 8 satisfying
9
with 0; when 1 is monotone, this recovers the classical 2 guarantee (Chen et al., 8 May 2026). QuickPrune supplies complementary guarantees on retained optimal value and pruned-set size, including
3
for every budget 4, and a pruned universe of size
5
5. Empirical behavior across application domains
In symbolic regression, PruneSymNet achieved the lowest test-set MSE on six public datasets relative to EQL, GP, and DSR, and by “voting” it won in 6–7 of cases across datasets. It also recovered exact symbolic ground-truth expressions more often than the baselines; on the Livermore set it found 8 of 9 expressions exactly, whereas the best baseline found 0. Ablations show that removing gradient-descent fine-tuning before pruning or replacing greedy pruning by random-edge deletion sharply degrades performance, and beam-search augmented pruning tends to find a low-loss subnetwork faster than pure greedy while avoiding occasional large-loss pruning decisions (Wu et al., 2024).
In transformer compression, Greedy-Gnorm reports stable accuracy under substantial head removal. When pruning down to about 1 of original heads, the reported before/after accuracies are 2 for BERT, 3 for ALBERT, 4 for RoBERTa, and 5 for XLM-RoBERTa. The paper further states that the BERT accuracy curve degrades smoothly even past 6 removal and that Greedy-Gnorm outperforms attention entropy, its inverse variants, and random pruning (Guo et al., 4 Feb 2026).
Greedy-layer Pruning reports a consistent speed/accuracy trade-off on GLUE. For 7, the baseline is 8 GLUE at 9 ms CPU and 00 ms GPU. 01 gives 02 GLUE, 03M parameters, 04 ms CPU, 05 ms GPU, and 06 speedup, outperforming 07 at the same depth and parameter count and remaining competitive with DistilBERT. On the two-layer exhaustive comparison, GLP08 exactly recovers Opt09 or is within 10 points in 11 tasks for BERT and 12 for RoBERTa (Peer et al., 2021).
Hierarchical CNN pruning reports similarly strong compression regimes. On CIFAR-10, HBGTS gives 13 accuracy on VGG16 with 14 parameter reduction and 15 FLOPs reduction, and 16 on ResNet18 with 17 parameter reduction and 18 FLOPs reduction. For ResNext101, the method reduces RAM requirement from 19 GB to 20 GB and achieves a 21 reduction in FLOPS without losing accuracy on CIFAR-10 (Purohit et al., 2024).
For exact split selection in boosted trees, Adaptive-Pruning Boost uses 22–23 fewer example assessments than Quick Boost, with CPU-time gains up to 24 on w4a and satimage and 25–26 on a6a and MNIST; the method is described as near-optimal relative to both a weight-order lower bound and a stronger exact lower bound (Aziz et al., 2018). In large-scale submodular optimization, QuickPrune discards 27–28 of the ground set, retains more than 29 of the original value after greedy selection on 30, yields 31–32 end-to-end speedups, and uses 33–34 fewer oracle calls than Submodular Sparsification for the same quality (Nath et al., 2024).
6. Limitations, variants, and recurrent misconceptions
A recurrent misconception is that greedy pruning is a single backward-elimination heuristic. The literature is more heterogeneous. Forward Selection starts from an empty network and greedily adds neurons; the associated theory shows that sufficiently large pre-trained networks contain small subnetworks with lower loss than networks directly trained with gradient descent, and the same convex-hull argument extends to randomly weighted networks (Ye et al., 2020). By contrast, several practical pruning systems are backward elimination procedures, and some, such as PruneSymNet, state explicitly that greedy algorithm often can not get the optimal solution (Wu et al., 2024).
A second misconception is that pruning scores are static. Greedy-Gnorm is designed around the opposite claim: pruning any head causes nonlocal changes in Q/K/V gradients across all layers, so scores computed once on the unpruned model become stale. Dynamic recomputation is therefore not a minor implementation detail but the central distinction from attention-entropy ranking and static Gnorm variants (Guo et al., 4 Feb 2026).
A third misconception is that pruning necessarily improves robustness in a broad sense. Greedy Adversarial Pruning is more specific: it improves resistance to transfer attacks from the uncompressed counterpart, but it does not harden models against PGD or other first-order attacks run on themselves, and adversarial accuracy on self-generated perturbations remains low (Weiss et al., 2022).
In submodular optimization, pruning is sometimes treated only as a preprocessing acceleration. The arbitrary-curvature framework shows a stronger role: pruning can be embedded inside greedy itself, and after each pruning stage every nonempty subset of the active set has positive value while 35 is monotone on that active set. This suggests that pruning can function not only as candidate reduction but also as an invariant-enforcing mechanism in the approximation analysis (Chen et al., 8 May 2026).
Taken together, these results support a precise interpretation. Greedy algorithms with pruning are most effective when a large search space contains many redundant or low-impact alternatives, when local re-evaluation is materially cheaper than global search, and when the pruning rule is tied either to exact certificates, as in interval-based split selection, or to task-relevant surrogates such as current loss, residual norm, or curvature. A plausible implication is that their success depends less on “greediness” in isolation than on how aggressively and how reliably the pruning stage reshapes the feasible search trajectory.