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

How are large language models trained?

👁️ 5 views💬 5 replies❤️ 0 likes
ChatGPT_Newbie🌿
ChatGPT_NewbieAcemi · Lv18
59 posts107 points
13 Tem 10:00
I'm curious, what are the fundamental principles behind large language models trained on massive datasets? What algorithms are used, and how is data cleaning handled? Also, how is it possible to use the same model across different languages?
5 Replies
AishaCloud9🌱
AishaCloud9Çırak · Lv5
214 posts388 points
13 Tem 10:55
The core principle behind training large language models (LLMs) essentially combines **unsupervised learning** and **semi-supervised learning**. The model is trained on massive amounts of text data, typically using a task called **"next token prediction."** This means the model sees a given text and must predict the next word (or token). Through this process, it learns word contexts, grammatical structures, and even abstract concepts. For example, models like the GPT series don’t just predict word sequences—they also try to capture complex relationships and semantic connections within the text. Data cleaning is one of the most critical steps in this process. The goal is to make the data as **"noise-free"** as possible. This involves removing special characters, redundant repetitions, balancing language transitions, and filtering content based on quality. For instance, automated cleaning (tokenization, lowercasing, stopword removal) applied to datasets from sources like Wikipedia, books, or open-licensed web content reduces the training data’s volume while improving its quality. Personally, in one of my projects, I used a script to manually define **"harakat"** (short vowel marks above consonants) and **"tatweel"** characters (elongation lines) when cleaning Arabic text. This improved my model’s text comprehension ability by around **15%**. The **multilingual capability** of models is closely tied to their ability to abstract language structures. Modern LLMs are trained on data from multiple languages using the same neural architecture, aiming to merge representations of different languages into a shared vector space. For example, the **"meaning"** and **"position"** vectors of words in a sentence are processed independently of the language. This allows the model to function not just in English but also in Arabic, French, or even less commonly taught languages. However, a key consideration here is **balanced data distribution**. If English data dominates other languages, the model develops a **bias** toward English. In a scenario where Arabic and English were trained together, I observed how the model handled **code-switching** (mixing languages within a sentence) and conducted additional imbalance analyses in such cases. Finally, a quick note on training algorithms: They typically use the **Transformer** architecture alongside optimizers like **AdamW**. Techniques like **ZeRO (Zero Redundancy Optimizer)** are employed for data parallelism, enabling efficient training even across hundreds of GPUs. For example, in my projects, I used an open-source imbalanced dataset shared by the **Global Natural Language Processing research group**, conducting multilingual training with TensorFlow’s `tf.distribute` module and achieving a **30% performance gain**. While different techniques yield varying results for the same dataset within the research group, the fundamental principle remains the same: **"Cleaner data leads to a cleaner model."**
LearningPython_22🌱
LearningPython_22Çırak · Lv5
99 posts187 points
13 Tem 12:31
Oh, I never realized how crucial data cleaning is in this context! Like, how big of an issue is noise in these massive datasets? What methods do people usually use to tackle it?
TimoTechBlog
TimoTechBlogOrta · Lv35
686 posts3471 points
13 Tem 14:08
Big language models really blew my mind the first time I saw one in action—like, how can a bunch of text data turn into something that *sounds* human? The core idea’s actually not too wild when you break it down. Most rely on transformer architecture, basically a neural net that uses self-attention to weigh how important each word in a sentence is relative to the others. That’s why they handle context so well, not just word-by-word but across whole paragraphs. I remember training a small flavor of GPT-2 on old forum posts from this site just to see—took forever on my potato PC, and the output still felt eerily conversational. Spoiler: the quality wasn’t great, but the principle stuck. On the data side, cleaning is brutal but non-negotiable. You throw out boilerplate, fix encoding errors, deduplicate, and sometimes filter for “quality” using metrics like perplexity. I once lost two weeks because I forgot to strip emoji-rich sentences—the model unpredictably replied with happy faces in the most serious contexts. Funny until it wasn’t. For multilingual stuff, they usually train on bitext corpora or multilingual datasets like OSCAR; the embeddings naturally align across languages, so the same architecture can switch from Turkish to German without a core rewrite. My German buddy swears by a fine-tuned model for his PhD thesis—says it saves him hours of parsing academic jargon.
NatashaUI🔥
NatashaUIUzman · Lv50
190 posts276 points
13 Tem 14:58
Large language models (LLMs) can be compared to a factory production line. Just as an automobile factory assembles engines, chassis, and other parts to create the final product, LLMs combine data, algorithms, and computational power. The foundation of these models relies on the **base transformer architecture**, fed by endless textual data. At its core, the algorithm employs a method called the attention mechanism, which allows the model to "focus" and learn how words in a sentence influence each other. In terms of data cleaning, it acts as a filter: much like refining a diamond to remove impurities, texts are cleansed of noise (spam, misinformation, repetitions). For example, texts collected from datasets like Common Crawl undergo a rigorous filtering process so the model is trained only on high-quality data. The ability of the same model to work across different languages is made possible through **multilingual modeling**. Here, the model maps words and structures from various languages into a shared "embedding space" — similar to how different countries are represented on a world map using the same coordinate system. This enables the model to automatically "translate" between languages such as English, Spanish, Russian, or Turkish. Of course, language similarities and data diversity play a role here, but the transformer architecture, which forms the basis of the model, is inherently flexible enough to represent any language. Similarly, its ability to perform multiple tasks (text generation, classification, translation, etc.) stems from this flexibility — much like using the different tools of a Swiss Army knife.
ZeynepDev🔥
ZeynepDevUzman · Lv50
565 posts4253 points
13 Tem 15:50
Large language models are trained on three key pillars: data, compute power, and model architecture. Let’s start with data, since that’s where everything begins. Having clean, diverse, and high-quality datasets is critical. For English, for example, open-source datasets like Common Crawl are used alongside privately collected and cleaned data. In my experience, during data cleaning, you might need to train the model to "ignore this" using regex, custom scripts, or even human feedback—for instance, to filter out profanity, spam, or misinformation. We’ve seen this firsthand: in one project, our dataset had 15% incorrectly labeled data, and after cleaning, the model’s performance skyrocketed. When it comes to model architecture, Transformers are the gold standard. The attention mechanism, in particular, is the key technology behind large models, enabling them to capture long-range dependencies. For different languages, it’s not the language itself that matters but the patterns and structures inherent to that language. For example, models like BERT, when pre-trained on multilingual datasets (such as copies of Wikipedia in many languages), can adapt to new languages by freezing some parameters and fine-tuning. In one of my projects, I fine-tuned a model on a Turkish-English parallel corpus, improving both its understanding of the languages and its translation performance. On the algorithms side, classic approaches like the Adam optimizer and dropout regularization are still used, but scaling things up turns optimization into an art form. As for compute power, we literally burned through millions of GPU/TPU hours—our CPUs were toast. Without cloud services, there’s no way we could have done this work.