feat(#681): add opt-in toggle for grounded facts correction#696
feat(#681): add opt-in toggle for grounded facts correction#696
Conversation
916a56e to
20d6e09
Compare
Debug APK readyCommit: Updated on each push. Removed when PR is merged or closed. |
…uplication, merge NZ Context/Memory rules
|
Don't think it helped: You: I need help writing a message to send to my nephew. He is currently boarding with us as he recently moved from new Zealand to Australia and we gave him a safe landing pad. Now he's a bit more settled, he has his Medicare and a new job we would like him to move out. The date we want him to move out is June 13th. We need the room for our 16 month old son Lachlan and we want to have our home be our family private space, which we can't do when we have him boarding with us. Here are a few options for the message to your nephew, depending on the tone you want to convey. Option 1: Direct and Warm
Option 2: Softer and More Collaborative
Option 3: Very Concise
Which tone do you think fits best? |
|
Gemma 4 e2b was even worse It did the below and then froze You: I need help writing a message to send to my nephew. He is currently boarding with us as he recently moved from new Zealand to Australia and we gave him a safe landing pad. Now he's a bit more settled, he has his Medicare and a new job we would like him to move out. The date we want him to move out is June 13th. We need the room for our 16 month old son Lachlan and we want to have our home be our family private space, which we can't do when we have him boarding with us. Here are a few options, depending on the tone you want to strike. Option 1. Warm and Encouraging Tone
Option 3. More Casual Tone
Choose the one that sounds most like you. Let me know if you want any changes! |
|
Gemma 4 e2b test You: I need help writing a message to send to my nephew. He is currently boarding with us as he recently moved from new Zealand to Australia and we gave him a safe landing pad. Now he's a bit more settled, he has his Medicare and a new job we would like him to move out. The date we want him to move out is June 13th. We need the room for our 16 month old son Lachlan and we want to have our home be our family private space, which we can't do when we have him boarding with us. Here are a few options, depending on the tone you want to strike. Option 1: Warm and Direct
Option 2: More Formal and Focused on Logistics
Option 3: Casual and Friendly
Choose the option that best fits your relationship with your nephew. Let me know if you'd like any adjustments! |
Summary
correctGroundedFacts()digit replacement logicWhy
correctGroundedFacts()inChatViewModel.ktwas actively mangling digits by replacing any 3-6 digit number with years from RAG context using Levenshtein distance. Examples:This runs on every query with RAG context, even when unrelated to grounded facts.
Additionally, the system prompt had:
Changes
System prompt (ModelConfig.kt)
ChatViewModel.kt
Settings (PR #1)
correctGroundedFactsEnabledtoggle (default OFF) in E-4B model settingsTesting
Files changed
ModelSettingsEntity.kt— AddedcorrectGroundedFactsEnabledfieldModelSettingsRepositoryImpl.kt— Added default valuefalseModelSettingsScreen.kt— Added toggle in E-4B model cardChatViewModel.kt— Added StateFlow, reads setting at init, gatescorrectGroundedFacts()call, removed per-turn grounding directiveModelConfig.kt— Merged NZ Context + Memory rulesCloses #681