Back to Blog
Mechanical gears on conveyor belt leading to small AI node - representing code doing the heavy liftingMechanical gears on conveyor belt leading to small AI node - representing code doing the heavy lifting

Deep Dive

Code First: When AI is the Wrong Tool

August 8, 2025 · 4 min read · By Yusuf Tunc Karadut

If code can do it, code should do it. There's a concerning number of AI automations that shouldn't be AI automations. Vision models reading invoices. LLMs parsing dates. Generative approaches to deterministic problems. This is expensive, slow, and fragile.

The Hybrid Pipeline

Document processing is the clearest example. A vision-language model can "read" a document, but it's computationally expensive and introduces non-determinism. Research into hybrid pipelines (Zhang et al.'s EcoDoc, LayoutLM architectures) shows that combining traditional OCR with specialized layout models or rule-based extraction is vastly more efficient.

The pattern: OCR extracts text (cheap, fast, deterministic). Regex finds dates and numbers (zero variance). A small LLM summarizes the notes section (where semantic understanding actually adds value). Cost drops by orders of magnitude. Reliability increases.

The Resilience Benefit

Beyond cost, hybrid solutions provide explainability and resilience. When the extraction fails, you know which component failed. When compute prices spike or API limits hit, deterministic components keep running. When auditors ask how you processed millions of documents, you can show them the code path, not just the prompt.

AI excels at semantic tasks: summarization, classification, understanding nuance. It's overkill for structured extraction. Match the tool to the task.

Sources

Zhang, Y., et al. (2025)

EcoDoc: Cost-Efficient Multimodal Document Processing

ACL 2025

Liu, X., et al. (2025)

Hybrid OCR-LLM Framework for Enterprise-Scale Document Information Extraction

arXiv:2510.10138

See AI applied to real financial research

Archivist helps analysts and investors explore global filings (SEC, SEDAR+, KAP and expanding) through natural conversation, grounded in real sources.

Try Archivist

Forever Free: your first 10 answers are on us

Use of this site indicates acceptance of the Privacy Policy and Terms of Use.

The information on this website is not reliable and not intended to provide tax, legal, or investment advice. Nothing contained on the website shall be considered a recommendation, solicitation, or offer to buy or sell a security to any person in any jurisdiction.

Mosaic Finance provides access to filings for companies including small cap securities which can be high risk and may lose their entire value. Only risk what you can afford to lose.

Theme

© 2026 Mosaic Finance. All rights reserved.