Fine-Tuned Transformers Show Clusters of Similar Representations Across Layers

Jason Phang, Haokun Liu, Samuel R. Bowman

    Research output: Chapter in Book/Report/Conference proceedingConference contribution

    Abstract

    Despite the success of fine-tuning pretrained language encoders like BERT for downstream natural language understanding (NLU) tasks, it is still poorly understood how neural networks change after fine-tuning. In this work, we use centered kernel alignment (CKA), a method for comparing learned representations, to measure the similarity of representations in task-tuned models across layers. In experiments across twelve NLU tasks, we discover a consistent block diagonal structure in the similarity of representations within fine-tuned RoBERTa and ALBERT models, with strong similarity within clusters of earlier and later layers, but not between them. The similarity of later layer representations implies that later layers only marginally contribute to task performance, and we verify in experiments that the top few layers of fine-tuned Transformers can be discarded without hurting performance, even with no further tuning.

    Original languageEnglish (US)
    Title of host publicationBlackboxNLP 2021 - Proceedings of the 4th BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP
    PublisherAssociation for Computational Linguistics (ACL)
    Pages529-538
    Number of pages10
    ISBN (Electronic)9781955917063
    StatePublished - 2021
    Event4th BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, BlackboxNLP 2021 - Virtual, Punta Cana, Dominican Republic
    Duration: Nov 11 2021 → …

    Publication series

    NameBlackboxNLP 2021 - Proceedings of the 4th BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP

    Conference

    Conference4th BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, BlackboxNLP 2021
    Country/TerritoryDominican Republic
    CityVirtual, Punta Cana
    Period11/11/21 → …

    ASJC Scopus subject areas

    • Computational Theory and Mathematics
    • Computer Science Applications
    • Information Systems

    Fingerprint

    Dive into the research topics of 'Fine-Tuned Transformers Show Clusters of Similar Representations Across Layers'. Together they form a unique fingerprint.

    Cite this