Repository navigation
fix(format): keep soft penalty zero at threshold - #237
Merged
helloml0326 merged 1 commit intoNov 15, 2026
Merged
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com>
helloml0326
approved these changes
Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenJudge Version
0.2.5, main
03c444567d5bb10429b10f4d2ad9df493b0edcc9.Description
With
use_soft_penalty=True,min_scaling=0.5,max_penalty=-2, and the real simple tokenizer, publicaevaluate()produces:alpha beta gamma alpha betaalpha beta alpha betaalpha beta alpha beta alphaThe exact threshold falls through both comparisons and retains the unnormalized repetition rate. Consequently, a less repetitive response receives a larger penalty than a more repetitive one. Include equality in the zero-penalty branch so soft scaling starts only above the threshold. Hard penalties and the default zero threshold retain their behavior.
Add 11 public scoring cases for unigram/bigram/trigram thresholds, a second threshold, below/above/default controls, metadata, and hard penalties. Document the existing
min_scalingparameter. No dependencies, model calls, replaced tokenizer, or service fixtures.Validation:
pytest tests/graders/format/ tests/graders/text/ -q: 232 passed (three first-import jieba warnings).pre-commit run --all-files --verbose: all hooks passed, including configured pytest 1221 passed, 139 skipped, five existing NumPy zero-variance warnings. The configured test hook excludes multimodal/generator/data/examples; skipped provider tests were not executed.0, 0, -0.4after the fix;git diff --checkpasses.No existing related issue was found after checking all open PR files, repetition/ngram/soft-penalty reports and the file history. AI assistance: OpenAI Codex for investigation, implementation and validation.
Checklist
pre-commit run --all-files.