0Pricing
AI Engineering Academy · Ders

LLM'ler Nasıl Eğitilir

LLM eğitiminin aşamalarını öğrenin: devasa derlemlerle ön eğitim, denetimli ince ayar ve RLHF; ayrıca her aşamanın model davranışı açısından neden önemli olduğunu keşfedin.

LLM'ler Nasıl Eğitilir, CoddyKit'te ücretsiz bir AI Engineering Academy dersidir. Bu, 4 dersinin 3. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, AI Engineering Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. AI Engineering Academy kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Three Stages of LLM Training

LLMs are built in three stages: pre-training teaches language and knowledge, fine-tuning teaches instruction-following, and RLHF aligns the model with what people want.

Pre-Training: Next Token Prediction at Scale

Pre-training feeds the model tons of text with one job: predict the next token. That simple goal is enough to teach grammar, facts, and reasoning along the way.

Training Data Quality and Curation

Raw internet text is messy. Teams clean it with data pipelines that filter, deduplicate, and score quality. The rule of thumb: better data beats a bigger model.

The Loss Function and Optimization

Training minimizes cross-entropy loss — how far the model's guess is from the right next token. Tiny weight nudges, repeated billions of times. The code shows the math.

# Illustrative cross-entropy loss for a single token prediction
import math

vocab_size = 50000
correct_token_index = 4217  # index for the word 'Paris'

# Model output probabilities (softmax of logits)
model_probs = [0.00002] * vocab_size  # simplified uniform base
model_probs[correct_token_index] = 0.70  # model is 70% confident in 'Paris'

loss = -math.log(model_probs[correct_token_index])
print(f'Cross-entropy loss: {loss:.4f}')  # ~0.3567

Emergent Capabilities from Scale

At enough scale, new emergent capabilities appear — like step-by-step reasoning — that small models simply don't have. Nobody trained them in directly; scale brought them.

Supervised Fine-Tuning on Instruction Pairs

A raw model just continues text. Supervised fine-tuning trains it on (instruction, ideal answer) pairs, so it learns to actually answer instead of rambling on.

# Illustrative SFT data format
training_example = {
    'messages': [
        {'role': 'system', 'content': 'You are a helpful assistant.'},
        {'role': 'user', 'content': 'What is the capital of France?'},
        {'role': 'assistant', 'content': 'The capital of France is Paris.'}
    ]
}
# During SFT, loss is computed only on the assistant turn tokens
# The system and user tokens are provided as context but not trained on

RLHF Phase 1: Training the Reward Model

RLHF starts with a reward model. People pick the better of two answers, and the reward model learns to predict those preferences — a stand-in for human taste.

RLHF Phase 2: PPO Fine-Tuning

Next, PPO tunes the LLM to score higher on the reward model. A KL penalty keeps it from drifting weird and gaming the reward instead of truly helping.

Direct Preference Optimization: Simpler RLHF

PPO is complex. DPO is a simpler alternative: it trains the model straight from preferred-vs-rejected answer pairs — no separate reward model needed.

Chinchilla Scaling Laws: Compute-Optimal Training

The Chinchilla finding: older models were undertrained. For a given budget, scale data and size together — roughly 20 tokens per parameter for the best results.

What Each Training Stage Affects

Each stage controls something: pre-training sets what it knows, fine-tuning sets how it behaves, and RLHF sets its values. That tells you which part to fix.

Quick Check

Test your understanding of AI Engineering concepts from this lesson.

Lesson Recap

Recap: pre-training builds knowledge, fine-tuning builds instruction-following, and RLHF or DPO aligns the model with human values. Next: what LLMs can and can't do. 💡

Sıkça Sorulan Sorular

“LLM'ler Nasıl Eğitilir” dersi ücretsiz mi?

Evet — “LLM'ler Nasıl Eğitilir” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve AI Engineering Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. AI Engineering Academy kursu toplamda 4 dersten oluşur.

“LLM'ler Nasıl Eğitilir” dersinde ne öğreneceğim?

LLM eğitiminin aşamalarını öğrenin: devasa derlemlerle ön eğitim, denetimli ince ayar ve RLHF; ayrıca her aşamanın model davranışı açısından neden önemli olduğunu keşfedin. AI Engineering Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

AI Engineering Academy öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te AI Engineering Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 3. dersidir.

“LLM'ler Nasıl Eğitilir” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu AI Engineering Academy dersinde kod yazıp çalıştırabilir miyim?

Evet. Her AI Engineering Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Otomatik Tamamlamadan ChatGPT'ye
  2. Transformer'lar ve Dikkat Mekanizması: Sade Bir Anlatım
  3. LLM'ler Nasıl Eğitilir
  4. LLM'lerin Yetenekleri ve Sınırlamaları
← AI Engineering Academy Sayfasına Dön