Skip to content

Vince/evidence source indices - #935

Draft
vintrocode wants to merge 6 commits into
mainfrom
vince/evidence-source-indices
Draft

Vince/evidence source indices#935
vintrocode wants to merge 6 commits into
mainfrom
vince/evidence-source-indices

Conversation

@vintrocode

Copy link
Copy Markdown
Contributor

make the deriver indicate which messages a conclusion came from via source ids

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dcb70a22-dae3-4265-be53-b10e465435ae

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vince/evidence-source-indices

Comment @coderabbitai help to get the list of available commands.

vintrocode and others added 4 commits July 28, 2026 14:35
- Renamed 'atomic facts' to 'molecular facts'
- Added decontextuality (stranger test) instruction with enduring vs incidental descriptors
- Added minimality instruction (only enough context for interpretability)
- Removed proposition gate (redundant with d + m gradient)
- Updated examples to show molecular ideal
Each explicit observation now carries source_indices — 0-based indices
into the <messages> block pointing to the messages that directly support
the conclusion. Messages in the prompt are prefixed with [N] indices.

This enables the action-based judge's evidence entailment criterion to
slice the conversation to just the supporting messages instead of using
the full conversation as evidence context (degraded mode).

No text duplication — the LLM outputs indices (cheap, low-error), and
the judge looks up the real message text from the trace input.
- Clarify that source_indices can point at any speaker's messages,
  not just the user's — what matters is which messages contain the evidence
- Add two examples: assistant-sourced attribution and multi-message
  attribution showing question + recommendation + confirmation
- Addresses issue where deriver cited wrong messages for conclusions
  derived from assistant responses
@matthewlanders
matthewlanders force-pushed the vince/evidence-source-indices branch from 4a28e4f to 5bce6b9 Compare July 28, 2026 20:08
Comment thread src/deriver/prompts.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prompt deviates greatly from the original prompt.
Needs to be tested against the current Neuromancer model to see if any negative effects occur.

Maybe we should keep this prompt out from this PR and scope this PR only to the batch message.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vintrocode I know you did some testing. Good to remove the prompt from this PR or is it required for the other changes?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that if we do revert most of the prompt changes, we will still need to update the prompt to give the model context about source_indices .

@VVoruganti VVoruganti left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So main thing to note here is that the batch_message_ids that were added as a new field in this draft would include also the IDs from the interleaved messages from other speakers.

This means that an explicit conclusion for peer A can reference a message made by peer B in the conversation. Historically we have been authorative in saying a conclusion can only be made for a peer based on something the Peer has actually said, otherwise any claim by a separate peer could lead to nonsensical conclusions being made

@matthewlanders

Copy link
Copy Markdown

So main thing to note here is that the batch_message_ids that were added as a new field in this draft would include also the IDs from the interleaved messages from other speakers.

This means that an explicit conclusion for peer A can reference a message made by peer B in the conversation. Historically we have been authorative in saying a conclusion can only be made for a peer based on something the Peer has actually said, otherwise any claim by a separate peer could lead to nonsensical conclusions being made

A few things important to clarify:

1.) The context from which conclusions are derived hasn't changed — the deriver has always seen other speakers' messages as context ("Extract ALL observations from the target peer's messages, using others as context" is the pre-existing rule and the prompt is built from every message in the batch, each labeled with its speaker). This PR just makes the model declare which messages it used.

2.) A citation including another peer's message doesn't mean the conclusion rests on their claim. Specifically, the target peer's statements are often uninterpretable alone ("the first one" in response to "do you prefer Python or Rust"). Because the entailment judge only sees cited messages, the interpreting context has to be cited or valid conclusions fail. In both prompt examples the peer's own message is always among the sources.

If anything this makes the "only from what the peer said" stance enforceable for the first time — a conclusion citing zero target-peer messages is now mechanically detectable.

3.) Your comments made me realize that the design of batch_message_ids was kind of suboptimal. It was only ever a lookup table for resolving batch-relative indices, and persisting the full batch list per observation was not useful. I just pushed a small change that resolves citations at save time and stores source_message_ids — just the IDs of the cited messages. source_indices stays in storage as per-derivation debugging provenance only. The model still only ever sees positions, and the peer-filtered message_ids field is untouched.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants