过去七天的 AI 新闻如狂风暴雨般涌来,AI 世界发生了许多重大变化。在这篇文章中,我们将深入探讨来自 Llama 3.3 70B、GPT-4o 和 Claude 3.5 Sonnet 等主要参与者的最新 AI 动态。

12 月 7 日,Meta 将发布其年度最后一个 AI 模型。而就在昨天(12 月 6 日),Meta 发布了拥有 700 亿参数的 Llama 3.3。尽管参数数量远低于 4050 亿的 Llama 3.1,其性能却不相上下。

Meta 强调,Llama 3.3 模型更高效、成本更低,可运行在标准工作站上,不仅降低运营成本,还能提供高质量的文本 AI 解决方案。

Llama 3.3 优化了多语言支持,支持八种语言:英语、德语、法语、意大利语、葡萄牙语、印地语、西班牙语和泰语。

该模型拥有 128K 的上下文长度,并支持多种工具格式。它可以与外部工具和服务集成,扩展模型的功能。

在这份逐步指南中,我们将介绍 Llama 3.3 的特点、如何本地使用 Llama 3.3,以及为什么它比 GPT-4o 和 Claude 3.5 Sonnet 更强大。

我强烈建议大家观看本文附带的视频,这将彻底改变你的聊天机器人体验,帮助你领略 Llama 3.3 的强大威力!

什么是 Llama 3.3

Llama 3.3 是 Meta AI 推出的一个多语言大规模预训练语言模型,拥有 700 亿参数。其性能可媲美 4050 亿参数的 Llama 3.1,并针对多语言对话进行了优化,支持英语、德语、法语、意大利语、葡萄牙语、印地语、西班牙语和泰语。

Llama 3.3 拥有更长的上下文窗口、多语言输入输出能力,并能集成第三方工具以扩展功能,非常适合商业和研究用途。

Llama 3.3 的关键特性

• 效率与成本:Llama 3.3 更高效、成本更低,可运行在标准工作站上,降低运营成本,同时提供高质量文本 AI 解决方案。

• 多语言支持:支持英语、德语、法语、意大利语、葡萄牙语、印地语、西班牙语和泰语,能够处理这些语言的输入输出。

• 长上下文窗口:支持 128K 上下文长度。

• 集成第三方工具:可与第三方工具和服务集成,扩展功能和应用场景。

Llama 3.3 与 Llama 3.2 的比较

与 Llama 3.2 相比,Llama 3.3 在文本任务上取得了显著性能提升。Llama 3.2 专注于轻量化模型(1B 和 3B 参数),适合边缘设备部署,以及多模态模型(11B Vision 和 90B Vision)。而 Llama 3.3 则缩小到 700 亿参数,聚焦于提高文本生成的质量。

Llama 3.3 的硬件要求

Llama 3.3 使用 Meta 定制开发的训练库、定制 GPU 集群和生产基础设施进行预训练。微调、标注和评估均在相同的生产基础设施上完成。总计耗费 3930 万 GPU 或 700 万 GPU 小时的训练资源,使用 H100–80GB (TDP 700W) 硬件。

如何在本地使用 Llama 3.3

Llama 3.3 使用与 Llama 3.1 相同的提示格式,因此 Llama 3.1 的提示可直接用于 Llama 3.3,这是迁移用户的一大优势。Llama 3.3 支持与 Llama 3.1 相同的代码解释器和工具调用功能,使模型能够利用外部工具和信息。

使用 Ollama 是运行本地语言模型最快的方法。推荐尝试 Llama 3.3 70B,它体积小巧,在大多数硬件上表现出色。

  1. 先下载 Ollama

  2. 打开终端,运行 ollama run llama3.3

​​​​

Llama 3.3 70B 与Claude 3.5 Sonnet 和 GPT-4o的对比

我们将对 Claude 3.5 Sonnet 和 GPT-4o 的性能进行比较,验证 Llama 3.3 70B 的表现。此次验证内容包括以下项目:

编程能力

我们使用了一些基于真实场景的复杂 Python 问题。以下是任务示例:

You are given an array nums consisting of positive integers.

Starting with score = 0, apply the following algorithm:

Choose the smallest integer of the array that is not marked. If there is a tie, choose the one with the smallest index.

Add the value of the chosen integer to score.

Mark the chosen element and its two adjacent elements if they exist.

Repeat until all the array elements are marked.

