Skip to main content
QUICK REVIEW

[Paper Review] N2N Learning: Network to Network Compression via Policy Gradient Reinforcement Learning

Anubhav Ashok, Nicholas Rhinehart|arXiv (Cornell University)|Sep 18, 2017
Advanced Neural Network ApplicationsComputer Science35 references116 citations
TL;DR

The paper presents a two-stage reinforcement learning method (layer removal then layer shrinkage) to automatically compress a teacher network into a high-accuracy, lightweight student network using policy gradients and knowledge distillation.

ABSTRACT

While bigger and deeper neural network architectures continue to advance the state-of-the-art for many computer vision tasks, real-world adoption of these networks is impeded by hardware and speed constraints. Conventional model compression methods attempt to address this problem by modifying the architecture manually or using pre-defined heuristics. Since the space of all reduced architectures is very large, modifying the architecture of a deep neural network in this way is a difficult task. In this paper, we tackle this issue by introducing a principled method for learning reduced network architectures in a data-driven way using reinforcement learning. Our approach takes a larger `teacher' network as input and outputs a compressed `student' network derived from the `teacher' network. In the first stage of our method, a recurrent policy network aggressively removes layers from the large `teacher' model. In the second stage, another recurrent policy network carefully reduces the size of each remaining layer. The resulting network is then evaluated to obtain a reward -- a score based on the accuracy and compression of the network. Our approach uses this reward signal with policy gradients to train the policies to find a locally optimal student network. Our experiments show that we can achieve compression rates of more than 10x for models such as ResNet-34 while maintaining similar performance to the input `teacher' network. We also present a valuable transfer learning result which shows that policies which are pre-trained on smaller `teacher' networks can be used to rapidly speed up training on larger `teacher' networks.

Motivation & Objective

  • Motivate automated, data-driven network compression to meet hardware constraints.
  • Develop a principled RL framework that searches for compact architectures derived from a teacher network.
  • Present a two-stage action scheme (layer removal followed by layer shrinkage) to efficiently explore architecture space.
  • Incorporate knowledge distillation to train the compressed student models.
  • Demonstrate compression effectiveness across multiple datasets and transferability of learned policies.

Proposed method

  • Formulate the teacher-to-student compression as a Markov Decision Process over network architectures.
  • Use two-stage policy networks: a layer removal policy (binary keep/remove) and a layer shrinkage policy (continuous attenuation of layer parameters).
  • Optimize policies with REINFORCE policy gradient using a reward that combines compression and accuracy (R = Rc × Ra).
  • Rc is a nonlinear compression reward based on parameter count; Ra is the ratio of student to teacher validation accuracy.
  • Incorporate hardware constraints by relaxing them into a reward condition with a gradual penalty (Ax ≤ b).
  • Train student networks with knowledge distillation using teacher logits (L2 loss between student outputs and teacher logits) to guide learning.

Experimental results

Research questions

  • RQ1Can reinforcement learning automatically discover compact student architectures that preserve accuracy when compressing from a larger teacher network?
  • RQ2Does a two-stage action strategy (layer removal then layer shrinkage) scale to modern architectures and datasets?
  • RQ3How well does the learned compression policy transfer between similar architectures or larger teachers?
  • RQ4Can hardware constraints be effectively integrated into the reward to produce practically viable models?
  • RQ5Does distillation from the teacher enhance performance of the compressed student networks?

Key findings

  • Achieved substantial compression (e.g., up to 10x) on models like ResNet-34 with accuracy close to the teacher.
  • Two-stage policy learning accelerates search by separating macro (layer removal) and micro (layer shrinkage) decisions.
  • Policies learned on smaller teachers transferred to larger teachers, speeding up training in new settings.
  • Outperformed pruning and hand-designed knowledge distillation baselines on several datasets (MNIST, CIFAR-10/100, SVHN, Caltech-256).
  • Hardware-constrained rewards yielded viable models under size constraints, demonstrating practical applicability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.