Counting What Counts: The Promise and Limits of AI in Analyzing Violent Extremism

Counting What Counts: The Promise and Limits of AI in Analyzing Violent Extremism
Enumerators conduct a household survey interview near Kigali, Rwanda, October 2018. Human interviewers remain the first link in any AI-assisted analysis pipeline. (Photo: Victor Balaban, U.S. Centers for Disease Control and Prevention, Public Health Image Library.)
Editor's note: The "Short of War" Podcast discussing this article is AI-generated.

In late 2024, a U.S. Agency for International Development (USAID) program in Kenya used a custom artificial intelligence (AI) model to code 541 interviews in communities from which Al-Shabaab recruits. Three results stand out. First, once the model was built, thematic coding, the most labor-intensive step, cost one-seventh of the human equivalent. Second, the model’s coding agreed with an expert human coder on most of the themes tested. Third, in most of the interviews, enumerators changed one Kiswahili word in the key question, asking about “violence” instead of “radical ideology.” The model coded those answers at full confidence, and no one caught the error until fieldwork was over.

Artificial intelligence now makes population-scale community assessment cheap enough to run routinely in places, and in languages, that conventional budgets could not reach. This changes what analysts can know about communities and how precisely programs can target them. However, AI does not supply the discipline that produces accurate data. A model neither checks the questions nor notices when enumerators depart from the script, and it cannot change the human incentives that have kept evaluation in this field weak for two decades. We propose three tiers of assisted coding, supervised collection, and audited loop to guide how much human supervision should be used for AI-enabled community assessments. This framework capitalizes on the promise of AI while keeping humans responsible for analysis of vulnerable communities.

When General James Mattis told Congress in 2013 that underfunding the State Department meant he would “need to buy more ammunition,” he was arguing that an ounce of prevention is worth a pound of treatment. Preventing and countering violent extremism (P/CVE) is one way of heading off threats before they become primarily military problems. Counterterrorism, in the Department of Defense’s definition, neutralizes terrorists and their networks once they exist, while P/CVE, as the United Nations (UN) frames it, works upstream on the conditions that make radicalization possible.

The difficulty has always been proving that P/CVE works. Program effects are diffuse and slow, so the field reports what it can count: workshops held, people trained, products delivered. In military planning terms these are measures of performance, which record that an activity took place; measures of effectiveness, which record whether anything changed, are rare. As the sociologist William Bruce Cameron observed, “Not everything that can be counted counts, and not everything that counts can be counted.”

The record bears this out. A 2016 review found that only one of 43 published P/CVE evaluations used a control group. That flaw is a matter of design, and cheaper analysis leaves it in place. What AI changes is the price and reach of measurement, letting evaluators survey more of a population, in its own language, and code the answers for a fraction of the former cost.

The Kenya Pilot

The USAID study described in the introduction was a baseline survey for a program strengthening community resistance to violent extremism in Garissa, Kilifi, Kwale, Lamu, and Mombasa, five Kenyan counties where Al-Shabaab recruits and operates. It asked about community problems, drivers of violent extremism, and prevention efforts. Respondents were probability-sampled, so findings could be generalized to the population. Human enumerators conducted and recorded the interviews in Kiswahili, and an automated pipeline turned each recording into coded data.

A commercial AI service transcribed and translated the audio. The team then built a classifier on OpenAI’s GPT-4o mini model and supplied it with the project codebook and worked examples. The classifier assigned themes to each of the 541 usable responses (615 interviews were targeted) and scored how well each fit. A P/CVE expert then hand-coded 30 randomly selected responses. The expert saw those transcripts only after collection had closed, too late to change what enumerators asked.

The Wrong Question, Asked at Scale

The most important finding was unanticipated. The instrument told enumerators to ask about itikadi kali, the Kiswahili term for “radical ideology.” In most cases they asked instead about vita, “violence.” Of the 30 responses the expert reviewed, the violent extremism questions were asked correctly in only four. Nor was it a lone slip: the same review found a follow-up question dropped in 27 of 30 interviews, and 41 to 53 percent of answers ran under 500 characters, too brief for open-ended questions. The pattern points to a gap in enumerator instruction rather than individual error. The output was large, internally coherent, and about the wrong issue: community perceptions of violence in general rather than of violent extremism.

