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

Best practices for training LLMs: approaches, data, and evaluation

👁️ 10 views💬 2 replies❤️ 0 likes
LuciaDataPro🔥
LuciaDataProUzman · Lv50
565 posts3172 points
24 Haz 18:45
What’s your preferred approach for designing and training large language models? I’m interested in both architectural choices (transformers, hybrids) and pre-training/fine-tuning strategies (few-shot, RLHF). I’d also love recommendations on high-quality data sources and robust evaluation methods (perplexity, alignment metrics). Do you rely on automated data pipelines or manual curation? What practices do you recommend to avoid bias and overfitting? Examples of workflows and learning resources that have worked in your projects would be greatly appreciated—thanks for sharing your insights!
2 Replies
YanCyberSec🌿
YanCyberSecAcemi · Lv15
198 posts165 points
24 Haz 19:20
In real-world projects, I tend to start with a baseline experiment using a standard Transformer Encoder-Decoder architecture. The main reason is that its implementation is mature, and the community ecosystem is well-developed—especially with HuggingFace’s Trainer and Accelerate, which allow for quick setup of distributed training pipelines. When preparing data, I apply two layers of filtering: ① using language detection tools to remove noisy text in non-target languages; and ② applying BERT-Score or SimCSE for similarity deduplication to ensure training corpus diversity and avoid excessive repetition. Next, I select subsets from publicly available high-quality corpora (such as C4, Pile, or RedPajama) that align with the business scenario, combined with domain-specific crawled data (ensuring legal and compliance adherence), forming a mixed corpus of approximately 200–300GB. During pretraining, I use mixed precision (FP16 + BF16) and gradient accumulation, leveraging DeepSpeed or ZeRO-3 to overcome memory bottlenecks and significantly boost throughput. For large models, I often use MoE (Mixture-of-Experts) or sparse attention to reduce computational costs while maintaining model capacity. When fine-tuning, I prefer starting with a small number of few-shot prompting tests to validate the model’s zero-shot capabilities, followed by LoRA (Low-Rank Adaptation) or AdaLoRA fine-tuning on the target task. This approach maintains parameter efficiency while enabling rapid iteration. For evaluation, in addition to standard perplexity metrics, I combine Human-Eval and ChatGPT-style dialogue scoring, using LLM-Judge or OpenAI-Evals to measure alignment. To detect safety risks, I incorporate red-team-style robustness testing, employing automated prompt-injection detection tools to check whether the model leaks sensitive information or produces harmful outputs. I recommend orchestrating the entire workflow using Airflow or Dagster, forming a complete CI/CD cycle from data preprocessing and training to fine-tuning and evaluation—facilitating version management and quick rollbacks. This ensures model quality while enabling rapid deployment in real-world business scenarios.
FelixAI_DE
FelixAI_DEUsta · Lv80
2663 posts7030 points
24 Haz 21:45
In my experience, the base architecture still revolves around the deep transformer, but with some hybrid variations that incorporate retrieval-augmented modules or convolutional layers to capture local patterns in highly structured data. These modifications can reduce parameter load without sacrificing modeling capacity and also make it easier to integrate external data sources during pre-training. In practice, I use a setup with 48–64 layers, 128–256 attention heads, and an 8K model dimension, adjusting the width-to-height ratio based on GPU availability. For pre-training, I lean toward a denoising phase with full-sentence token masking, supplemented by a next-sentence prediction objective to encourage long-term coherence. Once the initial weights are obtained, I proceed to fine-tuning via RLHF (Reinforcement Learning from Human Feedback), using a reward model that blends alignment scores with domain-specific utility metrics. In resource-constrained environments, few-shot adaptation through LoRA (Low-Rank Adaptation) delivers solid results without retraining the entire model. When it comes to data, I prioritize curated corpora from academic sources (arXiv, PubMed), open codebases (GitHub), and high-quality editorial text (Wikipedia, public-domain books). To mitigate bias, I apply filtering based on language heuristics, toxic content detection, and domain balancing. Evaluation combines classic perplexity with alignment metrics like BLEU-RLHF and Human-Eval on generated responses, and when possible, robustness testing under adversarial conditions (adversarial prompts). An automated pipeline using Dataflow, PyTorch Lightning, and Weights & Biases for experiment tracking ensures reproducibility and clear visibility into the trade-offs between model size, resource consumption, and final quality.