The U.S. Marine Corps is experimenting with artificial intelligence to improve the way it deploys its forces and spot potential weaknesses years in advance.

The Marines partnered with IBM to build a tool that crunches data on personnel and equipment to measure how prepared individual battalions are for combat. The tool could ultimately help top brass deploy some 186,000 active-duty Marines and countless pieces of military hardware around the globe in the most effective way possible, according to Matthew Dalkiewicz, who manages IBM’s accounts with the Marines and Navy.

A 25-year Marine veteran himself, Dalkiewicz said allocating the service’s resources is an imperfect science. Leaders map out deployment strategies years or even decades in advance, but situations will invariably arise that throw a wrench in those plans, he told Nextgov.

Planners are constantly forced to “reshuffle the deck” as crises flare up in different parts of the world, he said, and figuring out which units to move around is a complicated process. Numerous factors—training, deployment history, equipment readiness and others—affect how prepared a group is for a given situation.

Today planners rely on spreadsheets, whiteboards and basic applications to track readiness and manage forces, but artificial intelligence can offer them a better understanding of the resources at their disposal and the long-term effects of the decisions they make, he said.

The tech developed by Dalkiewicz’s team crunches both structured and unstructured data from multiple force management applications to create a real-time image of how prepared each unit is for combat. The seven-month pilot, which ended in March, specifically aimed to build a five-year management plan for the Marines’ infantry battalions.

He said the tool has two primary functions: It flags the units that are most ready for action and explains why others come up short. Armed with that knowledge, Dalkiewicz said, commanders can proactively train and invest in less prepared groups before they fall even further behind.

“A lot of times they only [invest more] when the problem arises,” he said. “Now they can see it ahead of time and say ‘OK, we're going to take action now to prevent that from occurring.’”

The software also sheds light on how deployment decisions will affect forces in the long run, he added. By analyzing historical trends along with real-time data, the tool could show how a unit’s readiness would change if it were, for instance, moved to a new location or given additional resources, according to Dalkiewicz. His team is also building a separate AI system that ranks course of action plans based on those extrapolations, which could one day be merged with the readiness software.

“You integrate that all together and you get a full holistic view of readiness across your force,” he said. “Now you can really make some data-driven decisions.”

The first phase of the pilot covered less than a quarter of the Marines’ total force structure, but Dalkiewicz said they plan to expand the scope in the next iteration. The next stage would include parts of the Marines’ aviation and logistics units, bringing about half branch into the purview of the program. With that additional data, he said, the AI would further refine its algorithms and deliver better results. They have yet to determine when the second phase will begin.

Ultimately, Dalkiewicz envisions leaders using the tool to make long-term management decisions for the entire service, though he admitted there’s still a long road ahead.

“We can't just … move from a pilot to scale overnight,” he said. “It's going to take a lot of planning, it's going to take a lot of time, it's going to take a lot of stakeholder engagement.”

Still, he added, “when you've got the buy-in and you have the results to stand on, it certainly makes it a lot easier.”

Editors Note: This story was updated to correct Dalkiewicz's length of service.