Large Language Models (LLMs) have revolutionized artificial intelligence by enabling multitasking across diverse fields. However, their high computational demands result in significant environmental impacts, particularly in terms of energy and water consumption. This paper addresses these issues by proposing an innovative compression approach to reducing LLM sizes. We focus on compressing the internal transformer layers, which are critical contributors to LLMs’ computational complexity. Our approach combines new mathematical and structural key methods for model compression. We begin by applying Forward Propagation Pruning (FPP) to compress the embedding and feed-forward layers, utilizing a weight freezing and zeroing technique for suspected unused parameters. This reduces the number of trainable parameters, accelerating the overall training process and enabling faster convergence. Second, the Weight Matrix Folding method is introduced to efficiently prune the self-attention layer matrices in a simple and efficient mathematical model. This method integrates Identical Row Compression (IRC) to optimize the compression of the Query and Key matrices, alongside Diagonal Weight Compression (DWC), which reformulates the Value matrix into a diagonal structure. Consequently, this technique significantly diminishes parameter variability across the three metrics, enhancing consistency and performance while simplifying complexity. The compression approach is evaluated on three language modeling datasets and eight widely used classification datasets, comparing it to various pruning methods. Our method successfully compresses transformer layers by 99% and linear layers by 70%, resulting in an overall model compression of around 70%, while maintaining nearly the same accuracy. Notably, with moderate compression rates of 20% to 40%, model performance not only remained stable but even improved. This leads to substantial reductions in memory usage and computational demands, making LLMs more resource-efficient and highlighting the potential to optimize them for a more sustainable AI future.
In the ongoing battle against adversarial attacks, adopting a suitable strategy to enhance model efficiency, bolster resistance to adversarial threats, and ensure practical deployment is crucial. To achieve this goal, a novel four-component methodology is introduced. First, introducing a pioneering batch-cumulative approach, the exponential particle swarm optimization (ExPSO) algorithm was developed for meticulous parameter fine-tuning within each batch. A cumulative updating loss function was employed for overall optimization, demonstrating remarkable superiority over traditional optimization techniques. Second, weight compression is applied to streamline the deep neural network (DNN) parameters, boosting the storage efficiency and accelerating inference. It also introduces complexity to deter potential attackers, enhancing model accuracy in adversarial settings. This study compresses the generative pre-trained transformer (GPT) by 65%, saving time and memory without causing performance loss. Compared to state-of-the-art methods, the proposed method achieves the lowest perplexity (14.28), the highest accuracy (93.72%), and an 8 × speedup in the central processing unit. The integration of the preceding two components involves the simultaneous training of multiple versions of the compressed GPT. This training occurs across various compression rates and different segments of a dataset and is ultimately associated with a novel multi-expert architecture. This enhancement significantly fortifies the model's resistance to adversarial attacks by introducing complexity into attackers' attempts to anticipate the model's prediction integration process. Consequently, this leads to a remarkable average performance improvement of 25% across 14 different attack scenarios and various datasets, surpassing the capabilities of current state-of-the-art methods.
Twitter’s widespread popularity has made it a prime target for malicious actors exploiting trending hashtags to disseminate harmful content. This study marks the first systematic exploration of semantic consistency in tweets to detect trending topic attacks. Unlike previous approaches, we emphasize the semantic aspect of tweets, leveraging advanced techniques such as semantic similarity estimation using WordNet and contextual understanding through Sentence-Transformers. To support this methodology, we curated large-scale, high-quality datasets comprising 7,000 Arabic and 28,000 English tweets, applying tailored preprocessing steps to ensure efficiency and accuracy. A novel data augmentation technique further enriched the quality and diversity of these datasets. We evaluated our approach using a comprehensive framework that assessed textual, image, and overall similarity. Five machine learning models—Random Forest, Decision Tree, K-Neighbors, Gradient Boosting, and XGBoost—were tested, with results benchmarked against nine baseline methods across different linguistic datasets and learning scenarios. Our approach demonstrated superior performance, achieving F1-scores of 96% for English and 97% for Arabic, with accuracy improvements ranging from 2% to 14% for English and 5% to 28% for Arabic. These results establish a new benchmark for detecting trending topic attacks across languages, highlighting the robustness and effectiveness of our method in combating malicious activities on social platforms.
This study benchmarks multiple machine learning models to predict student academic performance. The research analyzes data from students in mathematics and Portuguese language courses, examining the relationship between various factors and academic performance. The benchmark implementation includes data preprocessing, exploratory data analysis, feature engineering, model training, and hyperparameter tuning for both regression (predicting final grades) and classification (predicting pass/fail outcomes) tasks. The findings demonstrate that ensemble methods, particularly gradient boosting models, outperform other algorithms with root mean square error of 3.34 for regression and F1 score of 0.88 for classification after hyperparameter tuning. Feature importance analysis reveals that past failures, alcohol consumption, study time, and parent education level are among the most influential predictors of academic performance. The results provide valuable insights for educational stakeholders to implement targeted interventions for at-risk students and improve overall academic outcomes.