From e2f0296838f9865c0fa8a95ffbbad6106f72579c Mon Sep 17 00:00:00 2001 From: Anu Date: Wed, 22 May 2024 16:10:33 +0530 Subject: [PATCH] Docs: Add logit bias trick --- docs/docs/text/classification.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/docs/text/classification.md b/docs/docs/text/classification.md index a88c4ef41..29e319f93 100644 --- a/docs/docs/text/classification.md +++ b/docs/docs/text/classification.md @@ -30,7 +30,11 @@ Categorize user feedback into labels such as "bug", "feature request", or "inqui

How it works

- Marvin enumerates your options, and uses a clever logit bias trick to force the LLM to deductively choose the index of the best option given your provided input. It then returns the choice associated with that index. + Marvin enumerates your options, and uses a clever logit bias trick to force the LLM to deductively choose the index of the best option given your provided input. It then returns the choice associated with that index. +

+

Logit Bias Trick

+

+ You can configure ChatGPT as a logic gate or classifier by manipulating its token outputs using logit_bias and max_tokens. For a logic gate, set true to `1904` and false to `3934`, and restrict responses to these tokens with logit_bias and max_tokens set to 1. Similarly, for classification tasks, assign tokens for labels (e.g., 57621 for happy, 83214 for sad, and 20920 for mad) and use logit_bias to restrict outputs to these tokens. By setting max_tokens to 1, you ensure that the model will only output the predefined class labels.