Skip to content

research: boundary-aware constrained reconstruction without hidden Unicode - #125

Draft
byte271 wants to merge 1 commit into
mainfrom
research/boundary-aware-reconstruction-v1
Draft

byte271 wants to merge 1 commit into
mainfrom
research/boundary-aware-reconstruction-v1

Conversation

@byte271

@byte271 byte271 commented Nov 4, 2026

Copy link
Copy Markdown
Owner

New executable research mechanism

This is the next experimental step toward LLM text-watermark removal, not a detector product and not another Unicode layer. It is not yet a demonstrated watermark remover.

  • Add a dependency-free finite candidate-lattice planner under research/reconstruction/.
  • Track cross-sentence n-gram boundaries and optimize three normalized-text views jointly under a fixed edit budget.
  • Use source-sized denominators so output padding cannot dilute the objective.
  • Pareto-prune only equal-tail states, replay the complete output, and fail closed on state/evaluation limits. Exactness is limited to the supported tokenizers, supplied lattice, and objective.
  • Add a deliberately narrow English reporting-frame frontend: entity, metric, literal amount, unit, year, and negation must reparse identically and in order. Unsupported text is returned unchanged, not silently treated as successful removal.
  • Provide runnable CLI, receipts, frozen development protocol, greedy comparator, exhaustive references, and a legacy-carrier inverse control.

What is and is not measured

The corpus comprises 128 newly synthesized controlled-grammar documents. It is not LLM-generated watermarked prose. The metric is retained source-window overlap, not a watermark detector score or removal rate. Regex word/token views are not GPT-2/BPE or separate commercial tokenizer families.

Local check Result
New tests 102 passed
Existing CLI, CLI I/O, protected-machine-text tests 70 passed
Combined targeted tests 172 passed
Joint search strictly improves worst-view retention over identical-budget full-output coordinate greedy 51/128
Ties on worst-view retention 77/128
Mean worst-view retention: greedy / joint 0.6205182055 / 0.5987639731
Exhaustive benchmark comparisons 24/24
Randomized exhaustive-search tests 48/48
Grammar-frame/form roundtrips 2,048
Legacy outputs restored by deleting known carriers 128/128
New outputs unchanged by NFKC plus known-carrier deletion 128/128

Local runtime: CPython 3.13.5 on Linux. These are targeted local results, not a claim that full GitHub CI is green. The comparison is against the included coordinate-greedy baseline, not the repository's historical scheduler.

Canonical benchmark rows SHA-256: 36d173f4e1521f74a963754c917724eaf4e5ba37b62201feb662a5510f495736.

Limits

No real SynthID/KGW/proprietary-detector evaluation was run: the local runtime lacks pretrained tokenizer/model assets and outbound DNS was unavailable. The current end-to-end frontend handles only the documented reporting grammar; arbitrary English/Chinese prose is not supported. Visible wording changes. Frame equality is not universal semantic proof. Receipts explicitly retain watermark_removal_verified: false.

Scope control

Based on 09c8cbf184e37e2e934e133b74a5db9af67b4f97, independent of import-boundary PR #124. Only 10 new research/test/documentation files are added. No production algorithm, CLI default, hidden-carrier stack, frozen evidence, dependency, version, or workflow trigger changes. No model-generation reruns were manually requested. Keep draft until full-checkout CI and scientific review are complete.

Reproduce

python -m pytest -q tests/test_reconstruction.py
python -m research.reconstruction --text "Orion Labs reported a revenue of 120 USD in 2025. Vega Systems did not report a cost of 42 EUR in 2024." --json
python -m research.reconstruction.benchmark --output geometry-128.json
python -m research.reconstruction.legacy_control --output legacy-control.json

Add a dependency-free experimental candidate-lattice planner with bounded
exact multi-view search, cross-sentence window accounting, fixed source
normalization, and a narrow reporting-frame frontend. Do not alter the
production CLI, Unicode carriers, frozen evidence, or workflow triggers.

Local verification: 102 new tests and 70 existing CLI/machine-text tests pass.
On 128 synthetic grammar fixtures, joint search improves worst-view source
window retention over an identical-budget coordinate-greedy baseline on 51
cases; 24 exhaustive comparisons agree. This is a geometry mechanism test,
NOT a real LLM-watermark removal result. Scope and failure behavior are
explicit in receipts and documentation.
@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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