Yamada was born in Abu District, Nagato Province (in what is now part of the city of Hagi, Yamaguchi), and was the son of a 102 "koku" samurai official of the Chōshū Navy. After studies at the domain's "Meirinkan" academy (where he studied the "Yagyū Shinkage-ryū" school of Japanese swordsmanship), he joined the "Shōkasonjuku Academy" run by Yoshida Shōin in June 1857. He was the youngest student of the "Shōkasonjuku". He was in the retinue of Chōshū "daimyō" in Kyoto in the autumn of 1862. A strong supporter of the "sonnō jōi" movement, he signed his name in blood (together with Takasugi Shinsaku, Kusaka Genzui, Itō Hirobumi, Inoue Kaoru, Shinagawa Yajirō) to a petition to rid Japan of the foreigners. After Chōshū forces were driven from Kyoto by supporters of the "kōbu gattai" movement, he went into exile with Sanjō Sanetomi. During this period, he studied western military science under Ōmura Masujirō. He soon had the opportunity to put his training to practical use during the Kinmon incident, Shimonoseki Campaign, and Second Chōshū expedition. Despite his youth, he subsequently played a major role in the Boshin War, commanding a group of 700 men under the authority of Chōshū "daimyō" Mōri Takachika, starting with the Battle of Toba–Fushimi, and also commanding Satchō Alliance naval forces in Mutsu Bay.