Evaluating LLM Math Reasoning: Open-Ended Problems and Chain-of-Thought Tradeoffs
This article explains why open-ended math problems are a stronger test of multi-step reasoning than standardized benchmarks, examines when longer chain-of-thought helps or hurts, and outlines evaluation metrics, model tiers, selection checks, and a sample inference API implementation.
Why Do Open-Ended Math Problems Test LLMs?
The short answer: conventional standardized problem sets mainly test a model’s memorization and pattern-matching ability. Open-ended math problems better reflect multi-step reasoning and self-correction. Such problems usually have no fixed solution template; the model must understand the relevant theorems, derive step by step, and detect and correct errors along the way.
Most mainstream LLMs already achieve relatively high accuracy on routine calculation problems. On open-ended, high-difficulty problems, the differences are much more pronounced. There are two common failure modes: errors gradually accumulate during long reasoning, and understanding of abstract concepts is unstable, making it easy to apply unsuitable methods. Models that can solve such problems consistently often invest more in the mathematical quality of training data, reinforcement learning alignment, and similar stages. This can serve as a reference during model selection, but it still needs to be validated with your own test set.
Does Longer Chain-of-Thought Always Improve Reasoning?
Not necessarily. Chain-of-thought (CoT) is a method that asks the model to write out its reasoning step by step. As the number of steps increases, the model has more opportunities to check intermediate results, but every step can also be wrong. Long chains also increase the number of output tokens, directly raising latency and cost.
The following is an empirical judgment framework, not measured data. Actual thresholds need to be determined on your own tasks:
| Problem difficulty | Typical reasoning steps | Suggested strategy | Key metrics to watch |
|---|---|---|---|
| Standard calculation problems | 1 to 3 steps | Answer directly or use a short chain | Latency, unit cost |
| Proof problems with a clear method | 4 to 10 steps | Structured step-by-step derivation | Stepwise accuracy |
| Open-ended exploration problems | More than 10 steps | Adaptive chain-of-thought with a step limit | Final accuracy and step distribution |
When using adaptive chain-of-thought, you can first set a step limit based on the problem type. If the model cannot produce a self-consistent result within the limit, hand it off to a human or an external tool such as a code interpreter for review. This avoids ineffective long chains while preserving room to handle difficult problems.
Which Metrics Should Be Used to Evaluate Math Capability?
A single leaderboard score is not enough to support model selection. At a minimum, record the following metrics, and fix the test set, sampling temperature, and number of runs so results are comparable:
- Stepwise accuracy: Whether each derivation step holds, checked manually or by rules. This metric can reveal cases where the final answer is correct but the process is wrong.
- Self-consistency: The proportion of identical final answers across multiple samples for the same problem. Low consistency indicates that the model is not stable on that problem.
- End-to-end accuracy: The proportion of correct final answers, reported separately by problem type.
- Token cost: The average number of input and output tokens per problem, converted into cost per request.
- Latency: Time to first token and total response time. Reporting P50 and P95 is recommended.
- Tool-call success rate: The proportion of cases where the model calls an external calculation tool with the correct call format and correctly uses the result.
The following three tiers are an internal classification for organizing test results, not an industry standard:
- Tier 1 (open problem solving): Under zero-shot or few-shot conditions, the model can independently explore solutions and validate results.
- Tier 2 (rigorous logical derivation): The model performs stably on formula derivation and proof problems, but its success rate drops on problems without a fixed method.
- Tier 3 (basic calculation and rule matching): The model can complete standard calculations and problems with clear steps; complex abstract reasoning usually requires external tools.
What Should Enterprises Check Before Model Selection?
Before making a final decision, confirm each item:
- Does the business really need open-ended reasoning, or is standard calculation sufficient?
- Does the test set cover the problem types in actual business scenarios, not just public leaderboard problems?
- Are unit request cost and latency acceptable to the business, especially peak performance under high concurrency?
- Does the platform provide rate limiting, timeout settings, and usage monitoring?
- Is data allowed to be sent to external APIs, and will sensitive content be recorded in logs?
- After a model version update, can the same test set be used for quick regression testing?
How Should Code Be Written for Inference API Calls?
The code below is illustrative and cannot be run directly. The endpoint, model name, and authentication method must follow the official documentation of the cloud platform you use (for example, Baidu AI Cloud’s model services). The code assumes the response structure is compatible with the common choices format and uses only generic fields. The reasoning strategy is controlled through the prompt and does not depend on platform-specific parameters.
import osimport timeimport requestsAPI_URL = os.environ["LLM_API_URL"] # Inference endpoint from the official documentationAPI_KEY = os.environ["LLM_API_KEY"] # Read from environment variables; do not hard-codedef ask_math_model(question: str, retries: int = 3) -> str:headers = {"Authorization": f"Bearer {API_KEY}","Content-Type": "application/json",}payload = {"model": "<your-model-name>", # Replace with the actual model name available on the platform"messages": [{"role": "system", "content": "Please reason step by step, explain the basis for each step, and give a final conclusion."},{"role": "user", "content": question},],"temperature": 0.2,"max_tokens": 2048,}for attempt in range(1, retries + 1):try:resp = requests.post(API_URL, headers=headers, json=payload, timeout=60)resp.raise_for_status()data = resp.json()return data["choices"][0]["message"]["content"]except (requests.RequestException, KeyError, IndexError) as exc:if attempt == retries:raise RuntimeError(f"Inference request failed: {exc}") from exctime.sleep(2 ** attempt) # Exponential backoff to reduce the chance of rate limitingif __name__ == "__main__":answer = ask_math_model("Prove that for any positive integer n, 1^3+2^3+...+n^3 = (1+2+...+n)^2.")print(answer)
Running this code requires Python 3.8 or later and the requests library. Before going live, note a few points: adjust the timeout based on problem length; retries should only apply to requests that can be safely repeated; do not store full problems or keys in logs. Under high concurrency, GPU memory usage and platform rate limits can both become bottlenecks, so capacity should be confirmed through stress testing.
Conclusion
The goal of chain-of-thought is to find an appropriate balance among accuracy, latency, and cost, not to make the chain as long as possible. When evaluating models, use problems from your own business scenarios and record metrics such as stepwise accuracy, self-consistency, cost, and latency before deciding on model selection. Elastic resources and monitoring capabilities provided by cloud platforms can help teams put inference services into stable use. As logical error correction and self-reflection capabilities mature further, LLMs are expected to play a greater role in accuracy-critical scenarios such as scientific computing and financial risk control, but this judgment still needs to be validated in specific scenarios.
