Rethinking bert sentence embedding for Text classification with central and federated learning /
Omar Samir Galal Mohamed,
Rethinking bert sentence embedding for Text classification with central and federated learning / إعادة النظر في تضمین جملةBERT لتصنیف النص بالتعلم المركزيوالاتحادي / by Omar Samir Galal Mohamed ; Under the Supervision of Dr. Mona Farouk, Dr. Ahmed H. Abdel-Gawad. - 59 pages : illustrations ; 30 cm. + CD.
Thesis (M.Sc.)-Cairo University, 2023.
Bibliography: pages 55-59.
Text classification is a fundamental task in NLP that is used in several real-life tasks
and applications. Large pre-trained language models such as BERT achieve state-of-the-
art performance in several NLP tasks including text classification tasks. Although BERT
boosts text classification performance, the common way of using it for classification lacks
many aspects of its advantages. This thesis rethinks the way of using BERT final layer
and hidden layers embeddings by proposing different aggregation architectures for text
classification tasks such as sentiment analysis and sarcasm detection. This research also
proposes different approaches for using BERT as a feature extractor without fine-tuning whose
performance surpasses its fine-tuning counterpart. It also proposes promising multi-task
learning aggregation architectures to improve the performance of the related classification
problems. The experiments of the different architectures show that freezing BERT can
outperform fine-tuning it for sentiment analysis. The experiments also show that multi-task
learning while freezing BERT boosts the performance of hard tasks such as sarcasm detection.
The best-performing models achieved new state-of-the-art performance on the ArSarcasm-v2
dataset for Arabic sarcasm detection and sentiment analysis. For multi-task learning and
freezing BERT, a new SOTA F1-score of 64.41 was achieved for the sarcasm detection
with a 3.47% improvement and near SOTA FPN
1 of 75.78 for the sentiment classification.
For single-task learning, a new SOTA FPN
1 of 75.26 was achieved for the sentiment with a
1.81% improvement. Although gaining these results with the training data being resident
in one place, certain problem domains necessitate data distribution without data sharing.
Federated Learning (FL) allows multiple clients to collectively train a global model by
sharing learned models rather than raw data. However, the adoption of BERT, a large
model, within a Federated Learning framework incurs substantial communication costs. To
address this challenge, we propose a novel framework, FedFreezeBERT, for BERT-based
text classification. FedFreezeBERT works by adding an aggregation architecture on top of
BERT to obtain better sentence embedding for classification while freezing BERT parameters.
Keeping the model parameters frozen, FedFreezeBERT reduces the communication costs by a
large factor compared to other state-of-the-art methods. FedFreezeBERT is implemented in a
distributed version where the aggregation architecture only is being transferred and aggregated
by FL algorithms such as FedAvg or FedProx. FedFreezeBERT is also implemented in a
centralized version where the data embeddings extracted by BERT are sent to the central
server to train the aggregation architecture. The experiments show that FedFreezeBERT
achieves new state-of-the-art performance on Arabic sentiment analysis on the ArSarcasm-v2
dataset with a 12.9% and 1.2% improvement over FedAvg/FedProx and the previous SOTA
respectively. FedFreezeBERT also reduces the communication cost by 5× compared to the
previous SOTA. یعد تصنیف النص مھمة أساسیة في البرمجة اللغویة العصبیة والتي یتم استخدامھا في العدید من المھاموالتطبیقات الواقعیة. تحقق النماذج اللغویة الكبیرة المدربة مسبقًا مثلBERT أداءً متطورًا في العدید منمھام البرمجة اللغویة العصبیة بما في ذلك مھام تصنیف النص. على الرغم من أنBERT یعزز أداءتصنیف النص، إلا أن الطریقة الشائعة لاستخدامھ في التصنیف تفتقر إلى العدید من جوانب مزایاه. تعیدھذه الرسالة التفكیر في طریقة استخدام طبقةBERT النھائیة وطبقات التضمین المخفیة من خلال اقتراحبنیات تجمیعیة مختلفة لمھام تصنیف النص مثل تحلیل المشاعر واكتشاف السخریة. یقترح ھذا البحثأیضًا طرقًا مختلفة لاستخدامBERT كمستخرج للمیزات بدون ضبط دقیق. تُظھر تجارب البنى المختلفة أنتجمیدBERT یمكن أن یتفوق في ضبطھ لتحلیل المشاعر. تظھر التجارب أیضًا أن التعلم متعدد المھام أثناءتجمیدBERT یعزز أداء المھام الصعبة مثل اكتشاف السخریة. حققت النماذج الأفضل أداءً أداءً جدیدًامتطورًا في مجموعة بیاناتArSarcasm-v2 للكشف عن السخریة العربیة وتحلیل المشاعر. بالنسبةللتعلم متعدد المھام وتجمیدBERT ، تم تحقیق درجة جدیدة تبلغ 64.41F1-score لاكتشاف السخریة مع
تحسن بنسبة 3.47% و 75.78F1PN لتصنیف المشاعر. بالنسبة للتعلم بمھمة واحدة، تم تحقیق معدل جدید
قدره 75.26F1PN للمیول مع تحسن بنسبة 1.81%. على الرغم من الحصول على ھذه النتائج مع وجود
بیانات التدریب في مكان واحد، فإن بعض مجالات المشكلات تتطلب توزیع البیانات دون مشاركةالبیانات. یتیح التعلم الموحد (FL) للعدید من العملاء تدریب نموذج عالمي بشكل جماعي من خلال مشاركةالنماذج المدربة بدلاً من البیانات الأولیة. ومع ذلك، فإن اعتمادBERT ، وھو نموذج كبیر، ضمن إطارالتعلم الموحد یؤدي إلى تكالیف اتصالات كبیرة. ولمواجھة ھذا التحدي، نقترح إطارًا جدیدًا،FedFreezeBERT، لتصنیف النصوص استنادًا إلىBERT . یعملFedFreezeBERT عن طریق إضافةبنیة تجمیعیة أعلىBERT للحصول على تضمین أفضل للجمل للتصنیف أثناء تجمید متغیراتBERT . منخلال الحفاظ على تجمید متغیرات النموذج، یعملFedFreezeBERT على تقلیل تكالیف الاتصال بعاملكبیر مقارنة بالطرق الحدیثة الأخرى. تظھر التجارب أنFedFreezeBERT حقق أداءً جدیدًا متطورًا فيتحلیل المشاعر العربیة في مجموعة بیاناتArSarcasm-v2 مع تحسن بنسبة 12.9% و1.2% علىFedAvg/FedProx و الطریقة الأفضل سابقاً على التوالي. یعملFedFreezeBERT أیضًا على تقلیلتكلفة الاتصال بمقدار 5 مرات مقارنة بـأفضل طریقة سابقاُ.
Text in English and abstract in Arabic & English.
Computer Engineering
Text Classification BERT Federated Learning Natural Language Processing Pre-trained Language Models
621.39
Rethinking bert sentence embedding for Text classification with central and federated learning / إعادة النظر في تضمین جملةBERT لتصنیف النص بالتعلم المركزيوالاتحادي / by Omar Samir Galal Mohamed ; Under the Supervision of Dr. Mona Farouk, Dr. Ahmed H. Abdel-Gawad. - 59 pages : illustrations ; 30 cm. + CD.
Thesis (M.Sc.)-Cairo University, 2023.
Bibliography: pages 55-59.
Text classification is a fundamental task in NLP that is used in several real-life tasks
and applications. Large pre-trained language models such as BERT achieve state-of-the-
art performance in several NLP tasks including text classification tasks. Although BERT
boosts text classification performance, the common way of using it for classification lacks
many aspects of its advantages. This thesis rethinks the way of using BERT final layer
and hidden layers embeddings by proposing different aggregation architectures for text
classification tasks such as sentiment analysis and sarcasm detection. This research also
proposes different approaches for using BERT as a feature extractor without fine-tuning whose
performance surpasses its fine-tuning counterpart. It also proposes promising multi-task
learning aggregation architectures to improve the performance of the related classification
problems. The experiments of the different architectures show that freezing BERT can
outperform fine-tuning it for sentiment analysis. The experiments also show that multi-task
learning while freezing BERT boosts the performance of hard tasks such as sarcasm detection.
The best-performing models achieved new state-of-the-art performance on the ArSarcasm-v2
dataset for Arabic sarcasm detection and sentiment analysis. For multi-task learning and
freezing BERT, a new SOTA F1-score of 64.41 was achieved for the sarcasm detection
with a 3.47% improvement and near SOTA FPN
1 of 75.78 for the sentiment classification.
For single-task learning, a new SOTA FPN
1 of 75.26 was achieved for the sentiment with a
1.81% improvement. Although gaining these results with the training data being resident
in one place, certain problem domains necessitate data distribution without data sharing.
Federated Learning (FL) allows multiple clients to collectively train a global model by
sharing learned models rather than raw data. However, the adoption of BERT, a large
model, within a Federated Learning framework incurs substantial communication costs. To
address this challenge, we propose a novel framework, FedFreezeBERT, for BERT-based
text classification. FedFreezeBERT works by adding an aggregation architecture on top of
BERT to obtain better sentence embedding for classification while freezing BERT parameters.
Keeping the model parameters frozen, FedFreezeBERT reduces the communication costs by a
large factor compared to other state-of-the-art methods. FedFreezeBERT is implemented in a
distributed version where the aggregation architecture only is being transferred and aggregated
by FL algorithms such as FedAvg or FedProx. FedFreezeBERT is also implemented in a
centralized version where the data embeddings extracted by BERT are sent to the central
server to train the aggregation architecture. The experiments show that FedFreezeBERT
achieves new state-of-the-art performance on Arabic sentiment analysis on the ArSarcasm-v2
dataset with a 12.9% and 1.2% improvement over FedAvg/FedProx and the previous SOTA
respectively. FedFreezeBERT also reduces the communication cost by 5× compared to the
previous SOTA. یعد تصنیف النص مھمة أساسیة في البرمجة اللغویة العصبیة والتي یتم استخدامھا في العدید من المھاموالتطبیقات الواقعیة. تحقق النماذج اللغویة الكبیرة المدربة مسبقًا مثلBERT أداءً متطورًا في العدید منمھام البرمجة اللغویة العصبیة بما في ذلك مھام تصنیف النص. على الرغم من أنBERT یعزز أداءتصنیف النص، إلا أن الطریقة الشائعة لاستخدامھ في التصنیف تفتقر إلى العدید من جوانب مزایاه. تعیدھذه الرسالة التفكیر في طریقة استخدام طبقةBERT النھائیة وطبقات التضمین المخفیة من خلال اقتراحبنیات تجمیعیة مختلفة لمھام تصنیف النص مثل تحلیل المشاعر واكتشاف السخریة. یقترح ھذا البحثأیضًا طرقًا مختلفة لاستخدامBERT كمستخرج للمیزات بدون ضبط دقیق. تُظھر تجارب البنى المختلفة أنتجمیدBERT یمكن أن یتفوق في ضبطھ لتحلیل المشاعر. تظھر التجارب أیضًا أن التعلم متعدد المھام أثناءتجمیدBERT یعزز أداء المھام الصعبة مثل اكتشاف السخریة. حققت النماذج الأفضل أداءً أداءً جدیدًامتطورًا في مجموعة بیاناتArSarcasm-v2 للكشف عن السخریة العربیة وتحلیل المشاعر. بالنسبةللتعلم متعدد المھام وتجمیدBERT ، تم تحقیق درجة جدیدة تبلغ 64.41F1-score لاكتشاف السخریة مع
تحسن بنسبة 3.47% و 75.78F1PN لتصنیف المشاعر. بالنسبة للتعلم بمھمة واحدة، تم تحقیق معدل جدید
قدره 75.26F1PN للمیول مع تحسن بنسبة 1.81%. على الرغم من الحصول على ھذه النتائج مع وجود
بیانات التدریب في مكان واحد، فإن بعض مجالات المشكلات تتطلب توزیع البیانات دون مشاركةالبیانات. یتیح التعلم الموحد (FL) للعدید من العملاء تدریب نموذج عالمي بشكل جماعي من خلال مشاركةالنماذج المدربة بدلاً من البیانات الأولیة. ومع ذلك، فإن اعتمادBERT ، وھو نموذج كبیر، ضمن إطارالتعلم الموحد یؤدي إلى تكالیف اتصالات كبیرة. ولمواجھة ھذا التحدي، نقترح إطارًا جدیدًا،FedFreezeBERT، لتصنیف النصوص استنادًا إلىBERT . یعملFedFreezeBERT عن طریق إضافةبنیة تجمیعیة أعلىBERT للحصول على تضمین أفضل للجمل للتصنیف أثناء تجمید متغیراتBERT . منخلال الحفاظ على تجمید متغیرات النموذج، یعملFedFreezeBERT على تقلیل تكالیف الاتصال بعاملكبیر مقارنة بالطرق الحدیثة الأخرى. تظھر التجارب أنFedFreezeBERT حقق أداءً جدیدًا متطورًا فيتحلیل المشاعر العربیة في مجموعة بیاناتArSarcasm-v2 مع تحسن بنسبة 12.9% و1.2% علىFedAvg/FedProx و الطریقة الأفضل سابقاً على التوالي. یعملFedFreezeBERT أیضًا على تقلیلتكلفة الاتصال بمقدار 5 مرات مقارنة بـأفضل طریقة سابقاُ.
Text in English and abstract in Arabic & English.
Computer Engineering
Text Classification BERT Federated Learning Natural Language Processing Pre-trained Language Models
621.39