Implement hard confidence gate
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Summary
Implement a confidence gating mechanism that decides whether to use lookup or fall back to neural generation.
## Success Criteria
- [ ] Confidence score computed from n-gram statistics
- [ ] Threshold tuning mechanism
- [ ] Gate can be adjusted at inference time
- [ ] Metrics tracked: gate hit rate, confidence distribution
- [ ] A/B comparison infrastructure ready
## Confidence Metrics (Candidates)
- Raw count threshold
- Probability vs uniform baseline
- Entropy of continuation distribution
- Coverage (% of vocabulary seen)
## Interface
\`\`\`python
def should_use_lookup(context: list[str], threshold: float = 0.8) -> tuple[bool, float]:
"""Returns (use_lookup, confidence_score)"""
...
\`\`\`
## Open Questions
- Should threshold vary by position in sequence?
- How to handle partial matches (2-gram when 3-gram fails)?
Contributor guide
Assessment
This issue has not been assessed yet.