RESEARCH WRITEUP HALO GRPO

Making Qwen3-4B a dependable web→JSON extractor with Halo GRPO

ft-hf track · Team lead: @rjaat · Built with Halo

What we did and why

We built a local 4B model that turns messy web pages into schema-valid JSON across three families: product, job, and recipe.

The base model is sloppy: it drops list items, misreads prices in prose, and invents missing values.

We post-trained it with Halo to make extraction more accurate, schema-valid, and grounded in the page.

Method

r = clip(0.4·schema_valid + 0.5·field_F1 − 0.1·fabrication, 0, 1)
  • schema_valid = parses + validates against family schema.
  • field_F1 = micro F1 over leaf values with money/K-notation normalisation.
  • fabrication = fraction of non-null values unsupported by the page.
SourceRoleRows
8 real sites scraped with Firecrawlreal pages with provenance243 pages
gpt-oss-20b / 120b via OpenRoutergold labels + noise variants247 labels
seeded generatorsynthetic training pages350 rows
programmatic noise injectionlayout robustness75 variants

Every gold label was schema-validated and every value verified against its page. Near-duplicate clusters were kept whole, with a family-stratified split so no cluster spans train/eval.

Results

Eval setMetricBaseTunedΔ
real v2 hard (75 pages, unseen domains)field-F10.6250.778+0.153
real v1 (26 pages)field-F10.6390.838+0.199
fresh items, new seed 4242 (120 items)field-F10.9100.991+0.081
real v2 hardschema-valid0.9911.000+0.009
real v2 hardfabrication0.00560.0034−0.002
general-ability check (40 items)overall0.9250.9250

Three seeds (0, 1, 2), temperature 0.7.

See the difference

Page: Nordic Pulse Headphones 210 — $149.99, in stock. Weight 850 g. Warranty 2 years.

Base Qwen3-4B

{
  "name": "Nordic Pulse Headphones 210",
  "price": 149.99,
  "currency": "USD",
  "availability": "in_stock",
  "specs": {
    "Weight": "850 g"
  }
}

Tuned (Halo GRPO)

{
  "name": "Nordic Pulse Headphones 210",
  "price": 149.99,
  "currency": "USD",
  "availability": "in_stock",
  "specs": {
    "Weight": "850 g",
    "Warranty": "2 years"
  }
}

The base model drops the warranty field; the tuned model keeps every stated field and invents none.

How to reproduce

torchrun --nproc_per_node=1 scripts/training/grpo/offline.py extraction/configs/extraction-offline-grpo.yaml
python3 extraction/eval_extract.py --model Qwen/Qwen3-4B-Instruct-2507 --data extraction/data/eval_real_v2.jsonl --seeds 0 1 2

Platforms used

PlatformWhat we used it for
Modalall training and evaluation, 1× H100, offline GRPO
Firecrawlscraped 243 real pages from 8 sites, under 300 credits
OpenRoutergold labelling and noise variants with gpt-oss-20b/120b
BasetenModel APIs: GLM-5.3-Flash re-labelled 90 pages as an independent annotator (87.3% leaf agreement)
White Circle2 honesty policies scored 4,488 GRPO completions, 173 flagged
Lovablehosts this writeup
HuggingFacemodel, datasets, writeup mirror