Example
An AI-Powered Knowledge Check in Storyline
Great demo! I just started looking into this area myself and happened across your post. I see you used the MiniLM-L6-v2 model. When I was exploring various models, this did seem to result in one of the broadest similarity ranges between good and bad responses. Have you looked very much into other models or any other comparison approaches? Despite being around for a while, the available details on all of this seem rather diffuse and a bit cryptic. I guess I've finally found a meaningful use for AI chat models. 😀
Hey Nathan! Glad you liked the demo 😀. These are some similar options:
- paraphrase-MiniLM-L3-v2 (uses less memory and is potentially less accurate)
- all-distilroberta-v1
- google/embeddinggemma-300M
Based on lessons learned since building this example, one thing that could be improved in this example to achieve a better comparison would be the source text. My memory is a bit fuzzy on this now but I think I used the entire source paragraph to compare against. It may yield better results if the sourceText was a concise sentence with the key points we want our learner to remember. You could even adapt it to use multiple examples:
const idealAnswers = [ "Passkeys replace passwords and are phishing-resistant.", "You use biometrics for passkeys, which are stored on your device.", "It's a more secure way to log in without a password, using your phone or computer." ];
One other approach with a steep learning curve is fine-tuning the a model with good and bad examples so it's closer to what you're looking for. I believe Google Colab offers free GPU usage which is handy for that sort of thing.
