(Bloomberg) -- Toyota Motor Corp. plans to spend $2.8 billion to make sure its system for writing the software for self-driving cars will be just as efficient as the factories that build them.

The company needs faster and more reliable methods for writing software because self-driving cars require “millions and millions’’ of lines of computer code, according to James Kuffner, who’ll lead the new effort. That compares with tens of thousands of lines of code in cars just a generation ago.

The Japanese automaker is seeking an edge over rival car giants as well as newcomers such as Alphabet Inc.’s Waymo as the industry charts a path toward self-driving vehicles. Kuffner said he plans to hire 1,000 programmers as soon as he can find them, seeking to lure global talent.

“We’re not just doubling down but quadrupling down in terms of the budget,’’ Kuffner said in an interview. “We have nearly $4 billion to really have Toyota become a new mobility company that is world class in software.’’

For the effort, Toyota is setting up a new company in Tokyo with two of its suppliers. On Friday, Kuffner was named chief executive officer of the venture, called Toyota Research Institute -- Advanced Development.

Robotics, AI

Toyota had already allocated $1 billion to start a free-standing unit called Toyota Research Institute in 2015 to study self-driving, robotics and artificial intelligence. Kuffner, 47, has been serving as chief technology officer for TRI, which now has about 250 employees. Before that, he was the leader of robotics and cloud computing research at Alphabet’s Google unit.

Toyota’s two biggest suppliers, Denso Corp. and Aisin Seiki Co., will invest in the new venture, each taking a five percent stake, the carmaker said.

Currently, Kuffner said, teams of programmers work in isolation to solve portions of a big problem like self-driving and then spend “years and years’’ piecing their work together and testing it with AI and other tools. Toyota plans to streamline this process by validating each chunk of software as it’s written to make sure it’s robust enough for the cars and trucks that Toyota sells to the public.

Kuffner compared the process he hopes to establish to the Toyota Production System, which achieved industry-leading quality and efficiency in the 1980s by requiring workers to shut down assembly lines rather than tolerate defects that need to be repaired later.

2020 Olympics

He said he hopes to use the new system for the electric, fully self-driving delivery vans that Toyota plans to showcase at the 2020 Tokyo Olympics, and for the increasingly-sophisticated safety equipment Toyota is installing in vehicles on sale today.

Last month, the company introduced a Lexus LS 500 sedan that automatically initiates split-second steering and braking maneuvers after identifying a pedestrian in its path.

“The whole idea is, can we build a vehicle with highly-reliable software that is uncrashable, that will never be the cause of an accident,” Kuffner said.

Bloomberg News