Vertical vs. General LLMs: How Small Models Plus RL Compete

    Specialized and general-purpose large language models serve different roles. This article explains why SFT hits a reasoning ceiling, how reinforcement learning can raise accuracy on narrow, verifiable tasks, and how production RL stacks, GRPO memory savings, and cloud patterns support cost-effective vertical models.

    Vertical vs. general: division of labor, not replacement

    Debate over vertical-domain and general-purpose large language models is an engineering and economics trade-off, not a question of which replaces the other.

    General models optimize for breadth: massive corpora, mixed tasks, open-domain dialogue, and generalization. They can talk about almost anything, at the cost of high training and inference spend, and they often lack deep, reliable reasoning on specialist work.

    Vertical models optimize for depth: high accuracy, low hallucination, and strong logic inside a bounded task space. Their value is professional reliability per unit cost, not coverage.

    The right test is not “which is stronger,” but whether you need open-domain generalization, whether your data is a true industry moat, and whether your budget can support general-model inference. When the answer is “narrow and deep,” a smaller model with targeted training is often the better fit.

    Why SFT alone hits a ceiling

    A common mistake is treating a vertical model as industry data plus one supervised fine-tuning (SFT) pass.

    SFT is imitation learning. It teaches the model to sound and format like a domain expert—the “tone of voice.” Imitation shows what a correct answer looks like, not why it is right, where it is wrong, or by how much. On multi-step reasoning, logic stays locked to the pretrained base.

    That is the logic ceiling: SFT optimizes similarity to labels, not correctness of outcomes.

    Reinforcement learning: raising logic with outcome feedback

    Reinforcement learning (RL) takes another path. The model generates answers; a reward signal scores the result; the policy is updated. It optimizes the probability of getting the final answer right, so it fits tasks with clear correctness and automatic scoring—math reasoning, code generation, structured extraction.

    Even a small model, with a well-designed reward and enough training, can jump in quality on a vertical task, approaching or locally beating a general model at a fraction of the training and serving cost.

    Gains depend on data quality, task verifiability, and reward design. There is no guaranteed “doubling.” The trend that small models plus RL can win in a narrow domain has been shown repeatedly in public practice.

    What a production RL training stack must solve

    Building an LLM RL pipeline from scratch is hard. Production frameworks decouple training from inference and schedule them together. They typically address four pain points:

    • Slow inference: rollout dominates wall time; generation throughput sets training speed.
    • Tight GPU memory: several model copies in memory easily OOM.
    • Complex scheduling: mixed train/infer across multi-node, multi-GPU clusters is painful to hand-write.
    • Hard rewards: you need extensible reward hooks and verification.

    The usual pattern: a mainstream deep-learning framework for training, a high-throughput inference engine for generation, and a unified cluster scheduler. Putting both train and infer in the training framework often leaves inference slow. A dedicated inference engine plus a dedicated training engine commonly yields several times overall speedup.

    Architecture and data flow

    A typical production RL system has four layers:

    1. Data engine: load, batch, and format samples.
    2. Inference engine: high-throughput sampling of multiple candidate answers.
    3. Training engine: policy updates, often with fully sharded data parallel (FSDP) to cut per-GPU memory.
    4. Distributed coordination: schedule those roles and hide multi-node complexity.

    Simplified flow:

    Load data → generate multiple answers → score with rules or a model → update the policy → validate and save checkpoints.

    Five engineering steps:

    • Step 1: Read data (columnar formats such as Parquet for efficient batching).
    • Step 2: Inference nodes generate answers in batches (high-throughput engines help a lot).
    • Step 3: Reward scoring (rule matching or a reward model).
    • Step 4: Training nodes update parameters (training framework plus distributed parallelism).
    • Step 5: Evaluation and checkpointing to limit overfitting and training collapse.

    How GRPO saves memory

    Many RL setups keep a separate Critic (value) model for a baseline, which inflates memory.

    Group Relative Policy Optimization (GRPO) samples several answers for the same question and uses the group mean or relative ranking of rewards as the baseline, dropping the Critic. That often saves about 30–40% of memory. The five training steps:

    Rollout → Reward → Advantage → Policy update → Validation.

    A simplified GRPO-style loss (a reduced PPO-like objective, for illustration only):

    1. import torch
    2. def compute_grpo_loss(new_logprobs, old_logprobs, advantages):
    3. # Importance sampling ratio
    4. ratio = torch.exp(new_logprobs - old_logprobs)
    5. # Simplified objective: minimize negative advantage-weighted ratio
    6. return (-ratio * advantages).mean()

    Reward extraction (math example; the final answer is often after a marker):

    1. import re
    2. def extract_solution(text):
    3. # Convention: the final numeric answer follows "#### "
    4. m = re.search(r"#### (\-?[0-9\.\,]+)", text)
    5. return m.group(1).replace(",", "") if m else None

    The Actor is the only policy updated—it learns to generate better answers. The reward function sets the direction of that evolution.

    Engineering pitfalls

    • Design the reward first. Prefer automatically verifiable rule rewards on narrow tasks (correctness, unit-test pass rate). Avoid sparse rewards or easy exploits.
    • Match sample count to difficulty. Hard problems need more candidates for a useful comparison.
    • Balance memory and throughput: dedicated inference engines for speed; distributed parallelism and Critic-free methods for memory.
    • Guard against collapse: small learning rates, frequent validation, checkpoints for rollback.
    • Unify data formats: columnar storage and clear field contracts to keep the data engine and reward module loosely coupled.

    Running this on the cloud

    To reproduce the pipeline at lower cost on the cloud, combine generic capabilities: a container platform for elastic train/infer clusters, object storage for datasets and checkpoints, a message queue to decouple sampling and scoring, and logging plus monitoring for reward curves and memory watermarks. Generic services from providers such as Baidu AI Cloud (containers, object storage, monitoring and alerts) can be the substrate so teams focus on rewards and data rather than undifferentiated operations.

    Closing

    Vertical and general models split breadth and depth. When the task is narrow, deep, and automatically verifiable, small models plus reinforcement learning are a cost-effective way past the SFT logic ceiling. Decoupled train/infer architecture, GRPO-style memory savings, and careful reward engineering let teams build solid specialist capability at a controllable cost.