Zero Labs
Industry News / AI

Inside India’s 10-Billion-a-Month Payments Engine

Source · Towards AI By Keerthana Nyshadham

From the publisher’s feed, collected in the ZeroLabs newsroom.

5 AI Payment Architectures that Amazed meImagine processing over 10 billion financial transactions in a single month.Now, imagine doing it with millisecond latency, zero downtime, and population-scale security.Today as I drove past the NPCI office in Hyderabad, I felt wow THIS is the place that handles all this! I HAVE TO for sure learn how they do it!When you are building payment systems that handle the GDP of a small country every few days, you cannot just download a pre-trained model off Hugging Face and hope for the best. The latency requirements are in milliseconds, the security must be population-scale, and the edge cases are wild.So I naturally got curious how the National Payments Corporation of India (NPCI) and its ecosystem partners are solving these extreme bottlenecks. They are not just using generic APIs. They keep actively deploying custom DL architectures, federated graph networks, and cryptographic ML.Hi I’m Keerthana :) Lets Make it make sense, right?Lets break down five of the most complex ML architectures running under the hood of modern digital payments. First we will look at the surface-level magic and then dive straight into the core math.Image generated by Author1. Catching Multi-Bank Fraud RingsThe Surface:How do I catch a coordinated fraud ring laundering money across five different banks if those banks legally cannot share customer data with each other? I’d use Federated Learning combined with Graph Neural Networks.The Deep Dive:Financial transactions form a massive heterogeneous graph. Nodes are user accounts or devices, and edges are the actual money transfers. Instead of pooling all this sensitive data into a central server, banks run local Graph Attention Networks (GATs) on their own isolated data.The GATs learn the topological features of fraud (like mule account networks) through message passing.The core math for a node v updating its hidden state in layer k looks like this:hv(k+1) = σ(W(k)⋅AGG_{u∈N(v)} hu(k) + b(k))Because transaction data varies wildly across different regions and banks, simple averaging of these models fails. To fix this, the central aggregator uses a Mixture-of-Experts (MoE) routing layer. It learns which local bank models are the experts for specific fraud patterns and weights them accordingly.2. FiMI: A Payments-Native Agentic LLMThe Surface:Prompt engineering a generic LLM like ChatGPT to handle live financial disputes is a welcome mat for hallucinations. We dont want a chatbot guessing where our money is. So, they built FiMI (Finance Model for India), a highly specialized, payments-native LLM.The Deep Dive:FiMI is built on the Mistral Small 24B decoder-only architecture. It went through Continuous Pre-Training (CPT) on 68 billion tokens of financial data, math, code, and regional languages. Training this beast required 64 H100 GPUs using DeepSpeed ZeRO-3 and FlashAttention-2 to optimize memory states.To measure how well FiMI internalized financial logic without forgetting general knowledge, engineers tracked Perplexity (PPL).Perplexity measures the model’s uncertainty in predicting the next token. Lower is better:PPL(X) = exp(-(1/N) ∑_{i=1}^N log P(x_i | x_In production, FiMI operates as a ReAct (Reason + Act) agent. It is explicitly trained to output strict JSON schemas to trigger secure backend APIs (like check_transaction_status) rather than guessing answers. This bumped domain tool-calling accuracy up by 87% compared to base models.3. Replacing RFID with Pure Computer VisionThe Surface:Physical RFID tags for toll and parking payments (like FASTag) break, fall off or fail to read. The upgrade is replacing physical tags entirely with AI-powered cameras that read license plates and auto-debit the linked account.The Deep Dive:Running a standard Convolutional Neural Network (CNN) fails when cars are moving fast at night or plates are covered in mud. The modern pipeline uses single-stage detectors like YOLOv11 optimized for small object detection.To handle terrible lighting, the system applies Contrast Limited Adaptive Histogram Equalization (CLAHE) before passing the cropped plate to a custom OCR model.To train the OCR to read unsegmented, chaotic text sequences, the pipeline relies on Connectionist Temporal Classification (CTC) loss:L_CTC = -log ∑_{π∈B^{-1}(y)} P(π|x)This math allows the neural network to output character probabilities across a sequence and collapse repeated blanks into the final license plate string, achieving real-time inference speeds of roughly 43 milliseconds per frame.4. Hunting Zero-Day Fraud with Focal LossThe Surface:When dealing with millions of transactions a day, known fraud patterns are easy to block. But attackers constantly test new methods. Standard rules engines are too slow, and standard ML models fail because fraud is extremely rare (less than 0.1% of data).The Deep Dive:If you train a normal classifier on data where 99.9% of transactions are legitimate, the model will just predict “legitimate” every time and claim 99.9% accuracy. This is a classic class-imbalance nightmare.To fix this, the architecture uses SMOTE (Synthetic Minority Oversampling Technique) to synthetically generate fraud examples in the training manifold to balance the classes.During supervised training (like XGBoost), they replace standard log-loss with Focal Loss. Focal loss adds a modulating factor to the cross-entropy equation to heavily penalize the model when it confidently misclassifies the minority (fraud) class. Simultaneously, unsupervised models like Isolation Forests run in the background to hunt for entirely new behavioral anomalies.5. Deep Cryptographic Machine LearningThe Surface:How do you mathematically update a global fraud model if the central server is physically blinded to the data? Through a joint Centre of Excellence with the Indian Institute of Science (IISc), engineers are integrating high-level cryptography directly into the ML training loops.The Deep Dive:This relies on Privacy-Preserving Machine Learning (PPML). The architecture uses Differential Privacy (DP). Before a local bank sends its calculated gradients (weight updates) to the central server, it clips the L2 norm of the gradients and injects statistical noise (like Gaussian noise).The math for applying the Gaussian mechanism to the model update Δθ_k looks like this:Δθ̃_k = Δθ_k + N(0, σ²S²I)They layer this with Secure Multi-Party Computation (SMPC) and Homomorphic Encryption. This allows the central server to mathematically aggregate the gradients while they are strictly in ciphertext. The global model learns and updates, but the raw data never actually leaves the source.What now?Honestly I can’t stop thinking about the sheer math required to make systems like this run without crashing. These pipelines be pushing the absolute limits of scale and latency.Image generated by Authorps: over the next few weeks, I will be trying to understand each of these Architectures. One implementation per day, break down the core math, map out the architecture and look at how I can build these from scratch.Which of these 5 architectures are you most curious about? Let me know if you want deep dive into any/all of these!Thanks a lot for being with me till the end! Means a lot that u’d take your time to read my blogs. See you in the next one! Byeee & sending love 💝Inside India’s 10-Billion-a-Month Payments Engine was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.