The invention provides an apparatus for the thermal treatment of biomass, comprising (1) a low-temperature drying section comprising a low-temperature drying section channel with low-temperature drying section channel (screw) transporter, (2) a high-temperature drying section comprising a high-temperature drying section channel with high-temperature drying section channel (screw) transporter, (3) a torrefaction section comprising a torrefaction channel with torrefaction section channel (screw) transporter, (4) a cooling section comprising a cooling section channel with cooling section channel (screw) transporter, (5) a torrefaction section off-gas combustor, (6) a thermal energy transfer system, in thermal contact with the torrefaction section off-gas combustor and one or more of the torrefaction section, the high-temperature drying section and the low-temperature drying section.