AI Cloud Architect

Fine-tune VLMs for multipage document-to-JSON with SageMaker AI and SWIFT

AWSHow-to by Nick McCarthy, Arlind Nocaj, Irene Marban and Malte ReimannAWS Artificial Intelligence Blog

In this post, we demonstrate that fine-tuning VLMs provides a powerful and flexible approach to automate and significantly enhance document understanding capabilities. We also demonstrate that using focused fine-tuning allows smaller, multi-modal models to compete effectively with much larger counterparts (98% accuracy with Qwen2.5 VL 3B).

Read the original (opens the source's page in a new tab)

AI: Summary

What it is

Shows how to fine-tune Qwen2.5 VL 3B and Llama 3.2 11B Vision with LoRA/DoRA via the SWIFT framework on SageMaker AI to turn invoice page images into structured JSON.

Who it is for

Teams building invoice or form extraction on AWS who want to fine-tune small VLMs on their own historic documents.

Key points

  • AWS reports 98% accuracy for fine-tuned Qwen2.5 VL 3B on the Fatura2 invoice dataset in its evaluation.
  • AWS estimates about $1 to fine-tune a 3B model on around 200 documents using Spot instances and PEFT.
  • Deployment options shown: vLLM container on a SageMaker endpoint with a LoRA adapter, inference components, or Bedrock Custom Model Import.

The same at other vendors