The programmer’s maxim “garbage in, garbage out” understates the problem. In Kenya, garbage went in and confidence came out. Under the conventional method, a team of Kiswahili-speaking coders reads every transcript, and somewhere in the pile one of them notices that interviewers keep asking about vita. The model read the same transcripts and flagged nothing; its task never required comparing the question asked with the question written.

This is the tradeoff. Human coding is expensive, but coders who read every transcript also catch interviewers who stray from the script, a check no one budgets for. Replace the coders with a model and the cost falls, but the check disappears with them. Program teams must rebuild it as a deliberate step: human review of a transcript sample while enumerators are still in the field.

What AI Changed, Step by Step

The study team modeled three cost scenarios for transcribing, translating, and coding 615 interviews in Kiswahili: building and running the AI pipeline, at $152,452; a repeat survey reusing it, at $95,214; and the same steps done by skilled humans, at $244,243. All three are the team’s estimates at stated day rates (about $788 for analysts and the developer, $1,450 for the information technology (IT) director). The human-only figure was modeled, never spent, and none includes data collection, statistical analysis, or reporting. On those assumptions, the savings work out to 37.6 percent on first use and 61 percent on reuse.

Modeled cost of the three scenarios by processing step. Thematic coding falls from $78,848 to $11,194 once the model exists; expert review ($15,770) is constant; the one-time model build ($57,238) separates the first AI survey from a repeat. Figures are the study team’s estimates at stated day rates and exclude data collection, statistical analysis, and reporting. Source: authors, from the USAID Kenya study.

The savings were uneven, and coding fell furthest. Hand-coding was budgeted at 100 analyst-days. Adapting the existing model to a new survey took ten days of IT director and developer time plus under $20 in fees paid through OpenAI’s application programming interface (API). Translation, including a human verification pass, fell by 60 percent and transcription by a third.

Twenty days of expert time to guide and check the coding are identical in every scenario, and building the model was a one-time cost. AI did not make the study cheap; most of the cost still went to people and services. It did cut every processing step, and coding, once the model existed, by about 86 percent. Transcription and translation costs still rise with every interview; AI coding costs barely move, so the larger the survey, the bigger the saving.

Can the AI Results Be Trusted?

Cheap thematic coding is worth having only if it is accurate. Across the 30 reviewed responses, the team correlated the expert’s hand codes with the models on four themes tied to vulnerability or resilience to Al-Shabaab recruitment. On three (unemployment, awareness-raising on prevention, and theft) the two broadly agreed, with correlations of .37 to .53, moderate by conventional standards. On the fourth, gang violence, they did not correlate.

Three of four is promising for a first deployment, but 30 responses cannot validate the coding of all 541, and the themes tested were the most tangible in the codebook. The question P/CVE practitioners most want answered (why people join violent extremist groups) was where the model assigned high-relevance codes to the smallest share of responses (24.6 percent), and where the enumerators’ wording error had the greatest effect.

Where the two agreed, the results can guide targeting. Unemployment dominated in four of the five counties, with youth unemployment the most cited problem at 25.7 percent of responses; in the fifth, Mombasa, respondents ranked crime first. Residents aged 18 to 34 were about 1.7 times as likely as older residents to name radicalization-linked insecurity as a pressing problem (21.6 percent against 12.5 percent). Such differences tell practitioners where and with whom a program is most likely to work, and until now they have been too expensive to measure routinely.

The Enduring Problem

The pilot’s error was honest. The larger risk is data that is wrong on purpose. During the Vietnam War, the Civil Operations and Revolutionary Development Support (CORDS) program built the most ambitious assessment system in American counterinsurgency. Its Hamlet Evaluation System scored thousands of hamlets monthly, and the Phoenix program set quotas for neutralizing the Viet Cong infrastructure. The numbers looked rigorous but were widely gamed: quotas encouraged padded reports and false arrests, and hamlet progress ratings ran ahead of conditions on the ground. The people generating the data had strong reasons to make the program look successful, and the system could not tell.

