Practical Reinforcement Learning for Vertical-Domain Large Language Models
This article explains why supervised fine-tuning (SFT) alone cannot turn a general large language model into a true vertical-domain model, and lays out a practical reinforcement learning (RL) path instead. It covers the capability limits of SFT, why verifiable rewards make RL more cost-effective in vertical domains, the core group-relative policy optimization method that removes the value network, a four-layer architecture that decouples training from inference, empirical results on small models, a checklist of common pitfalls, and guidance on choosing between general and vertical models in a layered deployment.
The debate between vertical-domain large models and general-purpose large models is not really a contest of parameter counts. It is a choice of capability acquisition path. Many teams assume that “industry data + supervised fine-tuning (SFT) = a vertical model,” but practice repeatedly shows otherwise. SFT mainly changes the tone, format, and terminology of the output. It makes a model sound more like someone in the industry, yet it rarely makes the model think more like someone in the industry. The reasoning ceiling is set by the world knowledge and reasoning ability acquired during pre-training. If post-training only performs imitative fitting, the model quickly exposes its weaknesses on problems that require multi-step derivation, constraint satisfaction, or tool calls.
1. Capability Boundaries: Why SFT Is Not Enough
The training signal of SFT is the token-level likelihood of a “reference answer,” which rewards surface overlap with that reference. This leads to three structural weaknesses. First, labeling cost grows exponentially with task complexity; a single high-quality multi-step reasoning label often takes an expert several minutes or more. Second, the model only sees the “correct path” and never sees why “incorrect paths” are incorrect, so it lacks contrastive signal. Third, style overfitting is common: performance on general question answering drops without any gain in reasoning ability.
Reinforcement learning changes the optimization objective. Instead of fitting one specific answer, it maximizes a verifiable reward. For domains such as math, code, and structured extraction, where answers can be judged automatically, the reward is available at almost zero cost. This makes RL far more cost-effective in vertical domains than in general ones: a “good answer” in a general domain is hard to score automatically, whereas “right or wrong” in a vertical domain can often be determined precisely by rules.
2. Method Core: Group Statistics Instead of a Value Network
The mainstream lightweight approach is a group relative policy optimization family of algorithms. The idea is to sample multiple answers to the same question, use the mean reward within the group as a baseline, reinforce answers scoring above the mean, and suppress those below it. Compared with traditional proximal policy optimization (PPO), which requires additionally training a Critic, this approach removes a value model on the same scale as the policy model. GPU memory usage typically drops by 30% to 40%, which is decisive for single-GPU or single-node multi-GPU environments.
The training loop can be abstracted into five steps:
Rollout (generate multiple answers)→ Reward (rule-based or model scoring)→ Advantage (in-group normalization to relative advantage)→ Policy Update (update Actor parameters only)→ Validation (held-out evaluation and checkpoint saving)
Only the Actor participates in parameter updates. The reference model stays frozen to constrain drift, and an inference acceleration engine handles batch generation.
3. Engineering Architecture: Decoupling Training and Inference
Production-grade implementations usually follow a four-layer structure: a data engine handles sample loading and batch organization; an inference engine handles high-throughput generation; a training engine handles backpropagation and parameter synchronization; and a distributed coordination layer handles resource orchestration and failure recovery. The key design is to hand the generation workload to a high-throughput inference runtime rather than forcing the training framework to handle autoregressive decoding. In industry practice, this decoupling often yields several-fold gains in overall throughput, because the decoding stage is memory-access intensive, which is a completely different profile from the compute-intensive training stage.
The data flow can be broken down as follows:
- Read structured data files (such as a columnar storage format), with fields containing the prompt, reference answer, and decidable label.
- Inference nodes batch-generate N candidate answers, where N is generally 4 to 8.
- The reward module scores them, with rule validation first and model review added when necessary.
- Training nodes update parameters using the framework’s built-in distributed data parallelism and sharded optimizer.
- Evaluate on the held-out set and save checkpoints, monitoring the reward curve and answer-length drift.
An illustrative configuration snippet:
data:train_batch_size: 256max_prompt_length: 512rollout:n: 8 # Answers sampled per question; determines in-group baseline qualitytemperature: 1.0 # Low temperature weakens exploration and can make all advantages 0train:lr: 1.0e-6kl_coef: 0.001 # Constrains drift from the reference modelreward:type: rule # Exact answer match / unit test pass rate
4. Empirical Observations: The Vertical Leap of Small Models
On a public math reasoning benchmark, a model at the 1.5B scale improved accuracy from roughly 50% to nearly 80% after reinforcement learning. Training required only a single high-memory accelerator card and a few hours, at a cost one to two orders of magnitude lower than training or calling a general-purpose large model. The transferable conclusion is that when task answers are verifiable, domain terminology is closed, and output format is fixed, a small model plus reinforcement learning is enough to outperform a general-purpose large model in practical vertical scenarios, with clear advantages in latency and cost per call.
5. Pitfall Checklist
- Reward collapse: If the sampling temperature is too low or the problems are too easy, all in-group rewards are identical, advantages are zero, and there is no gradient for training. Raise the temperature or apply difficulty stratification.
- Length inflation: The model learns to game rewards with verbose reasoning, so add a length penalty or format constraints.
- Distribution shift: Too large a learning rate causes output to break down; combine KL constraints with gradient clipping.
- Reward leakage: Reference answers left in the prompt; strict data splitting and deduplication are mandatory.
- Evaluation distortion: Looking only at training reward and not the held-out set easily mistakes overfitting for capability gains.
- Resource bottleneck: When the generation stage becomes the bottleneck, increase concurrency and batch size first rather than adding training cards.
6. Selection Guidance
General-purpose large models suit open-ended, long-tail knowledge-intensive scenarios with rapidly changing requirements. Vertical small models suit scenarios where answers are decidable, call volume is high, latency is sensitive, and data compliance requirements are strict. The mature approach is not either/or but layering: a general model handles intent understanding and cold start, a vertical model takes on high-frequency deterministic tasks, and the two are routed through a unified gateway. Elastic scaling via a container platform, along with logging services and a monitoring and alerting system, closes the quality loop. In such a layered architecture, Baidu AI Cloud typically serves as the foundation for compute scheduling, model serving, and observability.
