计算复合函数

计算复合函数

背景

这个提示词通过要求评估给定的复合函数来测试大型语言模型(LLM)的数学能力。

提示词

Suppose g(x)=f1(x),g(0)=5,g(4)=7,g(3)=2,g(7)=9,g(9)=6g(x) = f^{-1}(x), g(0) = 5, g(4) = 7, g(3) = 2, g(7) = 9, g(9) = 6 what is f(f(f(6)))f(f(f(6)))?

Code / API

from openai import OpenAI
client = OpenAI()
 
response = client.chat.completions.create(
    model="gpt-4",
    messages=[
        {
        "role": "user",
        "content": "Suppose  g(x) = f^{-1}(x), g(0) = 5, g(4) = 7, g(3) = 2, g(7) = 9, g(9) = 6 what is f(f(f(6)))?\n"
        }
    ],
    temperature=1,
    max_tokens=256,
    top_p=1,
    frequency_penalty=0,
    presence_penalty=0
)

参考