Test-time compute has emerged as a powerful way to improve the accuracy of language models at inference time, with scaling laws quantifying how accuracy improves with additional forward passes. Existing scaling laws, however, focus on repeated sampling from a fixed prompt, even though many tasks admit multiple equivalent representations of the same underlying problem. A graph does not depend on how its nodes are numbered, and a program does not depend on the names of its variables, yet language models can change their answers under such rewritings. In this paper, we study test-time symmetrization, which uses forward passes on rewritings of the input and aggregates the resulting answers over the group G of rewritings. We prove that no amount of sampling and repeated decoding from a single representation can replace rewriting, while only O(log∣G∣) random rewritings suffice to recover the information provided by all ∣G∣ rewritings. The same set of O(log∣G∣) rewritings provides simultaneous approximation across models, decoding rules, and sampled reasoning traces, and the logarithmic scaling is optimal in general. We validate the theory with experiments on Qwen2.5-7B, Phi-4-mini, Llama-3.1-8B, and Qwen2.5-14B, with chain-of-thought reasoning, on graph reasoning, logical deduction, and multiple-choice question answering. At the same number of forward passes, spending them on rewritings of the input is substantially more accurate than spending them on repeated sampling from the original prompt whenever the model's answer depends on how the input is written, and the number of rewritings needed grows only logarithmically with the number of possible rewritings, as the theory predicts. Our results provide a principled way to enforce symmetries at inference time when they cannot be built into the model, which we call model-agnostic symmetrization.
Figures & tables
Figure 1: Rewriting by G explores the orbit of equivalent representations, while the frozen model pθ samples reasoning traces at each representation. Full orbit averaging uses ∣G∣ rewrites; test-time symmetrization uses only O(log∣G∣) random rewrites with a few traces each.
Figure 2: Decoding each rewriting produces the orbit field FxD . Full group averaging gives the invariant target qxD , while sparse averaging uses only the rewritings in S to approximate it.
Figure 3: Accuracy against the number of forward passes ( Theorem 1 ). Accuracy against the number of forward passes k when all k traces are sampled at the original prompt and voted (blue), or one trace is sampled at each of k random rewritings (orange), for six (task, size, model) cells. The dashed line is the vote over all traces at all rewritings. The last panel is the one task on which both aggregations hurt, discussed in the text.
Model
Task
Greedy
SC
Sym.
Sym. − SC
flip
Qwen2.5-7B, n=24
edge count
0.42
0.81
0.92
+10.8[+3.8,+18.4]
0.94
edge existence
0.88
0.96
1.00
+3.9[+0.9,+8.0]
0.75
node degree
0.44
0.40
0.38
−2.2[−8.0,+3.4]
0.90
Llama-3.1-8B
edge count
0.28
0.60
0.70
+10.0[+2.3,+18.3]
1.00
edge existence
0.72
0.81
0.86
+5.5[−0.7,+12.3]
0.57
node degree
0.68
0.88
0.90
+1.9[−4.3,+8.4]
0.87
Table 1: Accuracy at B=16 forward passes on graphs with n=16 nodes ( n=24 for Qwen2.5-7B). One greedy pass, self consistency with 16 traces (SC), and 16 rewritings with one trace each (Sym.), with the paired gain of Sym. over SC in accuracy points and its 95% interval. The column “flip” is the fraction of instances whose greedy answer changes across the 16 rewritings. Bold means that the interval excludes zero.
Figure 4: A non-graph task under three groups. “Who is the tallest of k people?” given the k−1 adjacent comparisons, rewritten by permuting the premises ( Sk−1 ), by flipping statements between “taller than” and “shorter than” ( Z2k−1 ), or both. Qwen2.5-7B, 100 instances per k , budget 16 . The three “position” and “comparison” variants are in Section H.5 .
Figure 5: Relative error of the sparse average on language-model fields ( Theorems 2 and 3 ). Relative error ∥ASF−PGF∥/∥F−PGF∥ of the sparse average against ∣S∣ for Qwen2.5-7B on graphs with n∈{8,12,16,32} nodes, one shared S , four decoding rules applied to the same next-token fields, median over seven tasks. PGF is estimated from 64 independent rewritings and the estimation noise is subtracted ( Section H.8 ). The dashed line is ∣S∣−1/2 .
Appendix figures & tables16 assets
Supplementary material from the paper’s appendix.
Appendix
Model
Task
n
N
Greedy
SC-16
Sym.-16
Gain
flip
Qwen2.5-7B
edge count
8
200
0.99
0.99
1.00
+1.0[+0.0,+2.5]
0.12
edge count
12
200
0.92
0.96
1.00
+3.9[+1.4,+6.7]
0.45
edge count
16
200
0.81
0.96
0.98
+2.2[−0.2,+5.0]
0.64
edge count
20
200
0.70
0.91
0.96
+4.7[+1.2,+8.7]
0.80
edge count
24
100
0.42
0.82
0.92
+10.7[+3.8,+18.0]
0.94
edge existence
8
200
0.94
0.96
1.00
+3.5[+1.2,+6.0]
0.49
Appendix
Table 2: Accuracy at a budget of 16 forward passes on Erdős–Rényi graphs for four model families: one greedy pass at a random rewriting, self consistency with 16 traces at a random rewriting (SC-16), and one trace at each of 16 rewritings (Sym.-16); paired gain (Sym.-16 minus SC-16) in points with 95% bootstrap interval over the N instances (bold: interval excludes zero); “flip” is the fraction of instances whose greedy answer changes across the 16 rewritings.
Task
n
m=1 ( r=16 )
m=4 ( r=4 )
m=8 ( r=2 )
m=16 ( r=1 )
edge count
8
0.990
1.000
1.000
1.000
12
0.958
0.995
0.998
0.999
16
0.963
0.984
0.985
0.988
20
0.910
0.948
0.959
0.961
24
0.817
0.912
0.927
0.930
edge existence
8
0.963
0.999
1.000
1.000
Appendix
Table 3: Allocation of a budget of 16 forward passes between m rewritings and r=16/m traces per rewriting, Qwen2.5-7B, with a majority vote over all traces.
Model
Task
n
N
Greedy
SC-16
Sym.-16
Gain
flip
SBM
edge count
16
100
0.70
0.92
0.97
+4.8[+0.2,+10.2]
0.78
edge count
24
100
0.40
0.77
0.88
+10.9[+3.5,+18.5]
1.00
edge existence
16
100
0.90
0.97
1.00
+2.8[+0.3,+6.2]
0.77
edge existence
24
100
0.86
0.97
0.99
+2.2[−0.3,+5.5]
0.85
node degree
16
100
0.50
0.48
0.45
−2.1[−10.8,+6.2]
0.91
node degree
24
100
0.20
0.19
0.15
−4.6[−10.7,+0.8]
0.97
Appendix
Table 4: Graph topology and serialization variants, Qwen2.5-7B, budget 16 . SBM: two communities; planted cycle: a cycle on 3 to n/2 random nodes plus sparse noise (cycle detection is omitted since the answer is always yes); adjacency lists and letter labels follow Herbst et al. (2025) (edge reordering acts trivially on adjacency lists, so only relabeling moves the prompt).
Figure 6: Order sensitivity and the gain of symmetrization against the graph size n , Qwen2.5-7B, budget 16 . The left panel shows the fraction of instances whose greedy answer changes across 16 rewritings, and the right panel the paired gain of 16 rewritings over 16 traces.
Figure 7: Single rewritings against their vote, Qwen2.5-7B, greedy decoding at each of the 16 rewritings of every instance. The blue bar runs from the fraction of instances answered correctly at all 16 rewritings (worst case, an adversary picks the serialization) to the fraction answered correctly at at least one (best case, an oracle picks it), and the dot is the accuracy of a random rewriting. The orange mark is Sym-16, the vote over one sampled trace at each of the 16 rewritings.
Figure 8: The deduction task under three groups, all three questions, Qwen2.5-7B, budget 16 . Each panel compares symmetrization with self consistency and greedy decoding on the same orbit.
Model
Task
k
N
Greedy
SC-16
Sym.-16
Gain
flip
reorder
tallest
5
100
0.98
1.00
1.00
+0.0[+0.0,+0.0]
0.09
tallest
8
100
0.93
0.99
1.00
+0.5[+0.0,+1.5]
0.72
tallest
11
100
0.83
0.94
1.00
+5.8[+1.8,+10.8]
0.89
j -th tallest
5
100
0.90
0.99
1.00
+0.9[−0.2,+2.9]
0.70
j -th tallest
8
100
0.63
0.84
0.92
+7.5[+0.5,+15.1]
0.98
j -th tallest
11
100
0.49
0.64
0.72
+7.8[−0.7,+15.9]
1.00
Appendix
Table 5: Deduction from k−1 adjacent height comparisons among k people, Qwen2.5-7B, budget 16 , under premise reordering ( Sk−1 ), statement flipping ( Z2k−1 ), and their product. Each group is compared against its own baselines, since the starting prompt is a random element of that orbit.
Procedure
Accuracy
Greedy, original ordering (1 call)
0.918[0.894,0.940]
Vote over 3 traces, original ordering
0.922[0.898,0.944]
4 orderings, aligned, one trace each
0.934[0.914,0.956]
16 orderings, aligned, one trace each
0.946[0.926,0.966]
All 24 orderings, aligned, all 72 traces
0.948[0.928,0.966]
16 orderings, not aligned
0.244[0.206,0.282]
Appendix
Table 6: ARC-Challenge with permuted options, Qwen2.5-7B, 500 questions, with 95% bootstrap intervals over questions. “Aligned” maps each predicted letter back to the option it names before voting ( Section 3 ), and “not aligned” votes over the letters as written.
Model
Task
k
N
Greedy
SC-16
Sym.-16
Gain
flip
SST-2
SST-2
4
200
0.95
0.96
0.96
−0.3[−1.1,+0.3]
0.07
SST-2
8
200
0.96
0.97
0.97
+0.3[−0.3,+1.2]
0.08
SST-2
16
200
0.95
0.97
0.97
+0.2[+0.0,+0.7]
0.06
Appendix
Table 7: Few-shot sentiment classification (SST-2) with k demonstrations, rewritten by permuting the demonstrations ( Sk ), Qwen2.5-7B, budget 16 .
Figure 9: Gain of 16 rewritings over 16 traces on the same orbit, for the exact group and for the two paraphrasers, Qwen2.5-7B answering, with 95% intervals over instances.
Model
Task
n
N
Greedy
SC-16
Sym.-16
Gain
flip
cross-family
edge count
12
100
0.85
0.89
0.99
+9.8[+3.8,+15.9]
0.80
edge count
24
78
0.46
0.68
0.74
+6.5[−3.0,+16.4]
0.96
edge existence
12
100
0.96
0.96
0.98
+1.2[−0.4,+3.7]
0.30
edge existence
24
72
0.94
0.97
0.98
+0.8[−0.6,+2.8]
0.38
node degree
12
100
0.65
0.66
0.62
−4.5[−9.6,+0.2]
0.55
node degree
24
77
0.52
0.53
0.55
+1.8[−3.6,+7.5]
0.60
Appendix
Table 8: Rewritings sampled from a paraphrasing model instead of the group, Qwen2.5-7B answering, budget 16 ; rows are labeled by the paraphraser (cross-family: Phi-4-mini; same-model: Qwen2.5-7B). Instances with fewer than one surviving paraphrase are dropped, hence N<100 at n=24 . Baselines (Greedy, SC-16) are computed on a paraphrase, so they differ from those of the exact group on the same instances ( Table 2 ).
Figure 10: A 0.8 M-parameter transformer encoder trained from scratch to count the edges of graphs with n=10 nodes, under three training regimes, evaluated on 2,000 held-out graphs, with mean and standard deviation over two seeds. “flip” is the fraction of test graphs whose prediction changes across 16 rewritings.
Figure 11: Fraction of graphs whose single-token answer changes under node relabeling only, edge reordering only, and both, Qwen2.5-7B, 60 graphs per task.
Figure 12: Exact uniform constant ∥AS−PG∥op of Theorem 2 against ∣S∣ for G=Sn (graphs on n=3,…,7 nodes, ∣G∣=n! ) and G=Z2d ( ∣G∣=2d , d=4,…,20 ); mean and standard deviation over five draws of S . For Z2d the constant stays at one until ∣S∣ is of order d , and larger groups need proportionally more rewritings; for Sn the curves nearly coincide.
Figure 13: Relative error ηS(F) for Qwen2.5-1.5B fields with one shared S per size and draw. (a) Mean and maximum over fields, and the exact worst case of Theorem 2 , for graphs with n=4 nodes ( ∣G∣=24 ) and n=5 nodes ( ∣G∣=120 ). (b) Mean by task and (c) by decoding rule at n=5 . The curves are nearly indistinguishable, as Corollary 3 predicts.
Symbol
Meaning
Introduced
X
space of prompts
Section 3
C , C=∣C∣
set of answer classes and its size
Section 3
y⋆:X→C
target function, invariant: y⋆(g⋅x)=y⋆(x)
Section 3
G , ∣G∣ , e
finite group of rewritings, its order, and its identity
School of Computer Science and Technology, Soochow University · Department of Foundation Model, 2012 Labs, Huawei · 3Harbin Institute of Technology, Shenzhen (HITSZ)