Return the score you get after applying the above algorithm.

Example 1:

Input: nums = [2,1,3,4,5,2]

Output: 7

Explanation: We mark the elements as follows:

  • 1 is the smallest unmarked element, so we mark it and its two adjacent elements: [2,1,3,4,5,2].

  • 2 is the smallest unmarked element, so we mark it and its left adjacent element: [2,1,3,4,5,2].

  • 4 is the only remaining unmarked element, so we mark it: [2,1,3,4,5,2].

Our score is 1 + 2 + 4 = 7.

LLama 3.3

def find_score(nums):

"""

Calculate the score by applying the given algorithm.

Args:

nums (list): A list of positive integers.

Returns:

int: The calculated score.

"""

score = 0

marked = [False] * len(nums)

while False in marked:

min_val = float('inf')

min_idx = -1

Find the smallest unmarked integer

for i, num in enumerate(nums):

if not marked[i] and num < min_val:

min_val = num

min_idx = i

Add the value of the chosen integer to score

score += min_val

Mark the chosen element and its two adjacent elements if they exist

for i in range(max(0, min_idx - 1), min(len(nums), min_idx + 2)):

marked[i] = True

return score

Example usage

nums = [2, 1, 3, 4, 5, 2]

print(find_score(nums)) # Output: 7

GPT-4o

def get_score(nums):

n = len(nums)

marked = [False] * n # Array to track marked elements

score = 0

while True:

Find the smallest unmarked element

smallest_value = float('inf')

smallest_index = -1

for i in range(n):

if not marked[i] and nums[i] < smallest_value:

smallest_value = nums[i]

smallest_index = i

if smallest_index == -1: # If no unmarked elements are left, break

break

Add the value of the chosen element to the score

score += nums[smallest_index]

Mark the chosen element and its two adjacent elements

marked[smallest_index] = True

if smallest_index > 0:

marked[smallest_index - 1] = True

if smallest_index < n - 1:

marked[smallest_index + 1] = True

return score

Example usage

nums = [2, 1, 3, 4, 5, 2]

print(get_score(nums))

Claude 3.5 Sonnet

def markElements(nums):

Create a copy of the input array to track marked elements

marked = [False] * len(nums)

score = 0

while not all(marked):

Find the smallest unmarked element

min_val = float('inf')

min_index = -1

Find the smallest unmarked element with the smallest index

for i in range(len(nums)):

if not marked[i] and nums[i] < min_val:

min_val = nums[i]

min_index = i

Add the chosen element's value to score

score += nums[min_index]

Mark the chosen element

marked[min_index] = True

Mark left adjacent element if it exists

if min_index > 0:

marked[min_index - 1] = True

Mark right adjacent element if it exists

if min_index < len(nums) - 1:

marked[min_index + 1] = True

return score

Test cases

test_cases = [

[2,1,3,4,5,2], # Example from the problem statement

[1,2,3,4,5], # Consecutive increasing numbers

[5,4,3,2,1] # Consecutive decreasing numbers

]

for nums in test_cases:

print(f"Input: {nums}")

print(f"Output: {markElements(nums)}\n")

所有三个解决方案在我使用 Visual Studio Code 运行代码时都正确无误。然而,Llama 3.3 的代码虽然清晰,但使用了 while False in marked 循环,这比 while not all(marked) 更不直观。此外,它在寻找最小未标记元素时重复了逻辑,且未使用辅助函数,使得维护性较差。

GPT-4o 的代码最易读,使用了简单明了的 while True 循环和明确的中断条件,注释简洁,逻辑清晰,避免了冗余,成为在可读性和维护性方面的一个优秀选择。

Claude 3.5 Sonnet 的代码也很清晰,并使用了 not all(marked) 作为循环条件,但其风格较为冗长,并且附加的测试用例虽然有帮助,却使代码的重点不如 GPT-4o 的版本集中。

总体而言,GPT-4o 的版本是最佳选择,因为它结构清晰,注释得当,设计直截了当,在可读性、功能性和维护性之间实现了良好的平衡。

数学能力

接下来,我比较和验证数学能力,我们让参与者回答概率问题。很多人害怕进入数据科学领域,因为他们对高中和大学的代数、矩阵和组合数学感到恐惧。

Find the probability of getting exactly two tails in 5-coin flips?

LLama3.3

Step 1: Define the sample space

