基于LLM的开放域问答
背景
以下提示旨在测试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
)
参考
- 通用人工智能的火花:GPT-4早期实验 (在新标签页中打开) (2023年4月13日)