How To Use GPT-o1 Preview (o1- Preview Tutorial) Complete Guide With Tips and Tricks

OpenAI's O1 Preview and O1 Mini use internal reasoning tokens for deeper problem-solving. O1 Preview handles complex tasks slowly; O1 Mini is faster for coding and math. Keep prompts simple, skip chain-of-thought instructions, and use delimiters to separate inputs.
Chapters
So, in today's video, we are diving into OpenAI's new 01 series models. And these models are specifically trained to excel in deeper reasoning and problem solving, making them the perfect for tasks that require a lot of critical thinking, like advanced coding, scientific reasoning, and complex data analysis. Now, the O1 series includes two models, the O1 preview and the O1 mini. The O1 preview is designed to tackle difficult problems using a broad range of general knowledge. Meanwhile, O1 Mini offers a faster, more cost effective solution for tasks that are focused on coding, math and science, where broad knowledge isn't as crucial. Now, these models are quite different to the traditional model you're used to with GPT4O. But while GPT4O is is still your go to for fast responses, image inputs and applications that require more versatility, the O1 models are designed to think deeply before responding. They use a unique feature called reasoning tokens, allowing them to break down a problem internally before providing an answer. This makes them more ideal for complex tasks, even if it takes a little bit longer to generate a response. However, keep in mind that the O models are currently in beta, so some features are limited. For example, they only handle text input, and some advanced functionalities like function calling aren't available yet. Today, I'll guide you through how to use these O1 models effectively, from setting them up and to writing prompts that maximize their capabilities. Whether you're a developer or a beginner, this video is going to help you and give you all the steps that you need. So let's dive into how you can leverage the O1 models to tackle some of the most challenging problems out there. So this is OpenAI's advice on prompting and, and I'm going to break down this entire thing step by step because although this information is really nice, it doesn't give you all of the information you need to know. So I'm going to go through in a quick presentation that's going to literally take two minutes each of these points and what they mean when you're prompting this new model. So with this model, what you want to do is you essentially want to ensure that you don't really follow all of your previous prompting guidelines because. Because the games have changed and this is somewhat of a new era in prompt engineering. So the first thing that OpenAI says is that you must keep your prompts simple and direct. What this basically means is that use short, straightforward sentences or commands when asking the AI to do something. So right here you can see I've got an example for this, but Basically what you want to do is you want to make sure that your prompts are really simple, straightforward and not using prompt engineering techniques, because this is already internally built into the model. So we can see a less effective prompt here, which is can you please, in a detailed and elaborate manner, explain how photosynthesis works? Considering all the biological and chemical processes involved, this is a less effective prompt compared to simply stating explain how photosynthesis works. Now, it might feel weird to do this because you might think that the model might not understand your query, but the second prompt is shorter and gets directly to the point, making it easier for the AI to understand what you're asking for. These models already have these internal instructions to make them reason about every single query that they're given. So when you add all of these unnecessary details that make the prompt less simple and less direct, it often confuses the model, resulting in a response that isn't as effective if you just asked it a simple question. It does feel counterintuitive, but this is from OpenAI's official documentation. Now let's move on to point number two. Point number two is that you want to avoid chain of thought prompting. Chain of thought prompting is where you'll tell an AI system or in this example, GPT4O or O1 think step by step and you don't want to ask the AI system to think step by step. For example, you can see a less effective prompt is to think step by step and explain how you calculate the square root of 16. This is a rather ineffective prompt for models like O1. The better prompt is what is the square root of 16? A simple question that doesn't ask the AI system to think step by step or to verify step by step or or any other prompt engineering techniques that you may use. It's better to simply ask it the question and await your response. The AI is already going to be doing all of the necessary reasoning steps that you might think, so try not to overcomplicate it with chain of thought prompting. Additionally, we need to use delimiters for clarity. So OpenAI on their documentation they state that we need to use delimiters. So what you need to do if you want a more effective prompt is, is to use special characters or formatting to separate different parts of your input to the AI. So essentially you can use XML tags and these tags are used encoding to structure data, e.g. question marks at the start of a question section and question marks at the end. So we can see a less effective prompt slash. A less clear prompt is translate the Text hello world and summarize this text. But for a better prompt that we can see, translate the text, hello world. We can see that this is in question marks. Then of course we've got another section, summarize this text. And we can see that this text is of course in quotation marks. And we can see here that the quick brown fox jumps over the lazy dog. So this is the kind of prompting that you want if you're trying to get the AI system to do many different things. And by adding triple quotation marks, you can clearly delimit the text to be translated and summarized so that the AI understands exactly what sections are related to which instruction. If you don't do this, the AI system might be a little bit confused on which bits it should do that to. So please make sure that you do do this. For prompts that are a little bit more complex, even with simple instructions, you can see that the instructions here are quite simple. But in order to make sure that the AI gets it right, you're going to have to separate them and basically allow the AI to understand exactly what you're asking. Now we have another one right here, which is of course limit context from external sources. So one thing that people might want to do is of course use external sources, but when providing extra information for the AI to use, keep it focused and only include what's most relevant. Now, retrieval augmented generation involves the AI retrieving additional information from external documents or databases to answer a question more thoroughly. And oftentimes this does work with other models and other systems, but providing too much context to IO is something that just isn't effective. So we can see right here giving the model too much context and saying, Here is a 20 page document on climate change and I want you to summarize the key points from the section on global warming, but the rest is about unrelated topics like ocean and forest management. Or if you have a long corpus of text that you input and you ask it a question on a specific section, that is just too much context for this model. The better prompt to do which is right here is to basically just say, summarize the key points about global warming from this excerpt and include that short paragraph or that short piece of text. These models are already going to be using a lot of reasoning tokens, so you want to make sure that you don't use too many tokens when you're using your prompts anyways until we get longer context windows in the future. But the first example gives too much irrelevant information, making it harder for the AI to focus and the second example is concise and only gives the necessary context, improving the quality of the response. So you could say reason on this piece of text about yada yada yada, or what do you think the implications for this are if you're currently confused between which models you want to use, because of course There is the O1 preview and of course there is the O1 mini. The O1 preview is for deep reasoning and complex problem solving, so this is tailored for situations where complex reasoning is essential. And this is where the model excels in handling intricate multi step problems that require deep thought and broad general knowledge. For example, if you're working on tasks related to scientific research, mathematical theorem proofs, or Advanced data analysis, O1 Preview can navigate these challenges by effectively considering multiple approaches before generating a response for broad general knowledge. If your tasks involve leveraging a wide range of knowledge from different fields, the O1 preview is a better choice. It's designed to use its internal reasoning tokens to evaluate various possibilities and provide well thought out answers. This is particularly useful for applications like academic research, legal analysis or complex decision making systems where an expansive understanding is required. Now there are use cases requiring high accuracy where you want to be using O1 Preview. So when you need the model to deliver highly accurate outputs for critical applications, the O Preview is more suitable. Its ability to think thoroughly before answering means it can handle more nuanced queries, making it ideal for for generating precise and reliable results in fields like medicine, engineering and science. And if your application can accommodate longer response times and you're looking to explore various solutions or hypotheses, O1 preview is the way to go. The model is slower, but its more deliberate processing is perfect for environments where quality outweighs speed. Now let's talk about O1 Mini. This has faster processing for routine tasks. O1 Mini is a streamlined version of O Preview that is optimized for speed and cost. It's best used for coding, math and science that doesn't require extensive background knowledge, but can still benefit from the model's advanced reasoning capability. For example, if you need to generate code snippets, form routine data validation, or solve well defined mathematical problems quickly, O1 Mini provides a more efficient solution. It is also cost effective option for high volume applications. If you have a high volume application that involves many requests or require a cost effective solution, O1 mini is the better choice. Its lower computational demands make it more economical to run, especially for applications that don't require the depth of reasoning that O1 preview offers. Now when working on programming tasks, debugging or implementing specific algorithms, O1 Mini excels. It's designed to handle structured tasks quickly and making it ideal for software development environments, technical support systems, or other applications where fast, reliable responses are needed. So to conclude, choose O1 Preview when you need deep, comprehensive reasoning, a broad understanding of complex problems and high accuracy, especially in fields like science, academia and advanced research. Or choose O1 mini when you require more cost effective solutions for well defined tasks in coding, technical fields, or routine problem solving scenarios. So let's actually take a look at some examples of where we can actually use these models and understand what they're doing effectively. For example, let's ask the model Can I use Reddit to power my YouTube channel focused on AI? So now that I've inputted this message right here you can see that the model has entered the phase where it is thinking. So if we click this drop down menu right here, we can see that there are different stages to where this model is going to be thinking through different scenarios and of course thinking through different steps. You can see right here that we won't always get the entire of the tokens. OpenAI has said to us that we don't always get the internal workings of the model, but we do see somewhat of an overview of how the model thinks about its strategy. And you can see we then get a very comprehensive feedback that is long, it's detailed, and it gives us some nice responses on how we could improve our YouTube channel. It talks about identifying relevant subreddits, engaging authentic, sharing our content thoughtfully, be mindful of self promotion rules, hosting an ama, utilizing advertisements, responding to feedback. And there are just many different sub strategies that you can see under here such as following the nine to one rule which I didn't even know about, and of course many other sub areas that you might have not. So These models, the O1 series of models are remarkably effective when you ask some questions that do require lots of reasoning and can involve many different steps for difficult questions. So if you want some prompt examples, you can see right here that OpenAI has included these on their Documentation tab. So for example, we've got code refactoring and it says the OpenAI series of models are able to implement complex algorithms and produce code. The prompt asks O1 to refactor a react component component based on some specific criteria. You can see right here that this is the prompt where given the react component below, change it so that the nonfiction books have red text. Return only the code in your reply. Do not include any Additional formatting. We can also see that there is code planning and you can see that I want to build a Python app that takes user questions and looks them up and yada yada yada. We can also see that for STEM research there is a simple question and these are the kinds of prompts that you should be using. If you're going to be looking at those fields, you could always ask it to code different things. This model does have really decent coding abilities. So right here I'm asking it to code Snake in Python that I can play. You can see it's going to clarify the request and you can see it's going to create the game and then crafting a Snake game. Now, a tidbit that I did want to add is that sometimes what the model might actually do, unfortunately it might not actually think as hard as you want about certain questions. So you have to understand that certain questions are going to have certain tokens based on what the model thinks. And if you do want the model to think harder about your problem, you're going to have to include certain extra questions within those questions using delimiters like I've previously spoken about. So you can see right here, this one thought about it for 17 seconds and it managed to deliver the code which I could then use to play this game. And it also gives me all of the exact steps needed to do get to the final output. Something I should probably add is that you're not supposed to actually ask the model to explain its reasoning steps. You can ask it to explain how it managed to get to the answer and explain why it thought that. But you can't actually ask the model to explain all of the steps behind this, because if you do, you'll actually receive a warning in the email from OpenAI. They are trying to keep the model's reasoning token secret for whatever reason. But it is something that I thought you guys should.










