Evaluating LLM Reasoning Ability: A Practical Approach with Combinatorics and Geometry Problems
A strong score on knowledge Q&A or text rewriting does not prove that a large language model can reason reliably across multiple steps. This article explains how to build a dedicated evaluation for reasoning ability: how to select verifiable, multi-step problems with typical traps; how to derive a standard answer using a worked volume-and-water-level example; how to identify and classify common errors such as the false "fully submerged" assumption; and how to build a reproducible evaluation pipeline with fixed output formats, repeated sampling, automated answer extraction, and accuracy statistics. It also covers how to interpret results across stability, error types, problem categories, and cost dimensions. Sample Python code is included for reference-answer generation and automated scoring.
1. Why Reasoning Ability Needs Dedicated Evaluation
When a large model performs consistently on knowledge Q&A or text rewriting tasks, that alone does not demonstrate reliable multi-step reasoning. Combinatorial counting, geometric volume, and permutation-enumeration problems require the model to maintain intermediate state, enumerate cases, and substitute values step by step. A single missed case or unit error at any step leads to a wrong final answer.
A reasoning evaluation therefore needs three things designed together: the problem types, an automated way to verify answers, and the number of samples per problem. Judging from a single response is unreliable, because the same model can produce different results for identical inputs.
2. Criteria for Selecting Problems
The quality of the problem set determines the value of the evaluation conclusions. Consider the following dimensions when selecting problems.
- Unique and verifiable answers: Each problem should have a definite numerical answer that can be compared programmatically, avoiding subjective human judgment.
- Multi-step constraints: Problems should ideally contain two or three interrelated conditions—for example, first computing a volume change and then determining the liquid level. This distinguishes genuine derivation from educated guesses about magnitude.
- Typical traps: Problems should include common points of misunderstanding, such as judging “whether an object is fully submerged.” Traps expose differences in the model’s key assumptions.
- Broad coverage: A single problem type is easy to over-optimize against. The evaluation set should include counting, geometry, algebra, unit conversion, and other types.
- Private management: Publicly circulating problems may already be in training data, inflating results. The evaluation set should be built in-house and updated regularly.
3. A Worked Volume Problem as the Reference Derivation
The following typical problem illustrates how to establish a standard answer and identify common errors.
Problem statement: A cube-shaped iron block with 30 cm edges has a small 10 cm cube removed from each of its 8 corners. It is then placed into a container with a base area of 2500 cm² that initially contains water 20 cm deep. Find the resulting water level.
Step 1: Compute the actual volume of the iron block.
- Original cube volume: 30³ = 27,000 cm³
- Volume of each removed corner cube: 10³ = 1,000 cm³; 8 corners total 8,000 cm³
- Remaining iron volume: 27,000 − 8,000 = 19,000 cm³
Step 2: Compute the initial water volume in the container.
- Initial water volume: 2500 × 20 = 50,000 cm³
Step 3: Determine the submerged part of the block.
The block is 30 cm tall, so whether the water level ends up below or above 30 cm must be checked separately. If the level is below 30 cm, the top of the block stays above the surface, and the submerged volume depends only on the cross-section below the waterline. After the corners are removed, the block’s horizontal cross-section is 900 − 4×100 = 500 cm² in the height intervals 0–10 cm and 20–30 cm, and the full 900 cm² in the interval 10–20 cm.
Let the water level be h (20 ≤ h ≤ 30). The submerged volume is:
V = 5000 + 9000 + 500 × (h − 20) = 4000 + 500h
Step 4: Set up the equation and solve.
The total volume of water plus submerged iron equals the base area times the water level:
50000 + 4000 + 500h = 2500h
Solving gives h = 27 cm, matching the standard answer.
Common error. Many solutions assume the block is fully submerged and compute directly from the remaining volume: (50,000 + 19,000) ÷ 2500 = 27.6 cm. This ignores the fact that the top of the block protrudes above the surface—a classic assumption error. Such errors should be classified separately in the evaluation, because they reflect the model’s judgment of physical conditions rather than its arithmetic.
The following code verifies the result via numerical integration and can serve as a reference-answer generator in an evaluation script:
def footprint(z, side=30, cut=10):"""Return the horizontal cross-section area (cm^2) of the block at height z."""corner = cut * cutif z < cut or z >= side - cut:return side * side - 4 * cornerreturn side * sidedef submerged_volume(h, side=30, dz=0.01):"""Compute the submerged volume of the block when the water level is h."""volume, z = 0.0, 0.0while z < min(h, side):volume += footprint(z + dz / 2) * dzz += dzreturn volumedef water_level(base_area=2500, water_height=20, iron_side=30, lo=0.0, hi=30.0):"""Use binary search to find the water level after the block is placed."""water_volume = base_area * water_heightfor _ in range(60):mid = (lo + hi) / 2if base_area * mid >= water_volume + submerged_volume(mid, iron_side):hi = midelse:lo = midreturn round(hi, 2)print(water_level()) # Outputs 27.0
4. Building a Reproducible Evaluation Pipeline
A stable evaluation pipeline should include the following components.
1. Fix the input format. Require the model to state its result at the end of the response in a uniform format, such as “Final answer:
2. Repeat sampling. Each problem should be asked multiple times, with the number of correct responses tallied. A single correct answer does not imply stability; repeated sampling reflects output consistency. The number of samples depends on budget, but each problem should have at least five trials.
3. Record settings separately. If the model offers a toggle for showing the reasoning process, results from both settings should be counted separately and never mixed. The same applies to different temperature parameters and system prompts.
4. Log latency and output length. Response time and output token count are important engineering metrics, but they should be reported separately from accuracy, so that speed is not mistaken for capability.
5. Automated verification. The following script implements the full flow of extracting the answer from a response, comparing it against the expected value, and computing accuracy:
import reANSWER_PATTERN = re.compile(r"Final answer[::]\s*(-?\d+(?:\.\d+)?)")def extract_answer(text):"""Parse the final answer from the model's response; return None on failure."""match = ANSWER_PATTERN.search(text)return float(match.group(1)) if match else Nonedef run_trials(ask, question, expected, trials=5, tolerance=0.01):"""ask: a function that calls the model and returns text; implement itaccording to the service you integrate with.Returns the accuracy for this problem. Responses that fail to parseare counted as incorrect."""hits = 0for _ in range(trials):pred = extract_answer(ask(question))if pred is not None and abs(pred - expected) <= tolerance:hits += 1return hits / trials
Usage:
accuracy = run_trials(ask, question_text, expected=27.0, trials=5)print(f"Accuracy: {accuracy:.0%}")
5. Dimensions for Interpreting Results
Once you have the raw data, analyze it from the following angles rather than looking only at the total score.
- Stability: Five correct answers out of five versus one out of five represent very different capability levels. For scenarios that require reliable output, stability often matters more than peak performance.
- Error types: Classify wrong responses as misreading the problem, missing cases, unit confusion, arithmetic mistakes, or assumption errors. The classification pinpoints the model’s specific weaknesses, informing prompt improvements or model selection.
- Differences across problem types: Counting problems and geometry problems usually fail in different ways. Per-type statistics prevent the total score from masking localized weaknesses.
- Cost and latency: In long-chain reasoning, latency can grow significantly, so accuracy gains from a given setting should be weighed against their cost.
