liveBook · Manning

Discriminative fine-tuning

As explained in Transfer Learning for Natural Language Processing

Discriminative fine-tuning trains different layers of a network at different learning rates.

Discriminative fine-tuning assigns different learning rates to different layers of a network. In a pretrained language model, layers capture different information, so adapting them at the same rate may not be ideal. ULMFiT uses this technique to adapt a general language model to a smaller dataset from a new distribution, helping address overfitting and catastrophic forgetting. section 6.3.1

One ULMFiT procedure first fine-tunes the last layer to find an effective base learning rate. It then divides that rate by 2.6 for the layer immediately below, and repeats the division for each successively lower layer. Lower layers therefore receive progressively smaller rates. section 6.3.1

Choosing layer rates

Suppose the last layer’s selected rate is 0.026. The next layer down would use 0.01, and the layer below that would use approximately 0.00385. These numbers illustrate the division rule; the base rate must be selected for the adaptation task. section 6.3.1

The rate assigned to a layer can also change during training. A slanted triangular schedule raises the rate quickly and then lowers it more slowly. This is separate from the choice of different rates across layers. Gradual unfreezing is another complementary technique: it progressively increases the number of trainable layers to reduce overfitting. section 6.3.1 section 9.1

Fake news detection

For a fake news detection task, an RNN-based language model can be adapted using ULMFiT techniques. The example uses a dataset of more than 40,000 articles labeled “fake” or “true.” Although demonstrated with an RNN, the adaptation techniques are architecture-agnostic and can also be applied to transformer-based models. section 9.1

How Transfer Learning for Natural Language Processing covers it

How deep it goes
Describes selecting a last-layer rate and successively dividing it by 2.6 for lower layers.
Examples
Uses an RNN-based fake news detection task with more than 40,000 articles labeled fake or true.
What you can do after
Practice assigning progressively lower learning rates to successive layers of a pretrained language model.
How it connects
Connects fine-tuning to gradual unfreezing, slanted triangular learning rates, overfitting, and catastrophic forgetting.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Transfer Learning for Natural Language Processing. The section links point to the parts of the book it draws on.