PrediPrune: ML-Based Candidate Pruning
- PrediPrune is a machine-learning approach that predicts the semantic validity of enumeration-generated RHS candidates in Souper, reducing SMT workload.
- It utilizes a multi-layer perceptron with structured similarity features from Souper IR, achieving high recall and accuracy while filtering candidates.
- Combined with Dataflow pruning and threshold tuning, PrediPrune can reduce overall compilation time by up to 51% without compromising optimization quality.
PrediPrune is, in its strict arXiv usage, a machine-learning–driven candidate pruning module for the Souper superoptimizer. It predicts whether an enumeration-generated right-hand side (RHS) candidate is likely to be semantically valid before that candidate is sent to an SMT solver, thereby reducing verification overhead and substantially reducing compilation time while preserving most of Souper’s optimization benefits (Ishimwe et al., 20 Sep 2025). A broader reading of the supplied literature suggests that the same name also functions as a more general motif for predictive or pre-emptive pruning: pruning teachers before distillation, pruning networks as early as possible during training, selecting calibration traces for pruning large reasoning models, optimizing random-forest prediction under feature-cost budgets, and generating robotic pruning points from semantic plant models (Park et al., 2021, Shen et al., 2021, Xiang et al., 24 Nov 2025, Nan et al., 2016, Fernandes et al., 2021).
1. Souper context and the verification bottleneck
Souper is an enumerative superoptimizer for LLVM IR. It operates on a domain-specific IR, Souper IR, that is a purely functional, control-flow-free subset of LLVM IR. Its basic loop is to extract an LHS dataflow subgraph from integer-typed root instructions, enumerate cheaper RHS candidates according to a cost model, and then use Z3 to check semantic equivalence by querying satisfiability of a bit-vector formula of the form . If is unsatisfiable, the candidate is valid; if it is satisfiable, the solver returns a counterexample and the candidate is invalid (Ishimwe et al., 20 Sep 2025).
The central difficulty is that enumerative synthesis produces many RHS candidates per LHS—ranging from a few to several hundred—and most are invalid. Every candidate must be fed through an SMT solver to confirm validity, and SMT solving over bit-vectors is expensive. In the SPEC CPU 2017 characterization reported in the supplied material, superoptimization of all workloads with Souper takes approximately 654 hours of compilation, including timeouts, even though runtime is reduced by approximately 38%. PrediPrune is designed to attack this verification bottleneck by reducing the number of invalid candidates passed to the SMT solver (Ishimwe et al., 20 Sep 2025).
This places PrediPrune in a specific niche within compiler optimization. It does not alter Souper’s equivalence criterion, and it does not replace SMT solving. Instead, it interposes a probabilistic gate between enumeration and verification, so that expensive formal checks are concentrated on candidates that are statistically more likely to survive them.
2. Core mechanism: probabilistic pruning before SMT
PrediPrune is a stochastic, machine learning–driven candidate pruning strategy integrated into Souper’s pipeline. For each LHS and enumerated RHS candidate, it extracts structured similarity features, feeds them into a trained Multi-Layer Perceptron (MLP) classifier, and uses the predicted probability that the RHS is valid to decide whether to keep the candidate or prune it early. Formally, if is the feature vector and , then the decision rule is
The method is stochastic in the explicit sense used by the paper: it relies on a statistical model trained from data and therefore carries uncertainty, so some valid candidates may be pruned and some invalid candidates may be kept (Ishimwe et al., 20 Sep 2025).
The pipeline is orthogonal to deterministic Dataflow pruning. Souper first enumerates RHS candidates, Dataflow optionally removes “obviously” bad candidates, PrediPrune then evaluates the remaining ones using its MLP, and only the survivors go to Z3. This division of labor is central to the method’s design. Dataflow pruning is structural and conservative, while PrediPrune attacks candidate validity from a statistical similarity angle. In the combined configuration, Dataflow removes large swaths of trivial invalids and PrediPrune filters a further portion of the candidates that remain (Ishimwe et al., 20 Sep 2025).
The threshold is the system’s main policy parameter. A low threshold, such as , keeps nearly every candidate with even a tiny predicted probability of validity, minimizing false negatives and preserving optimization opportunities at the cost of more SMT work. A high threshold, such as , is more aggressive, reducing SMT queries more sharply but risking more missed optimizations. This tunable trade-off is a defining property of the system rather than an incidental hyperparameter (Ishimwe et al., 20 Sep 2025).
3. Feature space, classifier architecture, and training corpus
PrediPrune’s feature extraction is explicitly multi-granularity. LHS and RHS are represented as Souper IR blocks and compared using token-based, text-based, metric-based, graph-based, and static count features. Token-based features include Jaccard similarity, overlap coefficients, the Dice–Sørensen coefficient, and a Tversky index computed after opcode normalization. Text-based similarity is computed using the Longest Common Subsequence ratio. Metric-based similarity uses Inclusion Compression Divergence with LZW compression, and the supplied material identifies ICD as the single most informative feature with score approximately 0.31. Graph-based similarity is derived from cosine similarity over degree-centrality vectors of LHS and RHS dataflow graphs. Static count features capture absolute differences in constants, arithmetic operations, compare instructions, instruction tree depth, total operands, instructions, unique opcodes, declared variables, select instructions, bit-width manipulation operations, block instructions preserving phi-node relationships, and phi instructions (Ishimwe et al., 20 Sep 2025).
In total, 20 features are initially extracted. Feature selection is then performed with SelectKBest using mutual information scoring, and the authors report that the top 14 features give the best performance: 86% recall and 85% accuracy. Using fewer features leads to noticeable recall drops, down to approximately 52% at one feature. The classifier maps this 14-dimensional feature vector to a probability of the valid class (Ishimwe et al., 20 Sep 2025).
The MLP is implemented with scikit-learn. Its hidden-layer sizes are , the hidden activation is tanh, the optimizer is Adam with learning rate 0.01, and training runs for 400 iterations. Alternative activations and optimizers were evaluated. Among the tested activations, tanh yields precision 0.67, recall 0.87, and accuracy 0.86, which is reported as the best combination among the tested settings. Among the tested optimizers, lbfgs does not converge reliably even up to 10k iterations, so adam is chosen (Ishimwe et al., 20 Sep 2025).
The training corpus is constructed from GAP, Coremark, MachSuite, and MiBench. Souper generates up to 300 RHS candidates per extracted LHS, and Z3 labels each as valid or invalid. The resulting corpus contains 641,758 candidates from 6,534 unique LHS, but only 53,377 candidates are valid, giving a class imbalance of approximately 8.3% valid examples. The authors balance the dataset using ClusterCentroids, yielding 85,566 samples split evenly into 42,783 valid and 42,783 invalid cases, followed by an 80/20 train/test split. Several classifiers are compared, and the MLP dominates Random Forest, Logistic Regression, and Naive Bayes on both recall and accuracy, which is the decisive criterion because false negatives correspond to valid candidates pruned away before SMT (Ishimwe et al., 20 Sep 2025).
4. Threshold tuning, Dataflow composition, and empirical results
The empirical evaluation is conducted on SPEC CPU 2017 C/C++ workloads, using a 32-core AArch64 machine at 2.91 GHz with 125 GB DDR4 DRAM, sequential Z3, a Redis-based external cache for previously validated 0 pairs, a 300 s per-LHS overall limit, and a 5 s per-RHS SMT-query limit. The four tested configurations are Baseline, Dataflow, PrediPrune, and PrediPrune + Dataflow, each with and without the external cache (Ishimwe et al., 20 Sep 2025).
The default threshold used when the goal is to preserve optimization quality is 1. On the representative namd workload, this threshold provides approximately 52% cost decrease, very high recall of valid candidates above 99%, precision of approximately 10%, and a true positive rate near 1 with false positive rate around 0.6 on the ROC curve. The philosophy is explicit: prune aggressively only against candidates that look very unlikely to be valid, and err on the side of keeping potentially useful ones (Ishimwe et al., 20 Sep 2025).
The main aggregate results are as follows.
| Configuration | Time without cache | Cost decrease without cache |
|---|---|---|
| Baseline | 654 hours | 38% |
| Dataflow | 363 hours | 42% |
| PrediPrune | 627 hours | 37% |
| PrediPrune + Dataflow | 320 hours | 42% |
The combined method is the dominant operating point. Relative to the Baseline without cache, PrediPrune + Dataflow reduces compilation time by 51%, from 654 to 320 hours, while improving cost decrease from 38% to 42%. Relative to Dataflow alone without cache, it reduces compilation time by 12%, from 363 to 320 hours, with the same 42% cost decrease. With cache enabled, PrediPrune + Dataflow reduces time from 384 to 244 hours relative to Baseline + cache, and from 273 to 244 hours relative to Dataflow + cache (Ishimwe et al., 20 Sep 2025).
The pruning-rate results are similarly structured. PrediPrune alone prunes 42% of candidates in geometric mean across benchmarks, while PrediPrune + Dataflow prunes 50% of the candidates left after Dataflow. With cache, PrediPrune-only pruning rises to 71%. These savings come without semantic risk in the usual compiler-correctness sense, because no transformation is ever applied unless SMT confirms equivalence. The failure mode is missed optimization opportunity rather than miscompilation. The paper nevertheless records localized losses in some workloads such as parest, leela, and namd, where a few valid candidates are pruned or timeouts change the set of successfully optimized LHS instances (Ishimwe et al., 20 Sep 2025).
5. Broader PrediPrune interpretations across pruning research
A broader, analogical use of the term in the supplied literature suggests that PrediPrune is not only a particular Souper module but also a recurring design pattern: use predictive, structural, or domain-specific signals to decide what should be discarded before a more expensive stage. In knowledge distillation, “Prune Your Model Before Distill It” is presented in the supplied material as matching exactly what is called PrediPrune: prune the teacher network before performing knowledge distillation. The proposed “prune, then distill” framework treats the pruned teacher as a regularized teacher that yields smoother effective labels, and it also constructs student architectures from the non-zero parameter counts of the pruned teacher’s layers (Park et al., 2021).
The same general motif appears in early structural pruning during training. “When to Prune? A Policy towards Early Structural Pruning” proposes Pruning-aware Training (PaT), which trains dense for a few epochs, tracks dominant subnetworks by neuron-importance ranking, and triggers pruning once an Early Pruning Indicator (EPI) shows that the subnetwork architecture has stabilized. On ImageNet, the method reports a 1.4% top-1 accuracy boost over state-of-the-art pruning counterparts and a 2.42 reduction in training cost on GPU, framing pruning time as a first-class optimization variable rather than a fixed schedule choice (Shen et al., 2021).
For Large Reasoning Models, the supplied literature treats the problem as one of predicting what to prune using the right calibration traces. “Think Before You Prune: Selective Self-Generated Calibration for Pruning Large Reasoning Models” shows that directly applying existing pruning techniques with generic calibration data such as C4 is not satisfactory, and that self-generated reasoning data are substantially better calibration inputs. Its Selective Self-Generated Reasoning (SSGR) strategy selects hard problems from the model’s perspective and moderately long correct reasoning traces, improving the reasoning ability of pruned LRMs by 10%–13% compared to general pruning methods (Xiang et al., 24 Nov 2025).
A different but structurally related formulation appears in resource-constrained random forests. “Pruning Random Forests for Prediction on a Budget” optimizes expected feature cost and accuracy by pruning a trained forest under a global budget. The formulation is posed as a 0–1 integer program with linear constraints that encourage feature re-use, and the paper proves total unimodularity of the constraint set so that the LP relaxation is exact. In the supplied material, this is presented as a model for how a system like PrediPrune could implement budget-aware pruning via a principled optimization layer (Nan et al., 2016).
The most distant but conceptually revealing analog is robotic viticulture. “Towards Precise Pruning Points Detection using Semantic-Instance-Aware Plant Models for Grapevine Winter Pruning Automation” is described in the supplied material as effectively a specialized instantiation of a general pruning point prediction framework like PrediPrune. There, the “pruning” object is not a candidate program or a model weight but a physical cut point on a cane, inferred from a semantic-instance-aware plant tree, agronomic assessments, and 3D geometry. The connection is not terminological strictness but the recurring decomposition into structured representation, local assessments, rule-based or predictive selection, and execution-oriented output generation (Fernandes et al., 2021).
6. Limitations, safety properties, and open directions
For the Souper system proper, the principal limitation is that PrediPrune is statistical rather than formal. There is no guarantee that no valid candidate is pruned. The paper emphasizes heavy overlap between valid and invalid candidates in feature space, as visualized by PCA, which makes classification inherently hard. The threshold 3 is therefore chosen to minimize false negatives rather than to maximize precision. This means that many invalid candidates are still sent to SMT, which is acceptable because SMT remains the final arbiter of correctness, but it also means that the classifier cannot eliminate the verification burden entirely (Ishimwe et al., 20 Sep 2025).
The method’s generalization is bounded by its training distribution and by Souper’s program model. Training uses GAP, Coremark, MachSuite, and MiBench, and the instruction set of Souper IR is small, with 51 integer instructions, which supports generalization within that domain. At the same time, the supplied material identifies limited applicability to path conditions, since Souper IR is control-flow-free, and notes that time-limit interactions can reduce the number of LHS instances successfully optimized in some workloads (Ishimwe et al., 20 Sep 2025).
The broader PrediPrune family in the supplied literature reveals a recurring set of open problems. In LRMs, SSGR requires generating 16 responses per question with maximum generation length 32768, so calibration-set construction is expensive; scaling beyond approximately 14B parameters remains open (Xiang et al., 24 Nov 2025). In early structural pruning, EPI thresholds are selected by grid search on ResNet50 and then transferred, which works in the reported CNN settings but leaves open how architecture-stability indicators should be defined for other model classes (Shen et al., 2021). In pre-distillation teacher pruning, over-pruning can make the teacher no longer student-friendly, especially when the teacher is not strongly overparameterized (Park et al., 2021). In robotic pruning-point prediction, single-view occlusions, Intel RealSense depth noise on thin objects, and hand-tuned thresholds limit completeness and portability across cultivars and training systems (Fernandes et al., 2021).
Taken together, these results suggest a unified research direction. PrediPrune, in the narrow compiler sense and in the broader analogical sense, designates systems that attempt to move pruning decisions earlier, make them cheaper, and ground them in structured evidence before invoking a more expensive downstream procedure—whether that procedure is SMT verification, full dense training, teacher-to-student transfer, long-chain reasoning preservation, feature acquisition at prediction time, or robotic cutting. The common problem is not merely sparsification, but selective allocation of expensive computation under uncertainty (Ishimwe et al., 20 Sep 2025, Xiang et al., 24 Nov 2025, Shen et al., 2021).