Although many mechanisms have been proposed for diabetic encephalopathy in type 2 diabetes mellitus (T2DM), the risk factors for cognitive impairment in type 1 diabetes mellitus (T1DM) are less clear. Here, we show that streptozotocin (STZ)-induced T1DM rats showed cognitive impairment in both Y maze and Morris water maze assays, accompanied with D-ribose was significantly increased in blood and urine, in addition to D-glucose. Furthermore, advanced glycation end products (AGE), Tau hyperphosphorylation and neuronal death in the hippocampal CA4/DG region were detected in T1DM rats. The expression and activity of transketolase (TKT), an important enzyme in the pentose shunt, were decreased in the brain, indicating that TKT may be involved in D-ribose metabolism in T1DM. Support for these change was demonstrated by the activation of TKT with benfotiamine (BTMP) treatment. Decreased D-ribose levels but not D-glucose levels; markedly reduced AGE accumulation, Tau hyperphosphorylation, and neuronal death; and improved cognitive ability in T1DM rats were shown after BTMP administration. In clinical investigation, T1DM patients had high D-ribose levels in both urine and serum. Our work suggests that D-ribose is involved in the cognitive impairment in T1DM and may provide a potentially novel target for treating diabetic encephalopathy.