Repository navigation
feat(rag): govern perturbation anchors for privacy-preserving scoring #798
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
Merged
Merged
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f75d376
rebuild: #798 unique product delta on current main
seonghobae 8e542e0
merge main into governed RAG perturbation anchors after #800
seonghobae 2db3890
Merge branch 'main' into fix/rag-perturbation-anchors-green
seonghobae 2cbe077
Merge branch 'main' into fix/rag-perturbation-anchors-green
opencode-agent[bot] 8317fe8
Merge branch 'main' into fix/rag-perturbation-anchors-green
opencode-agent[bot] 4f23815
test(rag): bind anchors to governed request relationships
seonghobae 0cb1643
test(rag): bind anchors to transform provenance
seonghobae 8c25fce
fix(rag): validate governed perturbation relationships
seonghobae e04731e
test(rag): migrate anchors to governed request pairs
seonghobae 5878dd7
docs(rag): separate provenance from scientific hypotheses
seonghobae b6af395
docs(changelog): record governed perturbation relationships
seonghobae a98af5e
Merge main into fix/rag-perturbation-anchors-green
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| # Governed RAG perturbation anchors | ||
|
|
||
| ## Added | ||
|
|
||
| - Added source-free, content-addressed reference-free RAG perturbation anchors with finite preregistered construct/direction semantics for unsupported claims, contradictions, irrelevant context, required-evidence removal, citation swaps, semantic paraphrases, style-only rewrites, and unanswerable queries. | ||
| - Require distinct governed baseline and perturbed request fingerprints and fail closed on unknown perturbation semantics or malformed identities. Expected directions are validation hypotheses, not claims that an observed system actually changed or that an evaluator is ground truth. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,47 @@ | ||
| # Governed RAG scoring request privacy | ||
| # Governed RAG scoring request and perturbation-anchor doctoring | ||
|
|
||
| ## Standards | ||
| ## Standards and research basis | ||
|
|
||
| American Educational Research Association, American Psychological Association, & National Council on Measurement in Education. (2014). *Standards for educational and psychological testing*. American Educational Research Association. | ||
|
|
||
| Es, S., James, J., Espinosa-Anke, L., & Schockaert, S. (2024). RAGAS: Automated evaluation of retrieval augmented generation. In *Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations* (pp. 150–158). Association for Computational Linguistics. https://doi.org/10.18653/v1/2024.eacl-demo.16 | ||
|
|
||
| National Institute of Standards and Technology. (2020). *Security and privacy controls for information systems and organizations* (NIST SP 800-53 Rev. 5). https://doi.org/10.6028/NIST.SP.800-53r5 | ||
|
|
||
| ## Rationale | ||
| Saad-Falcon, J., Khattab, O., Potts, C., & Zaharia, M. (2024). ARES: An automated evaluation framework for retrieval-augmented generation systems. In *Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers)* (pp. 338–354). Association for Computational Linguistics. https://doi.org/10.18653/v1/2024.naacl-long.20 | ||
|
|
||
| Williamson, D. M., Xi, X., & Breyer, F. J. (2012). A framework for evaluation and use of automated scoring. *Educational Measurement: Issues and Practice, 31*(1), 2–13. https://doi.org/10.1111/j.1745-3992.2011.00223.x | ||
|
|
||
| ## Privacy and provenance rationale | ||
|
|
||
| Reference-free RAG evaluation records provenance identities (system configuration, retrieval run, query revision fingerprints) without embedding raw query, context, answer, or source text. Managed identifiers must reject free-form content so the canonical scoring artifact cannot become a side channel. The host application may retain source material only under its own purpose-bound security, privacy, retention, and authorization controls. | ||
|
|
||
| ## Controlled perturbation anchors | ||
|
|
||
| `RAGPerturbationAnchor` preregisters a finite construct-specific expectation against two distinct governed scoring-request fingerprints. The package currently represents these hypotheses: | ||
|
|
||
| Reference-free RAG evaluation records provenance identities (system configuration, retrieval run, query revision fingerprints) without embedding raw query, context, or answer text. Managed identifiers must reject free-form content so the canonical scoring artifact cannot become a side channel. | ||
| - unsupported claim or explicit contradiction -> `grounded_generation` decreases; | ||
| - irrelevant context -> `retrieval_relevance` decreases; | ||
| - required-evidence removal -> `coverage_or_completeness_proxy` decreases; | ||
| - citation-target swap -> `citation_attribution` decreases; | ||
| - semantic query paraphrase or style-only rewrite -> `robustness` remains approximately invariant; and | ||
| - unanswerable query -> `answerability_and_abstention` increases. | ||
|
|
||
| These are controlled-validation expectations, not observed scores, statistical tests, causal effects, ground-truth labels, or evidence that a particular judge can identify world correctness. Context-groundedness remains conditional on the declared evidence regime. A successful anchor regression therefore demonstrates contract identity and preregistered direction semantics only; empirical validation still requires governed observations, calibrated evaluator/rater evidence, subgroup/DIF and drift analysis where applicable, and recovery or human-audit evidence commensurate with the intended interpretation. | ||
|
|
||
| ## Numerical and ownership boundary | ||
|
|
||
| The anchor layer performs no likelihood, calibration, thresholding, uncertainty estimation, scoring aggregation, retrieval, provider call, or truth adjudication. New production psychometric/numerical arithmetic remains Rust-owned with model-appropriate convergence and recovery evidence. Human, rule, AI, and LLM evaluator outputs remain fallible observations rather than truth by identity. | ||
|
|
||
| ## Implementation | ||
|
|
||
| `python/fast_mlsirm/scoring/rag.py` — `build_rag_scoring_request` validates `system_configuration_id` via `descriptive_identifier` and allowlists caller metadata. | ||
| `python/fast_mlsirm/scoring/rag.py`: | ||
|
|
||
| - `build_rag_scoring_request` validates `system_configuration_id` via `descriptive_identifier` and allowlists caller metadata; | ||
| - `RAGPerturbationKind` and `RAGPerturbationDirection` close the perturbation vocabulary; | ||
| - `RAGPerturbationAnchor` derives package-owned construct/direction semantics, rejects no-op baseline/perturbed request pairs, and content-addresses immutable anchor content; and | ||
| - `build_rag_perturbation_anchor` exposes only governed identities and perturbation kind, with no raw-content parameters. | ||
|
|
||
| `tests/test_scoring_rag_perturbation_anchors.py` binds the finite mapping, deterministic fingerprints, fail-closed malformed/unknown inputs, distinct request identities, and source-free public signature. | ||
|
|
||
| This bounded contract advances issue #607 stage-2 validation infrastructure. It does not by itself establish RAG system validity, a scalar quality score, evaluator interchangeability, retrieval recall, world correctness, calibration, DIF invariance, or release readiness. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.