The sample space consists of all possible outcomes of flipping 5 coins. Each coin can land in one of two ways: Heads (H) or Tails (T). So, the sample space has 2^5 = 32 possible outcomes.

Step 2: Identify the favorable outcomes

We want to find the probability of getting exactly 2 tails. This means we need to count the number of outcomes with 2 tails and 3 heads. We can use the binomial coefficient to calculate this:

Number of ways to choose 2 tails out of 5 flips = C(5, 2) = 5 / (2 × 3!) = 10

So, there are 10 favorable outcomes with exactly 2 tails.

Step 3: Calculate the probability

The probability of getting exactly 2 tails is the number of favorable outcomes divided by the total number of possible outcomes:

P(exactly 2 tails) = Number of favorable outcomes / Total number of outcomes

= 10 / 32

= 5/16

Answer

The probability of getting exactly 2 tails in 5-coin flips is 5/16 or approximately 0.3125 (31.25%).

In mathematical notation, this can be represented as:

P(X = 2) = (5 choose 2) × (1/2)^2 × (1/2)^3 = 10/32 = 5/16

where X is the random variable representing the number of tails, and (5 choose 2) is the binomial coefficient representing the number of ways to choose 2 tails out of 5 flips.

GPT-4o

Claude 3.5 Sonnet

I'll solve this using the binomial probability formula. Here's a step-by-step mathematical approach:

First, let's define our parameters:

Total number of coin flips (n) = 5

Number of desired tails (k) = 2

Probability of getting a tail in a single flip (p) = 1/2

Probability of getting a head in a single flip (q) = 1/2

The binomial probability formula is:

P(X = k) = C(n,k) * p^k * q^(n-k)

Let's break this down:

C(n,k) is the combination formula: 5! / (2! * (5-2)!) = 5! / (2! * 3!)

This calculates how many ways we can choose 2 tails out of 5 flips

Calculating:

C(5,2) = 5! / (2! * 3!) = (5 * 4) / (2 * 1) = 10

(1/2)^2 * (1/2)^(5-2) = (1/2)^2 * (1/2)^3

(1/2)^5 = 1/32

Final calculation:

10 * (1/2)^5 = 10/32 = 5/16

Therefore, the probability of getting exactly two tails in 5 coin flips is 5/16 or approxi

所有三个模型都正确得出了概率为 5/16 的结论。

Llama 3.3 的方法不够直观,缺乏简化步骤。

Claude 3.5 Sonnet 的表达清晰,但增加了一些额外的细节,例如对正面和反面的概率计算,这对于此问题可能并非必要。

GPT-4o 的表现最出色,因为它采用了清晰且结构化的基于公式的方法,直接应用二项式系数并对公式进行了简化,表述清楚易懂,避免了不必要的复杂性。

结论:

Llama 3.3 是 Llama 系列中功能最强大的版本,开源且高度实用。通过利用其开源特性,该模型可以根据每个公司的需求进行改进。

