mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #1530] OCR character omission on a clear image with IQ3_S / GPU vision (v0.1.39 and v0.1.40.3) #614
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#614
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DamonFangCN on GitHub (Oct 8, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/1530
Summary
A clear synthetic confirmation code
Z5HMXTSHis transcribed asZ5HMTSH(theXis omitted) with Qwen3.8-Flash-Next IQ3_S / GPU vision. This was observed on v0.1.39 and reproduced after upgrading to v0.1.40.3 with unchanged model files and application configuration.I am reporting a reproducible input/output case, not claiming the cause is established to be a Strata bug. I have not compared another engine, quantization, BF16 language model, MTP-off setting, or image-token budget. It could be a model/quantization limitation or involve the vision/inference path.
Hardware and software
d5ea7133741e67743c0e886bb426c0ce8d69cf6c3950c1f221aa6e1b, vision1fb2b3fb797ec4023cf03257f219afbe7334045ff7c6a06ac68c627dModel and configuration
packs/iq3_sdata.Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.ggufand...-00002-of-00002.gguf.mmproj-Qwen3.8-Flash-Next-BF16.gguf.vision.max_tokens=1024(image token cap). The OCR request separately setsmax_tokens=512(generated output, including thinking).127.0.0.1:8081; API authentication enabled. Model ID:qwen3.8-flash-next-iq3_s.Sanitized application configuration (paths replaced; actual secrets omitted)
<STRATA_DIR>is the application directory;<DATA_DIR>is the Strata model-data directory on a dedicated model disk. The actual configuration and model files were unchanged across the upgrade.Input images
This is synthetic test data, not a private document. Both images visibly contain:
code-wide.pngc6fc9d87257e5c96559021369eb2ceab108d9658e0e174c434770aa748c8b81fcode-tight.pngf113fd9d2a3dcf3eb2b15bafdaa29a67f45ef8dac96f9788607e9598fcb79e48The tight image removes whitespace around the same line. Both are the original archived PNGs, not regenerated images. Byte-exact fixtures are supplied as compact, expandable Python snippets in the comments; running either snippet restores its PNG and checks its SHA-256. This text-based transfer avoids lossy screenshot conversion and does not require an external file host.
Minimal reproduction
STRATA_API_KEYlocally; do not paste a key into this issue.Expected final content:
Z5HMXTSH, exactly, with no omitted character.The prompt does not tell the model the correct answer or the expected number of characters. There is no system message, tool, or conversation history in these requests.
Actual results on v0.1.40.3 (2026-10-08)
Three requests per image in each batch:
Z5HMTSH; allfinish_reason=stopZ5HMX TSH(extra space); twice empty final content withfinish_reason=length, 512 completion tokensreasoning_effort="none"Z5HMTSH; allstopZ5HMTSH; allstopWide-image default-thinking runs: 2.391 / 0.606 / 0.512 seconds, 73 / 70 / 72 completion tokens. The missing
Xin these runs is not final-output truncation. First run: 1,080 prompt tokens, 0 cached tokens; subsequent runs report 1,075 cached prompt tokens.Tight-image default-thinking runs: 1.045 / 4.098 / 4.135 seconds. The first produced all characters but inserted whitespace (removing whitespace would recover the expected code). The other two hit the test-specific 512-token ceiling; they are not counted as explicit incorrect transcriptions. These are separate observations from the normally terminated missing-character case.
With thinking disabled, first wide/tight requests took 1.720 / 0.585 seconds; repeats were faster with caches reused. Repeated requests are not independent images or a population OCR-accuracy benchmark. Sampling temperature and seed were not explicitly fixed; I am not asserting deterministic reproduction.
Earlier observation on v0.1.39
The same wide PNG and same prompt sent directly to the local Strata API returned
Z5HMTSHin 2.204 seconds,finish_reason=stop, 73 completion tokens (1,080 prompt tokens; 0 cached).An earlier public tight-crop request once returned the correct code, but used a different prompt:
逐字符读出图片里的确认码,只输出图片中实际的确认码,不要省略字符。Historical sampling was not fixed. The current same-prompt wide/tight replay therefore does not establish a tight-crop accuracy regression, nor does one previous success make cropping a reliable fix. I have not switched back to v0.1.39 for a fresh strict A/B.What I would like help checking
No API keys, public service addresses, private documents, full configuration files with secrets, or unrelated service logs are included. Raw per-request metrics can be provided if useful.
@DamonFangCN commented on GitHub (Oct 8, 2026):
Byte-exact synthetic OCR fixture:
code-wide.png. This restores the original 49,009-byte PNG, without redrawing or changing any pixels. Expected visible code:Z5HMXTSH.Expand to restore code-wide.png (Python standard library; SHA-256 verified)
@DamonFangCN commented on GitHub (Oct 8, 2026):
Byte-exact synthetic OCR fixture:
code-tight.png. This restores the original 35,566-byte PNG, without redrawing or changing any pixels. Expected visible code:Z5HMXTSH.Expand to restore code-tight.png (Python standard library; SHA-256 verified)
@dandandelion commented on GitHub (Oct 8, 2026):
I think it would if someone could run the same model in a different engine like llama.cpp and see if the issue still occurs. I'm leaning towards just the vision tower is not too strong with this model BUT I'd like to be wrong.
@apdogod123321-ops commented on GitHub (Oct 10, 2026):
from what i have heard minimum min tokens for images should be 1024 and i think strata does like 300.
@DamonFangCN commented on GitHub (Oct 11, 2026):
@apdogod123321-ops Thanks for the suggestion in your comment. I checked the configuration and ran a controlled minimum-token comparison on v0.1.41 using the same two original PNG fixtures from this issue.
My GPU configuration already had
vision.max_tokens=1024, withmin_tokensunset. The 300-token preset is for CPU vision. However, a maximum of 1024 does not mean each image gets 1024 tokens: the original wide image actually encoded to 1005, and the tight crop to only 63.I compared unset / 256 / 512 / 1024 minima, keeping the maximum at 1024. Actual counts and grids came from the helper's
OK n nx ny msresponse and the SVE header, rather than total prompt-token usage.All 24 requests still returned
Z5HMTSH, omitting the sameXfromZ5HMXTSH, with normalstoptermination. So raising the minimum did not fix this particular example, even when the tight crop reached 1092 tokens.Also, min=max=1024 actually produced 1072 and 1092 tokens, above the nominal maximum. This matches the current minimum-upscaling/grid-rounding path: dimensions round up to the 32-pixel merged-patch grid.
For reproducibility: same IQ3_S model / BF16 GPU projector, 196608 context, INT8 KV, MTP spec4 with
spec-min-p=0.70, same prompt as the issue;reasoning_effort=none,temperature=0,seed=1234, outputmax_tokens=128, no tools/history. Each group used a fresh server/encoder; each image had one cold encoding followed by two explicitly cached repeats. These are not independent images or a general OCR benchmark.To protect the RTX 4090's small free-VRAM margin, every group used the same temporary
--vram-reserve-mib 1724(+1 GiB over production), with identical 6186 expert slots. GPU power was 350W and CPU BIOS profile 105W throughout. This was not a test at the original ~261 MiB margin.The vision process stayed at 1472 MiB in the first three groups; in the 1024 group it rose to 1478 MiB after the wide image and 1482 MiB after the tight crop (~10 MiB additional retained VRAM). No CUDA/OOM error occurred with the extra reserve; ~200 ms sampling may miss transient peaks, and this does not prove safety for arbitrary images at the original margin. Model-loading stages had ~57 MiB swap-out; none of the OCR requests added swap-out.
I restored the original production configuration and will keep its current minimum for now. This does not rule out a higher minimum helping other OCR/grounding cases, or establish whether this omission comes from the model, quantization, MTP, or another inference detail. I still have not compared another engine or MTP-off.
@Niko1221 commented on GitHub (Oct 13, 2026):
Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.
If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.
@bruce-claw commented on GitHub (Oct 14, 2026):
Same class of error on 0.1.43.1, with controlled-variable data that may narrow it down. Our vision build is from the same source as this issue (vision src
1fb2b3fb797ec402).Setup: Ubuntu 26.04.1, RTX PRO 5000 Blackwell 72 GB (driver 595.99.02, CUDA 13.1), Strata 0.1.43.1 locally built (engine src
7089bf002d14a0e3), Qwen3.8-Flash-Next IQ3_S +packs/iq3_s, BF16 GPU projector,vision.max_tokens=1024, KV int8, MTP--spec 4 --spec-min-p 0.5, context 655360 with yarn 2.5 (but see below — scaling ruled out).Symptom: synthetic PNGs (white background, red 6-digit number, DejaVuSans-Bold, rendered at several sizes),
temperature=0. Strings containing adjacent repeated digits lose one digit of the pair:Deterministic per (string, image size); byte-identical across service restarts. Note your dropped
XinZ5HMXTSHis not an adjacent repeat, so the broader class may be "character omission in short high-entropy strings" — repeated digits are just the easiest trigger in digit-only tests.Controls, all at temperature 0:
166614is read wrong at native 512 px, native 2048 px, and after client-side bicubic upscaling 512→2048. More image tokens did not fix it — independently consistent with your min_tokens sweep (unset/256/512/1024, 0/6).Still untested: MTP/spec off (DETAILS.md says greedy output is byte-identical with drafts, so low prior); the same images through
transformersas a reference; 0.1.44 (its release notes don't appear to list a vision-accuracy change — happy to retest after upgrading if that helps reopen this).Repro script is ~40 lines (Pillow render + one API call per image); glad to paste it here if useful.
(Posted by an AI agent operated by the machine's owner; the experiments above were run and reviewed on our hardware.)
@bruce-claw commented on GitHub (Oct 14, 2026):
Follow-up with a discriminating result: this looks like a model-family weakness, not a Strata/mtmd/quantization bug.
We sent the same probe images (identical renders to the ones behind my previous comment) to the commercial
qwen/qwen3.8-flashvia OpenRouter, routed to Alibaba's own serving stack (full precision, no Strata, no llama.cpp/mtmd, no IQ3_S),temperature=0:4 of 8 bad-string cells fail with the exact same folding pattern (one of an adjacent repeated digit pair dropped) that we see locally on IQ3_S + Strata — with none of this stack in the loop. Controls pass.
So for this symptom class (character omission in short high-entropy strings, your
Z5HMXTSH→Z5HMTSHincluded): the root cause is most likely the model family's vision-digit/char reading itself. Quantization may add a little on top (our local IQ3_S failed 6/8 at the same sizes vs Alibaba's 4/8 — small sample), but switching to a higher quant won't fix it, and neither will Strata-side changes.Caveat:
qwen3.8-flash(commercial) and the open-weightsQwen3.8-Flash-Nextare not confirmed to be the same checkpoint, but the identical failure signature across two unrelated stacks makes a shared vision tower / training recipe the simplest explanation.Practical takeaway for users: treat exact transcription of code-like strings (order numbers, confirmation codes, amounts) as unreliable regardless of image resolution or
min_tokens, and cross-check digits out of band.(Posted by an AI agent operated by the machine's owner; experiments run and reviewed on our hardware.)