WorksComputer Science
Attention-Graph Curvature for the Verification of Mathematical Reasoning
Abstract
Language models have recently solved open Erdős problems and achieved gold-medal level performance on International Mathematical Olympiad problems. But their solutions, written in natural language, cannot yet be verified by proof assistants. An erroneous reasoning step can invalidate every step that comes after, so it is advantageous to detect errors early. Several methods have been proposed to detect erroneous reasoning quickly based on the features of the forward pass of the language model that performs reasoning. In this work, we study whether the directed Forman curvature of that model's attention graph, a local quantity computed at an edge from the attention weights around it, carries information about a step's correctness. To do so, we evaluate four per-step verifiers on ProcessBench with and without the curvature appended to their input. Appending curvature values improves the overall mean performance of all four verifiers. ReProbe, the verifier that takes every token of a step as input, shows the largest improvement. Adding the curvature increases the time of the language model's forward pass by 18% on average. Our code is available at https://github.com/kanghyeonz/attention-graph-curvature.
Introduction
Language models now solve mathematics problems of Olympiad and research difficulty. Gemini Deep Think scored 35 of 42 points at the 2025 International Mathematical Olympiad with solutions written in natural language [5], and an agent built on Gemini Deep Think solved or partially solved four problems listed as open in the Erdős problems database [2]. Language models, which we call generators, write such solutions in natural language that no proof assistant can check, so an erroneous step has to be detected quickly and automatically. Methods that detect erroneous mathematical reasoning from features of the generator’s forward pass have been proposed [7, 8, 11], and they use one of two types of features: 1) the hidden states, on which Zhang et al. [11] train an MLP probe to classify a reasoning segment ending in an intermediate answer and Ni et al. [7] train a transformer encoder to classify a reasoning step, and 2) the attention matrix taken as a weighted graph, the attention graph, from which Noel [8] computes spectral statistics of the hidden states to classify a whole solution. We adapt all three methods to construct per-step verifiers that score each step of a solution (§ 2.2).
In this paper, we study whether the local geometry of the attention graph carries information about the correctness of a step, that is, whether a per-step verifier detects an erroneous step more accurately when given the local geometry. The directed Forman curvature [10], which generalizes the Forman curvature [4] to directed graphs, is one quantity that describes this geometry at each edge. The curvature of an edge is a closed-form function of the attention weights of the edges that meet its two endpoints, so it requires no training and can be computed at every layer for every step (§ 2.1). In particular, the curvature can reflect an attention connection that is weak relative to the connections entering its source and leaving its target, potentially acting as a bottleneck. Our intuition is that the distribution of these relative connection strengths across a step may help distinguish correct from erroneous reasoning. We therefore test whether appending curvature features to a verifier’s input improves its ability to detect errors. Our results show that the directed Forman curvature provides information beyond what is already captured by the existing inputs of these per-step verifiers (§ 3.2).
Methodology
We begin with the notation for a solution and its steps. § 2.1 defines the curvature of the attention graph and the curvature vector that we append to a verifier’s input. § 2.2 describes the four per-step verifiers.
A solution consists of a sequence of steps , each corresponding to a paragraph of the solution. The problem followed by the steps of its solution gives the token sequence
in which is the number of tokens in step and the -th token of step . The generator is frozen, and denotes its last-layer hidden state at , with the hidden dimension and the layer count. Every solution is annotated in one of two ways (§ 3.1). An erroneous solution comes with the index of its first erroneous step, and we label all preceding steps as correct and the indexed step as erroneous, leaving subsequent steps unlabeled. A correct solution has no erroneous-step index, and we label all of its steps as correct. Figure 1 illustrates the verifier framework using an example solution.

