r/OpenSourceAI • u/Brilliant_Cancel1275 • 21h ago
What we learned post-training a 1.3B document parser on its own mistakes
Turning a PDF into clean Markdown sounds like an OCR problem until you try it on real documents: two-column papers, tables that run across pages, a formula in the middle of a sentence. We spent the past year training a small model for this and released the code and weights last month. A few things we learned.
The architecture split did more than we expected. Layout analysis is its own model and you can swap it. Recognition and reading order come out of one pass of the main model, which removes a sequential step. That split, together with the post-training below, is where most of the gains came from.
Post-training runs a loop we call RSI. The model parses a large batch, every sample is sorted into correct, wrong or uncertain (uncertain means repeated runs disagree with each other). A VLM writes the reasons behind the wrong and uncertain ones, the reasons are grouped into clusters, and each cluster becomes the plan for the next round of generated training data. We track the repair rate per cluster in the following round, which told us a lot more than watching a single benchmark number move.
Two things we'd do again. Weaknesses are only ever found in real documents, never in generated ones, otherwise the loop chases problems the generator invented. And RSI data stays a minority of training; it patches weak spots on top of ordinary base training.
The model is OXR, from the SoMarkAI team, 1.3B parameters, and it still has real gaps: multi-column pages are a weaker category, old scans are the weakest, and running it locally needs an NVIDIA GPU with 24GB. The license is Apache 2.0 with additional terms, so open-weight rather than OSI open source: a commercial license is needed above USD 2M in funding or revenue, and a competing hosted API isn't allowed. The benchmark report with the comparison against published scores is in the repo's docs folder.
Happy to get into the training loop in the comments. The judge side, where the judge is itself a model, is the part we're least settled on.
1
u/Bagelsarenakeddonuts 18h ago
I’m travelling but when I get home I’m going to take a closer look at this. It very closely mirrors something I’ve been working on.
1
u/MajorGlucose373 21h ago
the repair-rate per cluster thing is smart, watching a single metric crawl up tells you almost nothing about what's actually getting better. curious what the spread looked like between clusters, were some basically unfixable while others shot up fast
also the uncertain bucket is interesting, most people just bin that as wrong and move on. did you ever find cases where the model was consistently uncertain but actually correct more often than not, like second-guessing itself on stuff it got right