Code Monkey home page Code Monkey logo

chatgpt's Introduction

ChatGPT

ChatGPT is a text-based AI assistant by OpenAI. This is an analysis of ChatGPT.

Analysis of the ChatGPT API

ChatGPT can be used with 2 different models:

  • gpt-3.5-turbo
  • gpt-4

gpt-3.5-turbo

The model gpt-3.5-turbo is different from previous models. The model uses a new vocabulary cl100k_base with 100.000 tokens and the Chat Markup Language.

If we send the message [{"role": "user", "content": "13+37="}] to the model, we get the following chat completion response:

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "50",
        "role": "assistant"
      }
    }
  ],
  "created": 123,
  "id": "chatcmpl-XXX",
  "model": "gpt-3.5-turbo-0301",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 1,
    "prompt_tokens": 12,
    "total_tokens": 13
  }
}

The number of prompt tokens and completion tokens are computed as follows:

prompt_tokens = ['<|im_start|>', 'user', '\n', '13', '+', '37', '=', '<|im_end|>', '\n', '<|im_start|>', 'assistant']
# len(tokens) is 11

It's unclear why the model returns 12 prompt tokens instead of 11. Maybe a newline is added after the word assistant.

completion_tokens = ['50']
# len(tokens) is 1

gpt-4

The gpt-4 model also uses the new vocabulary cl100k_base but it returns a different number of prompt tokens compared to gpt-3.5-turbo. If we send the message [{"role": "user", "content": "13+37="}] to the model, it returns the following chat completion response:

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "50",
        "role": "assistant"
      }
    }
  ],
  "created": 123,
  "id": "chatcmpl-XXX",
  "model": "gpt-4-0314",
  "object": "chat.completion",
  "usage": {
    "completion_tokens": 1,
    "prompt_tokens": 11,
    "total_tokens": 12
  }
}

Performance

We have evaluated the ChatGPT model gpt-4-0314 with the HumanEval dataset. Out of 164 programming problems, the model can solve 78.66%.

Model name Pass@1 Date Comment  Completions of evaluation run Prompt
 gpt-4-0314 78.66% 2023-03-17 https://openai.com/api/ 2023-03-17-samples-gpt-4-0314.jsonl Complete the following code:\n{code}
 gpt-3.5-turbo-0301 72.56% 2023-03-01 https://openai.com/api/ 2023-03-01-samples-gpt-3.5-turbo-0301.jsonl
 text-davinci-002-render-sha 70.12% 2023-02-19 https://chat.openai.com/ 2023-02-19-samples-text-davinci-002-render-sha.jsonl
 text-davinci-002-render 56.10% 2022-12-03 https://chat.openai.com/
cushman-ml 56.10% 2022-10-23 Copilot
code-davinci-002 46.95% 2022-10-23 https://openai.com/api/
code-cushman-001 32.93% 2022-10-23 https://openai.com/api/

chatgpt's People

Contributors

saschaschramm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.