为什么 Llama 3.3 70B 比 GPT-4o 和 Claude 3.5 Sonnet 更优秀的更多相关文章

  1. IBM X3850 Windows 无法安装到这个磁盘。选中的磁盘具有MBR分区表。在 EFI 系统上,Windows 只能安装到 GPT 磁盘

    以前安装的是window2003 32位, 改装为2012 64位的时候.出现 Windows 无法安装到这个磁盘.选中的磁盘具有MBR分区表.在 EFI 系统上,Windows 只能安装到 GPT ...

  2. UEFI+GPT引导基础篇(一):什么是GPT,什么是UEFI?

    其实关于UEFI的几篇文章很早就写下了,只是自己读了一遍感觉很不满意,就决定重写.目的是想用最简单直白的语言把内容写出来,让每个人都能轻松读懂.当然,如果你已经对这些内容有了很深的理解的话,这篇文章除 ...

  3. 【转】对硬盘进行分区时,GPT和MBR区别。

    在Windows 8或8.1中设置新磁盘时,系统会询问你是想要使用MBR还是GPT分区.GPT是一种新的标准,并在逐渐取代MBR. GPT带来了很多新特性,但MBR仍然拥有最好的兼容性.GPT并不是W ...

  4. UEFI GPT

    其实关于UEFI的几篇文章很早就写下了,只是自己读了一遍感觉很不满意,就决定重写.目的是想用最简单直白的语言把内容写出来,让每个人都能轻松读懂.当然,如果你已经对这些内容有了很深的理解的话,这篇文章除 ...

  5. 对硬盘进行分区时,GPT和MBR有什么区别?

    在Windows 8或8.1中设置新磁盘时,系统会询问你是想要使用MBR还是GPT分区.GPT是一种新的标准,并在逐渐取代MBR. GPT带来了很多新特性,但MBR仍然拥有最好的兼容性.GPT并不是W ...

  6. UEFI+GPT引导基础篇 :什么是GPT,什么是UEFI?

    GUID Partition Table (GPT) is a standard for the layout of the partition table on a physical storage ...

  7. 硬盘MBR和GPT区别

    似乎人人都可以张嘴就说"我懂电脑",但是总有一些看起来完全不懂但实际上非常基础的东西让"懂"与"不懂"清晰地划清界限.比如UEFI+GPT就 ...

  8. 三分钟速览GPT系列原理

    其中,Transformer和BERT来自Google,GPT系列[GPT.GPT-1.GPT-2.GPT-3.ChatGPT.GPT-4]来自OpenAI. GPT Paper名为Improving ...

  9. Windows 10开机的秘密在哪里

    如何查看开机速度 查看开机速度,一定要安装所谓的第三方安全软件么?老子就是不喜欢被安全! Windows自带的事件查看器中记录了系统的一举一动,何必需要别人来监视? 在运行(WinKey+R)中输入e ...

  10. 对“传统BIOS”与“EFI/UEFI BIOS”的基本认识

    硬盘(MBR磁盘)分区基本认识+Windows启动原理 大家常会看到硬盘分区中这样的几种说法:系统分区.启动分区.活动分区.主分区.拓展分区.逻辑分区,MBR.PBR.DPT.主引导扇区等.尤其是看到 ...

随机推荐

  1. C# 新语法 switch 的简单写法

    // C# 中的新语法 switch 的简写 string str = "123"; string res = str switch { "1" => & ...

  2. Failed to mount component: template or render function not defined 使用 require 引入组件的时候报错

    为什么有的时候使用require引入组件不会报错,有的时候就会报错,需要加上default就不会报错  ? webpack 支持 CommonJS和 ES6模块打包,当我们引用组件的时候,在 scri ...

  3. 9. JS的数据类型,区别

    js 有2大数据类型分类 : 基本数据类型: 1. string 字符串 使用单.双引号包裹,或者使用反引号包裹 2. number 数字类型 3. boolean 布尔值 true false 4. ...

  4. WPF中为Popup和ToolTip使用WindowMaterial特效 win10/win11

    先看效果图: 大致思路是:通过反射获取Popup内部的原生窗口句柄,然后通过前文已经实现的WindowMaterial类来应用窗口特效:对于ToolTip,为了保持其易用性,我使用了附加属性+全局样式 ...

  5. 使用Radzen Blazor组件库开发的基于ABP框架炫酷UI主题

    一.项目简介 使用过ABP框架的童鞋应该知道它也自带了一款免费的Blazor UI主题,它的页面是长这样的: 个人感觉不太美观,于是网上搜了很多Blazor开源组件库,发现有一款样式非常不错的组件库, ...

  6. Go语言基础05 _string

    Go语言基础05 _string 1.基本使用 package string import "testing" func TestString(t *testing.T) { va ...

  7. Windows编译运行webrtc全过程,并实现屏幕共享

    文章分为三部分,代码获取/编译/运行. 第一步获取代码,打开cmd执行以下指令即可 set WORKSPACE=E:\webrtc mkdir %WORKSPACE% cd /d %WORKSPACE ...

  8. C#中的Math.Round

    开发者为了实现小数点后 2 位的四舍五入,编写了如下代码, var num = Math.Round(12.125, 2); 代码非常的简单,开发者实际得到的结果是12.12, 这与其所预期的四舍五入 ...

  9. pyenv-win-master\pyenv-win\libexec\pyenv-install.vbs(161, 5) Microsoft VBScript 运行时错误: 文件未找到

    Windows 10 运行 pyenv install 3.11.2 提示 pyenv-win-master\pyenv-win\libexec\pyenv-install.vbs(161, 5) M ...

  10. delphi12 Android Edit SDK安装

    安装 delphi 12.1 后,编译 FMX Android 程序失败! 查找原因,SDK配置全是叹号! 之前用过SDK Manager.exe,直接打开即可以选择下载,但现在发现没有了,查找资料如 ...