Hamlet Evaluation System map plot of the Saigon region and Mekong Delta, 31 January 1971, shading population density by pacification rating. (Source: Hamlet Evaluation System Command Manual, Military Assistance Command Vietnam/CORDS, Record Group 472, U.S. National Archives)

That incentive persists, and AI has lowered the price of acting on it. A 2025 study in the Proceedings of the National Academy of Sciences showed that an AI “respondent” passed 99.8 percent of the attention checks used to screen out bots, and that between 10 and 52 fabricated responses, at about five cents each, would have flipped the predicted outcome of seven major national polls in 2024. Deliberately corrupting a dataset to steer the system that depends on it is known as data poisoning.

A program manager hoping to renew a grant, a government that wants a counter-messaging campaign to look effective, or an opponent of an intervention could each inject fabricated sentiment into an AI-mediated survey for a few dollars, and poisoned results could steer programs to exacerbate grievance rather than build trust. AI changes what measurement costs, and anything built on it must be designed against both honest error and deliberate corruption.

Three Technical Constraints

Models perform worse in languages thin in their training data: less than five percent of AI training data on African languages is sourced or governed by African institutions. This is algorithmic bias. Its companion, automation bias, the tendency to trust machine output, means degraded coding is least likely to be challenged where it is most likely to occur. Models also hallucinate, producing fluent output the input does not support. Each can produce what Kenya produced, a clean-looking dataset built on bad input, and catching it takes someone who knows the language reading a sample.

A Three Tiered Framework, Ordered by Human in the Loop

For P/CVE organizations, the Kenya pilot suggests three tiers of AI-assisted assessment, each defined by need, context, and capacity.

Tier 1: Assisted Coding. The need is to analyze qualitative data a program already collects, faster and at larger scale. The context is any organization, including one with no AI governance. The capacity required starts with a codebook and a data policy on which models may hold interview text, since commercial, locally run open-weight, and foreign-jurisdiction models carry different control and privacy risks. It also requires two reviews. First, a person reads a transcript sample while enumerators are still in the field, the step the pilot lacked. Second, a person checks a sample of the model’s codes against a hand-coded set before anything is reported, as the pilot did on 30 responses. With both, the risk is low; without the first, Kenya shows what happens.

Tier 2: Supervised Collection. The need is to reach more people, in more languages, than human enumerators can, through AI-mediated interviews with adaptive follow-up questions. In 2026 Anthropic published 80,508 AI-conducted interviews with its own users in 70 languages, though those users self-selected. The context is a well-resourced implementer where enumerator access is limited and connectivity is not. The capacity required is everything in Tier 1 plus four additions: an expert reviews the instrument in each field language before deployment; a pilot with transcript review precedes full fielding; consent forms disclose that the interview is AI-mediated; and a named person signs off on high-stakes findings before anyone acts on them.

Tier 3: Audited Loop. The need is continuous tracking of community indicators across program cycles, with findings fed back into programming. The context is a multi-year investment by a large donor or government. The capacity required has four parts: an independent auditor reviews the algorithm; communities oversee what is collected and how it is used; adversarial testing probes the system for data poisoning; and compliance review checks the use against applicable law such as the European Union’s AI Act, which would likely treat it as high-risk. Because the loop acts on its own findings, a poisoned input becomes a program decision. For now, Tier 3 is a design target.

Implications for the P/CVE Field

Implementers should treat instrument review and in-field transcript review as the price of using AI at all. Both belong in the fieldwork plan and budget, along with one simple fidelity measure: the share of sampled interviews in which the key question was asked as written. In Kenya that figure was four in 30, and tracking it during collection would have exposed the error in time to retrain. Donors already have guidance: the UN Office of Counter-Terrorism’s 2026 practice guide, built on a survey of 120 practitioners (73 percent of whom had no formal preparation in AI use), is a serious start. What low-resource organizations lack is the money to follow it, including flexible funds for problems that surface mid-fieldwork.

