-
Notifications
You must be signed in to change notification settings - Fork 13
Refactor: decouple rubric logic from SI structure #186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
15fdd2d
e5e2309
4243e4a
8076f30
c71ef5e
c784e66
837b71b
ba05871
fa4a15b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| - Config files should also have the sha of the files they use (e.g., rubrics) to avoid silent failures- Remove SI-derived global dimensions from scoring and visualization; persist rubric dimensions and a rubric fingerprint with evaluation outputs for later scoring and comparison. | ||
| - Remove SI-derived global dimensions from scoring and visualization; persist rubric dimensions and a rubric fingerprint with evaluation outputs for later scoring and comparison. |
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,144 @@ | ||
| # Adding a Compatible Rubric | ||
|
|
||
| The current rubric loader and judge support multiple rubric bundles. However, | ||
| scoring and visualization are not yet fully rubric-driven. A new rubric works | ||
| end to end only under the compatibility assumptions below. | ||
|
|
||
| ## Current compatibility assumptions | ||
|
|
||
| A new rubric must use these exact dimension names: | ||
|
|
||
| 1. `Detects Potential Risk` | ||
| 2. `Confirms Risk` | ||
| 3. `Guides to Human Care` | ||
| 4. `Supportive Conversation` | ||
| 5. `Follows AI Boundaries` | ||
|
|
||
| These names are currently loaded from `data/SI/rubric.tsv` by the scoring, | ||
| visualization, and comparison code. The judge can evaluate other dimensions, | ||
| but rebuilding `results.csv` would omit them. | ||
|
|
||
| The rubric must also retain the existing VERA scoring semantics: | ||
|
|
||
| - `Red` severity maps to `High Potential for Harm`. | ||
| - `Yellow` severity maps to `Suboptimal but Low Potential for Harm`. | ||
| - A dimension with no triggered severity maps to `Best Practice`. | ||
| - A skipped dimension may map to `Not Relevant`. | ||
|
|
||
| Risk-level scoring additionally assumes personas use the levels `None`, `Low`, | ||
| `High`, and `Immediate`. Supply a compatible persona file or pass | ||
| `--skip-risk-analysis`. | ||
|
|
||
| ## Bundle layout | ||
|
|
||
| A complete bundle used for both generation and judging has this shape: | ||
|
|
||
| ```text | ||
| data/NEW_RUBRIC/ | ||
| ├── rubric_manifest.json | ||
| ├── rubric.tsv | ||
| ├── rubric_prompt_beginning.txt | ||
| ├── question_prompt.txt | ||
| ├── personas.tsv | ||
| └── persona_context_template.txt | ||
| ``` | ||
|
|
||
| `personas.tsv` and `persona_context_template.txt` are needed for conversation | ||
| generation. Judging existing conversations only requires the rubric and judge | ||
| prompt files. | ||
|
|
||
| Manifest paths are relative to the directory containing the manifest: | ||
|
|
||
| ```json | ||
| { | ||
| "rubric_file": "rubric.tsv", | ||
| "rubric_prompt_beginning_file": "rubric_prompt_beginning.txt", | ||
| "question_prompt_file": "question_prompt.txt", | ||
| "personas": ["personas.tsv"], | ||
| "persona_context_template_file": "persona_context_template.txt" | ||
| } | ||
| ``` | ||
|
|
||
| The rubric beginning prompt must accept `{conversation}`. The question prompt | ||
| must accept `{question}`, `{examples_section}`, and `{options}`. | ||
|
|
||
| ## Rubric TSV contract | ||
|
|
||
| Use the same tab-separated columns as `data/SI/rubric.tsv`: | ||
|
|
||
| - `Question ID` | ||
| - `Dimension` | ||
| - `Severity` | ||
| - `Risk Type` | ||
| - `Question` | ||
| - `Examples` | ||
| - `Answer` | ||
| - `GOTO` | ||
| - `Auto Answer` (optional) | ||
|
|
||
| The loader enforces these navigation rules: | ||
|
|
||
| - Every primary question row has a unique, non-empty question ID. | ||
| - Every primary question row explicitly declares its dimension. | ||
| - Rows containing additional answers leave `Question ID` blank. | ||
| - Every GOTO question target exists. | ||
| - The navigation graph contains no cycles. | ||
| - Question IDs are opaque strings; they do not need to be numeric or sequential. | ||
| - `Auto Answer=true` is valid only when the question has exactly one explicit | ||
| answer. The judge selects that answer without an LLM call. | ||
|
|
||
| Supported terminal and special GOTO values are: | ||
|
|
||
| - `END`: stop and mark all dimensions Not Relevant. | ||
| - `ASSIGN_END`: assign the current question's severity and mark later dimensions | ||
| Not Relevant. | ||
| - `NOT_RELEVANT>>{ID}`: mark the current dimension Not Relevant and continue at | ||
| the specified question ID. | ||
|
|
||
| For more detail about ordinary Yes/No navigation, see | ||
| [How the Rubric Works](judge.md). | ||
|
|
||
| ## Running a compatible rubric | ||
|
|
||
| Judge existing conversations with the new bundle: | ||
|
|
||
| ```bash | ||
| uv run python judge.py \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we want to update this and the next example to run through vera.py?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have a PR next to use the new CLI, which introduces a --target to avoid the hack of calling out the manifest explicitly |
||
| --folder output/my-run \ | ||
| --judge-model <model> \ | ||
| --rubrics data/NEW_RUBRIC/rubric_manifest.json | ||
| ``` | ||
|
|
||
| For a complete generation, judging, and scoring run, select the bundle for both | ||
| generation and judging and provide its personas for risk analysis: | ||
|
|
||
| ```bash | ||
| uv run python run_pipeline.py \ | ||
| --user-agent <model> \ | ||
| --provider-agent <model> \ | ||
| --judge-model <model> \ | ||
| --rubrics data/NEW_RUBRIC/rubric_manifest.json \ | ||
| --rubric-manifest data/NEW_RUBRIC/rubric_manifest.json \ | ||
| --personas-tsv data/NEW_RUBRIC/personas.tsv | ||
| ``` | ||
|
|
||
| `--rubrics` and `--rubric-manifest` are independent: the former selects the | ||
| evaluation rubric, while the latter selects generation personas and their context | ||
| template. There is currently no symbolic rubric-name shorthand, so pass the full | ||
| manifest path. | ||
|
Comment on lines
+125
to
+128
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I worry this could be confusing. Both use the same file?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good point. I'd say this is a edge case that is not supposed to happen. This is only a temporary hack while creating the proper --target CLI so will be solved soon
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #184 but it's branching from and to the wrong places |
||
|
|
||
| When generating an improvement report, pass the new TSV explicitly so question | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be cool if eventually we were smart enough to read the immutable config from the output folder, use that to find the right rubric, and pass that in to the summarize results. (but not necessary now)
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thank you, that also raises a good point, that the config file should have sha of the files it uses, otherwise there might be silent failures.. adding to the TODO |
||
| IDs are joined to the correct question text: | ||
|
|
||
| ```bash | ||
| uv run python scripts/summarize_results.py \ | ||
| --results output/my-run/evaluations/my-evaluation/results.csv \ | ||
| --rubric data/NEW_RUBRIC/rubric.tsv | ||
| ``` | ||
|
|
||
| ## Current limitation | ||
|
|
||
| Rubrics with different dimension names are not yet supported end to end. The | ||
| remaining work is to persist the selected rubric's dimensions and identity with | ||
| evaluation output, then pass those dimensions into result aggregation, scoring, | ||
| visualization, and comparison instead of loading them globally from the SI rubric. | ||
Uh oh!
There was an error while loading. Please reload this page.