Skip to content

fix(rag): groundedness support prompt presents nested citations in input while requesting flat output #1316

Closed

Description

@planetf1

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

  1. Rename the input key — change citations to something that doesn't echo the output schema (e.g. evidence or source_passages). Breaks the mirroring heuristic without removing the context the model needs.

  2. Strip citations from the span input — omit the per-span citation list entirely, relying on the Source Documents section already present in the prompt for grounding context. Simpler prompt, but may reduce assessment quality.

  3. 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

  1. added
    p2
    on Jun 23, 2026
  2. self-assigned this
    on Aug 10, 2026
  3. added
    area/adapter-functions
    area/component
    on Aug 10, 2026
  4. added
    bug
    on Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/adapter-functionsarea/componentbugp2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions