Rewrite quality checks allow grammatically malformed generalizations
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- ai, testing-qa
Research direction
Start by running docs/notebook_source/04_rewriting_biographies.py with the default rewrite configuration and inspect result.dataframe["biography_rewritten"]. Review the malformed examples and the quality metrics showing needs_human_review=False, then determine whether evaluation or repair should catch them. Done means malformed rewrites are corrected or marked for human review, with coverage beyond the reported biography cases.
Written by the indexing model from the issue text.
Description
Priority Level
Medium (Annoying but has workaround)
Describe the bug
Summary
The rewrite pipeline can produce grammatically malformed sentences when generalizing an entity embedded in a noun phrase. These outputs can still pass the automated quality gate with relatively high utility scores and needs_human_review=False.
Observed behavior
While executing docs/notebook_source/04_rewriting_biographies.py, the pipeline produced:
Luca Hawthorne is a in his late 30s astronomer...
Robert Harper is a in his late 60s paramedic...
The age values were generalized, but the surrounding sentences were not restructured. Grammatically correct versions would be:
Luca Hawthorne is an astronomer in his late 30s...
Robert Harper is a paramedic in his late 60s...
The malformed outputs received the following metrics:
| Output | Utility | Leakage | Needs review |
|---|---|---|---|
| Luca Hawthorne… | 0.908333 | 0.0 | False |
| Robert Harper… | 0.87 | 0.0 | False |
No repair was triggered.
Expected behavior
Generalized values should be integrated into grammatically correct prose. Clearly malformed rewrites should either be repaired automatically or marked for human review.
Likely failure mode
The model appears to substitute the generalized age phrase without restructuring the enclosing noun phrase:
a 37-year-old astronomera in his late 30s astronomer
Although the rewrite prompt requires natural prose, the current quality evaluation does not reliably detect this grammatical failure.
Impact
- Generated text can be visibly ungrammatical despite passing evaluation.
- Utility scores may overstate output quality.
needs_human_reviewdoes not identify malformed prose because it is score and threshold based.- Users may consume or publish defective rewrites without an obvious failure signal.
Suggested next steps
- Add prompt examples showing how attributive phrases must be restructured during generalization.
- Add explicit grammaticality or fluency criteria to the quality evaluator.
- Trigger repair when malformed syntax is detected.
- Study if this is the only case where it is happening, perhaps it's slipping through in other benchmark datasets too.
Steps/Code to reproduce bug
The malformed outputs were generated and committed in:
They were identified during review of PR #274:
To reproduce:
- Run
docs/notebook_source/04_rewriting_biographies.pyusing the default rewrite configuration. - Inspect
result.dataframe["biography_rewritten"]. - Because generation is nondeterministic, repeated execution may be required.
- Observe that malformed output can receive a passing utility score and
needs_human_review=False.
Expected behavior
Rewrite should generate correct grammar
Additional context
No response
- Dominant language
- Python
- Stars
- 136
- Forks
- 22
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 47
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 NVIDIA-NeMo/Anonymizer
-
Use context to recognize personal initials and lowercase namesPossibly taken @lipikaramaswamy claimed this 9 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
NVIDIA-NeMo/Anonymizer#340 ·
Maintainers usually reply within 1 day
-
Clarify date validation for months, years, and partial datesPossibly taken @lipikaramaswamy claimed this 9 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA-NeMo/Anonymizer#334 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NVIDIA-NeMo/Anonymizer#327 ·
Maintainers usually reply within 1 day
-
Replacement-map generation can silently omit a requested entity, causing the rewrite to be marked unavailablePossibly taken @dundysm claimed this 43 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA-NeMo/Anonymizer#278 · 2 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NVIDIA-NeMo/Anonymizer#6 · 1 comment ·
Maintainers usually reply within 1 day
All issues in NVIDIA-NeMo/Anonymizer
Similar issues
-
bug severity:low
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 2 days
-
curriculum documentation quality
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
githubnext/gh-aw-workshop#5367 ·
Maintainers usually reply within 3 days
-
OAuth documentation for GET /api/v2/users/me/ appears inconsistent with required global read scopeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Create Noise Latents ignores randomize_seed and produces the same noise every runPossibly taken @griptapeops claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
griptape-ai/griptape-nodes-library-diffusers#127 ·
Maintainers usually reply within 1 day
-
Jenkins capacity report: metrics history is lost when archiving a month failsPossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
adoptium/infrastructure#4568 ·
Maintainers usually reply within 1 day