Possible numeric precision drift from official demo

#1
by jasonni2 - opened

I have an image in which table can not be parsed correctly with llama.cpp(R-SWA branch). But it can be parsed correctly in the official demo. I tried variable quantized models. Even both bf16 combination can not work.

The table 2 ocr result is like this:

Methods"""
TEDs-STEDS>
TableFormer[2022]96.80-96.70
GridFormer [2023]98.63--
VAST[2023]98.63398.21-
TFLO \( P_{BASE} \)99.4399.2299.4299.34
TFLO \( P_{FULL} \)99.5699.4599.42\( \underline{99.40} \)

paper_test

Thanks for the report - reproduced and fixed.

Not a precision issue: the DRY flags in my run example caused it. They punish repetition, and the model writes tables as HTML markup - one <td> tag per cell, so lots of legitimate repetition. I removed the flags from the run examples (README + PRs); with the current command your image parses correctly and matches the HF reference.

Your image is now a regression case in https://github.com/sfallah/llama-mtmd-eval, so this can't come back silently.

If you want to verify with your image:

build/bin/llama-mtmd-cli -hf sabafallah/Unlimited-OCR-GGUF:bf16 \
  --image your-image.png -p "document parsing." \
  --chat-template deepseek-ocr \
  --temp 0 --flash-attn off --no-warmup \
  -n 8192 -c 16384 \
  --dry-multiplier 0.8 --dry-base 1.75 --dry-allowed-length 35 \
  --dry-penalty-last-n 128 --dry-sequence-breaker none

These DRY settings mirror the reference's no_repeat_ngram guard (35 / window 128) and are safe for tables - the old aggressive ones (allowed-length 2) were the culprit. The README run example is updated accordingly.

Sign up or log in to comment