A Facebook error message is seen in this illustration photo of a computer screen in Singapore in this June 19, 2014 file photo.  REUTERS/Thomas White/Files

With a fast-moving culture that rewards impatience, reveres obsession and views failure as a temporary speed bump, Silicon Valley couldn’t be more different than bureaucratic Washington. For years, tech companies have shunned the federal government’s cumbersome procurement system, even though it’s worth billions.

But Defense Secretary Ashton Carter is hoping to bridge the chasm dividing Washington and California with a visit this week to the valley—the first from a sitting defense secretary in 20 years, the Pentagon says. In a speech at Stanford University and meetings with venture capitalists and tech executives, including Sheryl Sandberg, Facebook’s chief operating officer, Carter is hoping to break down some of the barriers that have long prevented spunky startups from working with what they view as a stifling and sclerotic bureaucracy.

[Ash Carter’s long history with military technology]

The effort is a top priority for Carter, who has a long history moving through the Pentagon’s ranks but also has worked closely with the tech sector, as a senior executive at the Markle Foundation and working with MITRE Corp. and Draper Labs.

The Pentagon is increasingly concerned that it is losing its long-held technological superiority, as other nations invest in new technologies and software.

In a speech at Stanford on Thursday, Carter is set to announce new initiatives designed to lure Silicon Valley companies to work with the Pentagon, including opening an office in the valley where uniformed officers and defense civilians will try to foster relationships with innovative startups and more established technology stalwarts.

Defense Secretary Ashton Carter speaks during a meeting with military personnel at Osan Air Base in South Korea earlier this month. (Photo by Chung Sung-Jun/Getty Images)

The move is part of a broader attempt to lure America’s best and brightest into government work, especially in national security, where sophisticated, state-sponsored cyber attacks are creating new fronts in warfare. Earlier this week, Department of Homeland Security Secretary Jeh Johnson announced that the agency was also opening a satellite office in California to “convince some of the talented workforce here in Silicon Valley to come to Washington.”

But convincing the valley’s young talent that it should work with the federal agencies seen as more stodgy than disruptive will be difficult.

“They just couldn’t be farther apart,” said Russell Hancock, president of Joint Venture Silicon Valley, a nonprofit, non-partisan economic development group.

The Pentagon’s procurement process is “archaic. It’s frustrating. There’s no patience for it here,” Hancock said. “There’s a reluctance to take on the federal government as a customer because there’s so much red tape.”

In addition to the cumbersome processes, there is a huge cultural divide that has prevented tech companies from working with the federal government.

“We fail all the time,” Hancock said. “And out of the smoldering ash you come out with another idea. There has to be that idea of experimentation. And when you have all these audit requirements that’s harder to do.”

While the Pentagon is saying all the right things, it has also sent mixed messages to the private sector, said Stan Soloway, the president of the Professional Services Council, which represents government contractors.

In this June 5, 2014 file photo, a man walks past a Google sign at the company’s headquarters in Mountain View, Calif. (AP Photo/Marcio Jose Sanchez, File)

Instead of opening up the definition of what is a commercial product that the Pentagon could purchase more simply, it has repeatedly sought to tighten the definition, thus making it more difficult, he said.

“There is a lot of talk about driving innovation,” he said. “But there’s been a fair amount of backsliding.”

For a sense of the cultural divide, and the tensions that go with it, just look at how Elon Musk’s space company, SpaceX, has tangled with the Air Force over contracts to send military satellites into orbit. Musk, the billionaire co-founder of Tesla and PayPal who embodies the valley’s fast, obsessive personality, sued the Air Force, saying SpaceX should be allowed to compete for the contracts. Then he continued to criticize what he said was a painfully slow process to certify his company’s rockets to perform the work.

With its own research and development, the military used to drive much of the country’s technological innovation—from the development of the Internet to global positioning systems. But now, much of the advancements come from the commercial sector, which often wants nothing to do with the government—and, as former deputy defense secretary William J. Lynn III noted in an essay in Foreign Affairs last year, they don’t need the government’s money.

“Google may not need defense contracts, but the Pentagon needs more and better relationships with companies like Google,” he wrote. “Only the private sector can provide the kind of cutting-edge technology that has given U.S. troops a distinct advantage for the past 70 years.”