[FEATURE]: Near-duplicates in the exclusion fork and verifiable topic exclusion Issue Body

Open
#315 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@rushil23shah-hue is already working on this.

Since Nov 18, 2026.

  • #316 by @rushil23shah-hue — open

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Read docs/roadmap.md and inspect simple/near_duplicates.py and simple/ovl.py, plus the fork and verification paths mentioned in the proposal. The author reports a local implementation and plans to open a pull request, so check the issue for that work before starting. Done means measuring secondary mentions and passage losses, validating topic-filter provenance and range coverage in the chain, and comparing against rarity-matched controls as described.

Written by the indexing model from the issue text.

Description

Per the project roadmap in docs/roadmap.md (#next):

"Near-duplicates in the exclusion fork. The fork removed the 3I/ATLAS article as one document. Other articles that mention the comet stayed in, so the model may still have learned most of its facts. Count the training articles that mention it, and compare both models' loss on those passages. Then try excluding by topic (every range that mentions it), not by document. A topic exclusion is only as good as the filter that picks the ranges, so record the filter's code and version in the chain, and report its misses on a hand-checked sample. Compare against control articles about equally rare subjects, not just random articles of similar length, to separate what the removal did from its general knock-on effect on later training."

I would like to work on implementing this feature.

Proposed Architecture & Design:
  1. Secondary Mention Scanning (simple/near_duplicates.py):
    • Vectorized token subsequence search over tokens.u16 with leading whitespace variants and data.OFFSET.
    • Exclude the primary removed document (3I/ATLAS) from documents.jsonl so only secondary mentions across the corpus are measured.
    • Align every mention passage with exact training context windows ($k \times \text{ctx}$).
  2. Passage Loss & Token-by-Token Attribution:
    • Compute next-token cross-entropy loss under both base models ($\mathcal{L}{\text{orig}}$ and $\mathcal{L}{\text{fork}}$).
    • Attribute token-level perplexity deltas ($\Delta_{\text{token}} = \mathcal{L}{\text{fork}} - \mathcal{L}{\text{orig}}$) across the mention span.
  3. Rarity-Matched Controls & Significance:
    • Compare against equally rare astronomical controls (1I/'Oumuamua, 2I/Borisov) rather than arbitrary length-matched documents.
    • Compute 1,000-resample paired bootstrap 95% CI and permutation test ($p$-value).
  4. Verifiable Topic Filter Specification (topic_filter.json):
    • Cryptographically commit the filter extractor code SHA-256 (filter_code_sha256), version, hand-checked sample error rate, and sorted target ranges [[start, count], ...].
  5. Chain Integration in simple/ovl.py:
    • Add --exclude-topic-filter FILE to ovl.py fork, committing filter metadata into chain.jsonl under entry["fork"]["topic_filter"] and applying target ranges to control["exclude"]["wikipedia"] for bit-for-bit coverage validation by ovl.step and verify_segment.

I have implemented and tested this locally (82/82 tests pass on CPU, clean ruff lint). I will open the PR shortly.

Dominant language
Python
Stars
27
Forks
72
Avg merge
2d 19h
Merged PRs (30d)
45

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from AOSSIE-Org/OpenVerifiableLLM

All issues in AOSSIE-Org/OpenVerifiableLLM

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.