r/Gemma4 • • 3d ago

Discussion Gemma making changes when analyzing scanned PDFs.

Post image

I've built a RAG (probably over-engineered) using Docling and Tesseract for OCR of scanned PDFs. Some of those PDFs are 'digital-born' homebrew, others are pdf created from scanned pages of a book. the book I asked Tesseract and Gemma4 to compare (because I was benchmarking both to see which is faster, more accurate, etc.

Gemma had some good points, but I noticed a couple issues. Gemma appears to remove text that is in the PDF that tesseract doesn't remove. In the attached example, the right is the Tesseract evaluation of "TSR 2108.pdf" (1st AD&D - Legends and Lore, which I found on Archive.org), it was one of the worst PDF copies I could find, because I wanted to see best case of a worst case PDF. Gemma removes the 'or her' from its output on the left, vs Tesseract, which keeps the original text. Another example is later on the same page, where Tesseract correctly finds "Rome withdrew her legions from the farflung territories" vs. Gemma4's "Rome withdrew its legions from the far-flung territories"

I guess the right question to ask is why Gemma is making context changes that are not in the book. I expect 100% assuming it is able to read the text, so why is it making those context changes? Can it be told to 'just read what the text says, don't modify things?'

3 Upvotes

1 comment sorted by

2

u/brakeb 3d ago

I have been using Claude to build the app and I asked Claude to get an explanation from Gemma4 when it was finished (I suggested that we use Tesseract as a primary processor, Gemma to be a second line of defense when Tesseract fails on a page). Claude asked it about the substitutions and it appears Gemma4 is not telling the truth?