Diabetes mellitus (DM) can increase the risk of Alzheimer's disease (AD) in patients. However, no effective approaches are available to prevent its progression and development. Recently, autophagy dysfunction was identified to be involved in the pathogenesis of neurodegenerative diseases. This study was designed to investigate the effect of metformin on hyperphosphorylated tau proteins in diabetic encephalopathy (DE) by regulating autophagy clearance. db/db mice were randomly divided into four groups, db/+ mice were used as control group. Twelve-week old male db/db mice received consecutive intraperitoneal injection of 200 mg/kg/d metformin or (and) 10 mg/kg/d chloroquine for eight weeks. Morris water maze (MWM) tests were performed to test cognitive functions before the mice were euthanized. Metformin attenuated cognitive impairment in db/db mice, reduced hyperphosphorylated tau proteins, restored the impaired autophagy in diabetic mice, all of which were reversed by inhibiting of autophagy activity. In high glucose-cultured HT22 cells, metformin increased autophagy in a dose-dependent manner. Besides, metformin enhanced autophagy activity in an AMPK dependent manner. These data show that metformin may reduce tauopathy and improve cognitive impairment in db/db mice by modulating autophagy through the AMPK dependent pathway. These findings highlight metformin as a new therapeutic strategy for the treatment of DE.