Schema Error vs Semantic Error
- Schema error: Invalid structure/type.
- Semantic error: Valid structure but wrong meaning/value.
Remember: JSON Schema does not guarantee semantic correctness.
Self-Validation Fields
{
"stated_total": 120,
"calculated_total": 110,
"conflict_detected": true
}
Expose inconsistencies explicitly.
detected_pattern
Add fields such as:
detected_pattern
Use them to analyse which code patterns repeatedly cause false positives.
Batch custom_id
- Assign each request a custom_id.
- Correlate request with response.
- Identify individual failures.
Resubmit Only Failed Items
100 documents
↓
7 fail
↓
Identify failed custom_id values
↓
Fix only those inputs
↓
Resubmit 7
Context-Limit Failure
If an oversized document fails:
Chunk document
↓
Resubmit failed document
Before Large Batch
Small sample
↓
Refine prompt
↓
Validate
↓
Run large batch
Benefit: Better first-pass success and fewer expensive retries.
SLA Planning
Batch processing can take up to 24 hours.
Work backwards from the required SLA when deciding submission frequency.
Fast Revision
Schema valid ≠ semantically correct.
custom_id = correlation.
Failed subset = resubmit subset.
Oversized document = chunk.
Large batch = test sample first.