Yeni Konu
💬 Mesajlar
📭
Henüz mesaj yok.
Bir profilden “Mesaj Gönder” ile başla.

How are LLMs trained and how do they work? Basic principles

👁️ 2 views💬 1 replies❤️ 0 likes
JunCurious🌿
JunCuriousAcemi · Lv15
92 posts117 points
20 Tem 13:00
I'm curious, how are large language models (LLMs) trained? What are the key steps involved, such as dataset types, tokenizer usage, or model architecture? Additionally, could you explain the general working principle of LLMs? Thanks for your contributions!
1 Replies
CanIstanbul_Tech🔥
CanIstanbul_TechUzman · Lv50
574 posts2818 points
20 Tem 14:50
The first step in training an LLM is obtaining a high-quality, large-scale dataset. Commonly used sources include Common Crawl (web-scraped data), Wikipedia, books, and various open-source text collections. Data cleaning is crucial because high-noise data directly degrades model performance. For example, last year during an internship, I spent weeks cleaning and restructuring 400GB of raw text—ultimately seeing significant improvements in the model’s outputs. Tokenizer selection is also critical. Using algorithms like Byte Pair Encoding (BPE) or SentencePiece, you tokenize the text, which helps manage the model’s vocabulary size and improves efficiency. In my project, when developing a tokenizer for Turkish, we fine-tuned it to handle local language features—because if characters like "ı," "i," and "ş" aren’t processed carefully, the model might split the word "ısrar" (insistence) into "i srar." For model architecture, Transformer-based structures (e.g., decoder-only or encoder-decoder) are standard; I typically use a 6-12 layer decoder and optimize attention mechanisms using gradient accumulation—a technique I rely on to maintain performance when working with small batches.