An Azure machine learning service for building and deploying models.
The key issue is that Custom Neural models are not purely semantic models. They learn from a combination of text, language, and document layout signals. Therefore, moving a field and its label to a completely different location can impact extraction even when the label and value remain unchanged.
For your scenario, Custom Neural is generally the recommended starting point, as it is designed for structured, semi-structured, and unstructured documents and can generalise across document variations better than Template models. Microsoft also recommends starting with a Neural model where supported.
Regarding your specific questions:
- Custom Neural is not fully layout-independent. Neural models use both language and layout features during training and inference. As a result, a field that appears in a significantly different location than the patterns observed during training may not always be extracted, even if the label and value remain unchanged. Your PoC result is therefore an expected behaviour rather than necessarily a model defect.
- Including multiple real layout variations in training is the correct strategy. If suppliers use different bill formats, or if the same field appears in different locations across document versions, include those variations in the labelled training set. Neural models are specifically intended for documents that contain the same business information but differ in presentation and structure. [learn.microsoft.com]
- Yes, greater layout diversity generally improves generalisation. While no model can guarantee extraction from completely unseen layouts, training with representative variations helps the model learn broader patterns instead of overfitting to a single document structure. [learn.microsoft.com], [learn.microsoft.com]
- Microsoft's guidance is to include sufficient examples for each variation. A commonly recommended starting point is at least five labelled samples per layout variation, while larger and more diverse datasets typically produce better results.
- Custom Generative extraction is worth benchmarking if layout volatility is expected to be high. Your requirement is fundamentally semantic:"find the supply number regardless of where it appears, provided the surrounding context indicates it is the supply number." In scenarios where suppliers frequently change layouts, Generative extraction may prove more resilient because it is oriented toward understanding document content rather than relying predominantly on learned document structure. However, the best approach is to benchmark it against Custom Neural using representative production documents rather than assuming it will automatically perform better.
Things to consider additionally:
One aspect that is often overlooked is that artificially moving fields within a document is not always representative of real-world layout evolution. When suppliers redesign bills, they usually change multiple elements simultaneously, including section headings, neighbouring content, table structures, typography, and page organisation. Training and testing with genuine supplier versions typically provides a more realistic measure of model robustness than synthetically relocating individual fields.
Overall, for your use case, I would recommend:
- Custom Neural as the primary extraction model
- Training with diverse, real supplier layouts and bill versions
- Including multiple examples where key fields appear in different locations
- Benchmarking Custom Generative extraction if supplier layouts change frequently and unpredictably
This approach provides the best balance between accuracy, maintainability, and resilience to future layout changes.
Help make this community better for everyone: if this answer resolved your issue, please accept it or leave an upvote. If not, share more details in a comment so we can continue the discussion and find the right solution.