Sompote commited on
Commit
689a36b
Β·
verified Β·
1 Parent(s): 9ecc124

Model card from paper

Browse files
Files changed (1) hide show
  1. README.md +194 -15
README.md CHANGED
@@ -16,7 +16,10 @@ pipeline_tag: text-generation
16
 
17
  # GeoTech-SLM-9B-LoRA
18
 
19
- LoRA adapters for [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B) trained for geotechnical design calculations on GeoTechBench v0.4.1.
 
 
 
20
 
21
  This repository contains two adapters:
22
 
@@ -27,6 +30,14 @@ This repository contains two adapters:
27
 
28
  The recommended inference setup is thinking mode, a 32,768-token completion cap, and a majority vote of 8 samples at temperature 0.8, top-p 0.95, top-k 20.
29
 
 
 
 
 
 
 
 
 
30
  ## Important: keep GRPO as a runtime LoRA
31
 
32
  `grpo-60` is a small update on top of the merged stage-1 weights. **Do not merge it into bf16.** Merging this adapter into bf16 erases most of the GRPO update. Load `sd-a30`, merge that into the base model, then load `grpo-60` with PEFT or vLLM LoRA and leave it unmerged.
@@ -35,20 +46,187 @@ Do not load `grpo-60` directly on the untuned base model. It was trained on `/wo
35
 
36
  A merged stage-1 full-weight checkpoint is not published here. Merge `sd-a30` locally (see below).
37
 
38
- ## GeoTechBench v0.4.1 holdout (N = 338)
39
 
40
- Results for the recommended stack (merged `sd-a30` + runtime `grpo-60`), thinking mode, 32,768-token cap:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
- - Vote of 8 (T 0.8, top-p 0.95, top-k 20): **256 / 338 (75.7%)**
43
- - Single reply: **208 / 338**
44
 
45
- For comparison, merged `sd-a30` alone (no GRPO) scored 245 / 338 on the same vote-of-8 protocol, and 210 / 338 as a single reply.
46
 
47
- ## Training
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
- - **Base model:** `Qwen/Qwen3.5-9B`, snapshot `c202236235762e1c871ad0ccb60c8ee5ba337b9a`.
50
- - **Stage 1 (`sd-a30`):** QLoRA self-distillation SFT on the base model's own checked traces. 4-bit training (`load_in_4bit`), LoRA rank 16, Ξ± 16, learning rate 2e-5, checkpoint 30 (one epoch). Adapter recorded with PEFT 0.22.0.
51
- - **Stage 2 (`grpo-60`):** Dr.GRPO with TRL (`loss_type="dr_grpo"`, Ξ² 0) on the merged stage-1 bf16 weights. 60 steps, completion cap 12,288, learning rate 1e-5, group size 8 generations, 2 prompts per optimizer step. LoRA rank 32, Ξ± 64. Apply this adapter at runtime; do not merge it.
52
 
53
  ## Usage (PEFT)
54
 
@@ -121,10 +299,11 @@ These adapters are released under [Apache 2.0](https://huggingface.co/Qwen/Qwen3
121
  ## Citation
122
 
123
  ```bibtex
124
- @unpublished{youwai2026geotechslm,
125
- title={A local small language model with frontier-agent fallback for geotechnical design calculations},
126
- author={Youwai, Sompote},
127
- year={2026},
128
- note={Manuscript in preparation}
 
129
  }
130
  ```
 
16
 
17
  # GeoTech-SLM-9B-LoRA
18
 
19
+ LoRA adapters for [Qwen/Qwen3.5-9B](https://huggingface.co/Qwen/Qwen3.5-9B), trained for geotechnical design calculations, from the paper:
20
+
21
+ **A local small language model with frontier-agent fallback for geotechnical design calculations**
22
+ Sompote Youwai, King Mongkut's University of Technology Thonburi (KMUTT), 2026 (under review).
23
 
24
  This repository contains two adapters:
25
 
 
30
 
31
  The recommended inference setup is thinking mode, a 32,768-token completion cap, and a majority vote of 8 samples at temperature 0.8, top-p 0.95, top-k 20.
32
 
33
+ ## Abstract
34
+
35
+ Cloud agents built on frontier language models solve nearly every routine geotechnical design calculation, but they are billed per token and send project data outside the firm, whereas small open models run privately on one workstation card but are less accurate. This work studies a system in which a fine-tuned 9-billion-parameter model answers locally when its eight sampled answers agree and passes uncertain problems to a tool-using frontier agent.
36
+
37
+ The local model, Qwen3.5-9B self-distilled on its own shortest correct reasoning and trained briefly with reinforcement learning, is served as a majority vote over eight reasoning samples. On 338 holdout problems of GeoTechBench it solves 256 (75.7%), against 150 for the base model with greedy decoding, 208 for one base reasoning reply and 280 for DeepSeek-V4.1-Flash. A base-model vote over eight reasoning samples was not run, so what training adds under voting is unknown. Agreement ranks right above wrong answers (AUROC 0.928).
38
+
39
+ With the threshold cross-validated over problem groups of the same holdout, 51.2% of problems stay local and sending the rest to a Claude Opus 5.5 agent solves 334 problems (98.8%) at 0.480 instead of 0.910 US dollars per problem; the best threshold chosen in-sample gives 0.404 dollars and is optimistic. Dollar figures depend on how the agent's prompt cache is billed: with a shared cached prefix the agent alone would cost about 0.187 dollars. A hosted cascade from DeepSeek-V4.1-Flash to the agent solves 327 problems at 0.146 dollars, so the local tier pays off mainly where keeping problem data in the firm matters.
40
+
41
  ## Important: keep GRPO as a runtime LoRA
42
 
43
  `grpo-60` is a small update on top of the merged stage-1 weights. **Do not merge it into bf16.** Merging this adapter into bf16 erases most of the GRPO update. Load `sd-a30`, merge that into the base model, then load `grpo-60` with PEFT or vLLM LoRA and leave it unmerged.
 
46
 
47
  A merged stage-1 full-weight checkpoint is not published here. Merge `sd-a30` locally (see below).
48
 
49
+ The paper reports that the stage-2 update is about \(2 \times 10^{-6}\) per weight, or 0.03% of a typical weight, which is below the resolution of bf16 for most weights. After merging into the SD model's bf16 weights, only 5.6% of the elements changed at all, and the relative error of the merged update was 0.95, so most of the update was lost to rounding. Every evaluation of the GRPO model therefore applies the rank-32 adapter at run time on top of the merged SD model.
50
 
51
+ ## Method
52
+
53
+ The recipe has three stages, all on Qwen3.5-9B (Apache 2.0), which has a thinking mode and runs in bf16 on one 32 GB workstation card.
54
+
55
+ 1. **Self-distillation SFT (stage 1, `sd-a30`).** The base model is fine-tuned on its own shortest correct, finished, self-checked reasoning from the training split. Fine-tuning on a frontier model's short, answer-first solutions, and distilling DeepSeek-V4.1-Flash's long visible reasoning, both harmed this student, so stage 1 uses only the model's own text.
56
+ 2. **Dr.GRPO (stage 2, `grpo-60`).** Starting from the merged stage-1 model, a second adapter is trained with Dr.GRPO (TRL `loss_type="dr_grpo"`, \(\beta = 0\)). The reward puts correctness first and penalises replies that run out of tokens or loop. This adapter is applied at run time and is not merged.
57
+ 3. **Thinking-mode vote of 8.** At inference, eight independent thinking-mode samples are drawn at temperature 0.8, top-p 0.95, top-k 20, with a 32,768-token limit. Only samples that finish with a complete answer block vote. Two answers agree when every numeric quantity matches within that quantity's grading tolerance (floor 0.5%) and every verdict matches. The voted answer is the candidate with the most agreeing samples; its support \(m\) is that count (1 to 8).
58
+
59
+ **Hybrid routing.** A problem is answered locally when \(m \ge t\) and is otherwise passed to a tool-using frontier agent (Claude Opus 5.5 or, in a cheaper comparison, GPT-6.1-terra). The headline threshold is chosen by leave-one-group-out cross-validation over the 48 template groups of the same 338-problem holdout (1-point tolerance versus the agent on the other 47 groups). The in-sample choice \(t = 6\) is reported as well but is labelled optimistic.
60
+
61
+ ## Training data
62
+
63
+ All training data come from the 680 problems of `train_v1` in GeoTechBench release 0.4.1. No text from another model enters the training set. Of these, 76 problems were set aside as development problems (answered twice by every candidate checkpoint in thinking mode with a 14,336-token limit, 152 graded replies per checkpoint). The other 604 problems feed stage 1, and a subset of them feeds stage 2. The 338 holdout problems (`holdout_v1`) were used only for the final evaluations, after every training choice had been fixed on the development problems.
64
+
65
+ GeoTechBench release 0.4.1 contains 1,018 public problems and 2,227 graded quantities in seven method families: pile axial capacity, pile groups, retaining walls, seepage, shallow bearing capacity, settlement and consolidation, and slope stability. Of the problems, 251 ask for one quantity, 431 for two and 336 for three or more. Construction tiers are cited and manual worked examples from US government manuals, parametric template variants, and earlier release-0.3 problems. The holdout has 338 problems in 48 template groups.
66
+
67
+ **Stage 1 data.** The base model sampled four thinking-mode replies for each of the 604 training problems at temperature 0.6, top-p 0.95, top-k 20, with a 12,288-token limit. Of the 2,416 replies, 827 (34.2%) finished within the limit, and 749 of these (90.6%) passed the grader. The first sample solved 193 problems and at least one of four solved 266. A finished and correct reply was kept only if every final value appeared in the reasoning, the reasoning contained an explicit check step, and fewer than 10% of its lines were repeats; at most the two shortest replies per problem were kept. This gave 465 replies for 262 problems, with a median length of 9,133 tokens (90th percentile 11,686, maximum 12,230). All seven families are represented.
68
+
69
+ **Stage 2 data.** The prompts were the 144 problems among the 604 that the base model solved in one, two or three of its four stage-1 samples. The run used 120 of them, two per step, about 0.8 of an epoch over the pool (60 steps, 960 replies).
70
 
71
+ ## Training hyperparameters
 
72
 
73
+ Both stages use the training split of release 0.4.1 only, 4-bit NF4 base weights during training, adapters on the seven attention and feed-forward projections of the language layers, bf16 computation, seed 0 and one rented RTX 5090 (32 GB). Settings are those of Table 3 of the paper.
74
 
75
+ | | Stage 1: self-distillation (SD) | Stage 2: Dr.GRPO |
76
+ | --- | --- | --- |
77
+ | Start | base Qwen3.5-9B | SD model, adapter merged into bf16 |
78
+ | Data | own finished, correct, self-checked replies, \(\le 2\) shortest per problem: 465 for 262 problems, median 9,133 tokens | 144 prompts solved 1–3 of 4 times by the base model; 120 used |
79
+ | Sampling | thinking, \(T=0.6\), top-p 0.95, top-k 20, 4 per problem, 12,288 tokens | thinking, \(T=0.8\), top-p 0.95, top-k 20, 8 per prompt, 12,288 tokens |
80
+ | Adapter | rank 16, \(\alpha=16\), no dropout | rank 32, \(\alpha=64\) |
81
+ | Optimiser | paged 8-bit AdamW, \(2 \times 10^{-5}\), cosine, 5% warm-up | 8-bit AdamW, \(1 \times 10^{-5}\), 3 warm-up steps, cosine |
82
+ | Batch | 16 sequences (1 \(\times\) 16 accumulation) | 2 prompts \(\times\) 8 replies (micro-batch 2) |
83
+ | Length limit | 13,312 tokens | 1,536 prompt + 12,288 completion tokens |
84
+ | Loss | token-averaged NLL on reasoning and answer tokens | Dr.GRPO, \(\epsilon=0.2\), no KL (\(\beta=0\)) |
85
+ | Duration | 1 epoch, 30 steps | 60 steps, about 6.5 h |
86
+ | Checkpoint choice | development set: step 30 of 15 and 30 (82 vs 77 of 152) | development set: step 60 of 20, 40, 60 (84, 86, 89 of 152) |
87
+ | Software | TRL SFT trainer, PEFT, bitsandbytes | TRL GRPO trainer (`dr_grpo`), Unsloth, vLLM rollouts |
88
+
89
+ On the development problems the base model solved 73 of 152 replies, the 15-step checkpoint 77 and the 30-step checkpoint 82 (53.9%). Over the GRPO run, the share of correct replies on the training prompts rose from 0.35 in the first ten steps to 0.71 in the last ten, the share cut off at 12,288 tokens fell from 0.32 to 0.06, the median reply fell from 12,287 to 10,502 tokens and the mean reward rose from 0.25 to 0.72.
90
+
91
+ ## Evaluation results
92
+
93
+ All figures below are on the 338 holdout problems of GeoTechBench release 0.4.1 (`holdout_v1`). Accuracy is the share of problems with every quantity correct, with a Wilson 95% interval. The proposed method is Qwen3.5-9B with the stage-1 adapter merged, the stage-2 adapter applied at run time, and a thinking-mode vote of 8 at temperature 0.8 and a 32,768-token limit.
94
+
95
+ It solved 256 of 338 (75.7%; cluster-bootstrap 95% CI 65.1–85.7), against 150 for the base model with greedy decoding, 208 for one base thinking reply, 245 for the self-distilled vote of 8, 245 for the Qwen3.8-27B non-thinking vote, and 280 for DeepSeek-V4.1-Flash. Single replies of the base, self-distilled and GRPO models at 32,768 tokens and temperature 0.6 solved 208, 210 and 208 problems. GRPO added 11 problems under voting with borderline evidence (22 gained against 11 lost; McNemar \(p = 0.080\), cluster bootstrap \(p = 0.016\), group sign-flip \(p = 0.038\); not significant after Holm correction, \(p = 0.321\)). Because no base-model thinking vote was run, the contribution of training under voting is unknown. pass@8 of the proposed samples is 287 (84.9%), an upper bound on any selection rule over the same samples, not a deployable method.
96
+
97
+ ### Holdout accuracy (paper Table 4)
98
+
99
+ | System | Inference | Limit | Correct | Accuracy, % (95% CI) | vs proposed |
100
+ | --- | --- | ---: | ---: | --- | --- |
101
+ | **Proposed** | vote of 8, \(T=0.8\) | 32,768 | **256** | **75.7 (70.9–80.0)** | β€” |
102
+ | pass@8 (upper bound) | any of the 8 samples | 32,768 | 287 | 84.9 (80.7–88.3) | β€” |
103
+ | Claude Opus 5.5 | agent + tools | CLI | 338 | 100.0 (98.9–100.0) | 0/82, \(p < 0.001\) |
104
+ | GPT-6.2-sol | agent + tools | CLI | 335 | 99.1 (97.4–99.7) | 1/80, \(p < 0.001\) |
105
+ | GPT-6.1-terra | agent + tools | CLI | 324 | 95.9 (93.2–97.5) | 5/73, \(p < 0.001\) |
106
+ | DeepSeek-V4.1-Flash | API, reasoning, no tools | 32,000 | 280 | 82.8 (78.5–86.5) | 23/47, \(p = 0.006\) |
107
+ | SD only | vote of 8, \(T=0.8\) | 32,768 | 245 | 72.5 (67.5–77.0) | 22/11, \(p = 0.080\) |
108
+ | SD + Dr.GRPO | one reply, \(T=0.6\) | 32,768 | 208 | 61.5 (56.2–66.6) | 59/11, \(p < 0.001\) |
109
+ | SD only | one reply, \(T=0.6\) | 32,768 | 210 | 62.1 (56.9–67.1) | 55/9, \(p < 0.001\) |
110
+ | Base | one reply, \(T=0.6\) | 32,768 | 208 | 61.5 (56.2–66.6) | 56/8, \(p < 0.001\) |
111
+ | Base | one reply, \(T=0.6\) | 14,336 | 159 | 47.0 (41.8–52.4) | β€” |
112
+ | Base (no thinking) | vote of 8, \(T=0.6\) | 8,192 | 186 | 55.0 (49.7–60.2) | 75/5, \(p < 0.001\) |
113
+ | + GRPO pilot (no thinking) | vote of 8, \(T=0.6\) | 8,192 | 188 | 55.6 (50.3–60.8) | β€” |
114
+ | Base (no thinking) | greedy | 8,192 | 150 | 44.4 (39.2–49.7) | 109/3, \(p < 0.001\) |
115
+ | + GRPO pilot (no thinking) | greedy | 8,192 | 146 | 43.2 (38.0–48.5) | β€” |
116
+ | + RFT (no thinking) | greedy | 8,192 | 143 | 42.3 (37.2–47.6) | β€” |
117
+ | + SFT on frontier solutions | greedy | 6,144 | 42 | 12.4 (9.3–16.4) | β€” |
118
+ | + distilled DeepSeek reasoning | thinking, one reply | 14,336 | 93 | 27.5 (23.0–32.5) | β€” |
119
+ | Qwen3.8-27B base | vote of 8, \(T=0.6\) | 8,192 | 245 | 72.5 (67.5–77.0) | 33/22, \(p = 0.18\) |
120
+ | Qwen3.8-27B base | thinking, one reply, budget forcing | 32,768 | 236 | 69.8 (64.7–74.5) | 51/31, \(p = 0.04\) |
121
+ | Qwen3.8-27B base | greedy | 8,192 | 206 | 60.9 (55.7–66.0) | 64/14, \(p < 0.001\) |
122
+ | Qwen3.8-27B base | thinking, one reply | 32,768 | 187 | 55.3 (50.0–60.5) | β€” |
123
+ | Qwen3.8-27B + GRPO pilot | greedy | 8,192 | 199 | 58.9 (53.6–64.0) | β€” |
124
+ | Qwen3.8-27B + RFT | greedy | 8,192 | 195 | 57.7 (52.4–62.8) | β€” |
125
+ | Qwen3.8-27B + SFT on frontier solutions | greedy | 8,192 | 70 | 20.7 (16.7–25.3) | β€” |
126
+ | Gemma-4-12B-it (FP8) | vote of 8, \(T=0.6\) | 8,192 | 146 | 43.2 (38.0–48.5) | 117/7, \(p < 0.001\) |
127
+ | Gemma-4-12B-it (FP8) | greedy | 8,192 | 117 | 34.6 (29.7–39.8) | β€” |
128
+
129
+ Notes from the paper: Claude Opus 5.5 was rerun on the 81 revised holdout problems, with the earlier run of the same agent used on the 257 unchanged ones. The 6,144-token SFT-on-frontier row is compared in the text with the base model at the same limit (141, 41.7%). Budget forcing gives a cut-off reply at most 1,024 further tokens to write its answer. β€œvs proposed” is problems the proposed method solved that the system did not, and the reverse, with the exact McNemar \(p\) value.
130
+
131
+ ### Results by method family (paper Table 6)
132
+
133
+ | Method family | Problems | Vote of 8 | pass@8 | Mean single | DeepSeek-V4.1-Flash |
134
+ | --- | ---: | ---: | ---: | ---: | ---: |
135
+ | Pile axial capacity | 62 | 52 | 53 | 43.2 | 52 |
136
+ | Pile groups | 36 | 27 | 27 | 25.1 | 30 |
137
+ | Retaining walls | 77 | 52 | 59 | 42.1 | 60 |
138
+ | Seepage | 41 | 34 | 40 | 29.9 | 38 |
139
+ | Shallow bearing capacity | 42 | 36 | 41 | 31.6 | 41 |
140
+ | Settlement and consolidation | 37 | 24 | 28 | 17.2 | 24 |
141
+ | Slope stability | 43 | 31 | 39 | 27.2 | 35 |
142
+ | **Total** | **338** | **256** | **287** | **216.5** | **280** |
143
+
144
+ ### Ablation of training stages and token budget (paper Table 7, excerpt)
145
+
146
+ Each single-reply row is one thinking-mode reply at temperature 0.6, scored at 14,336 and 32,768 tokens from the same generation; a reply counts only if it ended within the budget. Vote rows use temperature 0.8.
147
+
148
+ | Qwen3.5-9B | Correct | Accuracy, % (95% CI) | With budget forcing | Cut off, % |
149
+ | --- | ---: | --- | ---: | ---: |
150
+ | Budget 14,336 tokens | | | | |
151
+ | Base model | 154/338 | 45.6 (40.3–50.9) | 167 | 46.4 |
152
+ | Self-distilled (SD) | 163/338 | 48.2 (42.9–53.5) | 184 | 38.5 |
153
+ | SD + Dr.GRPO | 179/338 | 53.0 (47.6–58.2) | 194 | 32.8 |
154
+ | SD, vote of 8 | 218/338 | 64.5 (59.3–69.4) | 233 | 36.5 |
155
+ | SD + Dr.GRPO, vote of 8 | 231/338 | 68.3 (63.2–73.1) | 244 | 30.8 |
156
+ | Budget 32,768 tokens | | | | |
157
+ | Base model | 208/338 | 61.5 (56.2–66.6) | 208 | 7.1 |
158
+ | Self-distilled (SD) | 210/338 | 62.1 (56.9–67.1) | 211 | 7.7 |
159
+ | SD + Dr.GRPO | 208/338 | 61.5 (56.2–66.6) | 209 | 5.6 |
160
+ | SD, vote of 8 | 245/338 | 72.5 (67.5–77.0) | 245 | 4.4 |
161
+ | SD + Dr.GRPO, vote of 8 (proposed) | 256/338 | 75.7 (70.9–80.0) | 256 | 1.8 |
162
+
163
+ At 32,768 tokens the training stages made no difference to a single reply (208, 210 and 208). GRPO helped mainly by making samples finish under voting.
164
+
165
+ ## Hybrid routing and cost
166
+
167
+ A problem is answered by the local vote when at least \(t\) of its eight samples agree with the voted answer, and by the agent otherwise. Local vote cost is 0.0155 US dollars per problem (8.6 h on one RTX 5090 at 0.61 dollars an hour) plus the agent's list-price API cost on the routed problems. Agent costs are from earlier runs, one fresh session per problem.
168
+
169
+ **Headline result (cross-validated threshold).** Leave-one-group-out cross-validation on the holdout, with a 1-point tolerance versus the Claude agent, chose \(t=7\) for 45 groups and \(t=6\) for 3 groups. This keeps **173 of 338 problems local (51.2%)** and the hybrid solves **334/338 (98.8%) at 0.480 US dollars per problem**, against 0.910 for the Claude agent alone.
170
+
171
+ **In-sample \(t=6\) is optimistic.** Six agreeing samples, chosen on this holdout, keeps 201 problems local (59.5%), with local precision 98.0% (4 confident errors in 3 groups), and also solves 334/338 at 0.404 dollars. That cost is an optimistic estimate. The same 338 problems define both the threshold analysis and the reported results; these are sensitivity analyses, not out-of-sample estimates.
172
+
173
+ Dollar figures depend on cache billing. With a shared cached prefix, the Claude agent alone would cost about 0.187 dollars, and the proposed hybrid at \(t=6\) would cost 0.104 dollars (0.090 at \(t=5\)). A hosted cascade that keeps DeepSeek-V4.1-Flash's answer when it finished within its budget (291 problems) and sends the rest to Claude solves 327 problems at 0.146 dollars (0.042 with a shared prefix), with 11 confident errors. The local tier therefore pays off mainly where keeping problem data in the firm matters.
174
+
175
+ ### Hybrid with a frontier agent (paper Table 9)
176
+
177
+ | Threshold | Local problems | Local right, % | Hybrid correct | Accuracy, % (95% CI) | Cost per problem, US$ | Saving, % |
178
+ | --- | ---: | ---: | ---: | --- | ---: | ---: |
179
+ | Uncertain problems sent to the Claude Opus 5.5 agent | | | | | | |
180
+ | \(t=3\) | 276 | 88.4 | 306/338 | 90.5 (86.9–93.2) | 0.198 | 78 |
181
+ | \(t=4\) | 248 | 93.5 | 322/338 | 95.3 (92.4–97.1) | 0.276 | 70 |
182
+ | \(t=5\) | 225 | 95.6 | 328/338 | 97.0 (94.6–98.4) | 0.339 | 63 |
183
+ | \(t=6\) (in-sample choice, optimistic) | 201 | 98.0 | 334/338 | 98.8 (97.0–99.5) | 0.404 | 56 |
184
+ | \(t=7\) | 169 | 98.2 | 335/338 | 99.1 (97.4–99.7) | 0.491 | 46 |
185
+ | \(t=8\) | 128 | 99.2 | 337/338 | 99.7 (98.3–99.9) | 0.600 | 34 |
186
+ | agent alone | 0 | β€” | 338/338 | 100.0 (98.9–100.0) | 0.910 | β€” |
187
+ | Cross-validated threshold (headline) | 173 | β€” | 334/338 | 98.8 (97.0–99.5) | 0.480 | β€” |
188
+ | Uncertain problems sent to the GPT-6.1-terra agent | | | | | | |
189
+ | \(t=6\) | 201 | 98.0 | 322/338 | 95.3 (92.4–97.1) | 0.044 | 32 |
190
+ | agent alone | 0 | β€” | 324/338 | 95.9 (93.2–97.5) | 0.065 | β€” |
191
+ | local vote alone | 338 | 75.7 | 256/338 | 75.7 (70.9–80.0) | 0.016 | β€” |
192
+
193
+ ### Routing baselines with Claude fallback (paper Table 10, excerpt)
194
+
195
+ Vote-agreement routing, solved of 338 / cost per problem in US$ (fresh-session agent pricing):
196
+
197
+ | Local tier | \(t=4\) | \(t=5\) | \(t=6\) | \(t=7\) | \(t=8\) |
198
+ | --- | --- | --- | --- | --- | --- |
199
+ | Proposed: SD + Dr.GRPO, thinking vote of 8 | 322 / 0.276 | 328 / 0.339 | 334 / 0.404 | 335 / 0.491 | 337 / 0.600 |
200
+ | SD only, thinking vote of 8 | 315 / 0.268 | 322 / 0.350 | 330 / 0.426 | 334 / 0.488 | 334 / 0.592 |
201
+ | Base 9B, non-thinking vote of 8 | 324 / 0.519 | 331 / 0.576 | 335 / 0.641 | 336 / 0.700 | 338 / 0.777 |
202
+ | Base 27B, non-thinking vote of 8 | 309 / 0.285 | 316 / 0.340 | 325 / 0.416 | 332 / 0.525 | 335 / 0.658 |
203
+ | Base 9B, thinking vote of 8 | not run | not run | not run | not run | not run |
204
+
205
+ Single-reply routing (keep the reply if it finished within its budget):
206
+
207
+ | First tier | Kept | Solved | Confident errors | Cost, fresh | Cost, shared prefix |
208
+ | --- | ---: | ---: | ---: | ---: | ---: |
209
+ | DeepSeek-V4.1-Flash (hosted API) | 291 | 327 | 11 | 0.146 | 0.042 |
210
+ | Base 9B, one thinking reply | 314 | 232 | 106 | 0.070 | 0.018 |
211
+ | SD + Dr.GRPO, one thinking reply | 319 | 227 | 111 | 0.057 | 0.015 |
212
+ | Proposed vote, \(t=5\) (comparison) | 225 | 328 | 10 | 0.339 | 0.090 |
213
+ | Proposed vote, \(t=6\) (comparison) | 201 | 334 | 4 | 0.404 | 0.104 |
214
+ | Claude agent alone | 0 | 338 | 0 | 0.910 | 0.187 |
215
+
216
+ ## Limitations
217
+
218
+ - **No base thinking-vote control.** The base model was never sampled eight times in thinking mode, so the contribution of training under voting, and to routing, is unknown. This is the paper's most important experimental gap.
219
+ - **One agent run, one seed.** Each condition was run once. Two single-reply runs of the base model differed by five problems, so differences of that size are noise; the GRPO gain of 11 problems under voting is of similar size. Agents ran once with default settings and one fresh session per problem. Training used one seed, one data set and one set of hyperparameters per stage. Latency of a single problem was not measured.
220
+ - **Threshold chosen on the evaluation holdout.** The routing threshold was cross-validated only over groups of the same 338 holdout problems, with a tolerance the authors chose. The in-sample \(t=6\) result is optimistic. Figures need confirmation on new problems.
221
+ - **Benchmark scope.** The 338 holdout problems form only 48 template groups; resampling whole groups widens the proposed method's 95% interval from 70.9–80.0 to 65.1–85.7%. The problems test the calculation step of hand methods for common design checks in US government manuals, mostly in US customary units. They do not test numerical analysis, site characterisation, judgement under uncertain ground conditions, Eurocode 7, AASHTO LRFD, or other national practice. Every statement names the convention that changes its answer, so the benchmark tests execution of a stated method rather than the choice of method and parameters. Success on these problems does not establish that a model can be trusted with design. The Claude agent's tools include verified design modules; overlap with the benchmark's generator or solver was not tested, so the agent's accuracy, and with it the hybrid's, may be inflated.
222
+ - **FHWA overlap.** Five holdout problems share an FHWA NHI-06-089 worked example with training problems: GT-001 (Example 8-1), GT-009 (Example 8-2), GT-018 (Example 9-4), and GT-020 and GT-021 (Example 9-6). The proposed method solved all five with eight agreeing samples. Without them (333 problems, 43 groups) the proposed method solves 251 (75.4%, cluster CI 64.3–85.2%), the SD-only vote 240 and DeepSeek 275; at \(t=6\) the local answers are right on 192 of 196 (98.0%) and the hybrid solves 329 at 0.410 dollars, and the cross-validated threshold gives 329 at 0.487 dollars, so no conclusion changes.
223
+ - **Dollar costs depend on billing.** With a shared cached prefix the agent alone would cost about 0.187 dollars, and the hybrid's saving shrinks. A hosted DeepSeek-to-agent cascade is cheaper (327 at 0.146 dollars). Reported costs leave out electricity, capital cost, idle time and the engineer's review time.
224
+
225
+ ## Intended use and out-of-scope use
226
+
227
+ **Intended use.** These adapters are for research and for private, on-premises assistance with routine geotechnical design calculations of the kind in GeoTechBench: bearing capacity and settlement of footings, axial capacity of piles and pile groups, earth pressure on retaining walls, seepage under a structure, and the factor of safety of a slope. The intended inference setup is a thinking-mode vote of 8, optionally routing low-agreement problems to a frontier agent so that a design office can keep a share of problem data inside the firm.
228
 
229
+ **Out of scope.** This model is **not a substitute for a licensed engineer's checks**. Outputs must be reviewed by a qualified engineer before they are used in design. The system is not intended for numerical analysis, site characterisation, or judgement under uncertain ground conditions, and the benchmark does not test Eurocode 7, AASHTO LRFD, or the choice of method and parameters when the convention is not stated in the problem. It is also not a general-purpose chatbot.
 
 
230
 
231
  ## Usage (PEFT)
232
 
 
299
  ## Citation
300
 
301
  ```bibtex
302
+ @article{youwai2026geotechslm,
303
+ author = {Youwai, Sompote},
304
+ title = {A local small language model with frontier-agent fallback for geotechnical design calculations},
305
+ journal = {under review},
306
+ year = {2026},
307
+ note = {King Mongkut's University of Technology Thonburi (KMUTT)}
308
  }
309
  ```