Real-Time Fraud Detection & GenAI Investigation — JPMorgan Chase

A fraud detection platform scoring 5M+ card transactions daily, a streaming feature store serving features in under 50 ms, and a RAG-based investigation assistant that cut analyst time by 40% — built under the explainability and governance constraints that financial services imposes.

AI/ML Engineer · JPMorgan Chase & Co., California · Sept 2023 – Oct 2025

What I built
  • Real-time fraud detection platform — processing 5M+ daily card transactions with LightGBM and Isolation Forest models, reducing confirmed fraud losses by 22% while improving transaction risk scoring.
  • Feast-based feature store — integrated with Apache Kafka to serve streaming features at sub-50 ms latency, enabling real-time detection and decisioning.
  • GenAI fraud investigation assistant — LangChain, Pinecone, and Retrieval-Augmented Generation, reducing analyst investigation time by 40% through contextual case retrieval.
  • Transformer-based anomaly detection — trained in PyTorch to identify abnormal transaction patterns, increasing detection accuracy by 15% while holding false positives below 2%.
  • Automated ML lifecycle — training, validation, versioning, and deployment through Kubeflow Pipelines, Terraform, and AWS EKS, improving deployment consistency and accelerating release cycles.
  • Model explainability — SHAP and LIME providing transparent fraud risk predictions to support regulatory compliance, model governance, and audit.
  • Inference optimisation — ONNX Runtime and post-training quantisation improving scoring throughput 3× while reducing latency for real-time processing.
  • Responsible AI controls — with Risk, Compliance, and Data Science: bias monitoring, output validation, and prompt injection safeguards enabling secure GenAI deployment.
Architecture
cardtransaction Kafkaevent stream Feastfeature store< 50 ms LightGBM Isolation Forest transformer risk scoreapprove / hold SHAP · LIME — why this score investigation assistantLangChain · Pinecone · RAG analyst40% faster reviews every flagged case carries its explanation into the review
The scoring path is latency-bound; the investigation path is quality-bound. Explainability is what connects them — a flagged transaction arrives at the analyst with reasons attached.
Technical specifications
Volume5M+ card transactions scored daily
Primary modelsLightGBM (supervised), Isolation Forest (unsupervised anomaly), transformer-based sequence models in PyTorch
Feature servingFeast feature store fed by Apache Kafka, sub-50 ms online lookup
GenAI assistantLangChain orchestration, Pinecone vector store, Retrieval-Augmented Generation over historical cases
OrchestrationKubeflow Pipelines for training and deployment, Terraform for infrastructure, AWS EKS for runtime
ExplainabilitySHAP and LIME for per-prediction attribution supporting audit and model governance
InferenceONNX Runtime with post-training quantisation — 3× throughput improvement
GovernanceBias monitoring, output validation, prompt injection safeguards, with Risk and Compliance
Reported outcomes22% reduction in confirmed fraud losses; 15% detection accuracy improvement at < 2% false positives; 40% reduction in investigation time
Interview questions 134 questions

Fraud detection interviews concentrate on class imbalance, the cost asymmetry between error types, and latency under regulation. The "what if" groups are where interviewers find out whether you understand the system or only remember it. Terms are defined in the glossary.

1 · Problem framing and business context (10)
  1. How do you frame fraud detection as a machine learning problem?
  2. What is the cost of a false positive versus a false negative here, in real terms?A blocked legitimate transaction is a customer service event and possible churn; a missed fraud is a direct loss plus liability. They are not symmetric and the ratio should drive the threshold.
  3. Where did your labels come from, and how long did they take to arrive?
  4. What is label delay and how does it affect training and evaluation?
  5. How did you handle fraud that was never reported and therefore never labelled?
  6. What does the 22% reduction in confirmed fraud losses actually measure?
  7. How did you attribute that reduction to the model rather than to other changes?
  8. Who consumed the risk score, and what action did it trigger?
  9. What was the baseline before the platform existed?
  10. How did you decide the threshold at which a transaction is held?
2 · Model choice and design (12)
  1. Why LightGBM rather than XGBoost or a neural network?Tabular data, speed of training and inference, native categorical handling, and interpretability that survives a compliance review.
  2. What does Isolation Forest do that LightGBM cannot?
  3. Why run a supervised and an unsupervised model together?
  4. How do you combine their outputs into a single decision?
  5. What did the transformer add over the gradient-boosted model?
  6. What is the sequence in your transformer — transactions per card over time?
  7. How did you prevent the transformer from simply relearning what LightGBM already caught?
  8. How did you decide the 15% accuracy improvement was real and not overfitting?
  9. What features mattered most, and were you surprised by any of them?
  10. How did you handle categorical features with very high cardinality, such as merchant ID?
  11. How did you deal with new merchants or cards with no history?
  12. Why not just use rules? What did the model give you that rules did not?
3 · Class imbalance and metrics (12)
  1. What was your fraud base rate, and why does that number dominate everything else?
  2. Why is accuracy a useless metric here?Predicting "not fraud" always would score above 99%. Say this plainly — it is the fastest way to show you understand the problem.
  3. Why precision-recall AUC rather than ROC AUC on imbalanced data?
  4. What is precision at a fixed recall, and why is it the metric operations actually cares about?
  5. How did you keep false positives below 2%, and what did that cost you in recall?
  6. Did you resample — SMOTE, undersampling, class weights? What did you choose and why?
  7. What goes wrong when you apply SMOTE before splitting the data?
  8. How did you set the decision threshold, and did it differ by segment?
  9. What is calibration and why does a fraud score need to be calibrated?
  10. How would you explain the precision-recall tradeoff to a non-technical risk manager?
  11. How did you evaluate over time rather than on a random split?
  12. What is a cost-sensitive loss and would it have been a better objective here?
4 · Feature store and streaming (12)
  1. What is a feature store and what problem does it solve?
  2. What is training-serving skew, and how does a feature store prevent it?The same feature definition computed once, served to both training and inference. Without it, the batch SQL and the online code drift apart silently.
  3. What is the difference between the online and offline store in Feast?
  4. What is point-in-time correctness and why does it matter for fraud features?
  5. How did you compute rolling aggregations — transactions in the last hour, for example — in a streaming context?
  6. How did Kafka fit into the pipeline, and what were the topics partitioned by?
  7. Why does partitioning by card ID matter for ordering?
  8. How did you achieve sub-50 ms feature lookup, and what was the storage backend?
  9. What happens to a scoring request when a feature is missing or stale?
  10. How did you handle late-arriving events in the stream?
  11. What is watermarking and did you need it?
  12. How did you monitor feature freshness in production?
5 · The RAG investigation assistant (12)
  1. What exactly did the assistant retrieve, and from where?
  2. Why RAG rather than fine-tuning a model on historical cases?
  3. How did you chunk case documents, and what did you experiment with?
  4. Which embedding model did you use and how did you evaluate it?
  5. Why Pinecone rather than pgvector or FAISS?
  6. How did you measure retrieval quality separately from answer quality?Retrieval precision and recall at k, evaluated independently — most "the model is wrong" complaints are retrieval failures wearing a costume.
  7. How did you prevent the assistant from hallucinating case details?
  8. Did you enforce citations back to the source case? How?
  9. How did you measure the 40% reduction in investigation time?
  10. How did you handle personally identifiable information in retrieved cases?
  11. What did the assistant do when no relevant case existed?
  12. How did analysts give feedback, and did that feedback improve the system?
6 · MLOps — Kubeflow, Terraform, EKS (12)
  1. What did your Kubeflow pipeline actually do, stage by stage?
  2. How were models versioned, and could you tie a production score back to a training run?
  3. What triggered retraining — a schedule, drift, or performance decay?
  4. How did you validate a new model before it replaced the incumbent?
  5. What is a champion-challenger setup and did you run one?
  6. How did you deploy — blue-green, canary, or shadow mode?Shadow mode is the strong answer for fraud: score in parallel without acting, compare, then promote.
  7. How did you roll back a bad model, and how quickly?
  8. Why Terraform rather than configuring infrastructure by hand?
  9. What did EKS give you over running on EC2 directly?
  10. How did you handle autoscaling for a workload with a daily traffic pattern?
  11. How did you separate the training and serving infrastructure?
  12. What did your on-call runbook say to do when scoring latency spiked?
7 · Explainability and governance (12)
  1. What is SHAP and what does a SHAP value actually represent?The contribution of one feature to the difference between this prediction and the average prediction, averaged fairly over all feature orderings.
  2. How does LIME differ from SHAP, and why use both?
  3. Why is TreeSHAP feasible on a gradient-boosted model when exact SHAP is not?
  4. How did you deliver explanations at the latency required for real-time scoring?
  5. Who consumed the explanations, and did they change any decisions?
  6. What does a regulator actually want to see in model documentation?
  7. What is model governance in a bank, and what artefacts did you produce?
  8. How did you monitor for bias, and against which attributes?
  9. What is disparate impact and how would you detect it in a fraud model?
  10. What do you do when a protected attribute is not in the model but is inferable from other features?
  11. How did you handle the tension between accuracy and explainability?
  12. Could you explain a transformer's decision to a compliance officer?
8 · Inference optimisation (12)
  1. Where was the 3× throughput improvement actually coming from?
  2. What is post-training quantisation and how does it differ from quantisation-aware training?
  3. How did you verify the quantised model still scored transactions the same way?
  4. What accuracy loss did you accept, and who approved it?
  5. Why ONNX Runtime rather than serving the PyTorch model directly?
  6. What is graph optimisation in ONNX Runtime — what does it change?
  7. What is the difference between throughput and latency, and which one mattered here?Both, at different points: throughput for the daily 5M batch, p99 latency for the real-time authorisation path.
  8. How did you batch requests without adding unacceptable latency?
  9. What was your p99 scoring latency and what was the budget?
  10. How did you profile to find the bottleneck before optimising?
  11. How much of end-to-end latency was feature lookup versus model inference?
  12. What would you have optimised next?
9 · Responsible AI and security (10)
  1. What is prompt injection and how does it apply to a fraud investigation assistant?
  2. How could an attacker manipulate the assistant through transaction data it reads?
  3. What output validation did you apply before showing an answer to an analyst?
  4. How did you prevent sensitive data leaking into the model provider's logs?
  5. What is data residency and did it constrain your design?
  6. How did you handle the right to an explanation for a declined transaction?
  7. What is adversarial drift — fraudsters adapting to your model — and how did you detect it?
  8. How often did you retrain, and was that fast enough against adaptive adversaries?
  9. What controls did Risk and Compliance require before GenAI could touch production data?
  10. How would you red-team this system?
10 · What if — data and distribution (10)
  1. What if the fraud rate doubled in a week?
  2. What if fraudsters found and exploited a blind spot in your features?
  3. What if a major merchant changed its transaction format overnight?
  4. What if the Kafka stream lagged by ten minutes?
  5. What if a feature became unavailable in production but was present in training?
  6. What if your labels turned out to be systematically biased toward one customer segment?
  7. What if a bug meant three months of training data had a corrupted field?
  8. What if the model performed well overall but badly on one country?
  9. What if a holiday shopping spike looked like coordinated fraud?
  10. What if you had to launch in a new market with no historical fraud data?
11 · What if — production incidents (10)
  1. What if scoring latency exceeded the authorisation timeout during peak traffic?
  2. What if the model started declining 10× more transactions than yesterday?
  3. What if the feature store returned stale values without erroring?The dangerous failures are the silent ones — this is why freshness needs its own alert rather than relying on error rates.
  4. What if the new model passed offline evaluation but degraded in production?
  5. What if you had to disable the model entirely — what is the fallback?
  6. What if Pinecone was unavailable during an investigation surge?
  7. What if an analyst acted on a hallucinated case summary?
  8. What if a rollback restored a model trained on data you have since deleted for privacy reasons?
  9. What if two models in the ensemble disagreed sharply on a high-value transaction?
  10. What if you discovered the 22% loss reduction was partly caused by an unrelated policy change?
12 · What if — design alternatives (10)
  1. What if you had to score in 10 ms instead of 50 ms?
  2. What if the bank forbade any model that could not be explained by a linear equation?
  3. What if you could not store any customer data at all?
  4. What if you had to run entirely on-premises with no cloud services?
  5. What if you had 100× the transaction volume?
  6. What if the assistant had to work for analysts in five languages?
  7. What if you replaced the whole ensemble with a single large model — what would you lose?
  8. What if the business wanted the model to explain itself in natural language to customers?
  9. What if labels became available in real time instead of weeks later?
  10. What if you had to hand this system to a team who had never seen it — what would you document first?
Glossary
TermWhat it means
Base rateThe proportion of transactions that are actually fraudulent — typically well under 1%, which is why imbalance dominates the problem.
Class imbalanceOne class vastly outnumbering the other, so a model can score well by ignoring the minority class entirely.
False positiveA legitimate transaction flagged as fraud. Costs customer trust and support effort.
False negativeFraud that was not caught. Costs money directly and may carry liability.
PrecisionOf the transactions flagged as fraud, the share that really were.
RecallOf the fraud that occurred, the share that was caught.
PR AUCArea under the precision-recall curve. More informative than ROC AUC under heavy imbalance because it ignores the abundant true negatives.
ROC AUCArea under the receiver operating characteristic curve. Looks flatteringly high on imbalanced data.
Precision at fixed recallThe operational metric — "at the recall we need, how many false alarms must the team absorb?"
CalibrationWhether a predicted probability means what it says — of everything scored 0.8, roughly 80% should be fraud.
Decision thresholdThe score above which action is taken. A business decision, not a modelling one.
Cost-sensitive lossA loss function weighting errors by their real cost rather than treating them equally.
SMOTESynthetic Minority Over-sampling — generating synthetic minority examples by interpolating between neighbours. Must be applied inside the training fold only.
Label delayThe lag between a transaction and a confirmed fraud label, often weeks. It limits how quickly you can learn and how you must evaluate.
LightGBMGradient-boosted trees using histogram-based splits and leaf-wise growth — fast on large tabular data with native categorical handling.
Isolation ForestAn unsupervised anomaly detector that isolates points with random splits; outliers separate in fewer splits. Needs no labels, so it can catch novel fraud.
EnsembleCombining several models' outputs, ideally with uncorrelated errors so their mistakes cancel rather than compound.
High-cardinality categoricalA field with very many distinct values, such as merchant ID. One-hot encoding explodes; target or hash encoding is usual.
Cold startA new card or merchant with no history, so history-based features are empty.
Feature storeA system that defines features once and serves them consistently to both training and inference.
FeastAn open-source feature store with an offline store for training data and an online store for low-latency serving.
Online vs offline storeOnline is a fast key-value lookup for serving; offline holds full history for training. Both derive from the same definitions.
Training-serving skewFeatures computed differently at training and serving time — a leading cause of models that work offline and fail in production.
Point-in-time correctnessBuilding training rows using only data available at that moment, so the model never sees the future.
Apache KafkaA distributed append-only log. Producers write to partitioned topics; consumers read at their own offsets, with ordering guaranteed within a partition.
Partition keyThe field deciding which partition an event lands in. Keying by card ID keeps one card's events ordered.
Late-arriving dataEvents that reach the stream after events that happened later, breaking naive time-window aggregations.
WatermarkingA stream-processing mechanism declaring how late data may be before a window is closed.
Feature freshnessHow recently a served feature was updated. Stale features fail silently, so freshness needs its own monitoring.
RAGRetrieval-Augmented Generation — retrieve relevant documents at query time and put them in the prompt so answers rest on evidence.
ChunkingSplitting documents into retrievable pieces. Chunk size and overlap materially affect retrieval quality.
EmbeddingA dense vector representation placing semantically similar text near one another.
PineconeA managed vector database serving approximate nearest-neighbour search with metadata filtering.
Retrieval precision at kOf the top k retrieved documents, how many were genuinely relevant — measured separately from the final answer.
HallucinationConfidently stated output not supported by the evidence. In an investigation tool, actionable and dangerous.
Citation enforcementRequiring every claim to point at a retrieved source, so an analyst can verify rather than trust.
PIIPersonally identifiable information. Governs what may be retrieved, logged, or sent to a model provider.
Kubeflow PipelinesOrchestrates ML workflows as containerised steps on Kubernetes, with tracked inputs and outputs per run.
TerraformDeclares infrastructure as versioned code and reconciles cloud resources against that declaration.
EKSAWS-managed Kubernetes — AWS runs the control plane, you run the workloads.
Champion-challengerRunning a candidate model alongside the incumbent and promoting only if it wins on agreed metrics.
Shadow modeScoring live traffic with a new model without acting on its output, to compare safely before promotion.
Canary deploymentRouting a small share of traffic to the new version first, expanding only if metrics hold.
Blue-green deploymentTwo full environments with traffic switched between them, giving an instant rollback path.
SHAPShapley Additive exPlanations — attributes a prediction to its features using a game-theoretic allocation that is fair and additive.
TreeSHAPAn exact, polynomial-time SHAP algorithm specific to tree ensembles, which makes explanations affordable on gradient-boosted models.
LIMELocal Interpretable Model-agnostic Explanations — fits a simple surrogate model around one prediction to approximate local behaviour.
Model governanceThe controls around a model in a regulated setting: documentation, validation, approval, monitoring, and audit trail.
Disparate impactA model producing systematically different outcomes across protected groups, even without using the protected attribute.
Proxy variableA feature correlated with a protected attribute, letting bias enter a model that never sees the attribute itself.
Bias monitoringTracking outcome differences across segments in production, not only at training time.
ONNX RuntimeExecutes models in the ONNX format across hardware, applying graph optimisations such as operator fusion and constant folding.
Post-training quantisationReducing weight and activation precision after training, using a calibration sample. No retraining required.
Quantisation-aware trainingSimulating reduced precision during training so the model learns to tolerate it — better accuracy, more expensive.
Throughput vs latencyTransactions per second versus time for one transaction. Batching raises throughput and usually raises latency.
p99 latencyThe value 99% of requests come in under. The number that reflects the worst experience users actually get.
Adversarial driftDistribution shift caused by adversaries adapting to your defences — unlike ordinary drift, it is deliberate and responsive.
Concept driftThe relationship between features and label changing over time, so a once-accurate model decays.
Prompt injectionInstructions hidden in data the model reads, hijacking its behaviour. Relevant wherever a model consumes untrusted content.
Output validationChecking model output against rules or schemas before it reaches a user or triggers an action.
Red teamingDeliberately attacking your own system to find failures before an adversary does.

Back to all projects.