StampyAI / stampy-chat

Conversational chatbot to answer questions about AI Safety & Alignment based on information retrieved from the Alignment Research Dataset
https://chat.stampy.ai
MIT License
13 stars 7 forks source link

Render equations #77

Open markovial opened 1 year ago

markovial commented 1 year ago

Some answers generate equations to explain things. The equations look like LaTeX code. Can we render equations using mathjax or something, so that the reader doesnt have to imagine what the equation is actually trying to say?

FraserLee commented 1 year ago

Totally doable. I've used both in prior projects, and imo KaTeX is a lot better than MathJax (better defaults, faster engine, better output when they do differ, etc).

The main point of consideration here that any rendering engine will be a pretty massive bundle, and will balloon our load times. It would only make sense if we don't load it initially, then lazily load it at some point based on page content. Not a major hurtle, but it's not completely trivial either.

One thing that might be useful: do you have a prompt which currently cases the system to output equations as part of an answer?

markovial commented 1 year ago

Originally I saw equations as part of these prompts -

It is not 100% guaranteed that equations show up though. You could just explicitly ask for equations to test, e.g. by using:

What is the equation for KL-divergence?

FraserLee commented 1 year ago

In theory the system is 100% deterministic, with the only variance we haven't quite nailed down yet coming from slightly non-deterministic order of citations (though they almost always are deterministic, it's weird). Testing it out, I see the aforementioned equations in the first question, though weirdly not in the second. Thanks for the prompts!!