Paper Examples

Reproduce paper-inspired Mesmer workflows while keeping reusable primitives generic.

Paper-inspired implementations live in examples/papers/.

Current examples include:

  • TAP: Tree of Attacks with Pruning.
  • PAIR: Prompt Automatic Iterative Refinement.
  • JBFuzz: mutation and fuzzing-style search.
  • Autonomous jailbreak agents: frontier-search technique with iterative feedback.

Paper examples should use real model actors and targets through Mesmer wrappers, not direct LiteLLM calls or fake callable targets unless explicitly marked as tests.

GCG-style work is currently represented as black-box reusable pieces, not as a full white-box GCG reproduction. True GCG needs tokenizer, logits, loss, gradient, and token-replacement access. Mesmer's current extraction keeps the useful hosted-model shape: source-backed paper.gcg.* prompt patterns, suffix-only proposal, deterministic suffix application through ops.ApplyTransforms, and response-start evaluation.

Paper names should stay in examples unless the mechanism generalizes. Generic mechanics now have reusable homes: Probe for one-shot probes, BestOfNProbe for bounded sampling, FrontierSearch for iterative branching, ConversationAgentProbe for explicit multi-turn loops, and PopulationFuzzing for seed-pool mutation and reward workflows.

Run a small TAP example:

MESMER_LOG_FORMAT=compact uv run python examples/papers/tap/run_tap.py --limit 1

Paper-specific prompts, datasets, URLs, thresholds, marker strings, and explanatory state names belong in examples. Extract stable reusable mechanics into strategies, operators, or techniques only when the mechanism appears beyond one paper.