Donors also inherit the Vietnam problem: implementers have reasons to make programs look successful. Review should go to a party with no stake in the outcome, and donors should receive the transcript sample with the findings. None of this is expensive. Both reviews cost days of expert time, and AI saved roughly $67,000 per repeat survey on coding alone.

Policy changes have made this urgent. Congress held the counterterrorism and nonproliferation account flat at $870 million for fiscal year (FY) 2026 even as it cut the State Department’s overall foreign operations budget by 16 percent, but U.S. foreign assistance obligations fell by nearly half between FY2024 and FY2025, and the dismantling of USAID removed a major source of funding and technical support for prevention. The expansion of counterterrorism priorities to include narcoterrorism and political violence has left the future of U.S.-funded P/CVE programming uncertain. Partner governments facing Al-Shabaab and similar groups will have to sustain prevention with their own resources. A 61 percent cut in analysis costs on repeat surveys could let them monitor local vulnerabilities more often and target interventions more precisely, provided they have the analytical expertise, data governance, and independent oversight to do it. The priority for U.S. policymakers and international partners should therefore be building that capacity rather than simply encouraging AI adoption.

Garbage In, Confidence Out

When General Mattis warned that underfunding the State Department would mean buying more ammunition, he was betting that prevention can work. For two decades P/CVE has struggled to show it, counting activity rather than effect. The Kenya pilot changes the economics of that problem without settling it. Once a model is built, a program can afford to ask whole populations, in their own languages, what makes them vulnerable, and to ask again every cycle. It can also afford to ask the wrong question at scale, and no model will say so. The three tiers put human review back where AI removed it: a person reading transcripts while enumerators are still in the field, a person checking the machine’s codes before anything is reported, and, at the top tier, auditors and communities watching what the system is fed. AI makes counting cheap. Deciding what counts, confirming it was asked, and resisting the pressure to report what funders want to hear remain human work, and organizations that keep them so will get the gain without the trade.


Jason S. Alexander, Ph.D., is a retired U.S. Foreign Service Officer with the United States Agency for International Development (USAID) and an advisor and researcher with the Irregular Warfare Initiative’s Emerging Technology focus area. He served as P/CVE Advisor to the 2024 USAID-funded study that piloted the AI-assisted analysis described in this article. His USAID career included postings as a Crisis, Stabilization, and Governance Officer in Kenya and East Africa and as a performance auditor with the USAID Office of Inspector General in Bangkok and Germany. He previously served with the U.S. Department of State, including in the Iraq and Afghanistan wars, with the U.S. Army National Guard in counterintelligence, and with the U.S. Marine Corps in infantry and security forces. Over 25 years those assignments have spanned the Middle East, South and Central Asia, East Africa, Southeast Asia, Europe, and Central America. He holds a Ph.D. in Public Policy and Administration, with research focused on preventing and countering violent extremism.

Jeffrey Szuchman, Ph.D., is Co-Director of the Emerging Technology focus area at the Irregular Warfare Initiative, where his work examines how emerging technologies shape governance and security in fragile and conflict-affected settings. He served as an advisor to the 2024 USAID-funded study that piloted the AI-assisted analysis described in this article. His USAID career included serving as Deputy Director for Democratic Governance, Peace and Security in Kenya, where he managed multi-million-dollar security, governance, and peacebuilding portfolios and advised on integrating responsible AI principles into national strategies, as well as leadership roles in USAID Liberia and Washington, DC, including Acting Director of Policy.

The views expressed are those of the authors and do not reflect the official policy or position of the United States Agency for International Development, the United States Government, or the Irregular Warfare Initiative.

If you value reading the Irregular Warfare Initiative, please consider supporting our work. And for the best gear, check out the IWI store for mugs, coasters, apparel, and other items.

Corporate Sponsors

The following organizations support IWI's mission to advance the study of irregular warfare.

Hadean logo
Leidos logo