Skip to Main Content

Machines and Society

A growing guide on the latest in data-driven research and emerging technologies at the intersection of society, information and technology.

What ChatGPT Is

In essence, ChatGPT is a chatbot interface to a series of models that power it. It is capable of generating natural language and code in a dialogue format for a variety of tasks. ChatGPT was released in November 2022 by the company OpenAI.


ChatGPT models

The newest model is GPT-4, a large multimodal model released in March 2023. Read more in its GPT-4 Technical Report (PDF).

Compared with its predecessor GPT-3.5, GPT-4 can process more than one modality of information, which accepts image and text inputs and produces text outputs. Since November 2023, ChatGPT's voice feature is available to all users. In Feb 2024, OpenAI launched Sora, a text-to-video model that can generate a minute of high fidelity video from text instructions. For multimodality and LLMs, learn more here.

GPT-4 also has an expanded context length, or the limit to how much the models can "remember" in a conversation with the user. This limit includes the token count from both the prompt and completion. For instance, a standard GPT-4 model can process about 8,000 tokens in a query. By comparison, GPT-3.5-turbo can process around 4,000 tokens.

Datasets used to train GPT-3, as documented in its technical report (PDF), include Common Crawl, WebText2, Books1, Books2, and Wikipedia, although sources of Book1 and Books2 are not entirely transparent

How ChatGPT Works

Practical knowledge of how ChatGPT works can be advantageous in generating high-quality outcomes using ChatGPT.


Prompts

Prompt is the way we talk to ChatGPT using natural language, or the way we program the models. 

Prompt design involves instructions and context passed to a language model to achieve a desired task. According to OpenAI, the key to effective prompt design is showing, not just telling, including providing instructions and examples, or providing a ground truth to limit the likelihood that the models make up an answer. 

Tricks to prompt design go back to how the models are trained and how transformer-based large language models can learn a new task from a few examples without the need for any new training data. This ability is referred to as in-context learning, a concept popularized by the GPT-3 paper.

See more prompt advice and more examples from OpenAI. 


Tokens

GPT models process input and output texts by breaking them down into smaller units called tokens. Tokens can be words, chunks of words, or single characters. The models infer statistical relationships between tokens and predict the next token in a sequence of tokens. 

Tokenization is the task of splitting character sequences into tokens. To see how this process happens, OpenAI's Tokenizer tool visualizes how text is tokenized. You may also estimate how many tokens your input text may cost using this tool.

Knowledge of tokens and tokenization improves prompt design when using ChatGPT. As a rule of thumb, a token is equal to roughly four characters in English; 1-2 sentences generally take up around 30 tokens.


Plugins

OpenAI added support to plugins in March 2023. Plugins enhance the capabilities of the language models by allowing the models to retrieve up-to-date information from the web and third-party knowledge bases, therefore improving the accuracy and relevance of their outputs.  Additionally, when ChatGPT plugins interact with developer-defined APIs, they will be able to a wide range of actions. Find here a curated list of ChatGPT plugins and demonstrations that showcase their capabilities. 


Connecting to the Internet

In September 2023, ChatGPT was able browse the internet for real-time information with direct links to sources, no longer limited to training data before September 2021. 


GPTs

GPTs are ways that users can build custom versions of ChatGPT for a specific purpose with no coding required. Although GPTs are not autonomous agents yet, they show a near future where AIs can start to act as agents.


Using user data to train model
According to OpenAI's policy, user data submitted via API will not be used to train OpenAI models. However, data submitted through non-API consumer service ChatGPT may be used to train their models. The data includes both prompts and responses.

How to Interact with ChatGPT through Prompts and Conversations

There are various methods to interact with ChatGPT through prompts to extract the most performance out of the language model, tapping into the emergent abilities of large language models that are not present in small models.

These approaches and techniques include:

  • Chain-of-thought prompting that instructs the model to explain its reasoning through intermediate steps to derive the final answer
    • Few-shot prompting that gives multiple examples of a task, typically with a context and a desired completion, and then one final example of context with the model expected to provide the completion
    • Zero-shot prompting that simply adding "Let's think step by step" before each answer
  • Generated knowledge prompting for commonsense reasoning, where we can generate useful knowledge from a language model and then provide the knowledge as an input prompt that is concatenated with a question
  • Zero-shot translation prompting that includes vetted, factual information to the LLM to be transferred to a new domain

