It's the heat that breaks down the caffeine I'd assume.
I'm not 100% sure what qualifies as a dark roast or light roast though for time & temp varies.
But, looking at it from a weed sense, I'd imagine there has to be a sweet spot, like with decarbing cannabis to activate the THC for edibles.