gpt-oss-20b as a dependable web→JSON extractor with Halo GRPO
Track: ft-gpt-oss · Team lead: @rjaat
Model: RJaat/gpt-oss-20b-web-extract-lora (LoRA on gpt-oss-20b, BF16)
Data: RJaat/web-extract-v1
First entry from this team: the same task on Qwen3-4B, ft-hf track —
writeup
1. What we did and why
We post-train gpt-oss-20b with Halo so it turns a messy web page into schema-valid JSON for three families — product, job, recipe — running locally.
The base model is a capable reasoner but an unreliable formatter on this task: it scores 0.652 field-F1 on held-out pages from unseen domains, and only 83.6% of its answers are schema-valid, because it reasons in prose before emitting JSON and sometimes never closes the object. We fix that with offline GRPO on a verifiable reward, without touching its general ability.
| Metric (hard set, 75 unseen-domain pages) | Base | Tuned |
|---|---|---|
| Field-F1 | 0.652 | 0.704 |
| Schema-valid | 0.836 | 0.876 |
| Fresh items (new seed) | 0.880 | 0.908 |
| General ability (40 items) | 0.675 | 0.700 |
2. Method
Halo offline GRPO, 3 epochs on 160 prompts × 8 sampled completions, LoRA r=64 α=128.
r = clip(0.4 · schema_valid + 0.5 · field_F1 − 0.1 · fabrication, 0, 1)
- schema_valid — the first balanced JSON object parses and validates against the family schema.
- field_F1 — micro-F1 over leaf values with money/K-notation normalisation.
- fabrication — fraction of non-null values unsupported by the page text.
Data, prompts and evaluation are the ones from our ft-hf entry (243 scraped pages →
247 schema-validated gold labels → 115 real + 350 synthetic training rows; near-duplicate
clusters kept whole and a family-stratified split). This is disclosed deliberately:
the task and dataset are shared, the model and every training run here are new.
Two engineering notes that matter for this family
- Hopper, not Blackwell. Halo's gpt-oss GRPO configs pin
flash_attention_4, which the H100 image does not carry, and RL cannot fall back to SDPA because it drops the attention sinks this model needs. Passingflash_attention_3makes the run work on Hopper. Verified: 20-step gate, then the full 3-epoch run,ep_size=1, single GPU. - Attention-only LoRA. Halo's default LoRA target list also adapts
mlp.experts.{gate,up,down}_projon this MoE model, and vLLM refuses to load expert LoRA weights. Restricting LoRA toq,k,v,okeeps the adapter loadable by vLLM and PEFT, so both the fast evaluation path and the judge'stransformerspath work.
3. Results
Three seeds (0, 1, 2), temperature 0.7, top-p 0.95, 2048 new tokens (the model reasons before answering; a 1024-token budget truncated both base and tuned and understated both).
| Eval set | Metric | Base | Tuned | Δ |
|---|---|---|---|---|
| real v2 hard (75 pages, unseen domains) | field-F1 | 0.652 | 0.704 | +0.052 |
| real v2 hard | schema-valid | 0.836 | 0.876 | +0.040 |
| real v1 (26 pages) | field-F1 | 0.592 | 0.657 | +0.065 |
| fresh items, seed 4242 (120 items) | field-F1 | 0.880 | 0.908 | +0.028 |
| general ability (40 items) | overall | 0.675 | 0.700 | +0.025 |
General ability did not degrade — math improved (0.8 → 0.9) while knowledge, instruction following and tool-use calls were unchanged. The model gained formatting discipline without losing what it knew.
The gain is smaller than on the 4B model because gpt-oss-20b starts from a higher ceiling: its failures were mostly format failures, which the reward fixes cheaply, rather than extraction errors.
4. Reproduce
# train (1× H100, ~16 min)
torchrun --nproc_per_node=1 scripts/training/grpo/offline.py \
extraction/configs/track2-grpo.yaml
# evaluate base and tuned on the hard held-out set
python3 extraction/eval_extract.py --model unsloth/gpt-oss-20b-BF16 \
--data extraction/data/eval_real_v2.jsonl --seeds 0 1 2 --max-new-tokens 2048
python3 extraction/eval_extract.py --model unsloth/gpt-oss-20b-BF16 \
--adapter RJaat/gpt-oss-20b-web-extract-lora \
--data extraction/data/eval_real_v2.jsonl --seeds 0 1 2 --max-new-tokens 2048
Rollouts are checked in (extraction/data/rollouts_gptoss.jsonl), so training needs no
rollout server and no API key.
5. Third-party materials
| Material | Use | Licence |
|---|---|---|
gpt-oss-20b (unsloth/gpt-oss-20b-BF16) |
base model | Apache-2.0 |
| 8 scraped sites (marketplace sandbox, two job boards, five recipe blogs) | page text | site terms |
| openai/gpt-oss-20b, gpt-oss-120b via OpenRouter | gold labels | Apache-2.0 |
Halo 1.3.0 (competition branch) |
training framework | Halo Licence |
6. Platforms used
| Platform | What we used it for |
|---|---|
| Modal | Training and evaluation on 1× H100: 3-epoch offline GRPO, rollouts, base-vs-tuned eval |
| HuggingFace | Hosts the adapter, the dataset, and this writeup |
Labelling, scraping and the annotator-agreement study for the shared dataset are disclosed in full in the ft-hf writeup; they are not claimed again for this entry.
7. Limitations
- The base model's prose reasoning consumes tokens before the JSON; pages that need very long answers can still truncate.
- Attention-only LoRA leaves the MoE experts untouched — full-expert adaptation would likely help job posts, but the resulting adapter cannot be served by vLLM.
- Shared dataset with our
ft-hfentry (same task, different model): an independent annotator agrees with the gold on 87.3% of leaf values, which bounds achievable F1. - Three schema families only; no multilingual or PDF input.
Built with Halo. Competition: Participant Guide.