NER: general vs fine-tuned, and when to switch
Start with a general NER model to learn what you need. Fine-tune a small model once your entities are specific to your domain, and handle negation and context separately.

We replaced a cloud LLM pipeline with small, fine-tuned AI models that code a chart in about a minute on an ordinary CPU, with better HCC capture and no patient data leaving the building.
"Risk adjustment coding is a reading job. A missed code costs money, and an unsupported one creates audit risk."
A coder opens a patient's chart, often hundreds of pages of progress notes, scanned faxes, lab reports and medication lists, and finds every chronic condition the provider actually addressed at a visit. Each becomes an ICD-10 code, and codes that map to HCCs drive how a health plan is paid.
Typed, scanned and copy-forwarded text mixed together; one condition on twenty pages, mostly as history.
Only current, supported conditions count. "History of", "rule out" and "denies" do not.
Every code needs its date of service and pages, not just a list.
Charts reviewed by the hundred thousand: dollars or minutes per chart don't scale.
Instead of one large model doing everything, we split coding into the steps a human coder takes and used the smallest AI component that does each step well.
Text layer first, OCR only on scans; tables become sentences
Biomedical NER marks every disease mention
Medical embeddings search the full ICD-10-CM catalogue
Negation, history, combination codes, excluded pairs
Fine-tuned model asks: would a coder code this?
A learned model picks the date that starts each visit
A private coding engine that proposes codes with their evidence, so coders review in seconds instead of re-reading the chart.
Page, sentence, TAMPER support and V24 / V28 HCCs.
Every code comes from the ICD-10-CM catalogue.
A threshold trades recall for fewer suggestions.
AI supports the coder rather than replacing them.

The whole system ships as one container with every model inside it, so accurate medical coding runs on commodity CPUs inside the client's own environment.
See the results
Measured at chart level against professional coders' results, on charts held out from all training.
~20 min down to ~1 min per chart, on CPU.
Down from ~$0.31 per chart.
Recall / precision, up from 73% / 70%.
Up from 51%, at 75% precision.
| Cloud LLM pipeline | MedGemma 4B, asked directly | Tathastha approach | |
|---|---|---|---|
| HCC (V28) recall / precision | 73% / 70% | 31% / 62% | 77% / 74% |
| ICD-10 category (3 characters) | 67% / 70% | 32% / 64% | 72% / 62% |
| Exact ICD-10 code | 52% / 53% | 24% / 56% | 66% / 47% |
| Visit dates | 51% / 74% | not produced | 83% / 75% |
| Invalid ICD-10 codes returned | not measured | 13% | 0% |
| Coder-decision AUC | — | 0.81 (~500 ms, GPU) | 0.91 (~30 ms, CPU) |
| Time per chart | ~20 min | ~6.5 min (GPU) | ~1 min (CPU) |
| Data sent to a third party | yes | no | no |
At the exact-code level the approach outputs some extra codes, so precision is lower than the LLM pipeline's; the decision model's threshold trades recall for precision when a client prefers fewer suggestions.
The same charts. The same coders. A fundamentally cheaper and safer way to code.
LLMs are a great way to get a first version working. For a high-volume, privacy-sensitive workflow, a pipeline of small, focused, fine-tuned models went further, faster and cheaper. Several ideas that sounded good, like bigger rerankers and zero-shot verifiers, made results worse and were dropped.
Most coding is search and rules.
Beats prompting for narrow decisions.
Keep a change only if it helps.
Start with a general NER model to learn what you need. Fine-tune a small model once your entities are specific to your domain, and handle negation and context separately.
A small local language model is a good fit for narrow, text-in text-out jobs where the answer is already in the input. It is a poor source of knowledge, and it needs a person checking its output.
For a high-volume, privacy-sensitive coding workflow, a pipeline of small, task-specific models beat repeated LLM calls on cost, speed, privacy and recall. We would not assume that holds for every task.
Tell us what you're trying to achieve. We'll help you explore the right approach from idea to impact.
View AllSend us the paragraph you'd normally write to a colleague. We'll get back to you within 24 hours.
hello@tathastha.com