How to Evaluate LLM Mathematical Reasoning and Generalization
Evaluating large language models on math is more than checking a final answer. This article uses a well-specified goat-grazing (disk intersection) problem to show how to score understanding, modeling, derivation, computation, and generalization, how to invert for rope length with a dimensionless equation and bisection, and how to build reproducible tests with variants, hints, and closed-loop scoring.
Do not judge an LLM by one final answer
When people evaluate mathematical ability in large language models, a single hard problem can be misleading. A polished formula, a long derivation, or a precise number may look like strong reasoning. The model may have recalled a similar solution, or it may have reached a nearby number from a wrong model. A wrong answer is not proof of no ability either: ambiguous wording, output-length limits, and numerical error all affect results.
A more useful evaluation splits the task into layers:
- Understanding: Does the model identify objects, conditions, and the goal?
- Modeling: Does it turn natural-language constraints into the right mathematical relations?
- Derivation: Can it carry out geometry, algebraic manipulation, and boundary cases in sequence?
- Computation: Can it solve equations reliably and check numerical error?
- Generalization: If conditions or parameters change, does it re-analyze instead of reusing an old answer?
- Reliable communication: Does it state assumptions, the domain of validity, and what is unknown?
Goat-grazing problems are useful because everyday wording often triggers a familiar sector-area formula, while a small change in geometry can turn the task into circle intersection and a nonlinear equation. Difficulty still depends on the actual conditions. Do not rank models or report pass rates without a shared test record.
Define an unambiguous test problem
The following idealized problem is only for illustrating a method. It is not a recap of any specific model run.
A circular pasture has radius (R). A goat is tethered at a point on the circumference with rope length (L). The goat may move inside and outside the pasture, but only grass inside the pasture counts. Ignore rope thickness, terrain, and obstacles. The reachable set is all points whose planar distance to the tether is at most (L).
Questions: How much grass can the goat eat? If it should eat exactly half the pasture, what condition must (L) satisfy?
Assumptions matter. Walls, wrapping around a post, or sliding along a boundary change the reachable set. Those are different problems.
Under the assumptions above:
- The pasture is a disk of radius (R).
- The goat’s range is a disk of radius (L).
- The distance between centers is (R).
- The edible region is the intersection of the two disks.
If a model writes a semicircle area without checking how the disks intersect, later algebra does not salvage the solution.
Why changing a parameter raises the reasoning load
Many textbook geometry problems reduce to “sector minus triangle,” but only when the angle is known or follows from simple geometry.
Here (L) is a variable. Intersection points, central angles, and overlap area all change with (L). A single fixed angle cannot be reused for every case.
When (L) is much smaller than (R), the pasture boundary near the tether looks locally like a straight line, so the edible area is close to half the activity disk. That is a local approximation, not an exact result. As (L) grows, curvature matters and the half-disk shortcut fails. Asking for a prescribed fraction of area requires inverting the area formula, typically with inverse trigonometric functions and a numerical root finder.
The point is not complexity for its own sake. It tests whether the model sees that changing a parameter can change the formula, the geometric regime, and the solution path, not only the number.
Derivation: from disk intersection to an area formula
Geometric regimes
At least three ranges should be distinguished:
- If (L=0), edible area is zero.
- If (0<L<2R), the circles meet at two points and the edible region is a lens.
- If (L\geq 2R), the activity disk covers the whole pasture, so the area is (\pi R^2).
(2R) is the distance from the tether to the farthest point of the pasture. Extending a local formula past this saturation point is an error.
Central angles
Let (O) be the pasture center, (P) the tether, and (Q) an intersection point:
[
OP=R,\qquad OQ=R,\qquad PQ=L.
]
Let (\alpha) be the half-central angle at (O) for the common chord, and (\beta) the half-central angle at (P). By the law of cosines:
[
\alpha=\arccos\left(1-\frac{L^2}{2R^2}\right),
]
[
\beta=\arccos\left(\frac{L}{2R}\right).
]
Angles must be in radians; otherwise sector areas are wrong.
Intersection area
For (0<L<2R), combining sectors and triangles gives
[
A(L)=
R^2\arccos\left(1-\frac{L^2}{2R^2}\right)
+
L^2\arccos\left(\frac{L}{2R}\right)
-
\frac{L}{2}\sqrt{4R^2-L^2}.
]
Scoring should check more than whether this expression appears:
- whether both inverse cosines are justified;
- how full sector angles relate to the half-angles;
- whether a triangle area is subtracted twice;
- which interval the formula covers;
- whether full coverage is handled separately.
That separates “recalled circle-intersection formula” from “understood this geometry.”
Inverting for rope length: dimensionless form is clearer
Half the pasture means
[
A(L)=\frac{\pi R^2}{2}.
]
Set (x=L/R). Then, for (0<x<2),
[
\arccos\left(1-\frac{x^2}{2}\right)
+
x^2\arccos\left(\frac{x}{2}\right)
-
\frac{x}{2}\sqrt{4-x^2}
=
\frac{\pi}{2}.
]
Two benefits: the answer depends only on the ratio (L/R) (scale-invariant), and the search interval is fixed at ([0,2]), independent of units.
A simple closed form is not required. A correct implicit equation plus a reliable numerical method is a sound approach.
Why bisection works
As rope length grows, edible area does not decrease. On (0<L<2R) it is strictly increasing:
[
A’(L)=2L\arccos\left(\frac{L}{2R}\right)>0.
]
Any target area between 0 and the full pasture corresponds to a unique rope length. Bisection needs no delicate initial guess and no derivative. Sketch:
Input: target coverage ratio q, relative error threshold epsilonRequire: 0 < q < 1left = 0right = 2target = q * πRepeat until error or iteration limit:x = (left + right) / 2area = normalized_overlap_area(x)if abs(area - target) / π <= epsilon:return xif area < target:left = xelse:right = xReturn the final interval and whether the error requirement was met
normalized_overlap_area is the intersection area divided by (R^2). Coverage-ratio error, area error, and rope-length error are different quantities and must not be mixed.
Reasoning versus template matching
A single item is easily contaminated by memorized similar problems. Safer tests use a family of variants on the same structure.
Change the target fraction
Replace “half” by any (q) with (0<q<1). A reliable model should solve (A(L)=q\pi R^2), not emit a rope length for a fixed fraction.
Move the tether
If the tether is not on the circumference, the distance between centers is no longer (R). The special formula cannot be reused. The model must reclassify the disks (disjoint, intersecting, or one containing the other).
Add or remove obstacles
Walls, wrapping, or sliding change distance versus reachability. A good response may first say that information is missing and ask about obstacle shape and whether the rope can contact and wrap. Clarifying an incomplete problem is more reliable than a confident guess.
Change wording and units
Keep the math, vary order of presentation, units, and what is asked (area, ratio, or rope length for a given ratio). The model should match the ask, not a fixed answer format.
Failing a familiar type does not by itself prove overfitting; succeeding on new wording does not prove the training data had no similar item. Stronger claims need variant sets and repeats.
A reproducible evaluation protocol
Three layers help:
Layer 1 — unprompted. Give the full problem only. Score independent modeling, derivation, and checking.
Layer 2 — graded hints. For example: consider disk intersection; discuss ranges of (L); introduce a dimensionless variable. Record at which hint the model succeeds. Hinted and unhinted success are not equivalent evidence.
Layer 3 — with a calculator. Score modeling and execution separately. A correct final number does not excuse a wrong formula or missing verification.
Log model version, full prompt, output limits, sampling settings, hints, and number of repeats. Report unprompted, hinted, and tool-assisted results separately.
Scoring and verification as a closed loop
Score multiple dimensions, not only the final number:
- condition identification (range vs. pasture);
- geometric model (disk intersection);
- derivation (angles, area terms, domain);
- boundaries ((L=0) and full coverage);
- numerics (method and stated error);
- consistency (area upper bound, monotonicity, dimensions);
- adaptation to variants.
Verification can combine analytic derivation, numerical integration, and Monte Carlo sampling. Cross-checks beat rereading the same proof. Approximations have their own error; a finite-sample area estimate is not absolute truth.
Keep failure types as well as scores: misread conditions, wrong formula, numerical failure, or missed boundaries. That information is more useful for model choice and system design.
From math tests to engineering use
The goal is not to prove a model can solve everything. It is to find reliability boundaries.
In a real system, the model can interpret requirements, state assumptions, and propose a solution path; deterministic code can do the numerics; checks can enforce ranges, units, and constraints. That split reduces fluent but wrong conclusions. For costing, configuration, and allocation with hard constraints, add input validation, exception handling, and human review where needed.
A scientific evaluation should ask: why was the answer right, does it still hold after a parameter change, can the number be verified independently, and does the model surface uncertainty when it fails? Only then does an impressive single reply become a trustworthy view of mathematical reasoning and engineering usefulness.
