Hi @DGhose, I’ve found that using the following prompt format to be reasonably good at getting GPT-2 to complete the pattern for the last input_n:
input_1 => output_1 \n input_2 => output_2 \n ... input_n =>

So for your use case, you could try feeding something like the following
apple => slice, eat, mash, cook, bake, juice \n book => read, open, close, write on \n spoon => lift, grasp, scoop, slice \n banana =>

which in the HuggingFace inference API for gpt2-xl produces a semi-coherent output for “banana”:

You’ll probably need more examples if you’re doing more complex mappings (e.g. language translation) and it takes a few tries to “cherry pick” the desired output because the text generation is not deterministic in the API (I think they use sampling)