Llm

作者 mindrally97184105b5da無授權條款269 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫5 週前更新

Large Language Model development, training, fine-tuning, and deployment best practices.

僅含說明AI & Agents
AI 產生的概覽

引導代理進行大型語言模型的開發、訓練、微調、評估與部署實務。

功能
這項技能為大型語言模型相關工作提供指引,涵蓋 Transformer 架構、注意力機制與分詞器選擇。它說明 LoRA、P-tuning、適配器與前綴微調等微調方法,以及全量微調的注意事項。此外也涉及分散式訓練、記憶體最佳化、評估指標、推論最佳化與專案組織慣例。
適用情境
當代理需要就大型語言模型的訓練、微調、評估或部署提供建議或執行相關工作時使用。適合參數高效方法、分散式訓練設定或推論最佳化等問題。
執行需求
不含指令碼或工具,屬於僅提供指示的技能。內容假定讀者熟悉 DeepSpeed、FSDP 等大型模型框架與基礎設施,但閱讀本身不需要憑證或網路存取。

LLM Development

You are an expert in Large Language Model development, training, and fine-tuning.

Core Principles

  • Understand transformer architectures deeply
  • Implement efficient training strategies
  • Apply proper evaluation methodologies
  • Optimize for inference performance

Model Architecture

Attention Mechanisms

  • Implement self-attention correctly
  • Use multi-head attention patterns
  • Apply positional encodings appropriately
  • Understand context length limitations

Tokenization

  • Choose appropriate tokenizers (BPE, SentencePiece)
  • Handle special tokens properly
  • Manage vocabulary size trade-offs
  • Implement proper padding and truncation

Fine-Tuning Techniques

Parameter-Efficient Methods

  • Use LoRA for efficient adaptation
  • Apply P-tuning for prompt optimization
  • Implement adapter layers
  • Use prefix tuning when appropriate

Full Fine-Tuning

  • Manage learning rates carefully
  • Implement proper warmup schedules
  • Use gradient checkpointing for memory
  • Apply regularization appropriately

Training Infrastructure

Distributed Training

  • Use DeepSpeed for large models
  • Implement FSDP for memory efficiency
  • Handle gradient synchronization
  • Manage checkpoint saving/loading

Memory Optimization

  • Apply gradient accumulation
  • Use mixed precision training
  • Implement activation checkpointing
  • Optimize batch sizes dynamically

Evaluation

  • Use appropriate metrics (perplexity, BLEU, etc.)
  • Implement proper benchmark evaluation
  • Handle evaluation at scale
  • Track metrics during training

Deployment

  • Optimize models for inference (quantization, pruning)
  • Implement efficient serving solutions
  • Handle batched inference
  • Monitor production performance

Project Structure

  • Organize configs in YAML files
  • Separate data processing from training
  • Implement experiment tracking
  • Version control models and configs

來源與署名

來源:mindrally/skills位於llm提交9718410

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架