kth.sePublications
Change search
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf
Unstructured pruning of pre-trained language models tuned for sentiment classification.
KTH, School of Engineering Sciences (SCI), Mathematics (Dept.), Mathematical Statistics.
2022 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE creditsStudent thesisAlternative title
Ostrukturerade beskärningsmetoder tillämpade på förtränade språkmodeller finjusterade försentimentklassificering. (Swedish)
Abstract [en]

Transformer-based models are frequently used in natural language processing. These models are oftenlarge and pre-trained for general language understanding and then fine-tuned for a specific task. Becausethese models are large, they have a high memory requirement and have high inference time. Severalmodel compression techniques have been developed in order to reduce the mentioned disadvantageswithout significantly reducing the inference performance of the models. This thesis studies unstructuredpruning method, which are pruning methods that do not follow a predetermined pattern when removingparameters, to understand which parameters can be removed from language models and the impact ofremoving a significant portion of a model's parameters. Specifically, magnitude pruning, movementpruning, soft movement pruning, and $L_0$ regularization were applied to the pre-trained languagemodels BERT and M-BERT. The pre-trained models in turn were fine-tuned for sentiment classificationtasks, which refers to the task of classifying a given sentence to predetermined labels, such as positive ornegative. Magnitude pruning worked the best when pruning the models to a ratio of 15\% of the models'original parameters, while soft movement pruning worked the best for the weight ratio of 3\%. Formovement pruning, we were not able to achieve satisfying results for binary sentiment classification.From investigating the pruning patterns derived from soft movement pruning and $L_0$ regularization, itwas found that a large portion of the parameters from the last transformer blocks in the model architecturecould be removed without significantly reducing the model performance. An example of interestingfurther work is to remove the last transformer blocks altogether and investigate if an increase in inferencespeed is attained without significantly reducing the performance.

Abstract [sv]

Modeller baserade på transformer-arkitekturer används ofta i språkanalys inom maskininlärning. Dessamodeller är ofta stora och är tränade i förhand för en allmän språkförståelse och sedan finjusterade för enspecifik uppgift. Eftersom dessa modeller är stora har de höga minneskrav och inferenstid. Fleramodellkompressionstekniker har utvecklas för att minska de nämnda nackdeular utan att påtagligtförsämra modellernas inferensprestanda. I denna avhandling undersöks ostrukturerade "pruning"-metoderför att studera vilka parametrar som kan tas bort och effekten av att ta bort en betydande del av modellenstotala parametrar. Specifikt tillämpades magnitudpruning, rörelsepruning, mjuk rörelsepruning och $L_0$regularisering på de förtränade språkmodellerna BERT och M-BERT, som finjusterades för att klassificeraom en mening är positiv eller negativ. Magnitudpruning fungerade bäst vid pruning av modellerna till ettförhållande på 15\% av modellens ursprungliga vikt, medan mjuk rörelsepruning fungerade bäst förviktförhållandet 3\%. För rörelsepruning kunde vi ej uppnå tillfredsställande resultat försentimentklassificering. Från att undersöka pruningsmönstren som härrörde från mjuk rörelsepruning och$L_0$-regularisering, fann vi att en stor del av parametrarna från de sista transformatorblocken imodellarkitekturen kunde tas bort utan att nämnvärt påverka modellens prestanda. Exempel på intressantvidare arbete är att helt ta bort de sista transformerblocken och undersöka om en ökning avslutledningshastigheten kan uppnås utan att nämnvärt påverka prestandan.

Place, publisher, year, edition, pages
2022. , p. 58
Series
TRITA-SCI-GRU ; 2022:315
Keywords [en]
Unstructured pruning, transformer, BERT, sentiment classification, natural language processing, neural networks, deep learning
Keywords [sv]
Ostrukturerad pruning, transformer, BERT, sentimentklassifikation, språkbehandling, neurala nätverk, djup inlärning
National Category
Other Mathematics
Identifiers
URN: urn:nbn:se:kth:diva-322564OAI: oai:DiVA.org:kth-322564DiVA, id: diva2:1720701
External cooperation
Sinch AB
Subject / course
Mathematics
Educational program
Master of Science - Applied and Computational Mathematics
Supervisors
Examiners
Available from: 2023-02-02 Created: 2022-12-20 Last updated: 2023-02-15Bibliographically approved

Open Access in DiVA

fulltext(3452 kB)673 downloads
File information
File name FULLTEXT01.pdfFile size 3452 kBChecksum SHA-512
e7a7f2f00855b0e71962141d734dcae1b829b7240d3ceb1180a1563fcc8a732145dd3ba2567ebe39792d4a1ecc678ef9b44d62db4c94db60cf8cbc1e87c962d2
Type fulltextMimetype application/pdf

By organisation
Mathematical Statistics
Other Mathematics

Search outside of DiVA

GoogleGoogle Scholar
Total: 673 downloads
The number of downloads is the sum of all downloads of full texts. It may include eg previous versions that are now no longer available

urn-nbn

Altmetric score

urn-nbn
Total: 664 hits
CiteExportLink to record
Permanent link

Direct link
Cite
Citation style
  • apa
  • ieee
  • modern-language-association-8th-edition
  • vancouver
  • Other style
More styles
Language
  • de-DE
  • en-GB
  • en-US
  • fi-FI
  • nn-NO
  • nn-NB
  • sv-SE
  • Other locale
More languages
Output format
  • html
  • text
  • asciidoc
  • rtf