 After studying mathematics, sailing, and navigation, Arai was appointed a director of the Naval Training Center in 1862.However, he was reassigned to the Shogunate's "Kōbusho" military academy in 1864, and it was there that he worked with Ōtori Keisuke, learning French-style infantry tactics in Yokohama in 1865.In 1868 during the Boshin War of the Meiji Restoration, Arai was assigned as a captain to the Shogunal Navy, and together with Enomoto Takeaki departed Shinagawa Harbor when Edo was surrendered to the Imperial Army.