Google DeepMind's Gemma 4 Parses PDFs Locally With 1,120 Visual Tokens
Updated
Updated · KDnuggets · Jul 7
Google DeepMind's Gemma 4 Parses PDFs Locally With 1,120 Visual Tokens
2 articles · Updated · KDnuggets · Jul 7
Summary
Gemma 4 can parse scanned and digital PDFs through the same local pipeline by rendering each page as an image and querying the model in plain language, producing structured JSON without OCR or layout-specific templates.
That image-first approach avoids the text-layer dependency that breaks tools like pdfplumber on scans and scrambles multi-column layouts, while Gemma 4's 2D positional encoding preserves tables, columns and field relationships.
Google DeepMind says the Apache 2.0-licensed model runs fully on local hardware, with the E4B-it version needing about 10 GB VRAM and offering visual token budgets from 70 to 1,120 for speed-versus-accuracy tuning.
For multi-page invoices, a two-pass workflow classifies pages at 280 tokens and extracts only relevant ones at 1,120 tokens, cutting processing time by roughly 35% to 40% while keeping sensitive financial documents on-server.