Downloads · 30 days
0
amad-iq/amad-vlm6-technical-report
amad-vlm6-technical-report is a image-text-to-text model from amad-iq. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
A technical report on TIES-merging two independently fine-tuned Arabic OCR specialists, with an error-type decomposition, behavior statistics, and bootstrap intervals that separate what merging repaired from what it t…
Downloads · 30 days
0
Access
Public
Updated Sep 9, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md25.1 KB · 94%
From the Hugging Face model README
A technical report on TIES-merging two independently fine-tuned Arabic OCR specialists, with an error-type decomposition, behavior statistics, and bootstrap intervals that separate what merging repaired from what it transferred and what it damaged.
Author: Murtadha · amad-iq Model: amad-iq/amad-vlm6 · GGUF
TL;DR — amad-vlm6 is a TIES merge of amad-vlm5 and DIMI-Arabic-OCR-V2 on their shared Qwen2.5-VL-7B-Instruct base. Against amad-vlm5 on all 13 KITAB-Bench
ocr-evaldatasets it improves macro CER (0.254 → 0.235) and CHrF (81.05 → 81.68) and worsens macro WER (0.361 → 0.463); on the 10 datasets free of amad-vlm5's training overlap it cuts CER by 26%. On the 7 datasets where all three models were scored, it beats both parents on every macro metric. Decomposition shows the mechanism is behavioral, not perceptual: the merge suppresses one parent's runaway reasoning (thinking rate 45–98% → 5–18%, truncated outputs 10% → 1%) while reading accuracy itself regresses on 10 of 13 datasets, improving only on adab and evarest. The merge does not reliably cancel the other parent's hallucination: on isippt and muharaf, insertion rates jump 0.006 → 0.471 and 0.012 → 0.423. Four per-dataset wins and three losses are statistically significant; five are not. The natural control — amad-vlm5 with inference-side loop and think-budget fixes — is running and will be added; until it lands, "the merge is the best way to get this fix" is unproven.
KITAB-Bench ocr-eval | amad-vlm5 | DIMI-V2 | amad-vlm6 |
|---|---|---|---|
| CER ↓ macro, 13 datasets | 0.254 | pending | 0.235 |
| WER ↓ macro, 13 datasets | 0.361 | pending | 0.463 |
| CHrF ↑ macro, 13 datasets | 81.05 | pending | 81.68 |
| CER ↓ 10 leak-free datasets | 0.321 | pending | 0.236 |
| CER ↓ 7 datasets where all three were scored¹ | 0.441 | 0.389 | 0.249 |
| CHrF ↑ same 7¹ | 70.92 | 58.22 | 80.35 |
¹ The 7 are the datasets on which the merge beat amad-vlm5 — a selection on the outcome, made to test whether DIMI alone explained those wins. DIMI-V2's remaining 6 datasets are being scored and the 13-set columns will be filled.
The parents fail in complementary, behavioral ways.
amad-vlm5 is a thinking OCR model: on dense page-level documents it reasons
inside <think>…</think> before transcribing. Measured on the benchmark, it
opens a reasoning block on 45–100% of page-level inputs (§5.1); on hindawi and
historicalbooks 10% of those blocks never close, consuming the whole generation
budget and producing no transcription. Greedy decoding also loops: one
khattparagraph page yielded 16,000 characters of a repeated phrase against a
361-character ground truth.
DIMI-Arabic-OCR-V2 never reasons and reads printed text competently, but over-generates: its outputs run 1.2–1.65× the ground-truth length on every dataset (§5.1), continuing past the page with fluent invented Arabic. On one 84-character line it produced 4,888 characters.
Both were fine-tuned from the same base, which makes their differences exactly expressible — and mergeable — as task vectors.
Each fine-tune is its task vector, the delta it added to the shared base:
τ_amad = W_amad − W_base τ_dimi = W_dimi − W_base
TIES-Merging (Yadav et al., 2023):
density fraction of each τ by magnitude
(density 0.5), zeroing the rest.W = W_base + λ · τ_merged, λ = 1.Implementation note: the merge was run with an in-house script that computes
exactly the steps above (disjoint mean, not sum); the mergekit recipe in §8
reproduces this with normalize: true and is illustrative — mergekit's support
for Qwen2.5-VL's vision tower should be verified before relying on it.
Empirical properties of this pair, each worth checking before any merge:
ocr-eval: 13
datasets, 3,760 images, unmodified repository metrics and Arabic
normalization.Extract the text in the image. Give me the final text, nothing else. — for all three models. DIMI-V2's model card
prescribes an Arabic instruction (استخرج النص العربي والأرقام الموجودة في هذه
الصورة بدقة عالية); it was not used here, so DIMI's standalone numbers are
provisional. A rerun with its own prompt is queued.FastVisionModel, 4-bit NF4 weights, HuggingFace
generate, greedy, no repetition penalty, batch 2. Image resolution: the
processor defaults of the Qwen2.5-VL checkpoint (no min/max_pixels
override).<think>…</think> is stripped before any
metric; an unclosed block scores as an empty prediction. Ground truth is
never modified.CER with 95% bootstrap CI; ✓ = amad-vlm6 better, ✗ = worse, ~ = intervals overlap.
| Dataset | n | CER amad-vlm5 | CER amad-vlm6 | sig. | WER | CHrF | leak |
|---|---|---|---|---|---|---|---|
| patsocr | 500 | 0.015 [.013,.017] | 0.012 [.010,.015] | ~ | 0.057 → 0.048 | 96.28 → 96.51 | |
| synthesizear | 500 | 0.041 [.032,.051] | 0.049 [.032,.077] | ~ | 0.150 → 0.159 | 91.66 → 91.32 | |
| isippt | 500 | 0.054 [.044,.065] | 0.541 [.082,1.50] | ✗ | 0.209 → 0.630 | 90.27 → 78.47 | |
| adab | 200 | 0.168 [.146,.194] | 0.112 [.094,.130] | ✓ | 0.585 → 0.478 | 66.45 → 71.90 | |
| evarest | 800 | 0.291 [.257,.330] | 0.142 [.120,.169] | ✓ | 0.524 → 0.278 | 68.45 → 86.62 | |
| historyar | 200 | 1.450 [.091,4.33] | 1.126 [.102,3.30] | ~ | 1.061 → 2.039 | 62.56 → 68.29 | |
| khattparagraph | 200 | 0.711 [.326,1.31] | 0.088 [.067,.113] | ✓ | 0.884 → 0.292 | 62.45 → 88.98 | |
| historicalbooks | 10 | 0.212 [.087,.394] | 0.127 [.100,.154] | ~ | 0.379 → 0.327 | 70.82 → 75.38 | |
| arabicocr | 50 | 0.025 [.014,.039] | 0.027 [.022,.033] | ~ | 0.093 → 0.123 | 95.17 → 92.33 | |
| hindawi | 200 | 0.241 [.185,.307] | 0.137 [.110,.173] | ✓ | 0.378 → 0.339 | 69.44 → 74.77 | |
| muharaf | 200 | 0.046 [.037,.056] | 0.600 [.197,1.40] | ✗ | 0.138 → 0.910 | 90.55 → 56.72 | ✓ |
| onlinekhatt | 200 | 0.017 [.013,.021] | 0.049 [.039,.059] | ✗ | 0.083 → 0.189 | 95.75 → 89.70 | ✓ |
| khatt | 200 | 0.035 [.027,.046] | 0.049 [.040,.060] | ~ | 0.158 → 0.207 | 93.83 → 90.87 | ✓ |
amad-vlm6 wins CER on 7 of 13 — 4 significant (adab, evarest, khattparagraph, hindawi), 3 not. It loses 6 — 3 significant (isippt, muharaf, onlinekhatt), 3 not. Note historyar: intervals of [0.09, 4.3] and [0.10, 3.3] mean its CER is set by one or two repetition-loop rows in each model; no conclusion should be drawn from it.
WER worsens on 7 of 13 — but on the 7 datasets where CER improved, WER improves on 6 (all but historyar). The macro WER increase (0.361 → 0.463) comes from three datasets — historyar (1.06 → 2.04), muharaf (0.14 → 0.91), isippt (0.21 → 0.63) — i.e. the same catastrophic rows that drive their CER, not from a general segmentation regression.
Macro over 13: CER 0.254 → 0.235, CHrF 81.05 → 81.68, WER 0.361 → 0.463. Excluding the three datasets overlapping amad-vlm5's training data (552 images, "leak"): CER 0.321 → 0.236, CHrF 77.35 → 82.46.
Baselines are the published numbers (run at the benchmark's default 500-token budget); our three rows use the protocol in §3 with a 4,096-token budget. Sorted by CHrF.
| Model | CHrF ↑ | CER ↓ | WER ↓ |
|---|---|---|---|
| amad-vlm6 (ours) | 81.68 | 0.235 | 0.463 |
| amad-vlm5 (ours) | 81.05 | 0.254 | 0.361 |
| AIN-7B | 78.33 | 0.20 | 0.28 |
| Gemini-2.0-Flash | 77.95 | 0.13 | 0.32 |
| GPT-4o | 61.01 | 0.31 | 0.55 |
| Qwen2.5VL-7B | 49.23 | 1.20 | 1.41 |
| GPT-4o-mini | 47.21 | 0.43 | 0.71 |
| EasyOCR | 45.47 | 0.58 | 0.89 |
| Tesseract | 39.62 | 0.54 | 0.84 |
| Qwen2VL-7B | 33.94 | 1.48 | 1.55 |
| Surya | 20.61 | 4.95 | 5.61 |
| Paddle | 16.73 | 0.79 | 1.02 |
Under our protocol amad-vlm6 ranks #1 by CHrF, #3 by CER, #4 by WER among the published systems. The budget difference means this is not a like-for-like leaderboard entry; under the benchmark's default 500-token budget amad-vlm5 scores CHrF 65.22, and amad-vlm6 has not been run at 500 (it still reasons on 5–18% of page-level inputs, §5.1, so the budget matters for it too).
Per model and dataset: share of outputs that open a <think> block, share
that never close it, share that hit the generation cap, share scored as empty,
and output length relative to ground truth (final answer only).
| Dataset | model | think % | unclosed % | hit cap % | empty % | len ÷ GT |
|---|---|---|---|---|---|---|
| khattparagraph | amad-vlm5 | 45.5 | 1.5 | 2.5 | 1.5 | 1.06 |
| amad-vlm6 | 5.0 | 0.0 | 0.0 | 0.0 | 0.98 | |
| DIMI-V2 | 0.0 | 0.0 | 4.0 | 0.0 | 1.61 | |
| hindawi | amad-vlm5 | 93.5 | 10.0 | 9.5 | 10.0 | 0.82 |
| amad-vlm6 | 16.0 | 1.0 | 1.5 | 1.0 | 0.97 | |
| DIMI-V2 | 0.0 | 0.0 | 26.0 | 0.0 | 1.09 | |
| historicalbooks | amad-vlm5 | 100 | 10.0 | 10.0 | 10.0 | 0.99 |
| amad-vlm6 | 100 | 0.0 | 0.0 | 0.0 | 1.14 | |
| DIMI-V2 | 0.0 | 0.0 | 10.0 | 0.0 | 1.65 | |
| arabicocr | amad-vlm5 | 98.0 | 0.0 | 0.0 | 0.0 | 1.00 |
| amad-vlm6 | 18.0 | 0.0 | 0.0 | 0.0 | 1.01 | |
| isippt | amad-vlm5 | 0.2 | 0.0 | 0.0 | 0.0 | 0.98 |
| amad-vlm6 | 0.2 | 0.0 | 0.2 | 0.0 | 1.44 | |
| muharaf | amad-vlm5 | 0.0 | 0.0 | 0.0 | 0.0 | 1.00 |
| amad-vlm6 | 0.5 | 0.0 | 0.5 | 0.0 | 1.36 | |
| adab / evarest / patsocr | DIMI-V2 | 0.0 | 0.0 | 0–0.8 | 0–0.2 | 1.22–1.65 |
Line-level datasets (patsocr, adab, evarest, synthesizear, khatt, onlinekhatt) show no thinking and ~1.0 length ratios for both amad models and are omitted except where noted.
Reading the table: the merge cut the thinking rate 3–9× on page-level sets, eliminated unclosed blocks and empty outputs on hindawi and historicalbooks (10% → 0–1%), and brought output length to ≈ ground truth where amad-vlm5 under-produced (hindawi 0.82 → 0.97). That is the "format fix", now measured. But on isippt and muharaf the merged model over-generates by 36–44% — DIMI's signature — where amad-vlm5 did not. The merge still thinks on 5–18% of page-level inputs (100% on historicalbooks), so it cannot be evaluated at the benchmark's 500-token default without the same truncation problem as its parent.
Character edit operations against the normalized ground truth:
SUB = substitutions / reference chars → reading errors
INS = insertions / reference chars → over-generation (loops, hallucination)
DEL = deletions / reference chars → missing output (truncation, under-transcription)
CER = SUB + INS + DEL
All 13 datasets, amad-vlm5 → amad-vlm6:
| Dataset | SUB | INS | DEL | what changed |
|---|---|---|---|---|
| patsocr | 0.007 → 0.007 | 0.005 → 0.003 | 0.003 → 0.003 | nothing material |
| synthesizear | 0.018 → 0.020 | 0.011 → 0.020 | 0.013 → 0.009 | slight INS up |
| isippt | 0.026 → 0.039 | 0.006 → 0.471 | 0.023 → 0.032 | hallucination crossed the merge |
| adab | 0.096 → 0.066 | 0.040 → 0.024 | 0.032 → 0.022 | reading + behavior improve |
| evarest | 0.171 → 0.083 | 0.074 → 0.045 | 0.046 → 0.015 | reading + behavior improve |
| historyar | 0.055 → 0.064 | 1.368 → 1.042 | 0.026 → 0.020 | loops persist |
| khattparagraph | 0.012 → 0.016 | 0.379 → 0.022 | 0.319 → 0.050 | loops + truncation fixed |
| historicalbooks | 0.041 → 0.058 | 0.026 → 0.025 | 0.145 → 0.044 | truncation fixed, reading −41% |
| arabicocr | 0.002 → 0.008 | 0.009 → 0.012 | 0.014 → 0.007 | reading 4× worse (tiny base) |
| hindawi | 0.046 → 0.065 | 0.033 → 0.030 | 0.163 → 0.042 | truncation fixed, reading −41% |
| muharaf | 0.024 → 0.120 | 0.012 → 0.423 | 0.010 → 0.057 | reading 5× worse and hallucination |
| onlinekhatt | 0.009 → 0.024 | 0.003 → 0.014 | 0.005 → 0.011 | all worse (memorized set) |
| khatt | 0.015 → 0.023 | 0.008 → 0.014 | 0.011 → 0.012 | all worse (memorized set) |
Three-way on the 7 outcome-selected datasets (amad-vlm5 / amad-vlm6 / DIMI-V2):
| Dataset | CER | SUB | INS | DEL |
|---|---|---|---|---|
| patsocr | 0.015 / 0.012 / 0.238 | 0.007 / 0.007 / 0.013 | 0.005 / 0.003 / 0.209 | 0.003 / 0.003 / 0.016 |
| adab | 0.168 / 0.112 / 0.438 | 0.096 / 0.066 / 0.282 | 0.040 / 0.024 / 0.047 | 0.032 / 0.022 / 0.109 |
| evarest | 0.291 / 0.142 / 0.178 | 0.171 / 0.083 / 0.099 | 0.074 / 0.045 / 0.055 | 0.046 / 0.015 / 0.023 |
| historyar | 1.450 / 1.126 / 0.847 | 0.055 / 0.064 / 0.161 | 1.368 / 1.042 / 0.541 | 0.026 / 0.020 / 0.145 |
| khattparagraph | 0.711 / 0.088 / 0.355 | 0.012 / 0.016 / 0.156 | 0.379 / 0.022 / 0.152 | 0.319 / 0.050 / 0.047 |
| historicalbooks | 0.212 / 0.127 / 0.477 | 0.041 / 0.058 / 0.193 | 0.026 / 0.025 / 0.185 | 0.145 / 0.044 / 0.099 |
| hindawi | 0.241 / 0.137 / 0.190² | 0.046 / 0.065 / 0.072 | 0.033 / 0.030 / 0.020 | 0.163 / 0.042 / 0.098 |
² DIMI's hindawi score is unreliable — see §5.3.
Macro over these 7: CER 0.441 / 0.249 / 0.389 · CHrF 70.92 / 80.35 / 58.22.
What the decomposition establishes:
(a) The gain is behavioral; reading did not improve — it mostly regressed. Substitution rate rises on 10 of 13 datasets (relative +16% historyar, +33% khattparagraph, +41% historicalbooks and hindawi, +50% isippt, 4× arabicocr, 5× muharaf). It improves only on adab (−31%) and evarest (−51%) and is unchanged on patsocr. Where amad-vlm6 wins, it wins because insertions and deletions collapsed — khattparagraph INS 0.379 → 0.022 and DEL 0.319 → 0.050 — not because it reads better. A merge partner with no reasoning acted as a behavioral regularizer on the reasoning parent.
(b) DIMI-V2 is not simply the weakest model. By CER it beats amad-vlm5 on 4 of these 7 datasets (evarest, historyar, khattparagraph, hindawi) and on the 7-set macro (0.389 vs 0.441). It is the weakest by CHrF (58.2) because its insertions are large and fluent — CHrF's character n-gram recall punishes invented text harder than CER's per-character count does. On the line-level sets (patsocr, adab) its over-generation makes it clearly worst.
(c) Hallucination did not cancel — it moved. The merge removed DIMI-style over-generation on the page-level sets, but on isippt (INS 0.006 → 0.471, 500 images) and muharaf (0.012 → 0.423) it introduced it where amad-vlm5 had none. On historyar the amad-vlm5 loop behavior survived (INS 1.042). Any claim that "the merge cancels the parents' failure modes" is therefore true on 5 datasets and false on 3.
(d) Real transfer on two datasets — with an open question. On adab and evarest (1,000 images, short scene-text lines) the merged model's substitution rate beats both parents. DIMI-V2's training data is not published; whether it saw adab- or evarest-like material cannot be audited, so "transfer" on these two may partly be DIMI-side memorization crossing the merge. The leak audit in this report covers amad-vlm5's training data only.
| Dataset | max GT tokens | DIMI outputs hitting cap | DIMI DEL |
|---|---|---|---|
| patsocr | 43 | 0.8% | 0.016 |
| adab | 13 | 0.0% | 0.109 |
| evarest | 16 | 0.0% | 0.023 |
| historyar | 90 | 3.0% | 0.145 |
| khattparagraph | 325 | 4.0% | 0.047 |
| historicalbooks | 218 | 10.0% | 0.099 |
| hindawi | 927 | 26.0% | 0.098 |
On the line-level sets the cap never binds (0–0.8% hit it, ground truths are ≤ 43 tokens), so DIMI's deletions there (adab 0.109) are genuine under-transcription and the cap could only have removed insertions. On hindawi, ground truths reach 927 tokens and 26% of DIMI's outputs hit the cap: real transcription was almost certainly truncated, which raises DEL and — because CHrF is recall-weighted — lowers CHrF. DIMI's hindawi row should be read as a lower bound on its quality; historicalbooks (10%) is borderline. The claim that the cap "can only flatter DIMI" holds for five of the seven datasets, not all.
If the merge's gain is mostly behavioral, the natural baseline is not "no
merge" but amad-vlm5 with inference-side fixes: a repetition penalty
against loops and a think budget that forces </think> after N tokens so an
answer is always emitted. If that recovers most of the gain without the
isippt/muharaf regressions, merging is the wrong tool for this fix. The same
applies to DIMI-V2 with a stopping criterion. This control is running under the
protocol of §3 (repetition penalty 1.05, think budget 1,024) and this section
will be updated with its full 13-dataset comparison. Until then the report
shows that merging fixed the behavior, not that merging was necessary.
Illustrative mergekit recipe — the published weights were produced by an in-house TIES implementation (trim → elect → disjoint mean) as described in §2; verify mergekit's handling of the Qwen2.5-VL vision tower before treating this as an exact reproduction:
merge_method: ties
base_model: Qwen/Qwen2.5-VL-7B-Instruct
models:
- model: amad-iq/amad-vlm5
parameters: {weight: 1.0, density: 0.5}
- model: AhmedZaky1/DIMI-Arabic-OCR-V2 # V2 only — V2 continues V1
parameters: {weight: 1.0, density: 0.5}
parameters: {lambda: 1.0, normalize: true} # true = disjoint mean, as used
dtype: bfloat16
Evaluation: KITAB-Bench ocr-eval, unmodified metrics.py; protocol in §3;
edit-operation decomposition via Levenshtein.editops on the same normalized
strings; bootstrap over images.
@inproceedings{yadav2023ties,
title = {TIES-Merging: Resolving Interference When Merging Models},
author = {Yadav, Prateek and Tam, Derek and Choshen, Leshem and Raffel, Colin and Bansal, Mohit},
booktitle = {NeurIPS}, year = {2023}
}
@inproceedings{heakl2025kitab,
title = {KITAB-Bench: A Comprehensive Multi-Domain Benchmark for Arabic OCR and Document Understanding},
author = {Heakl, Ahmed and Sohail, Abdullah and Ranjan, Mukul and others},
booktitle = {ACL}, year = {2025}
}
September 2026 · Murtadha · amad-iq · revised after external review