Implementasi Arsitektur Transformer GPT-2 untuk Prediksi Kata Selanjutnya pada Teks Resep Masakan Indonesia
DOI:
https://doi.org/10.62411/tc.v25i3.17163Abstract
Pemrosesan bahasa alami untuk domain spesifik memerlukan model yang mampu memahami struktur kalimat yang unik dan kosakata informal. Penelitian ini mengimplementasikan arsitektur Transformer bergaya GPT-2 yang dibangun dari awal untuk tugas prediksi kata selanjutnya (next-word prediction) pada teks resep masakan Indonesia. Dataset yang digunakan terdiri dari 14.945 resep masakan, yang ditokenisasi menggunakan metode SentencePiece Byte Pair Encoding (BPE) dengan vocabulary size sebanyak 8.000 token. Model causal language yang diusulkan memiliki 4 blok transformer, 4 attention heads, dan dimensi embedding sebesar 256, dengan total sekitar 5,26 juta parameter yang dapat dilatih. Proses pelatihan dilakukan menggunakan optimizer AdamW selama 30 epoch. Evaluasi pada data Data uji (test set) menghasilkan nilai cross-entropy loss sebesar 2,8471 dan perplexity sebesar 17,24. Selain itu, model ini berhasil mencapai akurasi Top-1 sebesar 40,07% dan akurasi Top-5 sebesar 67,72%. Pengujian decoding interaktif menggunakan strategi greedy, top-k, dan nucleus sampling menunjukkan kemampuan model yang baik dalam menghasilkan instruksi langkah memasak yang relevan secara kontekstual. Hasil ini menunjukkan bahwa arsitektur GPT-2 berskala kecil sangat efektif untuk tugas pembuatan teks yang spesifik pada domain tertentu. Kata kunci - Prediksi Kata Selanjutnya, GPT-2, Transformer, Byte Pair Encoding, Resep MasakanDownloads
Published
Issue
Section
License
Copyright (c) 2026 Ahmad Farhan Ramadhansyah, Jeny Fajarwati, Rezky Aulia, Adha Mashur Sajiah

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
License Terms
All articles published in Techno.COM Journal are licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0). This means:
1. Attribution
Readers and users are free to:
-
Share – Copy and redistribute the material in any medium or format.
-
Adapt – Remix, transform, and build upon the material.
As long as proper credit is given to the original work by citing the author(s) and the journal.
2. Non-Commercial Use
-
The material cannot be used for commercial purposes.
-
Commercial use includes selling the content, using it in commercial advertising, or integrating it into products/services for profit.
3. Rights of Authors
-
Authors retain copyright and grant Techno.COM Journal the right to publish the article.
-
Authors can distribute their work (e.g., in institutional repositories or personal websites) with proper acknowledgment of the journal.
4. No Additional Restrictions
-
The journal cannot apply legal terms or technological measures that restrict others from using the material in ways allowed by the license.
5. Disclaimer
-
The journal is not responsible for how the published content is used by third parties.
-
The opinions expressed in the articles are solely those of the authors.
For more details, visit the Creative Commons License Page:
? https://creativecommons.org/licenses/by-nc/4.0/









