Caffeine averages 1.2% of the total green (unroasted) bean weight of arabica coffee and it tastes bitter. Caffeine is very resistant to the roasting process and undergoes minimal degradation.
“There are only negligible losses of caffeine in the roasting process” (W. Heilmann, Coffee: Recent Developments)
So considering a typical weight loss of a roast might be around 14% for speciality coffee, that means many substances are breaking down in addition to moisture loss whilst caffeine is remaining more or less stable. Caffeine will, therefore, have a higher percentage of mass the further you roast. This also means that for darker roasts, where other chemicals and water have been evaporated or degraded further still, caffeine can be assumed to make up a slightly larger percentage of the weight of each bean.
Despite caffeine’s well-known bitterness, it typically contributes less than 10% of the bitterness of coffee (Clarke & Macrae, 1988). Decaffeinated coffee is still bitter, and spiking decaf with caffeine doesn’t change consumers’ perception of the coffee, so other compounds are considered more important in creating the bitterness of coffee.
Trigonelline is classed in the same category of chemicals as caffeine: an alkaloid. In plant biology, alkaloids are frequently used by the plant as a natural pesticide. This chemical is almost as abundant in green coffee as caffeine, at just under 1% on average (Stennert & Maier, 1994), but its final mass in the cup is reduced by roasting (see fig 3.1). This research found a mean reduction after roasting of 90% (Vignoli et al., 2014). It produces many aromatic substances with positive flavour associations such as pyrazine, furans, alkyl-pyridines, and pyrroles, while also imparting bitterness (Wei & Tanokura, 2015). It also forms niacin, an important dietary B vitamin (Trugo, 2003). While trigonelline’s bitter taste is also well established, it also contributes only a small part of coffee’s bitter taste