perf: Update config.default.toml (Adding more refusal markers)#212
perf: Update config.default.toml (Adding more refusal markers)#212Exponent-Pi wants to merge 1 commit intop-e-w:masterfrom
Conversation
Adding more refusal markers to detect safety mannerisms and pivots to other topics and so many more to catch different forms of refusals.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request aims to significantly improve the system's ability to detect when a Large Language Model (LLM) refuses a request. By expanding the list of predefined refusal markers, the changes enable the system to identify not only direct refusals but also more nuanced responses, such as topic pivots or indirect statements of inability. This enhancement is crucial for refining LLM interaction and ensuring more accurate safety and compliance checks. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request expands the list of refusal_markers in config.default.toml to improve refusal detection. While the expanded list is a good addition, there are a couple of issues. First, the default values for refusal_markers in src/heretic/config.py have not been updated, creating an inconsistency with config.default.toml. This can cause different application behavior depending on the configuration setup and goes against the spirit of the repository's style guide for configuration management. Second, the new list contains several duplicate entries that should be removed for clarity and maintainability. Please see my detailed comments.
Note: Security Review has been skipped due to the limited scope of the PR.
|
How was this list derived? About half of the new entries would already have been detected previously (through markers like "i can't"). It's not clear to me why those original markers would lead to false positives. Can you give some examples of actual responses from models that were misclassified before and are being correctly classified with this change? |
|
I derived it from eliciting common model refusals from all types of LLMs, like Claude, ChatGPT, Gemini, and open-weight LLMs. And for example, "I apologize" was something that was not detected in the original. I took the time to actually analyze the mannerisms that appear frequently in other responses that the original would not have caught just in case my additions do not catch the beginning of the refusal. Also, don't forget distillation is a real thing, and RLHF comes along with that, and it is increasingly teaching models to acknowledge your request and then pivot to a "safer" topic. like "I understand," then we can identify the common "however" responses in a lot in these pivoting or indirect refusals. |
I have seen LLMs use the words "I apologize" quite frequently in non-refusal situations though. As I said, it would be helpful if you could give some concrete examples of actual responses from models that were misclassified before. |
|
|
|
"I won't" and "I can't" were already in the list before this PR though. Still waiting for a concrete example of an actual model response whose classification is getting fixed by this PR. |
|
That's right, mistake on my part for overseeing |
|
We're using |
|
Closing this PR due to no feedback for more than a month. Feel free to reopen if you decide to get back to this. |
It increases refusal markers and detects pivots to other topics and all sorts of refusals. This may help refusal detection in the long run as LLMs are instead using pivots as safety measures instead of a straight brittle refusal with a bonus of less false positives.