Redpen, a linter for LLM prose: five sentences scored, four flagged as slop

Redpen Slop 11M

A linter for LLM prose. Redpen is an 11M-parameter token classifier that underlines the slop in a sentence, word by word.

LLM fiction has a house style. A shiver runs down her spine. He lets out a breath he didn't know he was holding. Her voice is barely above a whisper. Banning the words doesn't fix it: the model swaps "shiver" for "tremor" and carries on. So I trained a small model on the patterns.

At its strict setting, 97% of what it flags is slop a human editor would cut. It runs at about 4,700 sentences a second on a laptop CPU, so you can put it behind every reply your model writes.

Same sentence, with and without

Bold is the span Redpen marked. Scores are the highest token probability in the sentence, from this checkpoint.

Flagged Passes
He sets the cup down, jaw tight. 0.83 He sets the cup down. 0.00
She crosses the room and stays there, chest heaving. 1.00 She crosses the room and takes the glass out of your hand. 0.00
She meets your gaze and holds it. 1.00 She ties off the bandage, watching your hands. 0.02

Both sentences in the last pair have a look in them, and only one is slop. A word list can't make that call.

What it flags

Pattern Examples from this checkpoint
Reaction beat Her breath hitches. 1.00 ยท Her heart pounds in her chest. 0.99
Voice beat His voice drops to a whisper. 1.00
Stock face A smirk plays on his lips. 1.00
โ€ฆ many more patterns

The rest are in the weights.

Use it

from transformers import pipeline

redpen = pipeline("token-classification", model="dempfi/redpen-slop-11m", aggregation_strategy="simple")

for span in redpen("She crosses the room and stays there, chest heaving."):
    if span["entity_group"] == "slop":
        print(span["word"], round(float(span["score"]), 2))
# and stays there, chest heaving 0.99

Feed it one sentence at a time; the context is 128 tokens. A sentence is flagged when its highest token probability reaches the threshold. 0.7 is the default. Use 0.99 when a false flag is expensive, and 0.5 when a miss is.

Use the spans to trigger a regeneration, to drive a targeted rewrite, to filter fine-tuning data, or as a per-model slop rate in evals.

For SillyTavern, JanitorAI and other OpenAI-compatible frontends there is a ready-made extension and proxy: github.com/dempfi/redpen.

Results

Scored with this exact checkpoint on a held-out set that a human editor labelled blind. None of it was used in training.

  • Zero false flags at its tightest setting. At threshold 0.999, every sentence it flagged was slop.
  • Its 50 most confident flags were all correct. Of its top 100, 98 were.
  • Strict mode is 97% precise and still catches half of all slop, while flagging under 2% of clean sentences.
  • Wide mode catches 3 in 4 slop sentences at 86% precision.
  • ROC AUC 0.90, average precision 0.91.
Mode Threshold Precision Recall Clean sentences left alone
Tightest 0.999 1.00 0.08 100%
Strict 0.99 0.97 0.49 98%
High 0.95 0.92 0.61 94%
Default 0.7 0.87 0.71 89%
Wide 0.5 0.86 0.75 87%
Parameters 11.1M
Size 42 MB (fp32)
Architecture BERT, 4 layers, 256 hidden, 4 heads
Context 128 tokens, one sentence per call
Speed 4,700 sentences/s (batch 64, 4 CPU threads, Apple Silicon laptop)

Training

Redpen is a distilled 4-layer BERT, trained on fiction and roleplay sentences labelled against an editing rubric. The test set above was kept out of training entirely.

Limits

  • English only.
  • It learned from fiction and roleplay. It has never seen an essay or an email, so it won't catch "delve" or "rich tapestry".
  • It misses "it's not X, it's Y" in quoted dialogue.
  • It over-flags character bios. For those, run it at 0.9 and read what it marks before you cut.
  • The taste is strict. If it flags more than you want, raise the threshold.

If it gets a sentence wrong, post the sentence in the Community tab.

License

CC BY-NC 4.0. Free for personal projects, research and other non-commercial use, with credit. For commercial use, open a discussion on this repo.

Downloads last month
663
Safetensors
Model size
11.1M params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for dempfi/redpen-slop-11m

Quantized
(5)
this model

Evaluation results

  • Precision (strict, threshold 0.99) on Held-out human verdicts
    self-reported
    0.970
  • ROC AUC on Held-out human verdicts
    self-reported
    0.901
  • Average precision on Held-out human verdicts
    self-reported
    0.910
  • F1 (threshold 0.5) on Held-out human verdicts
    self-reported
    0.802