Reasoning in Large Language Models (LLMs) often suffers from inefficient long chain-of-thought traces with redundant self-exploration and validation, which inflate computational costs and even degrade performance. Inspired by human reasoning patterns where people solve new problems by leveraging past related cases to constrain search spaces and reduce trial-and-error, we propose Precedent Informed Reasoning (PIR) transforming LRMs'reasoning paradigm from exhaustive self-exploration to guided learning from precedents. PIR addresses two key challenges: what precedents to adopt and how to utilize them. First, Adaptive Precedent Selection (APS) constructs, for each question and LRM, a compact set of precedents that are both semantically related and informative for the model. It ranks examples by a joint score with semantic similarity and model perplexity, then adapts the amount of precedents to maximize perplexity reduction. Second, Test-time Experience Internalization (TEI) is treated as the test-time learning on precedent-informed instruction, updating lightweight adapters to internalize solution patterns and use them as a prior during subsequent reasoning. Experiments across mathematical reasoning, scientific QA, and code generation demonstrate that PIR consistently shortens reasoning traces while maintaining or improving final accuracy across LLMs, yielding outstanding accuracy-efficiency trade-offs.
Figures & tables
Figure 1: The illustration of different reasoning paradigms. Unlike normal reasoning that relies on self-exploration, precedent-informed reasoning leverages precedent experience to reduce the search space, improving reasoning efficiency.
Figure 2: The accuracy and length on DeepSeek-R1-Qwen2.5-7B/32B and QwQ-32B as incrementally vary the number of RS -filtered precedents in the reasoning prompt. Best accuracy gains are achieved within the given reference budget. We evaluate 100 randomly sampled instances per dataset. Markers denote the best result for each model-dataset pair: {\color[rgb]{0.122,0.467,0.706}\bullet} as MATH500, {\color[rgb]{0.839,0.153,0.157}\blacksquare} as GPQA Diamond, {\color[rgb]{0.173,0.616,0.173}\blacktriangle} as LiveCode Bench. See Appendix B for details.
Method
GSM8K
MATH500
AMC AIME
GPQA Diamond
LiveCodeBench
acc.
token.
acc.
token.
acc.
token.
acc.
token.
acc.
token.
DeepSeek-R1-7B
92.60
380.24
87.00
2576.49
58.33
3858.16
22.80
5020.86
32.68
5775.04
DeepSeek-R1-14B
92.60
265.91
86.00
2408.36
57.76
3523.09
24.66
4411.01
36.57
5432.53
DeepSeek-R1-32B
94.20
263.04
86.80
2269.37
59.92
3661.52
36.30
5028.59
41.02
5224.52
QwQ-32B Team (2025)
93.60
290.32
88.00
3318.15
63.00
4600.75
37.42
5585.19
42.99
5575.36
prompt to concise Wei et al. (2022)
94.00
182.42
90.50
2161.51
54.50
3286.95
31.98
4120.47
45.50
5611.31
Table 1: Accuracy ( acc. , %) and average thinking length ( token. ) across methods and datasets. Best and second-best results are in bold and underlined . All methods including PIR use DeepSeek-R1-32B as the backbone model.
Dataset
PIR (w/o TLM)
PIR (full)
GSM8k
0.00
1.08
MATH500
0.18
2.64
AMC AIME
0.11
5.38
GPQA Diamond
0.57
5.81
LiveCodeBench
0.04
8.19
Table 2: Statistics of the occurrence of precedent reference behaviors before and after applying TEI . Details of the behavior detection are in Appendix G .
Method
GSM8K
MATH500
AMC_AIME
GPQA Diamond
LiveCodeBench
HT.
HS.
HT.
HS.
HT.
HS.
HT.
HS.
HT.
HS.
DeepSeek-R1-32B
65.81
65.03
26.83
30.86
19.17
22.56
14.11
18.57
11.82
18.44
l1-max
60.20
64.90
41.97
37.78
23.06
28.00
36.96
37.20
33.63
29.17
s1-32B
73.97
69.22
59.92
39.18
32.15
33.64
42.46
40.65
34.79
35.56
DEER
77.00
71.80
59.10
41.18
39.62
44.97
40.08
38.46
34.39
30.42
SEAL
77.46
76.07
53.01
41.91
44.22
44.97
37.02
39.46
34.73
31.72
Table 3: The statistical results of attention score above average in one reasoning path in token ( HT. ) and segment ( HS. ) level. Best results are in bold . More calculation details are in Appendix H .
Method
GSM8K
MATH500
AMC AIME
GPQA Diamond
LiveCodeBench
Time
GPU
Time
GPU
Time
GPU
Time
GPU
Time
GPU
DeepSeek-R1-32B
18.06
72.00
114.40
72.00
174.35
72.00
224.00
72.00
246.72
72.00
QwQ-32B
59.35
72.00
145.67
72.00
211.96
72.00
253.27
72.00
253.06
72.00
prompt to concise
27.43
72.00
104.15
72.00
142.28
72.00
161.92
72.00
242.33
72.00
s1-32B
140.48
72.00
206.75
72.00
226.54
72.00
49.05
72.00
191.75
72.00
l1-max
23.19
40.00
51.15
40.00
49.30
40.00
58.34
40.00
62.07
40.00
Table 4: Time (seconds) and GPU memory (GB) cost of different methods across datasets. Within an A800, PIR is the second-fastest method in most case, with latency close to DEER (best) and substantially faster than the base model. With accuracy improvements over DEER (Table 1 ), PIR offers a favorable accuracy–efficient trade-off.
Method
GSM8K
MATH500
AMC AIME
GPQA Diamond
LiveCodeBench
acc.
token.
acc.
token.
acc.
token.
acc.
token.
acc.
token.
DeepSeek-R1-32B
94.20
263.04
86.80
2269.37
59.92
3661.52
36.30
5028.59
41.02
5224.52
w/o APS
94.60
253.22
88.80
1819.20
61.80
3472.31
55.15
4219.80
45.02
5045.93
w/o TEI
95.40
281.37
90.60
3725.20
63.60
3933.19
56.88
5169.49
46.46
5383.76
PIR (Ours)
95.60
197.03
93.20
1485.36
67.40
2935.83
65.22
3024.81
57.11
4023.37
Table 5: Ablation results. w/o reference example removes reference examples from input context. w/o instruction adaptation disables test-time adaption and uses only precedent informed prompting for reasoning.
Figure 3: Scalability of PIR across different reasoning models, with average accuracy (%) and reasoning tokens on different models reported for each dataset.
Sampling
MATH500
GPQA Diamond
LiveCodeBench
Strategy
acc.
token.
acc.
token.
acc.
token.
e=0
88.80
1819.20
36.15
4219.80
40.02
5224.52
e=1
87.00
2517.10
37.21
3291.51
36.54
5193.00
e=2
89.00
2239.31
49.30
3968.34
40.38
5840.62
e=3
94.00
2345.72
32.79
4186.22
38.46
4991.40
e=4
90.00
2154.91
35.88
4173.04
42.31
4919.39
Table 6: Comparison of example selection strategies under the same test-time experience internalization setting. We isolate the effect of PIR’s dual-dimension, adaptive selection by contrasting it with fixed-size ( e=n ) and single-dimension strategies (random, semantic-only, perplexity-only and SIFT Hübotter et al. (2025) ). See Appendix J.2 for details of settings.
Appendix figures & tables28 assets
Supplementary material from the paper’s appendix.
Appendix
MATH500
GPQA Diamond
LiveCodeBench
acc.
token.
acc.
token.
acc.
token.
e=0
87.00
2576.49
41.86
5482.81
21.15
25058.90
e=1
88.00
2019.90
40.00
4411.38
19.23
25189.14
e=2
82.00
1754.70
42.00
4110.14
28.84
22101.56
e=3
82.00
1655.82
46.00
3943.48
36.53
23313.76
e=4
86.00
2109.38
48.00
4069.18
30.76
24710.72
Appendix
Table 7: The result of pre-experiment for DeepSeek-R1-Distilled-Qwen2.5-7B. e=k means there are k examples provided in the input prompt.
MATH500
GPQA Diamond
LiveCodeBench
acc.
len.
acc.
len.
acc.
len.
e=0
91.00
3055.53
63.95
9243.30
55.76
19482.96
e=1
92.00
2285.34
46.51
8706.31
53.84
16686.50
e=2
88.00
3101.46
66.67
6267.77
57.69
14190.69
e=3
94.00
2660.18
55.81
4466.50
50.00
14973.87
e=4
88.00
3766.13
68.60
3482.04
48.07
13135.62
Appendix
Table 8: The result of pre-experiment for DeepSeek-R1-Distilled-Qwen2.5-32B. e=k means there are k examples provided in the input prompt.
MATH500
GPQA Diamond
LiveCodeBench
acc.
len.
acc.
len.
acc.
len.
e=0
92.00
3671.68
65.11
9242.30
57.69
13973.98
e=1
91.00
2284.34
48.84
8705.31
59.61
14082.94
e=2
92.00
3100.47
66.67
6266.77
61.54
13747.86
e=3
93.00
2659.18
55.81
4465.50
50.00
13556.00
e=4
88.00
3765.13
68.60
3481.04
51.06
11775.93
Appendix
Table 9: The result of pre-experiment for QwQ-32B. e=k means there are k examples provided in the input prompt.
GSM8K
MATH500
AMC AIME
GPQA Diamond
LiveCodeBench
precedent
2000
2000
2000
700
880
test
500
500
500
200
175
Appendix
Table 10: Sample Counts of Different Datasets for Precedent and Test Samples
Method
GSM8K
MATH500
AMC_AIME
GPQA Diamond
LiveCodeBench
acc.
token.
acc.
token.
acc.
token.
acc.
token.
acc.
token.
DeepSeek-R1-7B
92.60
440.39
88.91
4519.88
60.20
9305.71
27.45
17040.71
37.10
20331.73
DeepSeek-R1-14B
93.40
465.91
89.80
3973.30
60.20
7440.76
47.64
9678.51
47.95
16099.46
DeepSeek-R1-32B
95.00
464.54
91.00
4020.06
66.00
7312.36
53.80
11733.01
53.40
17384.53
QwQ-32B
96.20
1261.63
94.29
3875.44
66.90
6096.18
53.15
11732.34
57.32
15163.50
Appendix
Table 11: Accuracy ( acc. , %) and average reasoning length ( token. ) of models under a 32k context window.
Method
GSM8K
MATH500
AMC_AIME
GPQA Diamond
LiveCodeBench
Adapt.
Reason.
Adapt.
Reason.
Adapt.
Reason.
Adapt.
Reason.
Adapt.
Reason.
Ours (DeepSeek-R1-32B)
0.99
30.672
1.13
45.52
1.34
53.23
1.05
46.66
1.3
54.5
Appendix
Table 12: Stage time analysis. Adapt. and Reason. represent time adaptation and time reasoning respectively.
Method
GSM8K
MATH500
AMC_AIME
GPQA Diamond
LiveCodeBench
acc.
token.
acc.
token.
acc.
token.
acc.
token.
acc.
token.
QwQ-32B
92.40
1672.23
88.00
3318.15
64.45
5297.53
48.84
6132.83
30.77
6723.94
Ours(QwQ-32B)
95.80
738.24
90.00
1557.84
68.77
2126.18
55.56
4033.46
34.62
5587.40
DeepSeek-R1-7B
89.60
478.28
87.00
2576.49
62.53
2207.90
41.86
5482.81
15.38
7055.57
Ours(DeepSeek-R1-7B)
92.60
362.50
88.80
2055.53
64.40
1475.00
45.21
4862.41
19.25
6568.69
DeepSeek-R1-14B
90.80
439.25
86.00
2408.36
63.75
4223.15
31.40
5241.13
21.15
6433.59
Appendix
Table 13: The details result of scalability of PIR across different reasoning models.
Dataset
Num.
GSM8K
1.19
MATH500
1.56
AMC_AIME
2.73
GPQA Diamond
2.43
LiveCodeBench
2.23
Appendix
Table 14: Average number of dynamic precedents selected for different datasets.