O que é?

É um tipo de inteligência artificial que gera conteúdo pra vc. Consegue retornar vários tipos de conteúdo, como texto, código, imagem, etc..

Modelos multimodais

Consegue tanto interpretar quanto gerar múltiplos formatos de saída (imagem, texto, audio, etc.).

Como a IA gera conteúdo?

Muitos dados, petabytes, entram como treinamento em modelos de fundação.

Podemos usar para resolver problemas gerais (como o chatGPT). Ou problemas específicos, fazendo um fine tuning por exemplo.

Design de comandos (prompt engineering)

O design de comandos ou “prompt engineering” é o processo de criação e otimização de prompts (comandos ou instruções) para inteligências artificiais, como assistentes virtuais ou chatbots. O objetivo é criar comandos que direcionem a IA para fornecer as respostas mais úteis e relevantes possíveis. Isso pode envolver a experimentação com diferentes formatos de comando, a inclusão de palavras-chave específicas ou a formulação de perguntas de maneira particular para obter os melhores resultados.

O que deve ter?

Entrada (dúvidas, tarefas, etc…), contexto (instruções, informações) e exemplos (aprendizado zero-shot, one-shot ou few-shot)

  • Prompting de zero-shot - Este é um método onde o LLM recebe apenas um prompt que descreve a tarefa e nenhum dado adicional. Por exemplo, se você quer que o LLM responda a uma pergunta, você apenas solicita “o que é design de prompt?“.
  • Prompting de one-shot - Este é um método onde o LLM recebe um único exemplo da tarefa que está sendo solicitada para realizar. Por exemplo, se você quer que o LLM escreva um poema, você pode dar a ele um único poema exemplo.
  • Prompting de few-shot - Este é um método onde o LLM recebe um pequeno número de exemplos da tarefa que está sendo solicitada para realizar. Por exemplo, se você quer que o LLM escreva um artigo de notícias, você pode dar a ele alguns artigos de notícias para ler.

Práticas recomendadas

  • Use um texto conciso.
  • Prefira o que é específico e bem definido.
  • Peça uma tarefa por vez.
  • Peça para classificar em vez de gerar.
  • Inclua exemplos.

Referência de design de multimodal do Google

https://cloud.google.com/vertex-ai/docs/generative-ai/learn/introduction-prompt-design

Repositório com referências: https://github.com/GoogleCloudPlatform/generative-ai

Exemplo de prompt mais estruturado usando a plataforma do Google

Dessa forma, incluímos etapas e instruções sobre o que fazer.

You are an article summarizer.
For a given input article, you need to:
1. Extract the topic.
2. Extract a short description.
3. Extract 3 unique key learnings.
4. Compare the short description to each of the key learnings to test for replicated information. Delete any redundant key learning and generate a new key learning with novel information.
‎
Input: Our quantum computers work by manipulating qubits in an orchestrated fashion that we call quantum algorithms.
The challenge is that qubits are so sensitive that even stray light can cause calculation errors — and the problem worsens as quantum computers grow.
This has significant consequences, since the best quantum algorithms that we know for running useful applications require the error rates of our qubits to be far lower than we have today.
To bridge this gap, we will need quantum error correction.
Quantum error correction protects information by encoding it across multiple physical qubits to form a “logical qubit,” and is believed to be the only way to produce a large-scale quantum computer with error rates low enough for useful calculations.
Instead of computing on the individual qubits themselves, we will then compute on logical qubits. By encoding larger numbers of physical qubits on our quantum processor into one logical qubit, we hope to reduce the error rates to enable useful quantum algorithms.

Exemplo de prompt com instrução de formato de saída (output formatting)

É fundamental pensar no propósito da pergunta que você está fazendo e definir claramente o formato de saída esperado.

  1. Especifique o formato de saída para o Tópico. É melhor prática pedir para classificar em vez de gerar, quando possível. Quais tópicos você espera ver?
    1. Extract the topic. The topic can be one of: Computer Science, Psychology, AI, Other.
  2. Especifique o formato de saída para a Descrição.
    1. Extract a short description. The description must be one sentence at most, and introduces the subject of the article.
  3. Especifique o formato de saída para as Principais Aprendizagens. Você deve especificar se o modelo deve usar apenas informações contidas na solicitação ou pode estendê-lo com conhecimento prévio.
    1. Extract 3 key learnings. The key learnings summarize information on the “how” and “why” of the subject. Make sure to only use information in the input article.
You are an article summarizer.
For a given input article, you need to:
1. Extract the topic. The topic can be one of: Computer Science, Psychology, AI, Other.
2. Extract a short description. The description must be one sentence at most, and introduces the subject of the article.
3. Extract 3 key learnings. The key learnings summarize information on the "how" and "why" of the subject. Make sure to only use information in the input article.
4. Compare the short description to each of the key learnings to test for replicated information. Delete any redundant key learning and generate a new key learning with novel information.
‎
Input: Our quantum computers work by manipulating qubits in an orchestrated fashion that we call quantum algorithms.
The challenge is that qubits are so sensitive that even stray light can cause calculation errors — and the problem worsens as quantum computers grow.
This has significant consequences, since the best quantum algorithms that we know for running useful applications require the error rates of our qubits to be far lower than we have today.
To bridge this gap, we will need quantum error correction.
Quantum error correction protects information by encoding it across multiple physical qubits to form a “logical qubit,” and is believed to be the only way to produce a large-scale quantum computer with error rates low enough for useful calculations.
Instead of computing on the individual qubits themselves, we will then compute on logical qubits. By encoding larger numbers of physical qubits on our quantum processor into one logical qubit, we hope to reduce the error rates to enable useful quantum algorithms.

Exemplo de prompt para fazer a IA não responder nada fora do contexto ou instruções

Exemplos:

  • Responda com "Sou um resumidor de artigos. Forneça-me um artigo para resumir." a quaisquer solicitações que não envolvam resumo de artigos.
  • Remember that before you answer a question, you must check to see if *it* complies with your mission. If not, you can say, Sorry I can't answer that question