Open Domain Question Answering

使用LLMs进行开放领域问答

背景

以下提示测试了一个LLM在回答开放领域问题时的能力,这些问题涉及在没有提供任何证据的情况下回答事实性问题。

⚠️

请注意,由于任务的挑战性,当LLMs对问题没有相关知识时,它们可能会产生幻觉。

提示

In this conversation between a human and the AI, the AI is helpful and friendly, and when it does not know the answer it says "I don’t know".
 
AI: Hi, how can I help you?
Human: Can I get McDonalds at the SeaTac airport?

代码 / API

from openai import OpenAI
client = OpenAI()
 
response = client.chat.completions.create(
model="gpt-4",
messages=[
    {
    "role": "user",
    "content": "In this conversation between a human and the AI, the AI is helpful and friendly, and when it does not know the answer it says \"I don’t know\".\n\nAI: Hi, how can I help you?\nHuman: Can I get McDonalds at the SeaTac airport?"
    }
],
temperature=1,
max_tokens=250,
top_p=1,
frequency_penalty=0,
presence_penalty=0
)

参考