Shape Priors#

SPERM separates priors by the part of the function they constrain.

Output

ValueBound places global lower and/or upper bounds on predictions.

Feature-wise

Monotonicity, SlopeBound, and Unimodality describe how the prediction changes along one feature while the others are held fixed.

Cross-feature

Convex and Concave constrain the function jointly over its inputs.

Convenience constructors normalize to canonical primitives: Nonnegative and Nonpositive become value bounds; Increasing and Decreasing become monotonicity; and Lipschitz(L) becomes a slope interval [-L, L].

Current Support#

The following table describes the current implementation over the complete input space. Feature-wise priors constrain one feature at a time while the others are fixed; cross-feature priors constrain input features jointly.

Category Property Linear models Tree-based models MLP GPR
Output ValueBound X √ √ √1
Feature-Wise Monotonicity √ √ √ ⍻
SlopeBound √ X - ⍻
Unimodality X √1 √1 ⍻2
Cross-Feature Convexity X X √ ⍻
  • √: supported.

  • √1: supported, but the current implementation requires exactly one input feature.

  • ⍻: supported with a substantial loss of expressive power.

  • ⍻2: supported with a substantial loss of expressive power and on at most one feature at a time.

  • -: not yet supported.

  • X: not supported because the property is trivial or impossible for the base model, or would collapse it to a degenerate function class.

Interpretation by model family:

  • Linear model: coefficient and norm restrictions give exact slope bounds. A finite global value bound would force all slopes to zero and is therefore rejected. Affine functions are both convex and concave, and are unimodal in both modes, but this is only a trivial subset of those function classes.

  • MLP: bounded output transformations, monotone architectures, and input-convex neural networks provide strong constructions. Unimodality uses a specialized one-dimensional architecture with a trainable turning point.

  • Tree-based models: decision trees and random forests optimize bounded leaf values during fitting, while gradient boosting clips its final additive prediction. Both constructions give exact value bounds and preserve the supported shape constraints. Standard trees can enforce monotonicity by coordinating leaf predictions across ordered splits, and monotone step functions retain broad approximation power. However, piecewise-constant trees are discontinuous, so a nonconstant tree cannot have a finite global slope or Lipschitz bound, or be globally convex. Those combinations require continuous piecewise-linear model trees, constrained leaves, or a post-processing/projection method. Unimodality additionally requires globally coordinated leaf regions rather than independent split constraints.

  • GPR: the clamped B-spline/P-spline sieve is dense in the corresponding univariate and additive-component shape classes on compact subsets as n_basis grows. Its additive multivariate structure excludes cross-feature interactions, which is the expressive-power loss marked by ⍻. Linear constraints on spline controls and divided differences guarantee each convex candidate over the complete input space. Unimodality uses a linear number of turning-point candidates rather than a single convex feasible set.

Representative references include universal Lipschitz GroupSort networks, input-convex neural networks, continuous piecewise-linear decision trees, and Gaussian processes with linear-operator inequality constraints.

These symbols describe the implementation, not a claim that every prior is appropriate for every dataset. See Guarantees and Uncertainty for what “global” means.