Report index

A 2B parser that outperforms its 30B teacher on retrieval

An engineering account of how we used a 30B teacher once, served the task with a 2B student, and checked whether parsing gains survived downstream retrieval.

Harrison Kim 김형섭
AI Research Engineer, WIGTN
WigtnOCR on Hugging Face
01Problem

The output looked readable. Retrieval told a different story

Korean public documents combine scans, multi-column layouts, forms, charts, stamps and dense tables. We learned quickly that readable text alone was not the useful output. The structure had to survive long enough for retrieval to recover it.

A parser can look visually clean and still remove the value that answers a user’s question. That gap changed the evaluation plan: WigtnOCR separates intrinsic parsing quality from downstream retrieval quality instead of compressing both into one headline score.

OmniDocBench measures text, tables, formulas and reading order. KoGovDoc then holds the retriever and chunking policy fixed and measures how much answer-bearing content remains recoverable after parsing.

WigtnOCR benchmark highlights
FIG.Parsing and retrieval highlights from the released WigtnOCR evaluation, shown together because the report's argument is that the two do not move together. Lower is better for NED; higher is better for TEDS and retrieval metrics.
02Alternatives

Four kinds of parser, and what each one loses on a Korean government PDF

The model exists because the four things you would reach for first each fail differently on this corpus.

Plain OCRReads characters, not documents

It recovers text and drops the structure that says which value belongs to which field. PaddleOCR, the one measured here, returned between a third and a thirtieth of the text the deployed model did, losing most tables, forms and multi-column layouts.

Rule-basedFast, and structurally blind

PyMuPDF4LLM extracts quickly and recognises almost no structure: the article-clause-item hierarchy in a statute, and any page mixing a table with a diagram and prose, come out flat. Not the whole family, though. Marker is rule-based and leads text accuracy and reading order in the comparison two sections down.

Recent VLM parsersTrained on other people's documents

The current open VLM parsers are trained mostly on English and Chinese material. Korean government documents bring complex tables, forms, official seals, scanned pages mixed with digital ones, and multi-column layouts they were not tuned for.

A 30B VLMGood, and not deployable here

Parsing quality is high, but it needs two GPUs and is slow to serve. The project's constraint was the GPU budget, and a 2B model meets it: one GPU to serve, and an edge deployment that is actually realistic.

03Method

Use the 30B teacher offline and serve the 2B student

The practical decision was to spend the large-model budget during data creation, not on every document served. The 30B model creates structured supervision offline; production inference runs through the 2B student.

Stage 01Generate

Qwen3-VL-30B-Instruct converts 4,501 page images from 49 documents into structured Markdown.

Stage 02Judge

Qwen3.5-122B scores structure, table quality, completeness, hallucination and consistency.

Stage 03Filter

Low-quality pages are removed, document imbalance is corrected, and 294 government pages are held out.

Stage 04Distill

Qwen3-VL-2B-Instruct is fine-tuned with LoRA rank 8 / alpha 32 for three epochs using ms-swift and ZeRO-2.

Released training corpus

SourceDocumentsPagesRole
KoGovDoc103,637Domain adaptation
ArXiv39864Layout diversity
Total494,501Teacher generation
04Supervision

The judge reads text only, and that is the point

A 122B text-only model scored every generated page on five dimensions: structure, table quality, completeness, hallucination and consistency. It never sees the source image, and that is deliberate rather than a shortcut.

A vision model grading a vision model's output shares its visual interpretation bias, so the two agree on the same misreading and the evaluation closes a loop instead of testing anything. Separating the judge into a text-only model asks a different question: not whether this matches the image, but whether this output is usable as training data at all. Repetition loops, truncated text and leaked reasoning are all detectable from the text alone.

Scores run one to five and anything below three was dropped. 75.1% of the Korean government pages cleared that bar, and 73.8% of the arXiv pages.

05Data

