过去七天的 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. Math 数学库

    Math.random()  随机数字 Math.PI  圆周率

  2. 自定义指令 v-imgerror 当图片的 src 资源 无效 就替换 默认的 src 显示图片

    // 回顾自定义指令 // 作用 : 自定义一些对dom操作的快捷指令 // 前提:指令就是用来操作 dom (v-if /v-show/v-for ....) // 语法:Vue.directive ...

  3. 6. CSS有哪些方法可以提升层级

    1. 使用 z-index 2. 使用定位,脱离标准流

  4. 《使用Gin框架构建分布式应用》阅读笔记:p1-p19

    <使用Gin框架构建分布式应用>学习第1天,p1-p19总结,总计19页. 一.技术总结 1.go get & go install 执行go get 或者 go install ...

  5. C++刷题小知识点

    数据结构定义 struct ListNode { int val; ListNode *next; ListNode() : val(0), next(nullptr) {} ListNode(int ...

  6. 分布式应用架构的发展演变RPC

    什么是分布式系统? <分布式系统原理与范型>定义: "分布式系统是若干独立计算机的集合,这些计算机对于用户来说就像单个相关系统",分布式系统(distributed s ...

  7. LeetCode题目练习记录 _栈、队列01 _20211012

    LeetCode题目练习记录 _栈.队列01 _20211012 84. 柱状图中最大的矩形 难度困难1581 给定 n 个非负整数,用来表示柱状图中各个柱子的高度.每个柱子彼此相邻,且宽度为 1 . ...

  8. [解决方案] 几种通过 iproute2 来打通不同节点间容器网络的方式

    几种通过 iproute2 来打通不同节点间容器网络的方式 几种通过 iproute2 来打通不同节点间容器网络的方式 host-gw ipip vxlan 背景 之前由于需要打通不同节点间的容器网络 ...

  9. UE4纯C++实现游戏快捷栏之创建快捷栏UI

    作为一个在游戏界面中显示的快捷栏,我们需要在游戏运行时就显示出快捷栏UI,故我们创建两个Widget. 1.GameHUDWidget:负责游戏中界面UI的整体显示 2.ShortcutWidget: ...

  10. 19.使用kubeadm-ha脚本一键安装K8S

    使用kubeadm-ha脚本一键安装K8S 前情提示 以前安装k8s集群的时候使用的是k8s官网的教程 使用的镜像源都是国外的 速度慢就不说了 还有一些根本就下载不动 导致安装失败 ,使用一个开源的一 ...