用心打造
VPS知识分享网站

Bedrock大语言模型智能解题测试

关于学生使用大语言模型和其他人工智能聊天机器人的好处和风险的讨论一直在进行。虽然大语言模型如何融入教育以提高学习成果亟待实践,但正确使用 LLM 提升解题效率的重要性毋庸置疑。在这篇博客中,我们将以数学与语言学习的三个问题为例探讨大语言模型的准确性。

Amazon Bedrock 的功能

Amazon Bedrock 是一项完全托管的服务,通过单个 API 提供来自领先人工智能公司的高性能基础模型(FM),以及通过安全性、隐私性和负责任的 AI 构建生成式人工智能应用程序所需的一系列广泛功能。使用 Amazon Bedrock,您可以轻松试验和评估适合您的使用案例的热门 FM,通过微调和检索增强生成(RAG)等技术利用您的数据对其进行私人定制,并构建使用您的企业系统和数据来源执行任务的代理。由于 Amazon Bedrock 是无服务器的,因此您无需管理任何基础设施,并且可以使用已经熟悉的 AWS 服务将生成式人工智能功能安全地集成和部署到您的应用程序中。

使用 Bedrock 构建机器学习模型具有以下优势:

  • 简化开发流程:Bedrock 提供了简洁易用的 API 和丰富的文档,帮助开发人员快速上手并高效开发模型。
  • 灵活性和可扩展性:Bedrock 支持各种编程语言和框架,并提供了灵活的部署选项,使用户可以根据自己的需求进行定制化开发。
  • 高性能和可靠性:Bedrock 的运行时环境经过优化,具有高性能和可靠性,保证模型在不同环境下的稳定运行。

Claude 是一款备受欢迎的智能推理引擎,具有强大的逻辑推理和解题能力。Claude 3 具有强大的多模态视觉能力,指令遵循能力大幅度提升,并且支持 200k 超长上下文理解。其中,Opus 为 Claude 3 系列模型的最强版本,具有接近人类的理解能力,可以灵巧地处理开放式提示和复杂的任务。

测试内容

下面,我们以数学题为例看看 Claude 3 的能力:

all_llms = [ model['modelId'] for model in bedrock.list_foundation_models()['modelSummaries']]
prompt_data = """小圆的半径是3cm,大圆的半径是5cm,大圆与小圆的面积比是()。
A.3:5
B.9:25
C.25:9
D.5:3"""

body = {
            "anthropic_version": "bedrock-2023-05-31",
            "max_tokens": 1024,
            "messages": [
                 {
                    "role": "user",
                    "content": [
                        {
                            "type": "text",
                            "text": prompt_data
                        }
                    ]
                }
            ],
        }

输出:

在这个问题中,我们需要找出大圆与小圆面积的比值。让我们一步步来解决:

1. 首先,我们知道圆的面积公式是:A = πr²,其中 A 是面积,r 是半径。
2. 小圆的半径是 3cm,所以小圆的面积是:

  A₁ = π(3²) = 9π cm²

3. 大圆的半径是 5cm,所以大圆的面积是:

  A₂ = π(5²) = 25π cm²

4. 现在,我们可以计算大圆与小圆面积的比值:

  A₂ : A₁ = 25π : 9π

5. 我们可以约分 π,得到:

  25 : 9

所以,正确答案是选项 B:25 : 9,也可以写作 25/9 或 2.78(保留两位小数)。

第二题是几何题。

with open("images/math.png", "rb") as image_file:
    encoded_string = base64.b64encode(image_file.read())
    base64_string = encoded_string.decode('utf-8')

payload = {
    "modelId": "anthropic.claude-3-haiku-20240307-v1:0",
    "contentType": "application/json",
    "accept": "application/json",
    "body": {
        "anthropic_version": "bedrock-2023-05-31",
        "max_tokens": 1000,
        "messages": [
            {
                "role": "user",
                "content": [
                    {
                        "type": "image",
                        "source": {
                            "type": "base64",
                            "media_type": "image/png",
                            "data": base64_string
                        }
                    },
                    {
                        "type": "text",
                        "text": "As shown in the figure, in the rectangle quadrilateral ABCD, if E is a point on the edge AB, DAE folded along the crease DE to DA'E, Please independently assess the correctness of the following three statements and provide a complete analysis: \n1. The trajectory of the projection of point A' is F, AF is perpendicular to DE;\n2. AF intersects DE at O, When E varies, the trajectory of O is a circle with AD as the diameter;\n3. The trajectory of point A' is a circle with O as the center and AO as the radius;"
                    }
                ]
            }
        ]
    }
}