Two things wrong with the corpus before any training ran

  • 01One document accounted for 53% of the pages. A model trained on that learns that document rather than the domain, so a per-document ratio cap of 0.25 was applied.
  • 02The reasoning teacher had left English thinking traces inside some of the generated Markdown. Twenty pages were deleted outright and 257 were repaired.
  • 03What survived: 2,667 training pages and 294 held out and excluded from training. The split is at page level; the source does not establish that a held-out page never shares a document with a trained one.
06Intrinsic evaluation

The student improves tables without winning every metric

WigtnOCR matches the teacher on text NED and substantially improves table TEDS, while the teacher remains stronger on formula CDM.

OmniDocBench comparison chart
FIG.OmniDocBench comparison across the 30B teacher, base 2B, Marker and WigtnOCR.

OmniDocBench selected metrics

ParserText NED ↓Table TEDS ↑Formula CDM ↑Order NED ↓Skip ↓
Qwen3-VL-30B0.2890.5230.9390.2275.5%
Qwen3-VL-2B0.3640.5610.8650.30018.8%
Marker0.2180.5860.8630.1650.4%
WigtnOCR-2B0.2880.6490.8840.2115.8%
07Ablation

A bigger adapter made the tables worse

At this data size, rank 8 beat rank 32. The larger adapter improved formula CDM slightly and regressed the structure preservation the model exists for.

Rank 32 costs 4.9 points of Table TEDS and 2.1 points of text NED, which is an error metric, so that is a regression too. Five epochs overfits: validation loss turns up, and the table metric does not return to rank 8's level.

The tempting row is v2 at five epochs, which reaches a 0% skip rate. It gets there by producing something for every page rather than by parsing better, and the parsing metrics say so. The deployed model keeps a 5.8% skip rate and the table quality, which is the trade this corpus rewards.

LoRA configuration against OmniDocBench

ConfigRankEpochsText NED ↓Table TEDS ↑TEDS-S ↑CDM F1 ↑RO NED ↓Skip % ↓
v1, deployed830.2880.6490.7320.8840.2115.8%
v2, best3230.3090.6000.697not run0.2150.7%
v2, last3250.3060.6100.6950.8920.2140.0%
08Downstream evaluation

Cleaner chunks do not automatically retrieve better

MinerU produces the strongest boundary metrics but ranks fifth in retrieval. WigtnOCR preserves more answer-bearing structure and leads Hit@1, Hit@5 and MRR@10.

Boundary Clarity compared with retrieval Hit at 1
FIG.Boundary quality and retrieval diverge: intrinsic chunk cleanliness is not a substitute for end-to-end evaluation.
KoGovDoc retrieval results
FIG.Six-parser KoGovDoc retrieval comparison using the same semantic chunking and BGE-M3 retrieval pipeline.

KoGovDoc retrieval, 564 queries

ParserHit@1 ↑Hit@5 ↑MRR@10 ↑nDCG@10 ↑
WigtnOCR-2B0.7390.8550.7880.437
Qwen3-VL-30B0.7160.8390.7710.411
Marker0.7110.8530.7710.412
Qwen3-VL-2B0.7090.8140.7560.444
MinerU0.6080.7890.6820.384
PaddleOCR0.5120.6930.5920.293
09Failure analysis

What did not transfer cleanly

  • 01Formula CDM remains below the 30B teacher, so the compact model should not be presented as uniformly better.
  • 02Five of 294 KoGovDoc validation pages failed to produce evaluable output.
  • 03Qualitative examples still contain character-level OCR errors even when chart and table structure improves.
  • 04The retrieval result is specific to Korean government documents, BGE-M3 and the released chunking policy.
  • 05No controlled throughput, energy or serving-cost comparison has been released.
10Limitations

Where the claim stops

  • L01KoGovDoc represents one Korean government-document distribution and one retrieval stack.
  • L02Pseudo-label filtering reduces weak supervision but does not turn generated labels into human ground truth.
  • L03The release supports a parameter-count claim; it does not yet support a precise speed or cost-reduction claim.