about
Only Train Once: A One-Shot Neural Network Training and Pruning Framework (arxiv.org)
65 points by azhenley on Jul 16, 2021 | hide | past | pdf | 11 comments on HN

In plain words: Instead of training, then pruning and retraining, it groups parameters so whole groups can be dropped without changing results, and drives them to zero during training. It matched or beat the best pruning results on image and language tasks while cutting computation, without fine-tuning.

Abstract · Only Train Once: A One-Shot Neural Network Training And Pruning Framework

Structured pruning is a commonly used technique in deploying deep neural networks (DNNs) onto resource-constrained devices. However, the existing pruning methods are usually heuristic, task-specified, and require an extra fine-tuning procedure. To overcome these limitations, we propose a framework that compresses DNNs into slimmer architectures with competitive performances and significant FLOPs reductions by Only-Train-Once (OTO). OTO contains two keys: (i) we partition the parameters of DNNs into zero-invariant groups, enabling us to prune zero groups without affecting the output; and (ii) to promote zero groups, we then formulate a structured-sparsity optimization problem and propose a novel optimization algorithm, Half-Space Stochastic Projected Gradient (HSPG), to solve it, which outperforms the standard proximal methods on group sparsity exploration and maintains comparable convergence. To demonstrate the effectiveness of OTO, we train and compress full models simultaneously from scratch without fine-tuning for inference speedup and parameter reduction, and achieve state-of-the-art results on VGG16 for CIFAR10, ResNet50 for CIFAR10 and Bert for SQuAD and competitive result on ResNet50 for ImageNet. The source code is available at https://github.com/tianyic/only_train_once.

Tianyi Chen, Bo Ji, Tianyu Ding, Biyi Fang, Guanyi Wang, Zhihui Zhu, Luming Liang, Yixin Shi, Sheng Yi, Xiao Tu
arXiv:2107.07467 · cs.LG · submitted Jul 15, 2021 · updated Nov 12, 2021
abstract · pdf · html · Accepted by NeurIPS 2021

add comment on HN

As a hobbyist, I’ve wondered if the need for umpteen epochs just leads many nets to memorize datasets, especially when the performance jumps a lot from one epoch to another without much change during batches. It’s kind of disconcerting for those of us who don’t have millions of source images to train with.
I think the evidence is pretty much in on that -- namely, yes, if your data is too small, a reasonably large neural net (a.k.a. basically any computer vision model from the last 3-4 years) is perfectly capable of memorizing the training images.

The relative success of attacks on nets to extract their training data support that this happens in practice too.

Generalization performance as it stands now always has to be evaluated empirically.

The normal way to combat this is to have a training set and a validation set, use the validation images in forward pass to measure the performance of the network as it is being trained, but NOT use images from the validation set in updating the training weights.

Basically, evaluate the performance of the network on the validation set, but train it on the training set, and adjust your network structure and hyperparameters accordingly. Networks that "memorize images" will perform poorly.

How does a large company with million if images make sure there aren't very similar copies in not the training set and validation set? Seems like you could be accidentally over training if there's a lot of copies of very similar images. (For example, there's going to be a lot more pictures of the Taco Bell Chihuahua compared to other Chihuahuas, and possibly some of those pictures have enough similarity to make over fitting possible.
First of all having millions of images is of itself a good way to combat overfitting.

But yes, you touch upon a very important point, that is the dataset must be sufficiently diverse.

To be fair, humans have this problem as well; if I showed you an octagonal red sign that had the words "GO" inscribed in the middle you may still mistake it for a stop sign at first.

That’s fine… Randomly similar photos will occur in the real world just as much, so the good results for these will carry over.
This could be very useful for adaptive AIs in gaming.
I see they compare against various pruning techniques in related work, but do they compare accuracy and/or parameter reduction in their evaluation against lottery ticket approaches (whatever the state of the art is there)?
Short answer, as I'm on mobile: this is structured pruning, which is hardly comparable to unstructured methods like IMP (algorithm for lottery tickets)
Thanks. Can you give an intuition as to the difference between 'structured' and 'unstructured' pruning? What are the pros and cons of each?
In unstructured pruning, individual weights of a weight tensor are pruned with no constraints on their position in the tensor. In structured pruning, there are constraints on which weights are pruned. Think of pruning an entire output channels of a convolutional layer vs pruning arbitrary weights of the same tensor. Unstructured pruning allows for a greater percentage of the weights to be pruned, but unstructured pruning doesn't speed up a network on hardware accelerators, which favor dense matrix multiplications.