Table footer/summary rows missing from OCR output (rows present in source, absent from table markup)
Author: textlastigCreated Aug 28, 2026Updated Sep 22, 2026
### System Info / 系統信息
- Backend: MLX (mlx_vlm), model mlx-community/GLM-OCR-bf16
- Served via the SDK's own glmocr server (/glmocr/parse), not vLLM
- Apple Silicon Mac, macOS
- Deterministic decoding configured: temperature: 0.0, top_p: 0.00001, top_k: 1 (per config.yaml)
### Who can help? / 谁可以帮助到您?
_No response_
### Information / 问题信息
- [ ] The official example scripts / 官方的示例脚本
- [x] My own modified scripts / 我自己修改的脚本和任务
### Reproduction / 复现过程
We call the model directly the same way as in #96:
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
model, processor = load("mlx-community/GLM-OCR-bf16")
prompt = "Table Recognition:"
formatted_prompt = apply_chat_template(
processor, model.config, prompt, num_images=1)
result = generate(
model,
processor,
formatted_prompt,
image=["./invoice_table.png"],
max_tokens=2048,
verbose=True,
)
### Expected behavior / 期待表现
1. Take the attached source image (billing table from a real invoice, anonymized — no name/diagnosis, two rows highlighted in red are the ones missing from the output).
2. Run the code above (or the equivalent /glmocr/parse SDK call) on it.
3. Compare the returned table HTML against the source image — the last two rows ("Summe Honorar EUR: 86,23" and "Rechnungsbetrag EUR: 86,23") are not correctly transcribed.
4. Repeat the same call on the identical input a few times — the failure mode is not consistent (see below).
Actual Table Recognition: output for this region:
The 7 line-item rows are recognized correctly. The last two rows are not: instead of the label and amount text visible in the source, the table ends with two near-empty rows containing only a stray 1 and 2,300 copied from the pattern of the row above. rowspan="10" on the first cell correctly implies 10 rows total, so the model's own layout pass knows two more rows belong here, but recognition for those two rows produces no usable content.
Repeated runs on the identical input don't always fail the same way — sometimes these two rows are dropped from the table entirely instead of appearing empty and garbled, occasionally they come out correct.
This seems related to #182 (table output truncated for large tables on vLLM, resolved via --max-model-len/--gpu-memory-utilization) but appears to be a distinct issue: our table is small (9-10 rows total), generation doesn't hit a hard length limit, and the structure often looks complete (correct rowspan) even when content is missing — suggesting a recognition/attention issue specific to visually-separated footer rows, rather than context-window truncation.
| Datum | GOÄ | Leistung | Anz. | Auslagen | Faktor | Honorar |
|---|---|---|---|---|---|---|
| 13.02.24 | 1 | Beratung (persönlich oder telefon.) | 1 | 2,300 | 10,72 | |
| 6 | Untersuchung Organsystem Auge/HNO | 1 | 2,300 | 13,41 | ||
| 1201 | subj.Refraktion sphär.-zylindr.Gl. | 1 | 2,300 | 11,93 | ||
| 1202 | objektive Refraktionsbestimmung | 1 | 2,300 | 11,93 | ||
| 1207 | Prüfung./ Bestimmung von Mehrstärken-o. Prismenbrille | 1 | 2,300 | 9,92 | ||
| 1242 | Binoc.Unters.d.Augenhintergrundes | 1 | 2,300 | 9,38 | ||
| 1256 | Applanationstonometrie | 1 | 2,300 | 10,49 | ||
| 1 | 2,300 | |||||
| 1 | 2,300 |
Source: zai-org/GLM-OCR