wikillm

Concept · 1 paper · updated 2026-10-19

Sparse Bayesian learning

Sparsity from a Bayesian prior: each weight gets a zero-mean Gaussian whose variance is learned, and weights whose variance collapses are pruned. Used for neural architecture search and structural pruning. Trade-offs: the search caches feature maps in memory, and the only known source is one author-reported paper with unresolved inconsistencies.

bayesian-learningsparsitypruningnas

Markdown4 min read

AI-compiled overview, updated 2026-10-19, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

Overview

Sparse Bayesian learning gives each weight its own prior variance and lets the data decide how large that variance should be. A weight whose variance shrinks towards zero is effectively removed from the model. The paper frames architecture search as this kind of sparse learning over an over-parameterised network, where each candidate operation on an edge is one weight [arxiv:1905.04919 §3] 1905.04919 §5.1.

The prior is hierarchical. Each variance has a Gamma hyper-prior, which yields a Student-t marginal and favours sparsity. The paper sets the hyper-prior parameters to zero, which makes them flat 1905.04919 §5.1. The variance of an edge is also tied to the switches of the edges that feed into the same node, so a node whose inputs are switched off also weakens the variance of the edges it would feed 1905.04919 §4.1 1905.04919 eq. 6.

Pruning uses the posterior variance, not the weight magnitude. The paper states that magnitude depends on weight scale and on the architecture choice, which is why it prefers the variance-based rule 1905.04919 §1 1905.04919 §2. A Laplace approximation with a Hessian term gives the posterior update 1905.04919 §5.2.

Variants

Cell-based architecture search (BayesNAS)

Sparse Bayesian learning over the operations of a cell. The search trains an over-parameterised network for a short time, updates the variances once per iteration, and prunes edges whose variance is at most 1/(2\pi e) 1905.04919 §5.3 1905.04919 alg. 1. The reported CIFAR-10 test error is 2.81% for the variant with \lambda_w = 0.005, with cutout and an author-reported search cost of 0.2 GPU days 1905.04919 tab. 1. Card: BayesNAS: A Bayesian Approach for Neural Architecture Search.

Proxy search ties switches and re-weighting coefficients within a group of identical cells, so the search is on a smaller network that is then transferred 1905.04919 app. S1.3. Proxyless search runs the same procedure on each cell separately, using a PyramidNet backbone with a tree cell of nine paths 1905.04919 §6.2. The paper reports 2.41% CIFAR-10 test error for the proxyless variant with a reported search cost of 0.1 GPU days 1905.04919 tab. 1. These are author-reported numbers.

Structural compression of trained networks

The same machinery prunes groups of weights in a trained network: shape-wise, row-wise, column-wise or filter-wise groups, using a re-weighted group Lasso 1905.04919 app. S2 1905.04919 app. S2.1. The paper reports results for LeNet-300-100, LeNet-5 and ResNet-18 that trade a small error increase for fewer FLOPs in the MNIST cases 1905.04919 app. S2.2. The MNIST and CIFAR-10 results report no spread across runs.

When to use which

SituationUseWhy
Need a gradient-based architecture search that keeps a magnitude-free prune ruleCell-based searchThe prune rule uses the posterior variance rather than weight size 1905.04919 §1 1905.04919 §5.3.
Single GPU with limited memoryCheck firstFeature maps are cached to compute the Hessian, which the authors call inefficient, and that memory sets the search batch size 1905.04919 §8 1905.04919 §6.1.
Search time is the main constraintCell-based or proxyless searchThe paper reports 0.2 GPU days (cell-based) and 0.1 GPU days (proxyless), but also about 3 hours on one GPU, which conflicts with these figures (see below) 1905.04919 tab. 1 1905.04919 §6.1.
Need to shrink an already trained networkStructural compressionThis is the setting the group-Lasso variant targets, and it does not need a search 1905.04919 app. S2.
Need exact, reproducible numbersNot establishedNo official code was found, and the paper's own hyperparameters conflict in places (see below) 1905.04919 §6.1 1905.04919 app. S4.1.

Implementation sketch

Adapted from the search loop in the paper. Variants differ in how switches are tied (cell-based vs proxy), in the Hessian approximation, and in whether the loop is over architecture weights or over the groups of a trained network.

Pseudocode
# Sparse Bayesian search over one over-parameterised network  [alg. 1]
# Initialise architecture weights, variances and l1 weights to 1  [alg. 1]
arch, gamma, omega = ones(n), ones(n), ones(n)
for t in range(1, T + 1):
    # Train weights on the re-weighted loss; schedule not stated  [§5.3]
    net, arch = sgd_step(data, net, arch, lambda_w * omega)
    # Hessian of each architecture weight, from cached feature maps  [app. S3]
    hess = architecture_hessian(net, arch, data)
    # Posterior variance, using the previous gamma  [alg. 1]
    post = 1 / (1 / gamma + hess)
    # Re-weighting coefficient for the next l1 step  [alg. 1]
    omega = sqrt(gamma - post) / gamma
    # Switch of each architecture weight  [alg. 1]
    switch = abs(arch / omega)
    # Variance from the predecessor switches and the own switch  [eq. 6] [§4.1]
    gamma = 1 / (1 / pred_sum(switch) + 1 / switch)
# Keep edges whose entropy is positive  [§5.3]
keep = gamma > 1 / (2 * pi * e)

Notes: the number of iterations T is not stated for the CIFAR-10 search 1905.04919 §5.3. The paper does not say which Hessian approximation the experiments use 1905.04919 app. S3.1 1905.04919 app. S3.2.

Contradictions

Only one card covers this slug, so there are no disagreements between papers. Within BayesNAS, the reported numbers are inconsistent in three places, and each side is cited:

Papers

Source and license

Compiled from the papers listed on this page, all published under CC BY, CC BY-SA or CC0, with citations. See each paper's page for its authors and license.