Capítulo 3: LLaMA, Mistral e Modelos Open Source
Série LLaMA da Meta
| Versão | Tamanhos | Licença | Principais Características |
|---|---|---|---|
| LLaMA 1 | 7-65B | Pesquisa | Primeiro modelo open competitivo |
| LLaMA 2 | 7-70B | Comercial | Pesos totalmente abertos |
| LLaMA 3 | 8-70B+ | Comercial | Open state-of-the-art |
Mistral AI
# Inovações da Mistral
innovations = {
"Sliding Window Attention": "Sequências longas eficientes",
"Grouped Query Attention": "Uso eficiente de memória",
"Mixtral (MoE)": "46B parâmetros, 12.9B ativos"
}
Usando Modelos Open Source
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"mistralai/Mistral-7B-Instruct-v0.2",
torch_dtype=torch.bfloat16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2")
Comparação
| Aspecto | Fechado (GPT-4) | Open (LLaMA) |
|---|---|---|
| Capacidade | Superior | Competitivo |
| Controle | Limitado | Total |
| Custo | Por token | Infraestrutura |
| Privacidade | Dados enviados à API | Local |
Principais Pontos
Summary
- LLaMA democratizou o acesso a LLMs
- Mistral inova em eficiência
- Modelos open permitem customização e privacidade