Three AI Models Walked In and Designed Their Own OCR Networks From Scratch
Based on: LLM-Driven AutoML for Cross-Lingual Handwritten OCR: Closed-Loop Neural Architecture Search with GPT-5, GPT-4o, and Claude Sonnet 4 — Mobina Kashaniyan, Amirhossein Ghassemi, Nasser Mozayani
Picture the usual way a research team builds a handwriting recognizer. Someone reads twenty papers, picks a convolutional backbone, argues with a labmate about whether to bolt on an attention layer, runs a hyperparameter sweep overnight, and repeats that loop for weeks. Now picture skipping all of it: you hand GPT-5 a pile of Arabic, Persian, and English handwriting samples and a training script, and it designs the network itself, trains it, looks at the score, and redesigns it, over and over, with no human touching the architecture at any point.
That's what a new paper from researchers at Iran University of Science and Technology actually did. Not as a thought experiment, but as 270 separate runs across three models: GPT-5, GPT-4o, and Claude Sonnet 4. Each one acted as its own independent "architect," proposing a neural network, watching it train, reading the results, and adjusting course for the next attempt. No human picked the layer count. No human tuned the learning rate. No human wrote language-specific preprocessing for Arabic's connected letters or Persian's extra diacritics.
The best model they produced hit 98.1 percent accuracy. The average across all 270 runs stayed above 93 percent. And the resulting networks ran inference in 41 to 44 milliseconds, fast enough for a real product, not just a benchmark table. Whether that's a genuinely new capability or a fancy way of doing what AutoML tools already did is worth digging into, because the answer changes what you should take away from it.

Why Arabic, Persian, and English handwriting don't play by the same rules
Handwriting recognition is already harder than reading printed text, and cross-lingual handwriting recognition multiplies the difficulty. English cursive varies wildly by writer, but at least the letters are separate, upright-ish shapes with fixed forms. Arabic and Persian break most of the assumptions a model trained on English handwriting would rely on.
Both scripts are written right to left, and most letters change shape depending on whether they sit at the start, middle, or end of a word, since they connect to their neighbors like a single flowing stroke rather than discrete blocks. Small dots above or below a letter are often the only thing distinguishing one character from another, so a slight smudge or a rushed pen stroke can flip a b into a t. Persian adds its own extra letters and diacritic conventions on top of the Arabic base alphabet, meaning a model tuned for Arabic doesn't just transfer over.
Traditionally, handling three scripts this different means three separate pipelines: different preprocessing, different segmentation logic, sometimes different model families entirely. That's a lot of standing infrastructure to maintain, and it's exactly why "one model, three scripts, no manual tuning" is the interesting claim in this paper, not the accuracy number by itself.
How you actually get an AI to design its own neural network
The setup the researchers describe is a closed loop, meaning the output of each step feeds directly into the input of the next one with no human in between. Here's the shape of it:
- The LLM is given a task description (recognize handwritten text in a target language) and asked to propose a neural network architecture as code.
- That architecture gets trained on the handwriting dataset.
- The training results (accuracy, loss, maybe latency) get fed back to the same LLM.
- The LLM reads those results and proposes a revised architecture, trying to fix whatever went wrong or push accuracy higher.
- Repeat.
This is a known technique called neural architecture search (NAS), which normally works by having an algorithm mechanically try thousands of small variations on a network and keep whatever scores best. What's different here is that the "algorithm" doing the proposing is a general-purpose language model reasoning in something closer to plain language about what to try next, instead of a purpose-built search procedure. Think of the difference between a genetic algorithm mutating architectures at random and a colleague looking at your last three experiments and saying "the accuracy dropped when you added that extra pooling layer, let's try widening the convolutions instead." One is blind trial and error at scale. The other is closer to reasoning, or at least reasoning-shaped text generation.
Running this 270 times across three different models is what makes the paper more than an anecdote. It's evidence that the loop works somewhat consistently rather than nailing it once and writing a paper about the lucky run.
What the abstract doesn't spell out, and this matters, is exactly how those 270 runs split across the three models and three languages, what the actual discovered architectures look like, how big the datasets were, or how GPT-5's proposals compared directly to Claude Sonnet 4's on the same task. Those are the details that would tell you whether one model is a notably better "architect" than the others, and right now that comparison isn't public.
The numbers: 93 percent average, 98.1 percent best, and a 44-millisecond gut check
Strip away the process and look at what came out the other end. Mean test accuracy above 93 percent across 270 independent experiments is a solid floor, not a cherry-picked ceiling. It suggests the closed loop reliably converges on something workable rather than occasionally striking gold.
The 98.1 percent best-case number is the one that'll get quoted, and it's genuinely strong for cross-lingual handwritten text, a category where printed-text OCR systems (which are already mature and highly accurate) don't even attempt to compete, because handwriting is a different problem entirely. For context, human transcribers reading messy handwriting in an unfamiliar script make mistakes too. Getting a fully automated pipeline into that range without a human ever touching the architecture is a real result.
The latency number might be the most practically important detail in the whole abstract. A model that scores 98 percent but takes two seconds per image is a research curiosity. One that runs in 41 to 44 milliseconds is fast enough to sit behind an API and process a scanned form while someone waits for the response. That's the difference between "impressive demo" and "thing you could actually ship."
What's missing, and it's a real gap, is a language-by-language and model-by-model breakdown. An average north of 93 percent could mean all three languages cluster tightly around that number, or it could mean English pulls the average up while Arabic or Persian lag behind. Without that split, you can't tell whether the "cross-lingual" claim holds evenly or whether one script is doing the heavy lifting.

