input: 'What is 934+1208'
output: `print(934+1208)`
input: 'how many "r"s in strawberry'
output: `print(len([l for l in "strawberry" if l == 'r'])`
etc, etc. input: 'What is 934+1208'
ground_truth: 2142
input: 'how many "r"s in strawberry'
ground_truth: 3
You would then train the model to write python code that produces the ground_truth output. Your training code would take the model's output, run the python it produced, and then check whether the output matches the expected ground_truth. Importantly, this doesn't require you actually writing the code to solve the problem (you don't even have to know if it's solvable, technically!). Over time, the training loop would make the model more likely to produce outputs that get high rewards, which hopefully means it gets better at producing valid and applicable python.