Repository navigation
Description
Problem
_build_batch_support_prompt formats each input span with a citations key:
{"span_id": 0, "text": "...", "citations": [
Citation 0 (from doc X): "..."
]}It then instructs the model to respond with a flat JSON array. The model mirrors the nested structure it sees in the input, producing output like:
{"span_id": 0, "citations": [{"support_level": "FULLY_SUPPORTED"}]}instead of the requested:
{"span_id": 0, "support_level": "FULLY_SUPPORTED"}This was observed ~70% of the time with granite-4.0-micro.
Current state
PR #1292 added a correct fallback in _parse_batch_support_output that handles both the flat and nested output formats, including pessimistic aggregation when a span has multiple citations with mixed support levels. The parser is correct and production is unaffected.
The issue here is that the prompt is working against itself: the instruction says flat, the input demonstrates nested.
Options
-
Rename the input key — change
citationsto something that doesn't echo the output schema (e.g.evidenceorsource_passages). Breaks the mirroring heuristic without removing the context the model needs. -
Strip citations from the span input — omit the per-span citation list entirely, relying on the
Source Documentssection already present in the prompt for grounding context. Simpler prompt, but may reduce assessment quality. -
Accept nested output as the contract — remove the "flat" instruction, formalise the nested format, and simplify the parser. Honest about what the model does naturally.
Notes
- Any of these changes the model input and needs HPC validation before landing.
- The fallback in
_parse_batch_support_output(_norm+ pessimistic aggregation) is worth keeping regardless of which option is chosen — it guards against label variants like"FULLY SUPPORTED"(space). - See PR fix(intrinsics): restore aLoRA offsets and fix groundedness parser #1292 for the original analysis and the HPC run that confirmed the parser fix.
Activity