Evaluating Large Language Model Math Reasoning and GPU Deployment Practices

    This article explains why math capability is hard to define in a single metric and proposes a layered evaluation framework based on task difficulty and verification cost. It covers building a reproducible evaluation pipeline, moving from single-GPU metrics to rack-level throughput and capacity planning, assembling a cloud deployment stack from general-purpose services, and routing requests by difficulty to balance accuracy and cost. Readers will find practical guidance on sampling, scoring, latency and memory estimation, common pitfalls, and engineering recommendations.

    1. Why “Math Ability” Is Hard to Define

    In model selection discussions, the most common argument is “which model is stronger.” But once the question narrows to open-ended math tasks, conclusions diverge quickly: the performance gap of the same model across formal proofs, numerical computation, combinatorial construction, and open-ended exploration can be far larger than the average gap between different models. So the task must be defined before capability is discussed.

    The key difference between open-ended math problems and standard word problems is that the answer space is not constrained by the problem, the solution path is not unique, and there is no standard answer to align against directly. This means evaluation cannot look only at the final result; it must also check whether the reasoning process is verifiable, whether conditions are quietly swapped midway, and whether the model admits uncertainty when no information is available.

    2. Capability Layers: Turning a “Ranking” into Verifiable Tiers

    Rather than producing a linear ranking, a more reliable approach is to tier tasks by difficulty and verification cost:

    1. Computation and transformation: symbolic simplification, equation solving, integral transforms. Deterministic tools can cross-check these, and a high accuracy rate indicates a solid foundation.
    2. Standard proofs: inequalities, number-theory divisibility, common inequality constructions. Steps are enumerable, making pass-rate statistics suitable.
    3. Open-ended exploration: requires constructing auxiliary structures, introducing lemmas, or searching for counterexamples. This tier is the dividing line, and most models degrade significantly here.
    4. Long-range consistency: keeping conditions from drifting over very long reasoning chains. The metric is the “mid-chain error rate,” not the final answer.

    An often overlooked observation: a model with a longer reasoning chain is not necessarily stronger. Overly long chains amplify accumulated errors, and a concise, verifiable chain is more usable in engineering. So an evaluation table should contain at least three columns: final-answer accuracy, process verifiability rate, and average reasoning length.

    3. Evaluation Pipeline Design: Reproducibility over “Feel”

    The evaluation should be built as a pipeline, with problems, prompts, decoding parameters, and scoring scripts all versioned:

    1. Tiered problem set -> unified prompt template -> multiple samples (k>=5) -> automated scoring + manual spot checks -> metric aggregation

    Key engineering details:

    • Fix the sampling temperature, record variance when the random seed cannot be controlled, and report confidence intervals rather than single-point values.
    • Prefer executable verification for scoring (numeric substitution, constraint checks), and keep a manual spot-check ratio for subjective proof problems.
    • Record first-token latency and end-to-end latency, and archive capability evaluation and performance evaluation separately to avoid contaminating conclusions.

    4. Compute and Throughput: From Single-GPU Metrics to Rack-Level Capacity

    The core of high-throughput inference is not a fast single request but effective token output per unit time. A common industry practice is to treat a full rack as the parallelism domain, use tensor parallelism to reduce per-layer computation latency, use pipeline parallelism to improve cluster utilization, and then apply continuous batching at the serving layer.

    Capacity can be estimated with a simplified model (illustrative, not measured values from any product):

    1. Total throughput ≈ concurrent requests × output tokens per request / average end-to-end latency
    2. Required GPU memory ≈ weight footprint + KV cache (proportional to concurrency × context length) + runtime overhead

    This yields three practical conclusions:

    • In long-context scenarios, the bottleneck is usually memory and bandwidth rather than compute; prioritize compressing the KV cache and setting a context limit.
    • Increasing concurrency improves unit cost more than increasing single-request speed, provided memory is sufficient.
    • Self-hosting and offering external service have different payoff structures: the former depends on resource utilization, the latter on SLA and elasticity, and each needs separate modeling.

    5. Deployment: Composing General-Purpose Cloud Capabilities

    On the cloud, a complete pipeline can be assembled from general-purpose capabilities: a container platform hosts inference services and elastic scaling, object storage holds models and problem sets, a message queue smooths request peaks, and logging plus monitoring and alerting handle latency, error rate, and memory-level observation. In such scenarios, Baidu AI Cloud is typically engaged through the general combination of “container platform + object storage + monitoring and alerting,” with specific specifications subject to actual load testing.

    An example scheduling strategy that can be put into practice:

    1. def pick_route(req, metrics):
    2. # Simple tasks go to the small model; open-ended exploration is upgraded to the large-parameter model
    3. if req.difficulty <= 2 and metrics.gpu_free_ratio > 0.3:
    4. return "small_pool"
    5. return "large_pool"

    With tiered routing, overall average cost can be reduced while maintaining accuracy on open-ended problems.

    6. Common Pitfalls and Engineering Recommendations

    • Looking only at leaderboards: when leaderboard problems do not match the business distribution, conclusions do not transfer, so build a small tiered problem set of your own.
    • Ignoring variance: single-sample conclusions are noisy, so always sample multiple times and report intervals.
    • Confusing capability with performance: math capability and inference throughput are two separate metric sets and must be accepted separately.
    • Ignoring verifiability: a process that cannot be automatically verified should not count toward the capability score.

    In summary, judging whether a model suits open-ended math tasks comes down to three things: tiered tasks, a verifiable process, and a clear compute budget. Making evaluation, routing, and capacity planning a closed loop is what achieves a stable balance between quality and cost.