Are the humans of finance an endangered species?

People are still the lubricant that oils the wheels of finance, toiling at innumerable tasks—executing and settling trades, writing analysis, monitoring risk. That’s about to change.

Squeezed by low interest rates, shrinking trading revenue, and nimbler technology-based competitors, banks are racing to remake themselves as digital companies to cut costs and better serve clients. In other words, they’re preparing for the day that machines made by men and women take over more of what used to be the sole province of humans: knowledge work. Call it self-disruption.

Consider venerable State Street, a 224-year-old custody bank that predates the steam locomotive and caters to institutional investors such as pensions and mutual funds. In February, State Street executives told analysts that after spending five years upgrading technology systems, they realized how much more could be done. “We have 20,000 manual interventions on trades every day,” said Michael Rogers, president of the Boston bank. “There’s a huge opportunity to digitize that and move it forward electronically.”

But one person’s opportunity is another person’s exit package. State Street had 32,356 people on the payroll last year. About one of every five will be automated out of a job by 2020, according to Rogers. What the bank is doing presages broader changes about to sweep across the industry. A report in March by Citigroup, the fourth-biggest U.S. bank, said that more than 1.8 million U.S. and European bank workers could lose their jobs within 10 years.

Advances in cloud-based computing and algorithms capable of combing vast amounts of data for decision-aiding patterns make this possible. The human brain is a wondrous machine, but it isn’t changing. The pace of technological advancement is accelerating, and artificial intelligence (AI) may one day make many forms of work extinct. It’s a topic that’s dominated forums such as the Milken Institute Global Conference in May and has spurred talk of government-funded universal basic income programs that would pay citizens a regular stipend.  All of that’s a ways off. What concerns bankers today -- the ones who’ve survived round after round of post-financial crisis job cuts -- is how humans will coexist with machines over the next few decades. Maligned in recent popular culture via movies like The Big Short, the still-essential business of banking isn’t getting a breather after new regulations reined in profits and risk-taking. It’s under assault from all sides by fintech startups devising new ways of doing old kinds of banking. From Hong Kong to Dublin, Brooklyn to Dubai, these upstarts attracted $22.3 billion in funding last year, up 75 percent from 2014, according to an Accenture analysis of data from research firm CB Insights.

Bank executives know what’s coming. So they’re setting up coder labs and investing in startups, teaming up with digital competitors or buying them outright. JPMorgan Chase, the biggest U.S. lender by assets, is using AI to identify potential equity clients. And it’s marshaling OnDeck Capital’s client-vetting algorithm to speed lending to small businesses. Both Bank of America and Morgan Stanley, which together employ more than 32,000 human financial advisors, are developing automated robo-advisers. More than 40 global banks have joined forces with startup R3 to develop standards to use blockchain, software that allows assets to be managed and recorded through a distributed ledger, to overhaul how assets are tracked and transferred.

The universal theme of banking’s tech strategy is to make sure that, internally and in dealing with clients, ones and zeros flow seamlessly without messy human interference. At State Street, for example, incompatible systems and a variety of inputs mean people need to manually work an order -- some 50,000 of them arrive each month in the form of a telephonically transmitted document that many assume had gone the way of the cassette tape: the fax. Instructions received that way require a human to manually shuttle trade and settlement information between screens. In other instances, missing or mismatched information in complicated trades needs to be reconciled by a person.

Machine learning, where the decision-making power of algorithms improves as more data are raked in, can replace people in some instances, say finance executives including Daniel Pinto, head of JPMorgan’s investment and corporate bank. Algorithms already tackle tasks such as vetting banking clients, pricing assets, and hedging some orders without human intervention. “As we make those processes more and more efficient, you will need less people to do what we do today,” Pinto says.

Beyond that, bots armed with AI and the ability to understand and respond in natural language can be used to answer clients’ queries and eventually execute transactions, says Suresh Kumar, chief information officer of Bank of New York Mellon. “You start with something simple, maybe just offering information, then you start doing transactions,” Kumar says. “We obviously want to automate everything, but you have to prioritize.”