Optional [perplexity] extra: reference windowed scorer for the statistical OOD channel (OT.4)
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
Research direction
Read src/doberman/perplexity.py, the proxy’s default subjective-stack wiring, and pyproject.toml; first inspect how TokenChannelDetector and extra_detectors are used. The issue is blocked by #234, so check that calibration helper before starting. Done means the opt-in scorer and optional dependencies are wired as specified, with tests for the listed guarantees, including host-hook import isolation.
Written by the indexing model from the issue text.
Description
The deterministic Unicode scanner cannot see a GCG-style adversarial suffix: the red-team corpus proves those fixtures pass it clean, and the statistical channel that would catch them has stayed inert because core ships no scorer. Ship the reference scorer as an optional extra.
Build
src/doberman/perplexity.py:build_perplexity_fn(model_name="gpt2", window, stride)with lazytransformers/torchimports, scoring the max over sliding token windows so a local suffix inside long benign text still scores high;maybe_build_detector()returns aTokenChannelDetector(perplexity_fn=..., perplexity_threshold=...)orNone.pyproject.toml: a newperplexityextra (transformers,torch). Never a default or dev dependency; default CI runs no model.- Wiring: the proxy's default subjective stack appends the detector via
extra_detectors. The host-hook path never imports this module (tested via a clean-interpretersys.modulescheck).
Double opt-in: the extra must be installed AND DOBERMAN_PERPLEXITY=1 set. Without either, behavior is byte-for-byte unchanged.
Guarantees (each one is a test)
- Raise-only: soft channel, AUTH-capped by the subjective layer; it can never lower a verdict or hard-block.
- Model-load failure or a raising scorer means the statistical channel is simply absent; every deterministic protection is untouched.
- Scores only; scored text is never logged or persisted.
- The shipped default threshold is conservative; operators recalibrate with
calibrate_perplexity_thresholdon their own benign corpus.
Honest scope: catches high-perplexity adversarial text within a calibrated FPR budget. Defense-in-depth, not a jailbreak detector.
Blocked by #234 (the calibration helper lands first).
- Dominant language
- Python
- Stars
- 277
- Forks
- 42
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 16
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from DobermanCore/Doberman-Core
-
posthog
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
DobermanCore/Doberman-Core#791 ·
Maintainers usually reply within 3 days
-
level-6
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
DobermanCore/Doberman-Core#782 · 1 comment ·
Maintainers usually reply within 3 days
-
posthog
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
DobermanCore/Doberman-Core#767 ·
Maintainers usually reply within 3 days
-
good first issue help wanted level-2
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DobermanCore/Doberman-Core#333 ·
Maintainers usually reply within 3 days
-
good first issue help wanted level-2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
DobermanCore/Doberman-Core#272 ·
Maintainers usually reply within 3 days
All issues in DobermanCore/Doberman-Core
Similar issues
-
area:models enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
SACGF/variantgrid#2737 · 1 comment ·
Maintainers usually reply within 1 day
-
RedisStorage writes can persist a key without its sliding TTLPossibly taken @lianbie claimed this today. Opentriage/confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
agentscope-ai/agentscope#3878 · 1 comment ·
Maintainers usually reply within 2 days
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
vectorize-io/hindsight#6458 ·
Maintainers usually reply within 1 day