Implementation of Fine-Tuned Model Llama3 on Hugging Face to detect Online Gambling Promotional Text
DOI:
https://doi.org/10.21512/ijcshai.v3i2.15283Keywords:
Online Gambling, Llama 3.2, Hugging Face, Optimizer AdamW, Text Detection, PEFT, LoRAAbstract
Online gambling is a serious problem in Indonesia due to its social and economic impact, worsened by ease of access and massive promotional strategies. From the past research, online gambling promotion in Indonesia has not been widely conducted. This study aims to implement the Llama 3.2 Large Language Model (LLM) based on the Hugging Face library to detect online gambling promotions and analyze its performance with and without optimization techniques. The Llama 3.2 model is fine-tuned using the Parameter-Efficient Fine-Tuning (PEFT) and Low-Rank Adaptation (LoRA) approaches. Model performance was evaluated using the confusion matrix and classification report, covering metrics like accuracy, precision, recall, and F1-score. The results showed that the model without an optimizer produced an accuracy of 0.89. With the application of the AdamW optimizer, accuracy increased to 0.92 with an improvement in the balance between precision and recall in both classes. This improvement in performance demonstrates the effectiveness of using optimizers in improving model training and generalization processes. Overall, this study shows that Llama 3.2 is capable of effectively detecting online gambling promotions and can serve as a foundation for the development of illegal content detection systems.
References
[1] PPATK, Laporan Tahunan 2023, Jakarta: Pusat Pelaporan dan Analisis Transaksi Keuangan, 2024. [Online]. Available: https://www.ppatk.go.id
[2] D. Q. Nguyen, T. Vu, and A. T. Nguyen, “Improving Language Model Pretraining with Word Structural Knowledge,” arXiv preprint, arXiv:2402.05932, 2024.
[3] Y. Lv, Z. Xie, H. Liu, and Y. Yang, “Efficient Fine-Tuning of Large Language Models via Parameter-Efficient Low-Rank Adaptation,” Knowledge-Based Systems, vol. 285, p. 111298, 2024.
[4] R. Oliveira, J. Silva, and M. Martins, “Large Language Models in Financial Applications: Opportunities and Risks,” in Proc. 2024 Int. Conf. Artificial Intelligence Applications, pp. 102–112.
[5] J. Zhao et al., “LoRA Land: 310 Fine-tuned LLMs that Rival GPT-4, A Technical Report,” arXiv preprint, arXiv:2405.00732, 2024, doi: 10.48550/arXiv.2405.00732.
[6] S. E. Repede and R. Brad, “Llama 3 vs. State-of-the-Art Large Language Models: Performance in Detecting Nuanced Fake News,” Computers, vol. 13, no. 11, 2024.
[7] E. Smith, J. Peters, and N. Reiter, “Automatic detection of problem-gambling signs from online texts using large language models,” PLOS Digital Health, vol. 3, no. 9, p. e0000605, 2024.
[8] R. Perdana, A. Budi, I. Santoso, A. Ramadiah, and P. Putra, “Detecting Online Gambling Promotions on Indonesian Twitter Using Text Mining Algorithm,” Int. J. Adv. Comput. Sci. Appl., vol. 15, no. 8, 2024, doi: 10.14569/ijacsa.2024.0150893.
[9] L. Rafiqah and H. Rasyid, “Dampak Judi Online terhadap Kehidupan Sosial Ekonomi Masyarakat,” Al-Mutharahah: J. Penelitian dan Kajian Sosial Keagamaan, vol. 20, no. 2, pp. 282–290, 2023.
[10] H. H. Zain, M. F. Ramadhan, F. Saputra, and T. Supriyadi, “Pengaruh judi online terhadap kecenderungan remaja melakukan tindakan kriminal,” Triwikrama: J. Ilmu Sosial, vol. 6, no. 8, pp. 41–50, 2025, doi: 10.6578/triwikrama.v6i8.9835.
[11] CNBC Indonesia, “PPATK: 78% Penjudi Online Berpenghasilan di Bawah Rp 100 Ribu,” CNBC Indonesia, Sep. 25, 2023. [Online]. Available: https://www.cnbcindonesia.com/news/20230925115129-8-475252
[12] M. F. Pradika, L. T. T. Hidayat, A. H. D. Prakoso, and A. A. Khan, “Study of Online Gambling Promotion Policy in Indonesia, Pakistan, and USA,” Ettisal: J. Communication, vol. 9, no. 1, 2024.
[13] M. Guillou-Landreat, K. Gallopel-Morvan, D. Lever, D. Le Goff, and J. Y. Le Reste, “Gambling marketing strategies and the internet: What do we know? A systematic review,” Front. Psychiatry, vol. 12, p. 583817, 2021.
[14] A. E. Killick and M. D. Griffiths, “A content analysis of gambling operators’ Twitter accounts at the start of the English Premier League football season,” J. Gambling Studies, vol. 36, no. 1, pp. 319–341, 2020.
[15] I. Y. Nono, A. A. S. L. Dewi, and I. P. G. Seputra, “Penegakan Hukum Terhadap Selebgram yang Mempromosikan Situs Judi Online,” J. Analogi Hukum, vol. 3, no. 2, pp. 235–239, 2021.
[16] M. Raiaan et al., “A Review on Large Language Models: Architectures, Applications, Taxonomies, Open Issues and Challenges,” IEEE Access, vol. 12, pp. 26839–26874, 2024, doi: 10.1109/ACCESS.2024.3365742.
[17] L. Fan, L. Li, Z. …, S. Lee, H. Yu, and L. Hemphill, “A Bibliometric Review of Large Language Models Research from 2017 to 2023,” ACM Trans. Intell. Syst. Technol., 2023, doi: 10.48550/arXiv.2304.02020.
[18] X. Hou et al., “Large Language Models for Software Engineering: A Systematic Literature Review,” arXiv preprint, arXiv:2308.10620, 2023, doi: 10.48550/arXiv.2308.10620.
[19] L. Yan et al., “Practical and ethical challenges of large language models in education: A systematic scoping review,” Br. J. Educ. Technol., vol. 55, pp. 90–112, 2023, doi: 10.1111/bjet.13370.
[20] S. Minaee et al., “Large Language Models: A Survey,” arXiv preprint, arXiv:2402.06196, 2025, doi: 10.48550/arXiv.2402.06196.
[21] B. Jin, G. Liu, C. Han, M. Jiang, H. Ji, and J. Han, “Large Language Models on Graphs: A Comprehensive Survey,” arXiv preprint, arXiv:2312.02783, 2024, doi: 10.48550/arXiv.2312.02783.
[22] S. Pan, L. Luo, Y. Wang, C. Chen, J. Wang, and X. Wu, “Unifying Large Language Models and Knowledge Graphs: A Roadmap,” IEEE Trans. Knowl. Data Eng., vol. 36, pp. 3580–3599, 2023, doi: 10.1109/TKDE.2024.3352100.
[23] S. Wang et al., “Knowledge Editing for Large Language Models: A Survey,” arXiv preprint, arXiv:2310.16218, 2024, doi: 10.48550/arXiv.2310.16218.
[24] S. Bowman, “Eight Things to Know about Large Language Models,” arXiv preprint, arXiv:2304.00612, 2023, doi: 10.48550/arXiv.2304.00612.
[25] A. Dubey et al., “The Llama 3 herd of models,” arXiv preprint, arXiv:2407.21783, 2024, doi: 10.48550/arXiv.2407.21783.
[26] U. R. Pol, P. S. Vadar, and T. T. Moharekar, “Hugging Face: Revolutionizing AI and NLP,” Int. J. Res. Appl. Sci. Eng. Technol., vol. 12, no. 8, pp. 1121–1124, 2024.
[27] A. Ait, J. Izquierdo, and J. Cabot, “On the suitability of hugging face hub for empirical studies,” Empirical Software Engineering, vol. 30, no. 57, 2025, doi: 10.1007/s10664-024-10608-8.
[28] F. Pepe, V. Nardone, A. Mastropaolo, G. Bavota, G. Canfora, and M. Di Penta, “How do Hugging Face Models Document Datasets, Bias, and Licenses? An Empirical Study,” in Proc. IEEE/ACM Int. Conf. Program Comprehension (ICPC), 2024, pp. 370–381.
[29] A. Das, “Natural GaLore: Accelerating GaLore for memory-efficient LLM Training and Fine-tuning,” arXiv preprint, arXiv:2410.16029, 2024, doi: 10.48550/arXiv.2410.16029.
[30] H. Zhu et al., “APOLLO: SGD-like Memory, AdamW-level Performance,” arXiv preprint, arXiv:2412.05270, 2025, doi: 10.48550/arXiv.2412.05270.
[31] K. Church, Z. Chen, and Y. …, “Emerging trends: A gentle introduction to fine-tuning,” Natural Language Engineering, vol. 27, pp. 763–778, 2021, doi: 10.1017/S1351324921000322.
[32] G. Vrbancic and V. Podgorelec, “Transfer Learning With Adaptive Fine-Tuning,” IEEE Access, vol. 8, pp. 196197–196211, 2020, doi: 10.1109/ACCESS.2020.3034343.
[33] A. Hadji-Kyriacou and O. Arandjelović, “Context-PEFT: Efficient Multi-Modal, Multi-Task Fine-Tuning,” arXiv preprint, arXiv:2312.08900, 2023, doi: 10.48550/arXiv.2312.08900.
[34] A. Tahir, L. Cheng, and H. Liu, “JORA: JAX tensor-parallel LoRA library for retrieval augmented fine-tuning,” in Proc. 62nd Annu. Meeting Assoc. Comput. Linguistics (ACL), 2024, pp. 152–159.
[35] S. Ebneyamini, “Towards Developing a Library for Conducting Management Studies Using Design Research Methodology,” Int. J. Qualitative Methods, vol. 21, 2022, doi: 10.1177/16094069221112245.
[36] R. Rahul, H. Kajla, J. Hooda, and G. Saini, “Classification of online toxic comments using machine learning algorithms,” in Proc. ICICCS, 2020, pp. 1119–1123, doi: 10.1109/ICICCS48265.2020.9120939.
[37] B. Mohammadi, “Explaining large language models decisions using shapley values,” arXiv preprint, arXiv:2404.01332, 2024.
[38] P. Lindner, J. Ramnerö, E. Ivanova, and P. Carlbring, “Studying Gambling Behaviors and Responsible Gambling Tools in a Simulated Online Casino,” Front. Psychiatry, vol. 11, 2021, doi: 10.3389/fpsyt.2020.571954.
[39] H. Syahputra and A. Wibowo, “Comparison of Support Vector Machine (SVM) and Random Forest Algorithm for Detection of Negative Content on Websites,” J. Ilmiah Tek. Elektro Komp. Informatika, vol. 9, no. 1, 2023, doi: 10.26555/jiteki.v9i1.25861.
[40] H. Bichri, A. Chergui, and M. Hain, “Investigating the Impact of Train/Test Split Ratio on the Performance of Pre-Trained Models with Custom Datasets,” Int. J. Adv. Comput. Sci. Appl., vol. 15, no. 2, 2024, doi: 10.14569/ijacsa.2024.0150235.
[41] T. Thien and W. Yeo, “A comparative study between PCR, PLSR, and LW-PLS on predictive performance at different data splitting ratios,” Chem. Eng. Commun., vol. 209, pp. 1439–1456, 2021, doi: 10.1080/00986445.2021.1957853.
[42] Y. Xu and R. Goodacre, “On Splitting Training and Validation Set: A Comparative Study of Cross-Validation, Bootstrap and Systematic Sampling for Estimating the Generalization Performance,” J. Analysis and Testing, vol. 2, pp. 249–262, 2018, doi: 10.1007/s41664-018-0068-2.
[43] A. Russell, N. Hing, M. Browne, and V. Rawat, “Are direct messages (texts and emails) from wagering operators associated with betting intention and behavior? An ecological momentary assessment study,” J. Behavioral Addictions, vol. 7, pp. 1079–1090, 2018, doi: 10.1556/2006.7.2018.99.
[44] X. Xu, J. Bowen, and R. Taheri, “Token Masking Improves Transformer-Based Text Classification,” arXiv preprint, arXiv:2505.11746, 2025.
[45] E. J. Hu et al., “LoRA: Low-rank adaptation of large language models,” ICLR, vol. 1, no. 2, pp. 3–15, 2022.
[46] S. Selvakumari and M. Durairaj, “A Comparative Study of Optimization Techniques in Deep Learning Using the MNIST Dataset,” Indian J. Sci. Technol., vol. 18, no. 10, 2025, doi: 10.17485/ijst/v18i10.121.
[47] L. Fu, P. Liang, X. Li, and C. Yang, “A machine learning based ensemble method for automatic multiclass classification of decisions,” in Proc. 25th Int. Conf. Evaluation and Assessment in Software Engineering, 2021, pp. 40–49.
[48] D. Valero-Carreras, J. Alcaraz, and M. Landete, “Comparing two SVM models through different metrics based on the confusion matrix,” Computers & Operations Research, vol. 152, p. 106131, 2023, doi: 10.1016/j.cor.2022.106131.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Rafid Miftah Fadhil, Indira Syawanodya, Yulia Retnowati

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License - Share Alike that allows others to share the work with an acknowledgment of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work.
USER RIGHTS
All articles published Open Access will be immediately and permanently free for everyone to read and download. We are continuously working with our author communities to select the best choice of license options, currently being defined for this journal as follows: Creative Commons Attribution-Share Alike (CC BY-SA)





