0
$\begingroup$

I’m thinking of fine-tuning a pre-trained language model for a Q&A task. More specifically, I’d like to fine-tune the model on a single chapter in a classic college textbook. Afterward, the reader of the chapter should be able to engage in a Q&A session with the model about the content of the chapter.

But how do I make sure that the model stays on topic and doesn’t go out of a tangent? I know it is possible when looking at what https://play.aidungeon.io/ has achieved, but I don’t know if it will require me to build a model from the ground for each chapter. Can anyone tell me if I’m out of my mind or if it’s feasible?

Edit:

I've just learned that AI Dungeon's models has also struggled with a tendency to create graphic and sexual content despite not being prompted by players.

$\endgroup$

1 Answer 1

0
$\begingroup$

Perhaps you could train an auxiliary binary classifier to predict whether or not a response from the chatbot was on or off topic. You could use text from the chapters that you fine tune the Q.A. model with to generate examples of "on topic" text and then use text from other sources as "off topic".

Then, when the model generates an output, you could pass that through the binary on/off-topic classifier. If it is deemed off topic, you could then respond with some canned phrases, indicating that the chatbot is unable to answer the specific question. I have not tried this myself, but it seems to me like a reasonable place to begin.

$\endgroup$
1
  • $\begingroup$ Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center. $\endgroup$
    – Community Bot
    Commented Aug 23, 2022 at 14:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .