JUMP TO CONTENT

Wise Data Science

NF-SHIELD: How we automated the document analysis for our disputes


Author: Marten Türk, Data Scientist 

The process our customers use to provide additional documents had a bottleneck that could not be automated with deterministic rules. Not because we didn’t want to write rules, but because the problem itself wasn’t deterministic.

Customers sometimes submit evidence that our systems could not previously process: screenshots, crumpled receipts, long email threads, partial chats or incorrect documents altogether.

We didn’t just need a system that could validate documents, we needed a system that could actually understand them.

Introducing NF-SHIELD - Non-Fraud System for Handling Initial Evaluation of Lots of Documents - an LLM chain we built to do exactly that. Here’s how we identified the problem, what we tried, what worked in production, and what we learned.

What are disputes?

Sometimes, merchants make mistakes. They either charge the wrong amount, forget to send the customer's order out or if they do send the order out, it turns out the backpack that was ordered has the wrong color. If the merchant is unhelpful with resolving this issue, customers who paid with Wise can raise a dispute with supporting documentation, so we can help resolve it.

Such dispute processes don’t always follow a universal deterministic pattern and disputes raised against the same merchants can often have various outcomes depending on each case. If the customer has submitted a valid dispute with supporting documentation, then Wise can help them get a refund by raising a chargeback through our card scheme partners, who then help facilitate the process with the merchant’s bank.

In 2026, we set a goal to decrease our response times to all customer disputes. With an ever-increasing number of customers, we knew that to meet our goal we needed to do some automation. Our data science team saw an opportunity in this and we mapped out the entire dispute process and found the biggest bottleneck that could not be handled by our current automation efforts - document analysis. 

Figure 1: High level dispute flow, customer submits document, we either proceed with investigation or request additional info. If everything is present, we can proceed to a chargeback, otherwise the case gets rejected.

 Discovering the bottleneck

To find the bottleneck, we mapped out the entire dispute process and measured time spent per step. Human agents spend around 10 minutes per case. The first step - document analysis - was both the most time-consuming and the most critical. Since most disputes require reviewing documents, automating this step became our focus.

Figure 2: A high level breakdown of incoming disputes and how they are distributed. Line width can be interpreted as dispute volume.

Across the 10+ different dispute reasons we support, the requirements differ, but most cases require:

  • Proof of purchase, such as a receipt

  • Proof of communications with the merchant, such as screenshots of phone logs, emails or chats

We chose to automate those two document categories first, as they had the biggest influence on end-to-end automation rates. It's important to note that since these documents come in many different formats and varying degrees of clarity, we needed a very concrete definition of what a valid document would look like before proceeding.

What makes a valid document

Instead of looking at how human agents process our selected documents, we decided to ground ourselves to the absolute source of truth - card scheme rules. Based on the chargeback requirements outlined by schemes, we mapped out what information needs to be present and correct on each document to build a strong case for a chargeback. A strong case naturally leads to higher chances of the customer getting their money back. We then used the criteria for a valid document to shape our technical architecture.

System requirements

When designing the system, we established a core principle: LLMs interpret the documents,  our business rules make the decision. 

We intentionally avoided having the LLM make final decisions. Instead, we wanted to build a system that would extract structured information from unstructured images - such as receipt amounts, items, transaction dates. This extracted data would then be fed into business rules. This architectural choice decouples documents understanding from business logic. It allows teams to update their validation criteria for different dispute types on the fly, without needing the data science team to step in and change the prompts every time a policy changes.

For example, in most cases we would expect the receipt amount to match the transaction amount. But if the customer claims they were charged the wrong amount, we would instead be looking for a discrepancy between the transaction amount and the one shown on the receipt.

Figure 3: Example outputs from the model that give operational teams freedom to accomodate to their needs vs output that is too strict

The full pipeline would then need to take in documents, extract structured data and pass that to our rules where a decision on the validity of the documents can be made. If the documents are invalid, the downstream systems trigger the appropriate next steps in the customer journey. 

Figure 4: End-to-end document processing pipeline.

Evaluation

With the architectural criteria set, we needed to figure out how we could best meet our system requirements while maintaining high performance.

Since the submitted documents are screenshots or photos, traditional image classification techniques were not enough. We did not only need to identify whether an image looked like a receipt or a screenshot of a chat, we needed to understand the text, entities, date, amounts and the customer intent amongst all of it.

This made the problem a good fit for multimodal LLMs.

To evaluate different approaches, we needed a sandbox environment that mirrored production. In collaboration with the operational teams we created a gold-label dataset, evenly split between receipts and proof of communications.

The Experimentation Phase

One of the core principles that guides us in the Spend Risk Data Science team is that every time we build, we build something that is as simple as possible, but as complex as necessary. To achieve our performance targets or human QA performance, we created the following experimentation plan:

1. Start with one-shot prompts and see how the LLM performs

2. Create a chain of LLM calls, each call solving a piece of the extraction.

3. A simple agentic system analysing documents and another LLM as a judge to validate.

What Didn’t Work

One-shot prompts were appealing in their simplicity, but their performance plateaued below our target. The reason behind this is most likely that when given a large task the model has to review everything all at once. This creates long chains of complex reasoning in a single pass, which can easily lead to mistakes [1].

We also decided against the agentic setup. Creating an agent with an LLM judge would have increased latency, costs and system complexity without clear gains. We found that a multi-step pipeline was ultimately easier to evaluate, monitor and debug for this specific use case.

The Winning Solution: An LLM Chain

We settled on the second approach: a multi-step evaluation pipeline customized to specific document types.

Rather than relying on one huge prompt, we designed a chain on sequential LLM calls. Each step handles a micro-task - analysing the image, extracting or propagating information forward. This approach works well for several reasons:

  • Better generalisation: The academia has shown that decomposing problems and solving them sequentially helps models to generalise better on examples not explicitly shown in training data [2].

  • Reduced cognitive overload: Keeping each prompt smaller helps reduce context complexity. Prior work has shown that LLMs struggle with information positioned in the middle of long contexts, while information near the beginning or the end often being easier to retrieve [3].

  • Increased Faithfulness: For each extraction step, we ask the model to provide reasoning for its answer. Prompting the model to explain its thought process has proven to increase the faithfulness of its outputs [4].

In the end the system outputs a JSON that's ready for our downstream pipelines. Finally, to avoid vendor lock-in, we separated the LLM calls, prompt templates and provider configuration from the rest of the system architecture. This gave us a clean abstraction layer that allows us to switch between models with minimal changes if needed.

Final Results

Since going live, the automation rates have increased substantially. This has also opened up new avenues for applying LLMs to document analysis across the org. We are seeing multiple teams use the same architecture as a base for their own use cases, which increases confidence that what we built is indeed useful. As for next steps, we will continue building new layers of automation to delight our customers with fast and accurate responses whenever they run into an issue that requires them to raise a dispute with us.

Takeaways

Build model-agnostic solutions

Many LLM application patterns and architectures are model-independent, but the AI landscape moves fast. By building an abstraction layer for NF-SHIELD, we ensured we are not tied to a single vendor and can easily swap in better or cheaper models as technology evolves.

Build from first principles, not past habits

Approaching the problem from first principles helped us build an efficient architecture. Instead of asking “How do agents review this today?”, we asked “What makes a document valid for chargeback?”. By grounding our system in the absolute source of truth rather than mimicking human workflows, we avoided extracting unnecessary data, keeping the architecture simple, explainable and easy to maintain.


More Data Science projects


List #1

Related blogs

Working globally, staying local: Life at Wise in Japan

Teaser

People profile

Content Type

Blog

Publish date

03/02/2026

Summary

"When you join, you’ll see your own growth mirrored by the growth of the company. You won't just be watching change happen; you’ll be a direct part of it." Ataro Shoji (He/Him) Payment

Teaser

Ataro Shoji, our Payment Operations Senior Specialist, highlights how collaborating across time zones allows us to build 'Money Without Borders' while enjoying an inclusive, mission-driven culture 🌏

Read more

by

Verona Hasani

by

Verona Hasani

Expanding in Hyderabad

Teaser

People profile

Content Type

Blog

Publish date

06/27/2025

Summary

We sat down with SK Saraogi, Head of Expansion APAC, to discuss our strategic expansion into Hyderabad, India 🇮🇳Read more to discover why Hyderabad is the perfect location for our second glo

Teaser

We sat down with SK Saraogi, Head of Expansion APAC, to discuss our strategic expansion into Hyderabad, India 🇮🇳 Read more to discover why Hyderabad is the perfect location for our second global hub in APAC, offering unique opportunities for innovation, growth, and an incredible talent pool 🚀

Read more

by

Verona Hasani

by

Verona Hasani

From Agent to Team Lead: A Journey in Fraud Prevention

Teaser

People profile

Content Type

Blog

Publish date

06/06/2025

Summary

Driven by a passion for growth and team development, discover how Anna Pavlics advanced from Agent to Team Lead in Wise's Fraud Prevention team 🚀 "We put tremendous effort into bui

Teaser

Driven by a passion for growth and team development, discover how Anna Pavlics advanced from Agent to Team Lead in Wise's Fraud Prevention team 🚀

Read more

by

Verona Hasani

by

Verona Hasani

From Support agent to leadership: A decade of growth

Teaser

People profile

Content Type

Blog

Publish date

02/18/2025

Summary

Head of Servicing Scale and Experience, Ian Rynne, discusses his journey from starting as a Customer Support agent to becoming the Head of Servicing Scale and Experience at Wise. 

Teaser

Head of Servicing Scale and Experience, Ian Rynne, discusses his journey from starting as a Customer Support agent to becoming the Head of Servicing Scale and Experience at Wise.

Read more

by

Verona Hasani

by

Verona Hasani

Life in the heart of Austin

Teaser

Our culture

Content Type

Blog

Publish date

05/15/2024

Summary

My name is Cynthia. I'm a fraud agent at Wise, based in the Austin office. We strive to prevent fraudulent activity on the Wise platform. It can be tricky, as Wise supports many diff

Teaser

We spoke to Cynthia, a fraud agent based in the Austin office, to find out more about what life is like at Wise in Austin.

Read more
Keeping Tampa Bay Beautiful

Teaser

Environment Social Governance

Content Type

Blog

Publish date

01/24/2024

Summary

Wise’s volunteer day is not just a perk; it’s a celebration of community, camaraderie, and making a difference.Meet Claire Adelman, Customer Support Training Specialist, and Javier Perdo

Teaser

Wise’s Volunteer Day is not just a perk; it’s a celebration of community, camaraderie, and making a difference. Meet Claire and Javier, both showcasing the true spirit of Wise in Tampa.

Read more
Life as a Due Diligence Agent: Delis

Teaser

People profile

Content Type

Blog

Publish date

11/24/2022

Summary

Hi! My name is Delis and I’m a Due Diligence Agent (CDD) in our Tallinn team, focusing on business verification. What this means is that I onboard high risk businesses by assessing their r

Teaser

Hi! My name is Delis and I’m a Due Diligence Agent (CDD) in our Tallinn team, focusing on business verification. What this means is that I onboard high risk businesses by assessing their risk level, investigating business activity and determining business structure.

Read more
Life as a Due Diligence Agent: Rza

Teaser

People profile

Content Type

Blog

Publish date

11/24/2022

Summary

Hi! My name is Rza Mustafayev and I’m a Due Diligence Agent in our Latin America & Middle-East and Africa Region, focusing on personal and business customers. What this means is that I:Rev

Teaser

Hi! My name is Rza Mustafayev and I’m a Due Diligence Agent in our Latin America & Middle-East and Africa Region, focusing on personal and business customers.

Read more
View all
Search

Browse Jobs