We clarify the role played by BPS states in the calculation of threshold corrections of D = 4, N = 2 heterotic string compactifications. We evaluate these corrections for some classes of compactifications and show that they are sums of logarithmic functions over the positive roots of generalized Kac-Moody algebras. Moreover, a certain limit of the formulae suggests a reformulation of heterotic string in terms of a gauge theory based on hyperbolic algebras such as E10. We define a generalized Kac-Moody Lie superalgebra associated to the BPS states. Finally we discuss the relation of our results with string duality.