Operationalizing Document AI: A Microservice Architecture for OCR and LLM Pipelines in Production
Yao Fehlis, Benjamin Bengfort, Zhangzhang Si, Vahid Eyorokon, Prema Roman, Patrick Deziel, Devon Slonaker, Steve Veldman, Ben Johnson, Joyce Rigelo, Michael Wharton, Steve Kramer
arXiv:2605.18818 · 2026-05-20 공개 · arXiv · PDF
llm ocr pipeline-optimization gpu-inference asynchronous-processing horizontal-scaling production-deployment structured-field-extraction
Abstract
Academic research tends to focus on new models for document understanding creating a wide gap in the literature between model definition and running models at production scale. To close that gap, we present a microservice architecture that encapsulates pipelines of multiple models for classification, optical character recognition (OCR), and large language model structured field extraction as well as our experience running this pipeline on thousands of multi-page documents per hour. We describe our primary design decisions, including a hybrid classification, separation of GPU-bound inference from CPU-bound orchestration, use of asynchronous processing for the many IO-bound operations in the pipeline, and an independent, horizontal scaling strategy. Using batch profiling, we identified two surprising qualitative findings that shape production deployments: OCR, not language-model parsing, dominates end-to-end latency, and the system saturates at a concurrency determined by shared GPU-inference capacity rather than worker count. Our goal is to provide practitioners with concrete architectural patterns for building document understanding systems that work beyond the benchmark; effectively operationalizing models in production.
한국어 요약
한 줄 요약
**[Document AI / 프로덕션 아키텍처]** 분류·OCR·LLM 구조화 추출 파이프라인을 시간당 수천 다페이지 문서로 운영하는 마이크로서비스 아키텍처와 그 운영 경험을 보고.
핵심 기여도
- 학술 연구가 새로운 문서 이해 모델 정의에 집중하는 동안 "프로덕션 규모로 운영하기"라는 갭이 크게 벌어져 있다는 문제를 정의.
- 분류·OCR·LLM 기반 구조화 필드 추출을 하나의 파이프라인으로 묶는 마이크로서비스 아키텍처를 구체적으로 기술 (하이브리드 분류, GPU bound 추론과 CPU bound 오케스트레이션 분리, IO bound 단계의 비동기 처리, 독립적 수평 확장 전략).
- 배치 프로파일링을 통해 두 가지 직관에 반하는 운영 발견을 보고: (1) end-to-end latency를 지배하는 것은 LLM 파싱이 아닌 OCR이고, (2) 시스템 포화는 워커 수가 아니라 공유 GPU 추론 용량에서 결정됨.
- 모델 정의를 넘어 실제 production에서 문서 이해를 운영하는 구체적 아키텍처 패턴을 실무자에게 제공.
핵심 아이디어
"벤치마크의 모델 성능"과 "프로덕션 운영의 병목"은 다른 차원이며, 분류·OCR·LLM 추출이라는 이질적 컴포넌트를 결합한 시스템은 GPU 공유 추론 용량과 OCR 비용이 사실상의 디자인 제약이 된다.
기술적 접근법
- **모델/방법론**: 분류 → OCR → LLM 구조화 추출의 다단계 파이프라인을 마이크로서비스로 구성, 시간당 수천 페이지 처리.
- **핵심 기법**: 하이브리드 분류, GPU bound 추론과 CPU bound 오케스트레이션의 분리, 다수 IO bound 단계의 비동기 처리, 컴포넌트별 독립 수평 확장.
주요 결과
- end-to-end latency를 지배하는 컴포넌트는 LLM 파싱이 아니라 OCR(직관 반대).
- 시스템 포화는 워커 수가 아니라 공유 GPU 추론 용량으로 결정됨 → 워커만 늘려도 효과 없음.
- 배치 프로파일링을 통한 컴포넌트별 병목 식별의 중요성 실증.
의의 및 한계
**의의**: 학술 모델과 production 시스템 사이의 운영 격차를 메우는 구체적 아키텍처 청사진을 제시. **한계**: 특정 워크로드(다페이지 문서, 분류+OCR+LLM 파이프라인) 기반 경험치이며, 다른 도메인(예: 영상·실시간 스트림)에서의 결론 일반화는 후속 검증 필요.
실용적 활용
- 금융·법률·의료 문서 자동화 시스템의 아키텍처 설계 참고.
- OCR/LLM 워크로드의 비용 모델링과 인프라 의사결정.
- 모델 교체 시 시스템 영향 분석을 위한 컴포넌트별 프로파일링 템플릿.