Coder Social home page Coder Social logo

Comments (9)

Dawn-Xu-helloworld avatar Dawn-Xu-helloworld commented on June 8, 2024 1

我发现了幻觉的真正原因:
问题出在发给LLM的请求上,这个插件实际传入的是

{
"model":"MODEL_NAME",
"messages":[
    {"role":"assistant","content":"请求翻译的prompt"}
]
}

这个assistant的role是用来让LLM了解在 “这次用户提问之前LLM说过什么”的,也就是LLM的上下文记忆能力的来源,而用户询问LLM的内容应该把请求里的role设为user,所以没有自己问自己的经验的LLM就会产生幻觉

from ojbetter.

beijixiaohu avatar beijixiaohu commented on June 8, 2024

好的,有空我加上

from ojbetter.

Dawn-Xu-helloworld avatar Dawn-Xu-helloworld commented on June 8, 2024

对了,最好还要加个模式切换开关,因为我看你现在的prompt是作为用户发言输入的
如果要是可以把初始prompt作为system prompt 传入而非作为用户的第一句话,这样对于其他的LLM可能效果会更好一些(因为OpenAI的ChatGPT好像不太会关心system prompt,但是其他的LLM会)

from ojbetter.

beijixiaohu avatar beijixiaohu commented on June 8, 2024

你是指再提供一种模式,这种模式下会在messages数组中放俩object,一个是让他充当翻译的系统消息,一个是作为用户消息的翻译文本,是这样吗

from ojbetter.

Dawn-Xu-helloworld avatar Dawn-Xu-helloworld commented on June 8, 2024

你是指再提供一种模式,这种模式下会在messages数组中放俩object,一个是让他充当翻译的系统消息,一个是作为用户消息的翻译文本,是这样吗

是这样,就是

[
{"role":"system", "content":"系统提示词"}
{"role":"user","content":"需要翻译的东西"}
]

然后就直接做成一个单独的选项,开启的话发送这样的数据
不开启的话把系统提示词和需要翻译的句子用回车符隔开一块发过去就行,系统提示词留空

from ojbetter.

beijixiaohu avatar beijixiaohu commented on June 8, 2024

好的,明个我看有空不,有空加上

from ojbetter.

beijixiaohu avatar beijixiaohu commented on June 8, 2024

我发现了幻觉的真正原因:
问题出在发给LLM的请求上,这个插件实际传入的是

{
"model":"MODEL_NAME",
"messages":[
    {"role":"assistant","content":"请求翻译的prompt"}
]
}

这个assistant的role是用来让LLM了解在 “这次用户提问之前LLM说过什么”的,也就是LLM的上下文记忆能力的来源,而用户询问LLM的内容应该把请求里的role设为user

原来如此,感谢分享,下午我给改下

from ojbetter.

Dawn-Xu-helloworld avatar Dawn-Xu-helloworld commented on June 8, 2024

要不我PR一个

from ojbetter.

beijixiaohu avatar beijixiaohu commented on June 8, 2024

from ojbetter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.