Skip to main content

Optimizing the Performance of Text Classification Models by Improving the Isotropy of the Embeddings Using a Joint Loss Function

  • Conference paper
  • First Online:
Document Analysis and Recognition - ICDAR 2023 (ICDAR 2023)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 14191))

Included in the following conference series:

  • 911 Accesses

Abstract

Recent studies show that the spatial distribution of the sentence representations generated from pre-trained language models is highly anisotropic. This results in a degradation in the performance of the models on the downstream task. Most methods improve the isotropy of the sentence embeddings by refining the corresponding contextual word representations, then deriving the sentence embeddings from these refined representations. In this study, we propose to improve the quality of the sentence embeddings extracted from the [CLS] token of the pre-trained language models by improving the isotropy of the embeddings. We add one feed-forward layer between the model and the downstream task layers, and we train it using a novel joint loss function. The proposed approach results in embeddings with better isotropy, that generalize better on the downstream task. Experimental results on 3 GLUE datasets with classification as the downstream task show that our proposed method is on par with the state-of-the-art, as it achieves performance gains of around 2–3% on the downstream tasks compared to the baseline.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
eBook
USD 119.00
Price excludes VAT (USA)
Softcover Book
USD 159.99
Price excludes VAT (USA)

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    The labels of the test sets were not provided (they are only evaluated through the leaderboard at https://gluebenchmark.com/leaderboard) This setup also follows the work done by IsoBN [22].

  2. 2.

    More information regarding hyper-parameter tuning is available in a technical report [1].

References

  1. Attieh, J.: Optimizing the Performance of Text Classification Models by Improving the Isotropy of the Embeddings using a Joint Loss Function. Master’s thesis, Aalto University. School of Science (2022). http://urn.fi/URN:NBN:fi:aalto-202209255727

  2. Biś, D., Podkorytov, M., Liu, X.: Too much in common: Shifting of embeddings in transformer language models and its implications. In: Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies. pp. 5117–5130. Association for Computational Linguistics, Online (Jun 2021). https://doi.org/10.18653/v1/2021.naacl-main.403, http://aclanthology.org/2021.naacl-main.403

  3. Ethayarajh, K.: How contextual are contextualized word representations? comparing the geometry of BERT, ELMO, and GPT-2 embeddings. vol. abs/1909.00512 (2019). arXiv: abs/1909.00512

  4. Gao, J., He, D., Tan, X., Qin, T., Wang, L., Liu, T.: Representation degeneration problem in training natural language generation models. In: International Conference on Learning Representations (2019). http://openreview.net/forum?id=SkEYojRqtm

  5. Gong, C., He, D., Tan, X., Qin, T., Wang, L., Liu, T.Y.: Frage: Frequency-agnostic word representation. ArXiv arXiv:1809.06858 (2018)

  6. Kalyan, K.S., Rajasekharan, A., Sangeetha, S.: Ammus : A survey of transformer-based pretrained models in natural language processing (2021). https://doi.org/10.48550/ARXIV.2108.05542,

  7. Li, B., Zhou, H., He, J., Wang, M., Yang, Y., Li, L.: On the sentence embeddings from pre-trained language models. In: Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 9119–9130. Association for Computational Linguistics, Online (Nov 2020). https://doi.org/10.18653/v1/2020.emnlp-main.733

  8. Liang, Y., Cao, R., Zheng, J., Ren, J., Gao, L.: Learning to remove: Towards isotropic pre-trained Bert embedding. In: Artificial Neural Networks and Machine Learning - ICANN 2021: 30th International Conference on Artificial Neural Networks, Bratislava, Slovakia, September 14–17, 2021, Proceedings, Part V, p. 448–459. Springer-Verlag, Berlin, Heidelberg (2021). https://doi.org/10.1007/978-3-030-86383-8_36

  9. Loshchilov, I., Hutter, F.: Decoupled weight decay regularization (2017). https://doi.org/10.48550/ARXIV.1711.05101

  10. Mu, J., Viswanath, P.: All-but-the-top: Simple and effective post-processing for word representations (2018), publisher Copyright: © Learning Representations, ICLR 2018 - Conference Track Proceedings. All right reserved.; 6th International Conference on Learning Representations, ICLR 2018; Conference date: 30–04-2018 Through 03–05-2018

    Google Scholar 

  11. Rajaee, S., Pilehvar, M.T.: A cluster-based approach for improving isotropy in contextual embedding space. In: ACL (2021)

    Google Scholar 

  12. Rajaee, S., Pilehvar, M.T.: How does fine-tuning affect the geometry of embedding space: a case study on isotropy. In: EMNLP (2021)

    Google Scholar 

  13. Rudman, W., Gillman, N., Rayne, T., Eickhoff, C.: IsoScore: Measuring the uniformity of embedding space utilization. In: Findings of the Association for Computational Linguistics: ACL 2022, pp. 3325–3339. Association for Computational Linguistics, Dublin, Ireland (May 2022). https://doi.org/10.18653/v1/2022.findings-acl.262, http://aclanthology.org/2022.findings-acl.262

  14. Su, J., Cao, J., Liu, W., Ou, Y.: Whitening sentence representations for better semantics and faster retrieval (2021). https://doi.org/10.48550/ARXIV.2103.15316, http://arxiv.org/abs/2103.15316

  15. Timkey, W., van Schijndel, M.: All bark and no bite: Rogue dimensions in transformer language models obscure representational quality. In: Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 4527–4546. Association for Computational Linguistics, Online and Punta Cana, Dominican Republic (Nov 2021). https://doi.org/10.18653/v1/2021.emnlp-main.372, http://aclanthology.org/2021.emnlp-main.372

  16. Wang, A., Singh, A., Michael, J., Hill, F., Levy, O., Bowman, S.: GLUE: A multi-task benchmark and analysis platform for natural language understanding. In: Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pp. 353–355. Association for Computational Linguistics, Brussels, Belgium (Nov 2018). https://doi.org/10.18653/v1/W18-5446, http://aclanthology.org/W18-5446

  17. Wang, L., Huang, J., Huang, K., Hu, Z., Wang, G., Gu, Q.: Improving neural language generation with spectrum control. In: International Conference on Learning Representations (2020). http://openreview.net/forum?id=ByxY8CNtvr

  18. Wolf, T., et al.: Huggingface’s transformers: State-of-the-art natural language processing (2019). https://doi.org/10.48550/ARXIV.1910.03771

  19. Zabihzadeh, D.: Ensemble of loss functions to improve generalizability of deep metric learning methods. arXiv:2107.01130 (2021)

  20. Zampieri, M., Malmasi, S., Nakov, P., Rosenthal, S., Farra, N., Kumar, R.: Predicting the Type and Target of Offensive Posts in Social Media. In: Proceedings of NAACL (2019)

    Google Scholar 

  21. Zhang, Z., Gao, C., Xu, C., Miao, R., Yang, Q., Shao, J.: Revisiting representation degeneration problem in language modeling. In: Findings of the Association for Computational Linguistics: EMNLP 2020, pp. 518–527. Association for Computational Linguistics, Online (Nov 2020). https://doi.org/10.18653/v1/2020.findings-emnlp.46, http://aclanthology.org/2020.findings-emnlp.46

  22. Zhou, W., Lin, B.Y., Ren, X.: Isobn: Fine-tuning bert with isotropic batch normalization. Proc. AAAI Conf. Artif. Intell. 35(16), 14621–14629 (May 2021), http://ojs.aaai.org/index.php/AAAI/article/view/17718

Download references

Acknowledgments

This work was supported by the Terminal Cloud Service Competence Center of Huawei Technologies Oy. in Helsinki, Finland in the context of the master thesis of the first author.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Joseph Attieh .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Attieh, J., Woubie Zewoudie, A., Vlassov, V., Flanagan, A., Bäckström, T. (2023). Optimizing the Performance of Text Classification Models by Improving the Isotropy of the Embeddings Using a Joint Loss Function. In: Fink, G.A., Jain, R., Kise, K., Zanibbi, R. (eds) Document Analysis and Recognition - ICDAR 2023. ICDAR 2023. Lecture Notes in Computer Science, vol 14191. Springer, Cham. https://doi.org/10.1007/978-3-031-41734-4_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-41734-4_8

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-41733-7

  • Online ISBN: 978-3-031-41734-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics