A Practical Guide to LLM Evaluation: Math, Chain-of-Thought, and Text Generation
This guide provides developers with a reproducible methodology for evaluating large language models across three dimensions: open-ended math problems, chain-of-thought length with constraint adherence, and blind text generation quality testing. It covers sample design principles, quantitative metrics, thresholds, and execution steps, so you can swap in your own business data and obtain comparable results.
This article is aimed at developers who need to evaluate large language models for vendor selection or to build their own evaluation pipelines. It presents a reproducible evaluation methodology covering three dimensions: open-ended math problems, chain-of-thought length and constraint adherence, and text generation quality. For each dimension, it describes sample design principles, quantitative metrics, thresholds, and execution steps. You can replace the examples with your own business data to obtain comparable results.
1. Open-Ended Math Problems: Design, Contamination Prevention, and Scoring
Open-ended math problems are problems without a fixed solution template, or whose answer is not a single number. They typically fall into three categories: determining whether a proposition holds and providing a proof or counterexample; characterizing all objects that satisfy a given condition; and designing an improved version of a known method and proving its correctness.
These problems cannot be solved by plugging into formulas. The model must organize multi-step reasoning on its own, which makes logical gaps easier to expose.
There are three sources for problem design:
- Original problems created by domain experts.
- Rewriting competition problems by changing parameters, conditions, or conclusions, so they do not appear verbatim in public problem sets.
- Abstracting real technical problems from your own business into mathematical propositions, verified manually.
Each problem should record its creation date, author, and version number.
A problem template example:
- Problem ID: OM-2026-001-v1
- Type: Determine and prove / Characterize objects / Improve and prove
- Statement: Give the conditions, using parameters instead of specific values
- Reference answer: Provided by two independent reviewers, with key derivation points
- Canaray string: A unique string used to check whether the problem has entered public corpora
Contamination prevention measures include the following:
- Keep the test set internal only; never publish it to public repositories.
- Attach a unique canary string to every problem and periodically search public corpora for it.
- Run n-gram overlap checks against public corpora (for example, n = 13 characters). Replace any problem with overlap above 5%; this threshold is a starting point and should be calibrated against your own corpus.
- Rotate one third of the problems each quarter and increment the version number.
Scoring uses a 10-point rubric:
| Item | Points | Criteria | Deduction examples |
|---|---|---|---|
| Conclusion correctness | 3 | Final conclusion matches the reference answer | Wrong conclusion scores 0; correct conclusion covering only part of the cases scores 1 |
| Premise completeness | 2 | Theorems and conditions used are explicitly stated | Undeclared premise: deduct 1; missing key premise: deduct 2 |
| Derivation coherence | 3 | Every step has justification, no skipped steps | Skipping a key step: deduct 1; circular logic scores 0 |
| Counterexample or edge-case handling | 2 | Edge cases are checked or a counterexample is given | Unhandled edge case: deduct 1; invalid counterexample scores 0 |
The total score is the sum of all four items. The passing threshold is a total score of at least 6, with a conclusion correctness score of at least 2.
Scoring example: A problem with a correct conclusion earns 3 points. The derivation is complete with no skipped steps, earning 3 points. Two of three premises are listed, earning 1 point. Edge cases are not handled, earning 1 point. Total: 8 points — a pass.
Two raters independently score 20% of the samples. When scores differ by more than 2 points, a third reviewer adjudicates. If the agreement coefficient falls below 0.7, the scoring guidelines must be recalibrated.
Scores must remain comparable across test-set rotations. Keep 10% of the old problems as anchor problems in each rotation, used to map scores from old and new versions onto the same scale. Always report the problem-set version number. For comparisons on the same problems, use paired differences with a 95% confidence interval. When running the same model multiple times on the same problem-set version, report the mean and standard deviation.
2. Chain-of-Thought Length and Constraint Adherence
Chain-of-thought length measures how much intermediate reasoning a model writes before producing its answer. Constraint adherence measures whether the model follows constraints given in the problem during reasoning, such as a step limit, a banned method, or a fixed output format. Both metrics rely on programmatically computable definitions to avoid subjective human judgment.
Metric definitions:
- Character length (C): the number of characters in the reasoning portion, excluding whitespace and the final answer.
- Step count (S): the number of valid reasoning steps after splitting by numbering or line breaks; blank lines and pure headings are not counted.
- Constraint hit rate (H): the number of satisfied constraints divided by the total number of constraints in the problem. Constraints are specified when problems are authored, for example: “do not use induction,” “no more than 8 steps,” “output the final result in JSON.”
Sampling and statistical methodology:
- Run each problem 5 times independently. Use the median of the 5 runs for C and S, and the mean for H.
- Use the same problem set, the same prompt template, and the same maximum output length.
- Samples truncated because they exceeded the maximum output length are marked incorrect, counted separately, and excluded from the C statistic.
Recommended thresholds:
| Metric | Definition | Method | Threshold |
|---|---|---|---|
| C | Reasoning character count | Median of 5 runs | Judged as redundant reasoning if it exceeds 1.5x the baseline with no accuracy improvement |
| S | Valid step count | Median of 5 runs | Evaluated together with C |
| H | Constraint hit rate | Mean of 5 runs | Below 0.9 is judged as failing constraint adherence |
| Truncation rate | Proportion of samples truncated for exceeding length limits | All samples | If above 5%, increase the output limit and retest |
3. Blind Testing for Text Generation Quality
Blind testing means reviewers compare outputs without knowing which model produced them. It reflects real-world usage better than benchmarks alone, but the process must be rigorous; otherwise the results are not trustworthy.
The blind testing workflow:
- Prepare samples. Draw from real business requests, covering the main scenarios. At least 30 samples per scenario, with at least 200 in total.
- Anonymize. Remove personal information such as names, phone numbers, and order IDs, replacing them with placeholders.
- Randomize. Generate a random mapping for each sample, labeling candidate model outputs as A, B, C. The mapping table is held by a non-reviewer and decoded only after the review is complete.
- Randomize position. Randomly swap the display positions of A and B within each sample.
- Review independently. At least 3 reviewers score independently, with no communication between them.
- Consistency checks. Insert 10% duplicate samples per batch; the same reviewer’s scores across two passes should differ by no more than 1 point. If the inter-rater intraclass correlation coefficient falls below 0.6, retrain the reviewers and rescore.
The blind testing rubric has 5 dimensions, each scored 1 to 5, for a total of 25:
- Accuracy: Facts and business information are correct, with no fabricated content.
- Completeness: All key points of the question are covered.
- Constraint compliance: Format, length, tone, and other requirements are met.
- Readability: Clear structure, natural language, no redundancy.
- Usability: Readers can use the output directly without modifications.
For pairwise comparisons, a candidate model’s win rate equals its wins divided by the number of valid comparisons, with ties counting as 0.5 wins each. With 200 samples, the win rate has an error margin of roughly ±7 percentage points at the 95% confidence level. When the win rate gap between two models is smaller than 7 percentage points, treat it as not statistically significant.
4. Rotation, Contamination Prevention, and Comparing Results
The problem-set rotation, anchor problems, and canary string checks described earlier should be performed together with updates to the blind testing samples. Every evaluation run should fix the versions involved and record the full configuration so others can reproduce it.
A recommended result report format:
| Item | Content |
|---|---|
| Model and version | Name, version number, evaluation date |
| Problem-set version | Math problem-set version number, number of anchor problems |
| Math score | Mean, standard deviation, pass rate (total score ≥ 6 and conclusion correctness ≥ 2) |
| Chain-of-thought metrics | C, S, H, truncation rate |
| Text blind test | Win rate, 95% confidence interval, inter-rater agreement coefficient |
Only compare results gathered under the same problem-set version, the same prompt template, and the same sampling parameters. For cross-version comparisons, first convert scores using anchor problems, then compare the means.
