OpenAI o1-mini is a simplified, more economical version of o1-preview aimed at narrower tasks. It is especially effective in STEM, delivering strong performance on math and coding problems.
Use cases
-
Programming and debugging: The model almost matches o1-preview on the quality of code generation and debugging, but does it far faster and cheaper. That makes it ideal for real-time tasks where speed matters.
-
Education and solutions for students: The model is widely used for learning tasks and scientific research in STEM disciplines. It handles college-level assignments, solving physics and math problems with high accuracy.
-
Math and algorithms: o1-mini is particularly good at tasks involving theorems, equations and algorithms. That makes it useful for building math software and automating data analytics.
Advantages
-
High speed and low cost: The model is 80% cheaper and faster than o1-preview, which makes it a great option for tasks that need quick processing, such as writing and debugging code.
-
Optimised for STEM: Despite its compact size, the model handles science, technology and math tasks almost at the level of full-size models. It is especially effective at solving programming and advanced math problems.
-
Accessible for wide use: The model is optimised to complete tasks quickly, which makes it ideal for students, developers and engineers who need fast, accurate answers.
Prompting tips
OpenAI o1-mini specialises in STEM tasks (science, technology, engineering and mathematics) and is especially effective at coding and math. To get the most out of it, keep the model's specifics in mind when you write prompts.
Sample request and response
Since o1-mini has a smaller knowledge base than its larger counterpart, try to avoid broad requests that need wide context. Short, specific tasks work better. For example, if you want to write code, set a clear task with detailed requirements for the input and output data.
Example:
Write a Python function that sorts a numeric array using quicksort and add comments to every step.
Response:
// def quicksort(arr):
"""
A function that sorts a numeric array using the quicksort algorithm.
Parameters:
arr (list): The list of numbers to sort.
Returns:
list: The sorted list.
"""
# If the list is empty or holds a single element, it is already sorted
if len(arr) <= 1:
return arr
else:
# Pick the pivot element (it can be picked in different ways)
pivot = arr[len(arr) // 2]
# Split the list into three parts:
# less: elements smaller than the pivot
# equal: elements equal to the pivot
# greater: elements larger than the pivot
less = []
equal = []
greater = []
for x in arr:
if x < pivot:
less.append(x)
elif x == pivot:
equal.append(x)
else:
greater.append(x)
# Recursively sort the less and greater sublists, then join them with equal
return quicksort(less) + equal + quicksort(greater)
# Example of how to use the function
if __name__ == "__main__":
# The original unsorted array
array = [3, 6, 8, 10, 1, 2, 1]
# Call the quicksort function
sorted_array = quicksort(array)
# Print the sorted array
print("Sorted array:", sorted_array)Explanation of the algorithm's steps**
Recursion base case**:
If the list holds 0 or 1 elements, it is already sorted, and the function returns it unchanged.
Picking the pivot:
Pick the pivot element. Here we take the middle element of the list, but any other one will do (the first or the last, for instance).
Splitting the list:
Walk through every element of the list and distribute them into three new lists:less: holds elements smaller than the pivot.equal: holds elements equal to the pivot.greater: holds elements larger than the pivot.**
Recursive sorting and merging**:
Callquicksortrecursively for thelessandgreaterlists.
Join the sortedless,equalandgreaterlists into one sorted list and return it.
Sorted array: [1, 1, 2, 3, 6, 8, 10]This simple example shows how the quicksort algorithm works. You can test the function on different data sets to confirm it is correct and efficient.