过去七天的 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. python 打包 py 文件 为exe

    使用 pyinstaller 来进行打包 pip install pyinstaller 可能需要全局 科学 代理上网 或者 修改 下载源地址 执行命令 图标path:C:\desktop\icon ...

  2. MYSQL 批量删除以特定前缀开头的表

    前言 这是工作中确实会用到,比如分库分表后有t_order_01.t_order_02.t_order_03...t_order_08 这样的表. 测试过程中造了大量数据进行测试,其中可能含有部分脏数 ...

  3. 基于案例分析 MySQL 权限认证中的具体优先原则

    在 MySQL 的日常管理过程中,大家或多或少会遇到权限认证相关的问题. 例如,本来能够正常执行的操作,可能在新增一个账号或授权后就突然失败了. 这种现象往往让人误以为是 bug,但很多时候,其实并不 ...

  4. HAL+CubeIDE,STM32F407ZGT6正点原子探索者,舵机驱动,从零开始

    CubeIDE_HAL库_从零开始玩舵机 1.材料准备 开发板:正点原子STM32F407ZGT6探索者 舵机:SG90 舵机线材分辨:褐色 / 红色 / 橘黄色 -- GND / VCC / PWM ...

  5. 利用腾讯元器,将公众号变身为强大的.NET AI智能体

    前言 经常有粉丝朋友在公众号后台私信提问,因为个人平时比较少看公众号后台的私信所以没法及时回复.最近发现腾讯推出了一个可以创建和使用各种智能体的平台(帮助小白也能快速使用AI):腾讯元器,正好自己每天 ...

  6. 为什么需要[EnumeratorCancellation]?

    为什么需要 [EnumeratorCancellation]? 在使用 C# 编写异步迭代器时,您可能会遇到如下警告: warning CS8425: 异步迭代器"TestConversat ...

  7. 人工智能模型训练技术:随机失活,丢弃法,Dropout

    前一篇:<探索训练人工智能模型的词汇大小与模型的维度> 序言:Dropout 是神经网络设计领域的一种技术,通常我们把它翻译成 随机失活 或者 丢弃法.如果训练神经网络的时候不用 Drop ...

  8. 【一步步开发AI运动小程序】二十、AI运动小程序如何适配相机全屏模式?

    引言 受小程序camera组件预览和抽帧图像不一致的特性影响,一直未全功能支持全屏模式,详见本系列文件第四节小程序如何抽帧:随着插件在云上赛事.健身锻炼.AI体测.AR互动场景的深入应用,各开发者迫切 ...

  9. sql注入--学习笔记_1

    实验室 sql sql可以对数据库进行访问和处理:取回数据,删除数据.web页面会使用这些. SQL 能做什么? SQL 面向数据库执行查询 SQL 可从数据库取回数据 SQL 可在数据库中插入新的记 ...

  10. WiFi基础(八):WiFi安全、认证与加密

    liwen01 2024.11.17 前言 计算机网络在给人们带来便利的同时,也引入了安全风险,对于无线WiFi网络而言,风险更高.无线 WiFi 网络安全主要包括两大部分:接入认证和数据加密. 虽然 ...