Best Practices for LLM Post-Training: In-Depth Q&A Analysis

    Pre-trained large language models (LLMs) offer general capabilities, but post-training is essential to make them viable for specific business scenarios. Based on a series of technical live sessions, this article compiles and analyzes the most representative developer questions regarding post-training best practices. Covering data preparation, compute strategy, training stability, and evaluation, it provides practical engineering insights for teams currently engaged in or planning LLM post-training.

    1. Background: Why Post-Training Matters

    Pre-trained large language models possess general capabilities, but to make them truly usable in vertical business scenarios, they typically require a post-training phase. This includes Supervised Fine-Tuning (SFT), preference alignment (e.g., Reinforcement Learning from Human Feedback, or RLHF), and domain knowledge injection. Recently, a technical live session for developers focused on “Post-Training Best Practices.” The audience actively raised questions, primarily focusing on four areas: data, compute, training stability, and effect evaluation. This article selects the most representative Q&As, expanding and interpreting them with general engineering experience to serve as a reference for teams currently conducting or planning post-training work.

    2. Key Q&A Analysis

    Q1: How much domain data should be prepared, and which is more important: quality or quantity?

    This was the most frequently asked question. In practice, data quality almost always takes precedence over quantity. The recommended process for building a dataset is as follows:

    1. Seed Data Cold Start: A few thousand to tens of thousands of high-quality samples are sufficient to complete a baseline fine-tuning version. The focus should be on standard formatting, clear instructions, and accurate answers.
    2. Quality Filtering: Use dual approaches for cleaning: rule-based filtering (length, repetition rate, garbled text) combined with model scoring (e.g., using a stronger model to score sample quality).
    3. Difficulty and Diversity Ratio: Ensure the data covers different task types and difficulty levels to prevent the model from “specializing” too narrowly.

    A practical reference ratio: When mixing general instruction data with domain data for training, adjust the domain data proportion between 30% and 70%, determining the exact ratio through ablation experiments. Training purely on domain data easily leads to the degradation of general capabilities, known as “catastrophic forgetting.”

    Q2: Full Fine-Tuning or Parameter-Efficient Fine-Tuning (PEFT)? How to choose?

    The two are not mutually exclusive but represent a trade-off between resources and performance:

    • Full Fine-Tuning: Offers a higher performance ceiling, suitable for scenarios with sufficient data (usually tens of thousands of samples or more) and ample compute. However, it requires high VRAM and demands careful learning rate control to prevent overfitting.
    • LoRA-based Methods: Only trains low-rank incremental matrices, reducing VRAM usage to a fraction of full fine-tuning. It is suitable for scenarios with small data volumes that require rapid iteration. The commonly used rank value is between 8 and 64, and the target modules should ideally cover the Attention Q/K/V/O and MLP layers.

    Practical recommendation: Use LoRA first to quickly validate data quality and task feasibility. Once the data is proven effective, invest in full fine-tuning to pursue the performance ceiling. This ensures the most expensive trial-and-error costs are spent effectively.

    Q3: How to choose parallelism strategies for multi-GPU training?

    Common parallelism methods in large model post-training include Data Parallelism (DP), Tensor Parallelism (TP), Pipeline Parallelism (PP), and Sequence Parallelism. The selection logic can be summarized as:

    1. Model fits on a single GPU: Prioritize pure Data Parallelism, combined with gradient accumulation to increase the effective batch size.
    2. Does not fit on a single GPU but fits in a single node: Use DP + TP. The TP degree generally does not exceed the number of GPUs in a single machine (e.g., 2/4/8), because TP communication is frequent, and cross-node communication will become a bottleneck.
    3. Extremely large model requiring cross-node setup: Introduce PP. Pay attention to matching pipeline stage division with the number of micro-batches to avoid large pipeline bubbles.

    Additionally, activation recomputation (gradient checkpointing) and CPU Offload are common methods to reduce VRAM pressure. The former trades about 20%–30% compute overhead for significant VRAM savings and is usually worth enabling.

    Q4: How to troubleshoot when training loss stagnates or oscillates?

    For training stability issues, troubleshoot in the following order:

    1. Data side: Check for dirty data, excessively long samples, or duplicate samples. Overly long samples might trigger truncation, leading to label anomalies.
    2. Hyperparameter side: An excessively high learning rate is the most common cause of oscillation. The learning rate in the SFT phase is generally around 1/10th of that in pre-training, paired with a warmup (the first 3%–10% of steps).
    3. Precision side: Under mixed-precision training, monitor if the loss scale drops frequently. If necessary, switch to bf16 or lower the learning rate.
    4. Uniformity side: During multi-GPU training, check whether the load on each GPU is balanced and whether data sharding is sufficiently randomized.

    It is recommended to log the loss curve, gradient norm, and learning rate curve for every training run. Comparing these three can quickly pinpoint the source of anomalies.

    Q5: What to do if the model becomes “dumber” or loses general capabilities after fine-tuning?

    This is a typical alignment tax / forgetting issue. You can try the following:

    • Mixed Replay Data: Mix a certain proportion of general instruction data into the training set, which usually significantly mitigates the issue.
    • Reduce Training Intensity: Decrease the number of epochs (in many scenarios, 1–2 epochs are sufficient) and lower the learning rate.
    • Modular Increment: Use LoRA and mount or merge it as needed during inference, preserving the base model’s original capabilities.
    • Early Evaluation: Periodically run general capability benchmarks during training. If a degradation trend is detected, stop promptly.

    Q6: How to evaluate the trained model? Don’t just look at a single score

    It is recommended to build a three-tier evaluation system:

    1. Automated Benchmarks: Cover both domain task metrics and general capability benchmarks to prevent a “whack-a-mole” effect where fixing one capability breaks another.
    2. LLM-as-a-Judge: Use a strong model to score generated results across multiple dimensions (correctness, completeness, format adherence). This is suitable for open-ended tasks without standard answers. Be sure to design rubrics carefully and apply de-biasing measures (e.g., swapping positions to eliminate position bias).
    3. Human Spot-Checking: Sample and manually review real online requests. This is the ultimate authoritative standard.

    At the same time, beware of “training set leakage evaluation”—if the evaluation data originates from the same source as the training data, scores will be artificially high. Ensure the evaluation set is strictly isolated.

    Q7: What optimization techniques exist for deployment after training?

    Common optimization combinations for deploying post-trained models include:

    • Quantization: Weight quantization (e.g., INT8/INT4) can drastically reduce VRAM and bandwidth requirements. It requires calibration data to control precision loss. Be sure to conduct precision regression tests before going live.
    • Inference Acceleration: Use mature inference frameworks to gain capabilities like operator fusion, continuous batching, and KV Cache management. Throughput can typically be increased several-fold.
    • Serving: Combine load balancing, multi-instance elastic scaling, and a monitoring/alerting system to ensure online stability.

    It is worth noting that quantization and fine-tuning can have interactive effects—the weight distribution after fine-tuning differs from the base model. Quantization schemes need to be recalibrated and validated; you cannot directly reuse the base model’s quantization configuration.

    Q8: What is the recommended tech stack for building a post-training pipeline from scratch?

    A typical minimum viable pipeline includes:

    • Data Layer: Data storage (e.g., object storage) + data cleaning scripts + quality assessment tools.
    • Training Layer: A training framework supporting distributed fine-tuning + task scheduling and checkpoint resumption.
    • Evaluation Layer: Automated evaluation scripts + result visualization dashboards.
    • Deployment Layer: Inference service + canary release + online monitoring.

    If building on the cloud, teams can directly use container platforms to host training tasks, use object storage to manage datasets and model artifacts, and use logging and monitoring services to observe the training process, avoiding reinventing the wheel on infrastructure.

    3. Conclusion

    Post-training is a deeply coupled endeavor involving data, algorithms, and engineering. From the Q&A in these live sessions, a few core principles can be extracted: data quality precedes quantity, small iterative steps outweigh one-shot perfection, and the evaluation system must cover both general and domain-specific capabilities. It is recommended that teams promote a closed-loop process of “small-scale validation — data iteration — full-scale training — quantized deployment — online monitoring,” establishing quantifiable acceptance criteria at each step. As toolchains and infrastructure mature, the barrier to entry for post-training continues to lower. What truly makes a difference is the depth of understanding of business data and the mastery of engineering details.