输出如下:

Let's analyze each statement independently:

1. "The trajectory of the projection of point A' is F, AF is perpendicular to DE."
This statement is correct. As the point E moves along AB, the folding line DE also moves. The point A' is the reflection of point A across the folding line DE. By the properties of reflections, the line segment AA' is always perpendicular to the folding line DE, and its midpoint lies on DE. The trajectory of point F, which is the projection of A' onto AD, forms a line segment perpendicular to DE.

2. "AF intersects DE at O. When E varies, the trajectory of O is a circle with AD as the diameter."
This statement is correct. Let's prove it using the inscribed angle theorem. As E moves along AB, the angle ∠ADE remains a right angle (90°). Therefore, points A, D, and E always form a right triangle with ∠ADE = 90°. The point O, being the intersection of AF and DE, is the midpoint of the hypotenuse AD in this right triangle. According to the inscribed angle theorem, any angle inscribed in a semicircle is a right angle. Consequently, as E varies, the point O traces a semicircle with AD as its diameter. Since the situation is symmetrical on both sides of AD, the complete trajectory of O is a circle with AD as the diameter.

3. "The trajectory of point A' is a circle with O as the center and AO as the radius."
This statement is also correct. We can prove it using the properties of reflections. As established earlier, the point A' is always the reflection of point A across the folding line DE. Therefore, the line segment AA' is always perpendicular to DE, and DE is the perpendicular bisector of AA'. Since O is the midpoint of AD, it is also the midpoint of AA'. As E varies and DE changes, the position of A' changes accordingly, but the distance A'O remains equal to AO. Thus, the trajectory of point A' is a circle with O as the center and AO as the radius.

In conclusion, all three statements are correct, and their validity can be demonstrated using geometric principles such as the properties of reflections and the inscribed angle theorem.

答案正确。

接下来,我们调用 Sonnet 测试 GRE:

prompt_data = """Because people expect theater directors to be authoritarians, many were surprised that Clark was so _____.

histrionic
megalomaniacal
egalitarian
indolent
charismatic"""

输出:

The word that best fits the blank is "egalitarian".

Egalitarian means believing in or based on the principle that all people are equal and deserve equal rights and opportunities. If Clark was egalitarian as a theater director, it suggests he treated everyone in the cast and crew as equals, rather than being an authoritarian who demanded obedience and maintained strict hierarchies.

The other options don't fit as well in the context:

- Histrionic means excessively dramatic or emotional, which doesn't directly contrast with being authoritarian.
- Megalomaniacal means having delusions of grandeur or an obsessive desire for power, which aligns more with authoritarianism than contrasts with it.
- Indolent means lazy, which isn't a clear opposite of authoritarian.
- Charismatic means charming and able to inspire devotion in others, which, while a positive trait, doesn't necessarily imply a contrast with authoritarianism.

Therefore, "egalitarian" is the best choice to fill in the blank, as it presents a leadership style that would be surprising for people who expect theater directors to be authoritarian.

再调用 haiku 翻译:

最能够填补空白的词是"平等主义的"。 平等主义意味着相信或基于所有人都是平等的原则,并应该享有平等的权利和机会。如果克拉克作为一个话剧导演是平等主义者,这表明他平等地对待所有演员和工作人员,而不是一个要求服从和维持严格等级制度的权威主义者。其他选项在这个语境中就不太合适:

- 夸张的意味着过于戏剧性或情绪化,这并不能直接与权威主义形成对比。

- 偏执狂意味着幻想伟大或对权力的迷恋,这更符合权威主义而不是与之形成对比。

- 懒惰意味着懒惰,这不是权威主义的明确对立面。

- 有魅力意味着迷人并能激发他人的忠诚,尽管这是一个积极的特质,但并不一定意味着与权威主义形成对比。

因此,"平等主义的"是填补空白的最佳选择,因为它描述了一种令人意外的领导风格,相对于人们预期的话剧导演的权威主义风格。

答案正确,并且对不同选项有详细的解释。

经过以上两个案例,我们可以看到 Claude 可以准确解答中学数学和 GRE 语言问题,并给出详细讲解。

结语

在这篇文章中,我们探讨了大语言模型在教育领域的应用,并以数学和语言学习为例,详细展示了大语言模型 Claude 在解决各类问题时的出色表现。

赞(0)
未经允许不得转载;国外VPS测评网 » Bedrock大语言模型智能解题测试
分享到