Why it matters for anyone building or choosing OCR
If you're evaluating OCR engines for a product, the headline finding here isn't really "AI can hit 98 percent on handwriting." It's that the process of building a specialized recognizer for a new script or domain might be getting cheaper to bootstrap. Today, if you need a handwriting recognizer for a language nobody's built good tooling for yet, you're looking at a research project: gather data, hire someone who knows the script, iterate on architecture for months. A closed loop like this points toward a future where that first pass takes days instead of months, with a general-purpose model doing the initial architecture search before a human takes over for refinement.
That said, a few things are worth keeping in perspective before you get excited about "AI designs its own OCR model" as a product feature:
- This is architecture search, not a shipped product. The paper demonstrates that LLMs can propose and refine network designs. It says nothing about how these models handle noisy real-world scans, coffee stains, low-resolution phone photos, or the sheer variety of handwriting quality you'd see from actual users rather than a curated benchmark.
- Closed-loop AutoML has existed for years without LLMs. Neural architecture search is not new. What's new is swapping the search algorithm for a language model. Whether that swap produces meaningfully better architectures than existing NAS methods, or just architectures a human finds easier to read and reason about, isn't something the abstract settles either way.
- Three languages is not "cross-lingual" in the way a production system needs. Real document pipelines see dozens of scripts, mixed-language pages, and handwriting layered with printed text or stamps. Arabic, Persian, and English are a meaningful and genuinely hard test set, but they're not a stand-in for the full range a general OCR product has to handle.
For a platform like ours, built around comparing OCR engines head to head, the practical takeaway is to watch this space rather than expect it in production tomorrow. If closed-loop, LLM-driven architecture search turns out to generalize past these three languages and past clean benchmark data, it could shrink the time it takes new engines to reach competitive accuracy on underserved scripts. That's the kind of development that eventually shows up as a new option in a comparison table, not as a research abstract.
What the paper doesn't tell us yet
Read generously, this is a genuinely clever demonstration that a general-purpose LLM can substitute for a hand-built NAS algorithm and get respectable results without a human architect. Read skeptically, it's an abstract light on the details that would let anyone verify or reproduce the claims.
We don't know the dataset sizes or sources, which matters enormously for handwriting recognition since accuracy numbers swing wildly depending on whether a benchmark uses clean, single-writer samples or the messy multi-writer sets that resemble what a real product would see. We don't know how the 270 experiments split across the three models and three languages, so there's no way to tell if GPT-5 outperformed Claude Sonnet 4 as an architecture designer, or if one language dragged the average down while the others carried it. There's no comparison to existing NAS methods or to hand-designed handwriting recognizers, so "this is better than what came before" isn't something the abstract actually claims, even though it's the natural reading. And there's no discussion of compute cost: running 270 full training loops, each preceded by an LLM call, is not free, and knowing whether this approach is efficient enough to matter commercially depends entirely on numbers that aren't in front of us.
None of that erases the interesting part. Using a general-purpose LLM as an iterative architecture designer, rather than building a bespoke search algorithm for each new task, is a real shift in how NAS could work going forward. It's just worth remembering that a strong average accuracy and a fast inference number are the beginning of an evaluation, not the end of one. The paper that would actually convince a production team to adopt this approach is the one with the dataset details, the per-language breakdown, and a head-to-head against the NAS methods already in use. Until that version shows up, this is a promising proof of concept, not a settled result.