Here are some techniques:

  • Sampling multiple times
  • Asking for reflection (e.g. "Did you meet the assignment")
  • Giving ChatGPT an identity to give it context (e.g. "You are an expert on this topic")
  • Structured prompting consisting of multiple elements (e.g. a prompt starting with role and goal, step-by-step instructions, proceeding with expertise, constraints, personalization, examples and few-shot, and ending with asking for specific output) 

Read More

ChatGPT explainers


Courses


More on generative AI

Demo, Tips and Resources

To prompt ChatGPT effectively, it is important to be specific about what you are looking for, and provide context and examples to help ChatGPT generate accurate and relevant responses. Asking follow-up questions and giving feedback to ChatGPT’s responses can also help it learn and improve over time. Besides, it is also recommended to experiment with different prompts.

What does effective prompting look like? Here’s an example:


User: I want you to act as a personal trainer. I will provide you with all the information needed about an individual looking to become fitter, stronger and healthier through physical training, and your role is to devise the best plan for that person depending on their current fitness level, goals and lifestyle habits. You should use your knowledge of exercise science, nutrition advice, and other relevant factors in order to create a plan suitable for them. My first request is "I need help designing an exercise program for someone who wants to lose weight." 

Tip: Be specific when you ask questions. Provide context and examples.

 

ChatGPT: Sure, I can help design an exercise program for someone who wants to lose weight. Here are some general guidelines and considerations for creating an effective exercise plan:
1. Identify goals: Before starting any exercise program, it's important to clearly define your goals. In this case, the primary goal is weight loss. It's also important to consider other goals such as improving cardiovascular health, building strength, and increasing endurance.
2. Assess current fitness level: ...
3. Choose appropriate exercises: ...
4. Determine frequency and duration: ...
5. Consider nutrition: ...

Here's an example of a weekly workout plan for someone who wants to lose weight:
Monday: 30 minutes of brisk walking, followed by a full-body strength training workout
Tuesday: Rest day
Wednesday: 30 minutes of jogging, followed by a core-focused strength training workout
Thursday: Rest day
Friday: 30 minutes of cycling, followed by a lower-body strength training workout
Saturday: 30 minutes of brisk walking, followed by an upper-body strength training workout
Sunday: Rest day
... Remember to listen to your body, start slowly and gradually increase the intensity and duration of your workouts. Consistency is key, and remember that weight loss is a journey, not a destination. Good luck with your fitness journey!

User:  I don't have time for training on Mondays. I am also not a fan of cycling. Give me a more interesting workout plan. 

Tip: Give feedback.

 

ChatGPT: Sure, I can revise the workout plan to better suit your preferences and schedule. Here's an updated plan:
Monday: Rest day
Tuesday: 30 minutes of brisk walking, followed by a full-body strength training workout
Wednesday: Rest day
Thursday: 30 minutes of jogging, followed by a core-focused strength training workout
Friday: 30 minutes of swimming, followed by a lower-body strength training workout
Saturday: 30 minutes of hiking or outdoor activities, followed by an upper-body strength training workout
Sunday: Rest day
This updated plan includes more outdoor activities like hiking, which can be a fun and challenging way to get cardio exercise. Swimming is also a great low-impact cardio exercise that can be easier on your joints compared to jogging or cycling. Strength training is still a key component of the plan, as it helps build lean muscle mass and boost metabolism. ...

User:  How can I make sure I'm not overdoing it with strength training? 

Tip: Ask follow-up questions.

 

ChatGPT: It's important to listen to your body and not push yourself too hard with strength training, as overdoing it can lead to injury or muscle soreness that can hinder your progress. Here are some tips to make sure you're not overdoing it with strength training:
1. Start with lighter weights: ...
2. Gradually increase weight and reps: ...
3. Take rest days: ...
4. Listen to your body: ...
5. Work with a trainer or coach: ...
Remember that strength training should be challenging, but it should also be enjoyable and sustainable. By listening to your body and gradually progressing your workouts, you can avoid overdoing it and achieve your fitness goals safely and effectively.

Reference: Act as a Personal Trainer


Tools, Resources, and More Examples