Bagaimana mesin memahami bahasa? Dari word embedding ke RNN, LSTM, dan akhirnya Transformer — arsitektur yang melahirkan GPT, BERT, dan revolusi LLM.
Bahasa manusia ambigu, sequential, kontekstual, kompleks. Mesin harus capture makna kata, urutan, konteks panjang, dan nuansa budaya.
Klasifikasi (sentiment), Named Entity Recognition (NER), POS tagging, Machine Translation, Question Answering, Summarization, Text Generation, Semantic Search, Speech-to-Text.
Hitung frekuensi tiap kata. Kehilangan urutan & semantic. Baseline.
Term Frequency × Inverse Document Frequency. Bobot kata penting di doc tertentu.
Word2Vec, GloVe — representasi dense vector yang capture semantic.
vec("king") − vec("man") + vec("woman") ≈ vec("queen")Network dengan loop — output di-feed kembali ke input layer berikutnya. Cocok untuk sequence (text, time-series, audio).
h_t = tanh(W_h · h_{t−1} + W_x · x_t + b)y_t = W_y · h_t + b_yRNN biasa tidak bisa pelajari dependency panjang. Setelah ~10 step, gradient mengecil sampai mendekati nol — network "lupa" konteks awal.
Long Short-Term Memory (Hochreiter & Schmidhuber, 1997). Tambahkan cell state + 3 gates (forget, input, output) untuk control informasi.
forget_gate = σ(W_f · [h_{t-1}, x_t] + b_f)input_gate = σ(W_i · [h_{t-1}, x_t] + b_i)output_gate = σ(W_o · [h_{t-1}, x_t] + b_o)cell_state = forget_gate × c_{t-1} + input_gate × candidateh_t = output_gate × tanh(cell_state)
Insight 2014: alih-alih compress seluruh input ke 1 vector, biarkan decoder "perhatikan" bagian input yang relevan untuk setiap output.
score(query, key) = query · key^T / √d_kattention_weights = softmax(scores)output = Σ attention_weights · valuesVaswani et al., 2017: buang recurrence sepenuhnya. Pure attention. Hasilnya: bisa di-paralelkan di GPU, training jauh lebih cepat, capture long-range dependency lebih baik.
| Model | Tahun | Arsitektur | Fokus |
|---|---|---|---|
| BERT (Google) | 2018 | Encoder-only | Understanding (klasifikasi, QA) |
| GPT-2 (OpenAI) | 2019 | Decoder-only | Generation |
| T5 (Google) | 2019 | Encoder-Decoder | Text-to-text universal |
| GPT-3 | 2020 | Decoder, 175B | Few-shot learning |
| ChatGPT/GPT-4 | 2022/23 | RLHF on top | Conversational |
| Claude, Llama, Gemini | 2023+ | Various decoder | State-of-the-art |
Saat Google deploy BERT ke search engine 2019, mereka tunjukkan contoh: query "can you get medicine for someone pharmacy". Pre-BERT, Google fokus pada keyword "medicine, pharmacy". Post-BERT, Google paham konteks "for someone" — pertanyaan tentang pickup obat untuk orang lain.
Pelajaran: Transformer mengubah semantic understanding fundamental. 10% query Google diuntungkan dari BERT, salah satu update terbesar dalam sejarah search engine.