Generating Prompt Data for the LLM Prediction Game
Introduction: The Role of Prompt Data in the Game
Welcome back! In the previous lesson, you learned about the LLM Prediction Game — how it works, how players interact with it, and how their guesses are scored. Now, we are ready to start building the data that powers the game.
In this lesson, you will learn how to generate the prompt data that the game uses to ask questions. This data is essential because it provides the daily questions and the structure that the game relies on. By the end of this lesson, you will know how to create a set of prompts, each with a question, some settings, and a few random elements to keep the game interesting.
Key Python Concepts for This Lesson
Before we dive in, let’s quickly remind ourselves of a few Python basics that will be useful in this lesson:
- Lists: A way to store multiple items in a single variable.
- Dictionaries: A way to store data in key-value pairs, allowing you to quickly look up values by their keys. For example,
{"llm": "gpt-5.4-nano", "user_question": "What is the capital of Spain?"}. - Random Selection: The
randommodule helps us pick random items from a list. - Saving Files: We use the
open()function and thejsonmodule to write data to a file.
If you need a refresher on any of these, feel free to look at Python documentation. Otherwise, let’s move forward!
Building a Prompt Entry: What Goes Into Each Question
Each prompt entry in our game is a small package of information. Let’s break down what each entry contains:
llm: The name of the language model we are using (for example,"gpt-5.4-nano").system_prompt: Instructions for the model (for example,"You are a helpful assistant. Your answers must only contain 10 words in plain text, do not use markdown.").user_question: The question that will be shown to the player.breakpoints: A list of numbers that will be used later in the game logic.
Let’s look at a simple example of what one entry might look like in Python:
This dictionary holds all the information for one prompt. In the next steps, we’ll see how to generate many of these entries automatically.
