Prep your equipment. Heat the oven to 375°F (190°C).
Grease a 9x13-inch baking dish with butter or nonstick spray.
Cook the sweet potatoes. Place the peeled, chopped sweet potatoes in a large pot. Cover with cold water and add a pinch of salt. Bring to a boil and cook until fork-tender, about 15–20 minutes.
Drain well.
Mash until smooth. Return the drained sweet potatoes to the warm pot. Add butter and mash until smooth and creamy. You can use a masher for a rustic texture or a hand mixer for extra smoothness.
Flavor the mash. Stir in brown sugar, warm milk or half-and-half, eggs, vanilla, cinnamon, nutmeg (if using), and salt.
Mix until fully combined and silky. Taste and adjust sweetness or spices as you like.
Fill the baking dish. Spread the sweet potato mixture evenly in the prepared dish. If you’re using pecans inside the base, fold them in now.
Bake the base. Bake uncovered for 18–22 minutes, until the edges are slightly puffed and the center is hot.
This helps set the eggs and keeps the topping from sinking.
Add the marshmallows. Remove the dish and scatter an even layer of mini marshmallows over the top. Keep it single-layered for even browning.
Finish in the oven. Return to the oven for 8–12 minutes, until the marshmallows are melted and golden. Watch closely during the last few minutes to prevent burning.
Rest and serve. Let the casserole sit for 10 minutes before serving.
This helps the base set and keeps the topping intact.