Heat the oven to 425 degrees and line a sheet pan with parchment paper. Halve sweet potatoes lengthwise, then brush all over with olive oil.
Place cut side down on prepared sheet and roast for 30 to 40 minutes, or until completely cooked through. Take sweet potatoes out of the oven and let cool for a few minutes. Use a fork to slightly flatten the sweet potatoes and make a well for the filling.
Divide half the cheese among the potato halves. Spoon the beans or grains over them, then sprinkle with the remaining cheese. Return the pan to the oven and bake for another 5 minutes, until the cheese has melted and the filling has warmed through.