Figure 1. Verifier framework and evaluation. A verifier maps features extracted from the generator’s forward pass on a step’s prefix to a score, and the rule in Section 3.1 determines whether a step is flagged. An erroneous solution is correctly classified when the first flagged step is the annotated first erroneous step, and a correct solution when no step is flagged.
Curvature of the attention graph
Let denote the number of tokens from the first token of the problem up to and including the final token of step , where is the number of tokens in the problem. At every layer we average the attention weights over heads and remove self-loops. This yields, for each step , one weighted directed graph per layer on the first tokens, i.e., the prefix ending at . An edge is included whenever query attends to key with a nonzero weight (Appendix § 6), and is assigned weight , with . The directed Forman curvature [10] of an edge, with unit vertex weights, is
where is the set of edges into and the set of edges out of , both in the graph from the same layer as . This curvature compares the attention on an edge with the attention on the edges entering its source and leaving its target. With the other weights fixed, weaker attention on the central edge or stronger attention on these neighboring edges cannot increase its curvature. It can therefore describe a connection that is weak relative to the connections on either side, which motivates our intuition of a local bottleneck. We hypothesize that the distribution of such local relations differs between correct and erroneous steps. The sign also depends on the number of neighboring edges, so negative curvature alone does not establish a bottleneck or a reasoning error (Appendix A).
Curvature is defined on edges, whereas a per-step verifier takes tokens or steps as input, so we aggregate them accordingly. For a set of tokens, we consider the graph of the prefix that ends at the step containing them. At each layer , we summarize the curvatures of their outgoing edges by their quantiles, and stack these quantiles across layers to obtain the curvature vector of . Let denote the set of edges leaving tokens in at layer of the graph. Then
Here denotes the -quantile of the curvatures of the edges in . Two choices of are used. For a single token we write , and denotes at the token , with the same subscripts as . For all the tokens of step we write . A method that takes hidden states receives for each token whose hidden state it takes, whereas a method that takes one vector of statistics per step receives (Table 1). Because causal attention only allows a token to attend to itself and preceding tokens, the prefix graph of step is fixed once has been generated. Therefore can be computed and the step scored immediately. For a finished solution, one single forward pass provides the graphs for all steps. Appendix A gives the conditions under which the maximum-quantile coordinates are constant across steps in the final-token and pooled step representations.
Per-step verifiers
We compare four per-step verifiers, which we refer to as methods, each specified in Appendix B, and Table 1 states their inputs. Spectral, logistic uses the five spectral statistics of Noël [8] at every layer, giving features as input to a logistic classifier. While Noël [8] thresholds one statistic at one layer, we keep the statistics but replace the classifier so that this method and Hidden states, linear differ only in their input. Hidden states, linear applies the same logistic classifier to the last-layer hidden state at the final token of a step. The MLP probe of Zhang et al. [11] is a two-layer network on the last-layer hidden state. We train it at the final token of a step to predict the step’s correctness with the hyperparameter grid and selection rule of that paper. ReProbe [7] is a transformer encoder over the last-layer hidden states of the tokens within a step, trained with the hyperparameters that its paper reports.
To test whether the gains from curvature can also be obtained with simpler attention features, we append two alternative representations to each method’s original input. The first takes the same five quantiles of the edge weights instead of their curvatures, giving features (Neg-log). The second takes normalized attention entropy, concentration, and first-token attention mass at every layer, giving features (Stats). Each representation is supplied at the same token or step resolution as curvature (Appendix B).
Results
In this section we present our empirical results. § 3.1 describes the benchmark on which the methods are evaluated, the metric, and the paired comparison used to evaluate each method with and without the curvature vector. § 3.2 reports the paired differences and the comparisons with the two simpler attention representations, and § 3.3 the cost of obtaining and appending the curvature vector.
Benchmark and metric
ProcessBench [12] is a collection of step-by-step solutions written in natural language by open-weight language models for problems from four subsets: GSM8K, MATH, OlympiadBench and Omni-MATH. For every solution, human experts annotate either the first erroneous step or that no step is erroneous. We use the solutions from the seven generators with 8B parameters or fewer. ProcessBench has no OlympiadBench or Omni-MATH solutions from three of the generators, so the seven generators give a total of 22 generator–subset combinations, each consisting of the solutions one generator produced for one subset. For each generator–subset combination, every method is trained and evaluated by stratified five-fold cross-validation grouped by problem, repeated over 10 seeds. For test fold , validation uses fold and fitting uses the other three folds, without refitting on validation data (Appendix § 8).
A method’s classifier maps its input for a step to a score , the probability that the step is correct, and a step is flagged when for a threshold . The metric is the one ProcessBench reports as its F1 score, the harmonic mean of the fraction of correct solutions in which no step is flagged and the fraction of erroneous solutions whose first flagged step is the annotated first erroneous step. The of a generator–subset combination is the mean over the seeds of the value computed from that seed’s pooled held-out decisions, and the threshold is the only quantity chosen to maximize , on the selected model’s own scores for its three fitting folds (Appendix § 8). For each of the four methods, the configurations without and with curvature form a pair with the same folds, seeds, classifier type, and threshold selection rule. The Neg-log and Stats configurations use those same folds and seeds, and the same normalization, fitting, and model-selection rules as the corresponding method. Each configuration selects its own threshold from its own fitting scores. The paired tests reported in Table 2 compare curvature with the original input. We report the paired difference for each generator–subset combination . We summarize the 22 differences using their solution-count-weighted mean, the number of positive differences, and a two-sided Wilcoxon signed-rank test (Appendix § 8).
| Method | Base | + Neg-log | + Stats | + Curvature (ours) | ||
| Spectral, logistic | 0.3261 | 0.3165 | 0.3298 | 0.3474 | +0.0213 | <0.001 |
| Hidden states, linear | 0.1828 | 0.1872 | 0.1847 | 0.1907 | +0.0079 | 0.044 |
| MLP probe | 0.2991 | 0.3033 | 0.3021 | 0.3037 | +0.0047 | 0.483 |
| ReProbe | 0.2932 | 0.3068 | 0.3103 | 0.3472 | +0.0540 | 0.0011 |
Table 2. Each method with its original input (Base) or with one attention-derived representation appended: five quantiles of per layer (Neg-log, 5L features), normalized attention entropy, concentration, and first-token attention mass (Stats, 3L), or curvature (, 5L). All configurations use the same folds and seeds. Within each method, the fitting and threshold-selection rules are identical across feature configurations. is the harmonic mean of the accuracies on correct and erroneous solutions, averaged over the 22 generator–subset combinations with solution-count weights. and the unadjusted two-sided Wilcoxon -value compare curvature with Base only (§ 3.1); they do not test curvature against Neg-log or Stats.
Effects of curvature features
Table 2 summarizes the four curvature pairs and the two attention controls for each method over the 22 generator–subset combinations. Appendix § 9 reports and for every generator–subset combination and the mean of over the generator–subset combinations of each subset.
Appending curvature features yields the highest overall mean performance for all four methods (Table 2). The simpler attention representations, Neg-log and Stats, also improve mean performance in most cases, but their gains are smaller than those obtained with curvature. The magnitude and consistency of the curvature gains nevertheless vary across verifiers.
ReProbe shows the largest improvement, with and positive differences in 18 of the 22 generator–subset combinations with . Its performance also improves on every subset, with gains ranging from on GSM8K to on MATH (Table 4). The spectral logistic and hidden-state linear classifiers show smaller mean improvements of and , with positive differences in 18 and 14 combinations, respectively; both improvements have . The MLP probe shows the smallest mean improvement, at , with positive differences in 13 combinations, and its improvement is not statistically significant ().
Table 4: Mean over the generator–subset combinations of each subset, weighted by each generator–subset combination’s solution count, with the standard error of that mean over the generator–subset combinations in parentheses, the weighted sample standard deviation of the generator–subset combination values divided by the square root of the Kish effective number of generator–subset combinations. The four subsets contain 7, 7, 4, and 4 generator–subset combinations. Each method appears twice, without and then with appended to its input. All is the same weighted mean over all 22 generator–subset combinations, the value Table 2 reports. Tables 5 to 8 give each generator–subset combination separately.
| Method | GSM8K | MATH | OlympiadBench | Omni-MATH | All |
| Spectral, logistic | 0.279 (0.045) | 0.302 (0.024) | 0.328 (0.021) | 0.377 (0.014) | 0.326 (0.016) |
| with curvature | 0.321 (0.045) | 0.337 (0.024) | 0.338 (0.015) | 0.383 (0.014) | 0.347 (0.014) |
| Hidden states, linear | 0.096 (0.044) | 0.143 (0.021) | 0.198 (0.033) | 0.261 (0.035) | 0.183 (0.021) |
| with curvature | 0.111 (0.035) | 0.158 (0.024) | 0.200 (0.030) | 0.262 (0.042) | 0.191 (0.020) |
| MLP probe | 0.187 (0.041) | 0.249 (0.029) | 0.340 (0.040) | 0.376 (0.041) | 0.299 (0.024) |
| with curvature | 0.181 (0.035) | 0.274 (0.031) | 0.336 (0.039) | 0.370 (0.037) | 0.304 (0.023) |
| ReProbe | 0.210 (0.054) | 0.254 (0.028) | 0.317 (0.021) | 0.360 (0.026) | 0.293 (0.021) |
| with curvature | 0.238 (0.057) | 0.327 (0.014) | 0.362 (0.030) | 0.413 (0.022) | 0.347 (0.020) |
Table 4.
ReProbe’s larger gains may be related to how it incorporates curvature. It receives at every token of a step (Table 1), so its input retains the information of how the curvature varies across the tokens of the step. In contrast, the three other methods receive a single vector per step, either from the final token or from quantiles computed over the step, which does not preserve the full token-level variation. We hypothesize that this variation carries useful information about a step’s correctness, but leave a direct test of this hypothesis to future work.
| Method | Input | With curvature |
| Spectral, logistic | , one vector per step | |
| Hidden states, linear | , the final token | |
| MLP probe | , the final token | |
| ReProbe | , every token of the step |
Table 1. Inputs to each method without and with the curvature vector, with the spectral statistics of Appendix B and the last-layer hidden state.
Computational cost
Adding curvature introduces only modest computational overhead relative to the generator’s forward pass. Returning the attention and averaging over heads add 14.6 ms to a 118 ms forward pass, while computing the curvature vector takes 6.8 ms per step on average (Table 3, Appendix § 8). Once is formed, appending it to a verifier increases the scoring time by less than 0.1 ms for all four methods. The main additional cost therefore comes from extracting and processing the attention graph rather than appending the curvature itself, and remains small compared with generation. Because the curvature vector can be computed as soon as a step is generated, this low overhead makes it practical to use curvature-based verification during inference to flag erroneous steps before generation continues.
| Subset | Plain | Attention | Head mean | Forming | Within memory |
| GSM8K | 60 | 5.5 | 0.5 | 2.4 | 100% |
| MATH | 102 | 11.6 | 0.7 | 5.7 | 99% |
| OlympiadBench | 145 | 17.8 | 1.0 | 8.7 | 97% |
| Omni-MATH | 139 | 16.5 | 1.0 | 8.3 | 97% |
| All | 118 | 13.7 | 0.9 | 6.8 | 98% |
Table 3. Cost per step of what the curvature vector requires, in ms, averaged over the prefix lengths of the scored steps of each generator–subset combination and then over the generator–subset combinations of a subset weighted by solution count. Plain is the generator’s forward pass with fused attention, which every method requires; attention is what the pass that returns the attention matrices adds to it, and head mean the mean over heads at every layer; forming is the edge weight, the curvature of Equation (2), and the quantiles of Equation (3) at every layer, computed for all layers at once. Within memory is the share of steps whose prefix the pass returning the attention matrices completes within the 24 GB of the GPU; the other entries average over those steps, and forming over all steps. Timings on random matrices and random tokens at the steps’ prefix lengths (Appendix § 8).
Conclusion
We introduced attention-graph curvature as a feature for verifying erroneous mathematical reasoning, to our knowledge the first use of directed Forman curvature for this purpose. Appending these curvature features increased the overall mean performance of all four methods, with the largest gain for ReProbe which receives token-level curvature. For ReProbe, curvature also gave larger gains than either of the two simpler attention-derived representations on all four subsets. We hypothesize that how curvature varies across tokens may carry useful information, and leave the direct comparison of token-level and step-level inputs to future work. The additional computational cost of curvature is relatively small compared with the generator’s forward pass, and the features can be computed as soon as each step is generated. Future work can therefore use curvature-based verification to improve a generator’s reasoning on the fly, for example by rejecting or resampling flagged steps or guiding generation toward alternative reasoning paths.
Acknowledgments and Disclosure of Funding
The work of Johannes F. Lutzeyer is supported by the French National Research Agency (ANR) via the “GraspGNNs” JCJC grant (ANR-24-CE23-3888).
Details of the curvature
Choice of curvature. The spectral analysis of attention graphs by Noël [8] motivates studying whether their local connectivity is also useful for verifying reasoning. The directed Forman curvature of an edge, Equation (2), is a closed-form function of the attention weights of the edges that meet its two endpoints. It describes how the edge relates to its neighboring connections. The Ollivier–Ricci curvature [9] requires an optimal transport problem to be solved at every edge [6], which is costly on a graph with one edge per attended token at every layer of every prefix, so we did not use it. This computational advantage motivates the choice but does not establish that Forman curvature is more predictive than other graph features.
Sign and magnitude. The curvature of depends on the edges that arrive at its source and the edges that leave its target . For fixed , each of them lowers the curvature by an amount that is nondecreasing in its attention weight, since a larger attention weight gives a smaller until the floor is reached. The factor scales the sum, so with the neighboring weights fixed, decreasing the edge’s attention cannot increase its curvature. The curvature can therefore reflect a connection that is weak relative to the incoming connections at its source and the outgoing connections at its target. Its sign also depends on the number of neighbors: if all weights in the expression are equal and the two sums contain a total of terms, the curvature is . It can thus be negative even when the central edge is no weaker than its neighbors. Negative curvature alone does not identify a global bottleneck or a reasoning error. The connectivity interpretation in Noël [8] motivates this local analysis, but does not establish either implication for our directed curvature.
Edge weight. Were the attention weights themselves taken as , an attention weight of would contribute a thousand times what a weight of 1 does to the sums of Equation (2), and softmax gives a query many entries of that size, so the sums would be dominated by the edges the model attends to least. We therefore take , and the floor prevents a division by zero in Equation (2) at an edge of attention weight exactly 1, whose is 0. We retain all positive head-averaged attention entries except self-loops, without further sparsification or renormalization. The transformation is a modeling choice. The Neg-log control uses the same transformed weights without computing curvature, while Stats summarizes the attention weights directly (Appendix § 7).
Aggregation. For each step, we restrict the graph to the prefix ending at that step before computing edge curvatures. Causal attention alone does not make this restriction unnecessary: later queries can add incoming edges to earlier tokens and change their curvature. A step’s final token has no incoming edge within its prefix graph, so the summaries of Equation (3) are taken over outgoing edges. A token with no outgoing edge, including the first token of the sequence after self-loops are removed, is assigned a zero vector. A quantile in Equation (3) is computed by linear interpolation between adjacent order statistics. The step summary pools the outgoing edges of all its tokens before taking quantiles; it is not the average of the token summaries. These summaries describe distributions of curvature values, but do not preserve which edges connect which tokens. Using them across layers and, for ReProbe, across tokens lets the verifier use patterns involving multiple edges without treating an individual negative value as an error indicator.
Maximum quantile. Every edge has curvature at most 2. If a step’s final token has a positive attention edge to the first token, that edge has curvature exactly 2: its source has no incoming edge and its target has no outgoing edge, so both sums in Equation (2) vanish. Under this condition, the maximum quantile is 2 at that layer both for the final token and for the pooled step edges. In finite precision, an attention entry may be zero, so the existence of this edge must be checked. The same argument does not apply to every token within the step, since earlier tokens can receive incoming edges from later tokens of that step. We retain all five quantiles. A coordinate that is constant on the fitting data becomes zero on those data after centering; removing the maximum quantile at every token would change ReProbe’s representation beyond the removal of constant coordinates.
Implementation details
This appendix specifies the four methods in the notation of Equation (1), and Table 1 states what each input becomes with the curvature. The seven generators belong to the Qwen2, Qwen2.5, Qwen2.5Math, Llama-3 and Llama-3.1 families. is 28 for the Qwen ones and 32 for the Llama ones, so has 140 or 160 entries, and the hidden dimension is 1,536 for the two 1.5B generators, 3,584 for the three 7B Qwen generators, and 4,096 for the two Llama generators. Each prior method was implemented from its paper and, where the authors released code, from that code as well, with the adaptations described below. All methods use the same stored generator features and fold assignments. Normalization statistics and class-frequency ratios are estimated from the three fitting folds; ReProbe’s erroneous-class weight is fixed at 3. The designated validation fold is used to select neural-network settings and checkpoints (Appendix C). For every method the score of a step is the probability of the correct-step class, and since ReProbe’s head outputs the probability of the erroneous class, its is one minus that output. The logistic classifier of Spectral, logistic and Hidden states, linear is per-feature standardization, with mean and standard deviation estimated on the training folds alone, followed by -penalized logistic regression at the scikit-learn defaults (, lbfgs, tolerance ), with max_iter increased to 2000 and class_weight='balanced'. These settings are fixed across folds; validation is not used to tune the logistic classifiers.
Spectral, logistic. The input is the five spectral statistics of Noël [8] at every layer, the Dirichlet energy, the spectral entropy, the high-frequency energy ratio, the Fiedler value, and a smoothness measure, values, computed on the prefix graph with the heads uniformly averaged and the resulting matrix symmetrized, the combinatorial Laplacian, the median eigenvalue index as the high-frequency cutoff, and the smoothness in the form of the released library, the Dirichlet energy divided by the squared Frobenius norm of the layer’s hidden states. The classifier of that paper thresholds one statistic at one layer, and we give all values to the logistic classifier so that this method and Hidden states, linear differ only in their input.
Hidden states, linear. The input is , under the same logistic classifier.
MLP probe. A two-layer perceptron with a ReLU hidden layer of width , with a single linear layer, on , following Zhang et al. [11]. We standardize each input dimension on the three fitting folds’ labeled steps, using the sample standard deviation with a lower bound of . The objective is the cross-entropy with the correct class weighted by , where is the ratio of erroneous to correct training steps, optimized with Adam at batch 64 for at most 200 epochs, with patience 10 on the designated validation fold and the best epoch restored. An improvement must reduce validation loss by more than . Validation loss is averaged over labeled steps, weighting each batch by its number of steps. Four hyperparameters are searched on a grid of 216 hyperparameter settings, the learning rate over , over , the weight decay over , and . The 10 best by validation step accuracy at score threshold 0.5 are retained and the smallest among them chosen, ties by validation accuracy. The selected setting is trained again with the same seed and fitting data, using the same validation checkpoint rule. Validation data are not added to the fitting set. Zhang et al. [11] train the probe at the end of a segment of the reasoning that ends in an intermediate answer, which they call a chunk, to predict whether that answer is correct, and we train it at a step’s final token to predict the step’s correctness. The patience, the tie-break, and the standardization of the inputs are ours, and the standardization interacts with weight decay and early stopping, so the selected hyperparameters are not comparable to that paper’s.
ReProbe. A two-layer projection to of each token’s , a learned marker embedding added to every token of the step, one encoder layer with 16 heads and dropout 0.1, the mean over the step’s tokens, and a two-layer head, following Ni et al. [7], with padded positions masked out of the encoder’s attention. We standardize each input dimension on all retained tokens of the first 32 fitting solutions in the fixed data order, or all fitting solutions if fewer are available, with population standard deviations bounded below by . Training uses the learning rate of Ni et al. [7], , their batch size of 128, their weight of 3 on the erroneous class, and their five epochs, with AdamW at weight decay 0.1, linear warm-up over the first 5% of the updates then linear decay to zero, and gradients clipped to norm 1, and keeps the checkpoint with the lowest validation loss on the designated validation fold. The warm-up lasts at least one update. Validation loss is averaged over labeled steps, weighting batches by their numbers of steps. To limit memory use, each logical batch of up to 128 steps is processed in smaller batches, accumulating gradients with weights proportional to their sizes before one optimizer update. No further validation split is made. Our encoder receives only the current step’s tokens; their generator hidden states already incorporate the preceding prefix. We use the last-layer hidden states, a maximum generator input length of 2048 tokens, and the normalization and checkpoint rules specified here. These choices define our adaptation to the per-step task and the available data.
Attention controls. Both controls use the same positive head-averaged attention entries and prefix graphs as curvature, with self-loops removed. They are computed at every layer. The retained input tokens and step boundaries are identical across configurations.
Negative-log attention. For each token, we take the five quantiles of over its outgoing edges, at the levels in Equation (3), using linear interpolation. The step-level representation pools the outgoing edge weights of all retained tokens in the step before taking quantiles. No attention renormalization is applied. An empty edge set gives five zeros. Stacking across layers gives features, the same dimension as curvature.
Attention statistics. At a fixed layer, let be the set of keys with positive attention from token , excluding itself, and let . For , we normalize the retained outgoing weights as . For , normalized entropy and concentration are
The third statistic is , where is the first token of the full input, with if . For , we set and ; for , all three statistics are zero. Numerical values are clipped to . The step representation averages each of the three statistics over retained tokens in that step. Stacking across layers gives features.
Control inputs and fitting. The spectral classifier receives each control’s step representation; the hidden-state linear classifier and MLP receive the control representation at the step’s final retained token; ReProbe receives its representation at every retained token. In each case it is appended to the method’s original input in place of curvature. The normalization, class weighting, hyperparameter grid where applicable, checkpoint selection, and threshold-selection rules are unchanged. Models are fitted separately for each configuration. The Neg-log comparison matches curvature’s added dimension and input resolution. Stats has fewer features and is not a comparison at equal input dimension.
Numerical reproducibility. Neural fitting uses fixed seeds and strict deterministic PyTorch algorithms, with cuDNN benchmarking and TF32 disabled. CUDA evaluation sets CUBLAS_WORKSPACE_CONFIG=:4096:8 before execution. The features, partitions, software versions, and fitting outputs are recorded. Separate checks replay threshold selection and solution counts from saved scores, and compare repeated fits with unchanged and altered test labels. These checks concern the recorded execution environment, not equality across hardware or software versions.
Cross-validation, threshold selection, and cost
The 22 generator–subset combinations contain 1,994 solutions and 14,906 steps, and a generator–subset combination contains 22 to 164 solutions and 118 to 1,436 steps. ProcessBench’s solutions come divided into steps at paragraph breaks that the benchmark inserted by reformatting, discarding the few solutions whose final answer the reformatting changed. Every input of a generator–subset combination comes from a forward pass of its own generator, its folds, thresholds, and metric are computed within it, and where generator–subset combinations are averaged the weight is each one’s solution count. Each generator–subset combination is evaluated by stratified group cross-validation with five folds and seeds 0 through 9, a seed determining one partition of the solutions into folds. Solutions of the same problem remain in one fold. Stratification approximately balances correct and erroneous solutions, with problem groups taking precedence over exact class proportions and fold sizes. The partitions are fixed before evaluation and shared by all sixteen method–feature configurations, including the eight configurations using Neg-log or Stats.
For test fold , validation uses fold and fitting uses the remaining three folds. The nominal proportions are 60% fitting, 20% validation, and 20% test, with deviations due to integer counts and problem groups. The validation fold selects neural-network settings and checkpoints. Test data are excluded from fitting, normalization, checkpoint selection, and threshold selection. The selected model is not refitted on the combined fitting and validation folds.
For each test fold, the selected model scores its own three fitting folds, and is selected on these scores and applied to that model’s test-fold scores. No scores from other fold models are used. The candidates are the quantiles of the step scores pooled over the fitting folds at the 50 levels , taken after non-finite scores are removed and with duplicate quantile values removed. The classifiers are trained on labeled steps with cross-entropy objectives, so is not their training objective, and is the only quantity chosen to maximize it. The candidate maximizing on the fitting folds is kept, with ties broken in favor of the smallest . Candidate values of are compared using integer success and total counts to avoid numerical tie-breaking differences. is zero when both class accuracies are zero and undefined when a class is absent. If the fitting set lacks either solution class or has no finite scores, the predefined fallback is .
The threshold is selected on the same data used to fit the model, rather than on an independent calibration set, and can overfit those scores. The test folds evaluate the complete procedure, including this threshold-selection rule. Validation and test scores are not used to adjust the threshold candidates or their selection.
These out-of-fold decisions are pooled across the five folds before the metric is computed. Let and denote the correct and erroneous solutions of the generator–subset combination, and the index of the first step flagged in solution under seed ( if none),
with the annotated first erroneous step, and their harmonic mean, taken as 0 when both ratios are 0. Here is the false-positive rate among fully correct solutions, not among individual correct steps, and measures exact first-error localization. The reported value and standard deviation are then
is formed once per seed from the pooled decisions rather than averaged over the five per-fold values: averaging harmonic means gives a different statistic, and a fold containing no solution of one class has no defined value, by analogy with the F-measure [3]. The standard deviation is taken over the 10 seeds and not over the 50 folds, since folds within one seed share training data [1]. It describes variation across partitions and training seeds on the same data, not a standard error from independent datasets. The signed-rank test of Section 3.1 uses the 22 combination-level mean differences between curvature and the original input, leaving out exact zeros. We report unadjusted two-sided p-values. Comparisons with Neg-log and Stats are descriptive; these tests do not assess their differences from curvature. Combinations can share benchmark problems across generators, so they should not be interpreted as 22 independent samples of problems.
Small samples. The GSM8K/Qwen2-1.5B combination has 41 solutions, only four of them fully correct. Five folds therefore cannot each contain a fully correct solution. A validation or test fold may lack this class even when its labeled steps contain both classes, since an erroneous solution can contain correct steps before its first error. Step-level validation loss remains defined, but cannot assess acceptance of fully correct solutions in that fold. We retain the fixed fold rotation and pool test counts before computing . Small validation sets can still make checkpoint selection unstable.
Truncation. Solutions are tokenized with truncation at 2048 tokens. A partially retained step is scored from its retained tokens, using the final retained token for the two final-token verifiers. A step with no retained tokens is excluded from fitting and validation losses and is treated as not flagged by every method, including the spectral classifier. Its solution remains in the metric denominator, so a first error beyond the retained prefix cannot be detected under this rule. There are eight steps with no retained tokens in four solutions of the 22 generator–subset combinations.
Timings. All timings are on one NVIDIA GeForce RTX 3090 with 24 GB of memory and an AMD EPYC 7232P CPU, on random matrices and random token sequences at the prefix lengths of the scored steps, and Table 3 averages them over the steps of each generator–subset combination, from timings on a grid of prefix lengths interpolated at each step’s own, and over the generator–subset combinations of a subset weighted by solution count. The generator’s plain forward pass uses a fused kernel and returns no attention matrices, whereas a method that takes the attention graph as input requires a pass that returns them. At the median prefix that pass takes 2 to 16 ms more than the plain pass, whose own time is 27 to 150 ms, and the mean over heads takes under 1 ms. At the longest prefix the difference is 6 to 63 ms where the pass runs within memory, and in 12 of the 22 generator–subset combinations, those of the 7B and 8B generators with prefixes above about 1,500 tokens, the matrices of every layer and head together with the model exceed the 24 GB, so Table 3 averages over the steps within memory, 98 percent of them. These measurements use synthetic inputs and exclude prefixes that exceed the memory limit; they do not measure the latency of end-to-end generation with verification. Computing for the longest prefix of a generator–subset combination takes 3 to 72 ms at a peak of 266 to 7,937 MiB, against 2 to 6 ms and 61 to 577 MiB at the median prefix, computed for all layers at once. Scoring one step peaks at 9.6 MiB of GPU memory for the MLP probe and 32 to 109 MiB for ReProbe, which takes at most 1.1 ms at a generator–subset combination’s longest step, and the logistic classifiers use no GPU. With appended, each method’s scoring time changes by less than 0.1 ms, at most 0.07 ms for ReProbe.
Detailed results
Table 4 gives, for each method without and with curvature, the mean of over the generator–subset combinations of each subset with its standard error over the generator–subset combinations, and Table 5 to Table 8 give for every generator–subset combination and configuration with its standard deviation over the 10 seeds, and Figure 2 gives the paired difference of every generator–subset combination with its standard deviation over the seeds. Table 9 gives the corresponding subset means for the two attention controls. Every value is from our own runs. The values use ProcessBench’s definition, which that benchmark calls the F1 score, but are not comparable to the values it publishes, which pool a subset’s generators.
Table 5: Every method on the GSM8K subset, by generator, in its configuration without curvature and with the curvature vector appended (+curv). Values are , the mean over the 10 seeds, with the sample standard deviation over the seeds beneath. is the generator–subset combination’s solution count. SpL spectral logistic, Hid hidden states linear, MLP the MLP probe, RePr ReProbe.
| Generator | SpL | SpL+curv | Hid | Hid+curv | MLP | MLP+curv | RePr | RePr+curv | |
| Llama-3.1-8B | 61 | 0.391 (0.062) | 0.437 (0.052) | 0.045 (0.049) | 0.107 (0.058) | 0.271 (0.039) | 0.228 (0.096) | 0.219 (0.079) | 0.297 (0.061) |
| Meta-Llama-3-8B | 24 | 0.098 (0.142) | 0.273 (0.105) | 0.000 (0.000) | 0.016 (0.052) | 0.090 (0.123) | 0.142 (0.085) | 0.000 (0.000) | 0.113 (0.105) |
| Qwen2-1.5B | 41 | 0.306 (0.137) | 0.312 (0.145) | 0.295 (0.065) | 0.251 (0.065) | 0.302 (0.057) | 0.215 (0.141) | 0.372 (0.075) | 0.232 (0.163) |
| Qwen2-7B | 52 | 0.330 (0.044) | 0.405 (0.033) | 0.079 (0.056) | 0.114 (0.042) | 0.134 (0.055) | 0.182 (0.081) | 0.293 (0.101) | 0.421 (0.096) |
| Qwen2.5-1.5B | 42 | 0.254 (0.060) | 0.234 (0.050) | 0.164 (0.067) | 0.157 (0.059) | 0.233 (0.094) | 0.277 (0.059) | 0.262 (0.057) | 0.251 (0.064) |
| Qwen2.5-7B | 27 | 0.264 (0.124) | 0.284 (0.177) | 0.000 (0.000) | 0.000 (0.000) | 0.060 (0.077) | 0.042 (0.094) | 0.044 (0.098) | 0.046 (0.074) |
| Qwen2.5-Math-7B | 22 | 0.064 (0.103) | 0.085 (0.109) | 0.000 (0.000) | 0.000 (0.000) | 0.043 (0.091) | 0.021 (0.067) | 0.022 (0.070) | 0.000 (0.000) |
Table 5.

