Skip to content

politeness-bloat โ€” Politeness Token Removal โ€‹

Severity: WARN (default) ยท Auto-fix: Yes ยท Category: ๐Ÿ“ Verbosity

What It Does โ€‹

Detects unnecessary politeness words that consume tokens without affecting model output quality. LLMs respond identically to "Write a function" and "Please kindly write a function" โ€” the polite version just costs more.

Default Detected Words โ€‹

The following words/phrases are flagged by default:

Word / phraseTokens wasted
please~1
kindly~1
i would appreciate~3
thank you~2
be so kind as to~5
if possible~2

You can customize the list โ€” see Configuration.

Severity: allow_politeness โ€‹

The allow_politeness flag is not intuitive

  • allow_politeness: false (default) โ†’ findings fire at WARN level
  • allow_politeness: true โ†’ findings fire at INFO level (demoted)

Setting allow_politeness: true does not disable the rule โ€” it just reduces severity so it won't fail a --fail-level warn pipeline. To disable entirely, set the rule to false.

Example โ€‹

Input:

Please kindly help me write a Python function.
I would appreciate it if you could add error handling.
Thank you.

With allow_politeness: false (default):

[ WARN ] politeness-bloat (line 1)
  'please' adds ~1.5 tokens without semantic value. Remove it.

[ WARN ] politeness-bloat (line 1)
  'kindly' adds ~1.5 tokens without semantic value. Remove it.

[ WARN ] politeness-bloat (line 2)
  'i would appreciate' adds ~1.5 tokens without semantic value. Remove it.

[ WARN ] politeness-bloat (line 3)
  'thank you' adds ~1.5 tokens without semantic value. Remove it.

With allow_politeness: true:

[ INFO ] politeness-bloat (line 1)
  'please' adds ~1.5 tokens. Consider removing (~1.5 tokens).
  [This is allowed per configuration โ€” removing improves token efficiency.]

After --fix:

Write a Python function.
Add error handling.

Cost Impact โ€‹

At 10,000 calls/day and $0.005/1k tokens, removing 3 politeness tokens per prompt saves:

3 tokens ร— $0.005/1000 ร— 10,000 calls/day ร— 30 days = $4.50/month

Small per-prompt, and it compounds across all your prompts.

False Positives โ€‹

"Please" in quoted strings or examples โ€” the rule matches case-insensitively as a whole word, so please inside a quoted string like "Please enter your name:" will still trigger. If your prompt is about a UI element that uses "please", disable the rule or adjust your prompt to use a placeholder.

"If possible" as a genuine constraint โ€” if you mean "do X if it's feasible given the constraints", consider replacing with a clearer conditional rather than suppressing the rule.

Configuration โ€‹

yaml
rules:
  politeness_bloat:
    enabled: true
    allow_politeness: false    # false = WARN (default), true = INFO
    words:                     # override the full list
      - please
      - kindly
      - i would appreciate
      - thank you
      - be so kind as to
      - if possible
      - could you please
      - would you mind
    savings_per_hit: 1.5       # tokens saved per occurrence (used in output messages)

fix:
  politeness_bloat: true       # auto-remove on --fix

Add custom words โ€‹

To add words to the default list, you must specify the full list:

yaml
rules:
  politeness_bloat:
    words:
      - please
      - kindly
      - i would appreciate
      - thank you
      - be so kind as to
      - if possible
      - with your assistance    # custom addition
      - at your earliest convenience  # custom addition

Disable โ€‹

yaml
rules:
  politeness_bloat: false

Released under the Apache 2.0 License.