Skip to content

feat: novelty pressure tests — Phase 2 benchmark honesty - #8

Closed
cschanhniem wants to merge 1 commit into
mainfrom
feat/novelty-pressure-tests
Closed

cschanhniem wants to merge 1 commit into
mainfrom
feat/novelty-pressure-tests

Conversation

@cschanhniem

Copy link
Copy Markdown
Collaborator

Summary

Implements Phase 2: Novelty pressure from AGENTS.md:

"Top candidates are not merely copies of known AMP motifs."

This PR verifies that the pipeline actively penalizes near-duplicate copies of known AMPs and selects genuinely novel sequences instead.

Test dataset: examples/benchmark/novelty_pressure_pool.csv

ID Sequence Type
NOV-DUP-001 KWKLFKKIGAVLKVL Exact copy of REF-000001
NOV-DUP-002 KWKLFKKIGAVLKFL 1-substitution near-dup
NOV-DUP-003 KWKLFKRIGAVLKVL 1-substitution near-dup
NOV-NEW-001 RRLKKVLGAVLKVLK Genuinely novel AMP-like
NOV-NEW-002 WKWLKKIRGKLLKV Genuinely novel AMP-like
NOV-NEW-003 FLKHFKIKAVLKRLK Genuinely novel AMP-like
NOV-NEG-001..005 degenerate sequences Non-AMP negatives

What the tests prove

Test Result
Exact reference copy → novelty = 0.0 ✅
1-substitution near-dup → novelty < 0.20 ✅
Genuinely novel AMP-like → novelty ≥ 0.20 ✅
Novelty decreases monotonically with similarity ✅
nearest_reference populated for near-dups ✅
Pipeline excludes near-dups from selected batch ✅
Exact reference copy never in selected batch ✅
Novel AMPs preferentially selected over near-dups ✅
Near-dups don't dominate top-5 ranked candidates ✅
Near-dups confirmed at ≥70% similarity to references ✅

Test plan

  • make test — 50 tests pass
  • ruff check src tests — clean

Phase 2: Novelty pressure — top candidates must not be mere copies of known AMP motifs.

- Add examples/benchmark/novelty_pressure_pool.csv: 11 sequences including
  3 near-dups of known references (NOV-DUP-*), 3 genuinely novel AMP-like
  sequences (NOV-NEW-*), and 5 non-AMP negatives (NOV-NEG-*)
- Add test_novelty_pressure.py: 13 tests verifying:
  - Exact reference copies receive novelty = 0.0
  - 1-substitution near-dups receive novelty < 0.20 (below min_novelty threshold)
  - Genuinely novel sequences receive novelty >= 0.20
  - Novelty decreases monotonically with increasing reference similarity
  - nearest_reference field is populated for near-duplicate candidates
  - Pipeline min_novelty filter excludes near-dups from selection
  - Exact reference copies never appear in selected batch
  - Novel AMP-like candidates preferentially selected over near-dups
  - Near-dups do not dominate the top-5 ranked (novelty weighting has effect)
- Add recall_at_k, random_recall_at_k, enrichment_factor, benchmark_summary to evaluate.py
- Fix ruff F401 unused imports across pipeline.py, test_cli.py, test_pipeline_filters.py
- 50 tests passing, ruff clean
@cschanhniem

Copy link
Copy Markdown
Collaborator Author

Superseded by PR #11 (feat/integrate-all-phases), which merges all Phase 2 + Phase 3 work into a single consolidation PR with 251 tests passing.

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.

1 participant