Polymer transistors are being intensively developed for next-generation flexible electronics. Blends comprising a small amount of semiconducting polymer mixed into an insulating polymer matrix have simultaneously shown superior performance and environmental stability in organic field-effect transistors compared with the neat semiconductor. Here we show that such blends actually perform very poorly in the undoped state, and that mobility and on/off ratio are improved dramatically upon moderate doping. Structural investigations show that these blend layers feature nanometre-scale semiconductor domains and a vertical composition gradient. This particular morphology enables a quasi three-dimensional spatial distribution of semiconductor pathways within the insulating matrix, in which charge accumulation and depletion via a gate bias is substantially different from neat semiconductor, and where high on-current and low off-current are simultaneously realized in the stable doped state. Adding only 5 wt% of a semiconducting polymer to a polystyrene matrix, we realized an environmentally stable inverter with gain up to 60.