Figure 2. of § 3.1 for every generator–subset combination, with its solution count. A bar is the standard deviation over the 10 seeds of the within-seed difference. A marker is blue when the change is positive, red when it is negative and gray when it is zero, and filled when the change is larger in magnitude than its bar.
| Generator | SpL | SpL+curv | Hid | Hid+curv | MLP | MLP+curv | RePr | RePr+curv | |
| Llama-3.1-8B | 162 | 0.406 (0.029) | 0.402 (0.035) | 0.342 (0.041) | 0.356 (0.032) | 0.473 (0.035) | 0.450 (0.017) | 0.426 (0.033) | 0.456 (0.029) |
| Qwen2-7B | 131 | 0.376 (0.041) | 0.403 (0.035) | 0.270 (0.044) | 0.274 (0.048) | 0.361 (0.028) | 0.375 (0.036) | 0.328 (0.026) | 0.381 (0.062) |
| Qwen2.5-7B | 104 | 0.338 (0.050) | 0.344 (0.045) | 0.191 (0.043) | 0.201 (0.054) | 0.279 (0.055) | 0.278 (0.072) | 0.326 (0.032) | 0.362 (0.050) |
| Qwen2.5-Math-7B | 132 | 0.374 (0.041) | 0.368 (0.030) | 0.210 (0.034) | 0.183 (0.035) | 0.349 (0.025) | 0.337 (0.039) | 0.336 (0.054) | 0.430 (0.044) |
Table 8. As Table 5, for the Omni-MATH subset.
| Method | Control | GSM8K | MATH | OlympiadBench | Omni-MATH | All |
| Spectral, logistic | Neg-log | 0.3363 | 0.2840 | 0.3141 | 0.3490 | 0.3165 |
| Spectral, logistic | Stats | 0.3299 | 0.2882 | 0.3371 | 0.3738 | 0.3298 |
| Hidden states, linear | Neg-log | 0.1018 | 0.1469 | 0.2032 | 0.2640 | 0.1872 |
| Hidden states, linear | Stats | 0.0977 | 0.1514 | 0.1966 | 0.2578 | 0.1847 |
| MLP probe | Neg-log | 0.1752 | 0.2655 | 0.3384 | 0.3792 | 0.3033 |
| MLP probe | Stats | 0.1806 | 0.2507 | 0.3505 | 0.3776 | 0.3021 |
| ReProbe | Neg-log | 0.1922 | 0.2814 | 0.3176 | 0.3853 | 0.3068 |
| ReProbe | Stats | 0.1999 | 0.2856 | 0.3275 | 0.3795 | 0.3103 |
Table 9. Mean for the two attention controls, averaged over the generator–subset combinations of each subset with solution-count weights. Each combination is first averaged over the ten seeds. The All column uses solution-count weights over all 22 combinations. Table 4 gives the corresponding values without added features and with curvature.
Table 6: As Table 5, for the MATH subset.
| Generator | SpL | SpL+curv | Hid | Hid+curv | MLP | MLP+curv | RePr | RePr+curv | |
| Llama-3.1-8B | 139 | 0.306 (0.036) | 0.334 (0.051) | 0.203 (0.053) | 0.214 (0.033) | 0.350 (0.043) | 0.368 (0.049) | 0.314 (0.049) | 0.357 (0.046) |
| Meta-Llama-3-8B | 70 | 0.391 (0.049) | 0.437 (0.020) | 0.198 (0.021) | 0.220 (0.038) | 0.294 (0.075) | 0.345 (0.062) | 0.287 (0.048) | 0.332 (0.039) |
| Qwen2-1.5B | 47 | 0.347 (0.047) | 0.372 (0.054) | 0.186 (0.088) | 0.259 (0.075) | 0.303 (0.067) | 0.307 (0.061) | 0.291 (0.048) | 0.350 (0.059) |
| Qwen2-7B | 131 | 0.358 (0.048) | 0.389 (0.035) | 0.101 (0.042) | 0.113 (0.046) | 0.224 (0.036) | 0.280 (0.025) | 0.284 (0.032) | 0.331 (0.044) |
| Qwen2.5-1.5B | 74 | 0.229 (0.085) | 0.278 (0.069) | 0.120 (0.045) | 0.120 (0.046) | 0.202 (0.061) | 0.206 (0.062) | 0.100 (0.059) | 0.327 (0.047) |
| Qwen2.5-7B | 97 | 0.238 (0.044) | 0.277 (0.053) | 0.141 (0.045) | 0.145 (0.038) | 0.210 (0.042) | 0.221 (0.018) | 0.209 (0.045) | 0.256 (0.043) |
| Qwen2.5-Math-7B | 96 | 0.256 (0.074) | 0.287 (0.093) | 0.069 (0.038) | 0.088 (0.058) | 0.155 (0.029) | 0.167 (0.055) | 0.250 (0.054) | 0.333 (0.050) |
Table 6.
Table 7: As Table 5, for the OlympiadBench subset.
| Generator | SpL | SpL+curv | Hid | Hid+curv | MLP | MLP+curv | RePr | RePr+curv | |
| Llama-3.1-8B | 164 | 0.346 (0.023) | 0.348 (0.032) | 0.269 (0.040) | 0.258 (0.036) | 0.391 (0.031) | 0.394 (0.043) | 0.293 (0.033) | 0.394 (0.026) |
| Qwen2-7B | 108 | 0.256 (0.051) | 0.294 (0.033) | 0.141 (0.064) | 0.139 (0.059) | 0.292 (0.035) | 0.268 (0.061) | 0.314 (0.031) | 0.307 (0.072) |
| Qwen2.5-7B | 123 | 0.339 (0.033) | 0.332 (0.037) | 0.136 (0.034) | 0.143 (0.038) | 0.237 (0.037) | 0.250 (0.038) | 0.283 (0.032) | 0.300 (0.028) |
| Qwen2.5-Math-7B | 147 | 0.352 (0.037) | 0.366 (0.033) | 0.211 (0.039) | 0.228 (0.036) | 0.403 (0.026) | 0.393 (0.026) | 0.373 (0.046) | 0.419 (0.035) |
Table 7.
References
- [1]Yoshua Bengio and Yves Grandvalet. No unbiased estimator of the variance of k-fold cross-validation. In Advances in Neural Information Processing Systems, 2003. URL https://proceedings.neurips.cc/paper_files/paper/2003/file/e82c4b19b8151ddc25d4d93baf7b908f-Paper.pdf.
- [2]Tony Feng, Trieu Trinh, Garrett Bingham, Jiwon Kang, Shengtong Zhang, Sang-hyun Kim, Kevin Barreto, Carl Schildkraut, Junehyuk Jung, Jaehyeon Seo, Carlo Pagano, Yuri Chervonyi, Dawsen Hwang, Kaiying Hou, Sergei Gukov, Cheng-Chiang Tsai, Hyunwoo Choi, Youngbeom Jin, Wei-Yuan Li, Hao-An Wu, Ruey-An Shiu, Yu-Sheng Shih, Quoc V. Le, and Thang Luong. Semi-autonomous mathematics discovery with Gemini: A case study on the Erdős problems. arXiv:2601.22401, 2026. URL https://arxiv.org/abs/2601.22401.
- [3]George Forman and Martin Scholz. Apples-to-apples in cross-validation studies: pitfalls in classifier performance measurement. ACM SIGKDD Explorations Newsletter, 12(1):49–57, November 2010. ISSN 1931-0153. doi: 10.1145/1882471.1882479. URL http://dx.doi.org/10.1145/1882471.1882479.
- [4]Robin Forman. Bochner’s method for cell complexes and combinatorial Ricci curvature. Discrete & Computational Geometry, 29:323–374, 2003. URL https://api.semanticscholar.org/CorpusID:9584267.
- [5]Thang Luong and Edward Lockhart. Advanced version of Gemini with Deep Think officially achieves gold-medal standard at the International Mathematical Olympiad, 2025. URL https://deepmind.google/discover/blog/advanced-version-of-gemini-with-deep-think-officially-achieves-gold-medal-standard-at-the-international-mathematical-olympiad/. Google DeepMind Blog post, 21 July 2025.
- [6]Khang Nguyen, Nong Minh Hieu, Vinh Duc Nguyen, Nhat Ho, Stanley Osher, and Tan Minh Nguyen. Revisiting over-smoothing and over-squashing using Ollivier-Ricci curvature. In Proceedings of the 40th International Conference on Machine Learning, 2023. URL https://proceedings.mlr.press/v202/nguyen23c.html.arxiv.org/abs/2211.15779
- [7]Jingwei Ni, Ekaterina Fadeeva, Tianyi Wu, Mubashara Akhtar, Jiacheng Zhang, Elliott Ash, Markus Leippold, Timothy Baldwin, See-Kiong Ng, Artem Shelmanov, and Mrinmaya Sachan. ReProbe: Efficient test-time scaling of multi-step reasoning by probing internal states of large language models. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Association for Computational Linguistics, 2026. URL https://aclanthology.org/2026.acl-long.536/.
- [8]Valentin Noël. Geometry of reason: Spectral signatures of valid mathematical reasoning. In Proceedings of the 43rd International Conference on Machine Learning, 2026. URL https://openreview.net/forum?id=0CDK1MQj3W.arxiv.org/abs/2601.00791
- [9]Yann Ollivier. Ricci curvature of Markov chains on metric spaces. Journal of Functional Analysis, 256(3):810–864, February 2009. ISSN 0022-1236. doi: 10.1016/j.jfa.2008.11.001. URL http://dx.doi.org/10.1016/j.jfa.2008.11.001.
- [10]R. P. Sreejith, Jürgen Jost, Emil Saucan, and Areejit Samal. Forman curvature for directed networks. arXiv:1605.04662, 2017. URL https://arxiv.org/abs/1605.04662.
- [11]Anqi Zhang, Yulin Chen, Jane Pan, Chen Zhao, Aurojit Panda, Jinyang Li, and He He. Reasoning models know when they’re right: Probing hidden states for self-verification. In Second Conference on Language Modeling, 2025. URL https://openreview.net/forum?id=O6IOAv7683.arxiv.org/abs/2504.05419
- [12]Chujie Zheng, Zhenru Zhang, Beichen Zhang, Runji Lin, Keming Lu, Bowen Yu, Dayiheng Liu, Jingren Zhou, and Junyang Lin. ProcessBench: Identifying process errors in mathematical reasoning. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), Vienna, Austria, July 2025. Association for Computational Linguistics. URL https://aclanthology.org/2025.acl-long.50/.arxiv.org/abs/2412.06559