Anomaly detection for graph-based data

Diffusion modeling within the representational space of a variational autoencoder enables state-of-the-art results.

Anomaly detection is the identification of data that diverges significantly from established norms, which can indicate harmful activity. It’s a particularly tough challenge in the case of graph-based data, where anomaly detection is based not only on data values but on topological relationships within the graph. Because anomalies tend to be rare, it can be hard to find enough examples to train a machine learning model on the complexities of anomaly detection in graphs.

In a paper we presented last week at the International Conference on Web Search and Data Mining (WSDM), we describe a new method for synthesizing training data for graph-based anomaly detectors. Our method combines a variational graph autoencoder, which learns a probability distribution that can be used to generate random samples, with diffusion modeling, which learns to convert random noise into intelligible outputs.

In tests, we compared anomaly detectors trained with synthetic data generated through our method with detectors trained using five previous approaches to data augmentation. We compared the models on five datasets, using three different metrics, for a total of 15 experiments. In 13 of those experiments, our model came out on top; different models were the top performers on the other two.

Graph-based modeling

Graphs are the natural way to represent data movement through networks, whether they’re computer networks, communication networks, or networks of interactions, as between buyers and sellers on an e-commerce site. Anomaly detection in graphs can thus help detect server attacks, spam, fraud, and other types of abuse.

Related content
Slice-level detection of robots (SLIDR) uses deep-learning and optimization techniques to ensure that advertisers aren’t charged for robotic or fraudulent ad clicks.

In recent years, graph analysis has, like most fields, benefited from deep learning. Graph neural networks build up graph representations iteratively: first, they embed the data corresponding to nodes in the graph; then they produce embeddings that combine node embeddings with those of adjacent nodes; then they produce embeddings that combine those higher-level embeddings; and so on, until some fixed termination point. Ultimately, the model produces embeddings that capture information about whole neighborhoods of the graph. (In our experiments, we decided on four-hop neighborhoods.)

The complexity of graphs — the need to represent data both topologically and quantitatively — means that models for analyzing them need extra training data, which can be scarce in the wild. Hence the need for synthetic training data.

Latent-space diffusion

At its core, our data synthesis model is a variational graph autoencoder. “Autoencoder” means that it’s trained to output the same data it receives as input. In-between the input and output layers, however, is a bottleneck layer that forces the network to learn a compressed representation of the input.

“Variational” means that the model’s training objective encourages it not only to faithfully reproduce inputs but also to learn compressed representations whose distribution adheres to some prespecified shape, such as a Gaussian distribution. This means that, during the data synthesis phase, random samples from that distribution are likely to result in realistic-looking data.

The autoencoder’s compressed representations define a representational space, and it’s within that space that we apply diffusion modeling. The autoencoder produces an embedding of the input graph, and our model iteratively adds noise to it. A denoiser then performs the same process in reverse, iteratively denoising the embedding.

At left is a beige rectangle labeled "Graph space" and at right a larger blue rectangle labeled "Latent space". In the top row of the graph space, an input graph passes to a GNN encoder, whose output, z0, is in the latent space. Z0 goes through a diffusion process to become ZT, at the right edge of the top row. At the right edge of the bottom row, ZT passes leftward, to an MLP, to become Z-tilde-t-minus-1, which is iteratively denoised (T-1 times) to produce z-tilde-0, at the left edge of the latent space. Z-tilde-0 passes to an MLP decoder in the second row of the graph space, which generates a new graph from it.
Our approach applies diffusion modeling within the representational space (latent space) defined by the graph encoder. Noise is added to the input embedding (z0) in T discrete steps; the embedding is then denoised in another T steps.

 This is, effectively, a second check to ensure that the synthetic data looks like real data. If the distribution learned by the autoencoder doesn’t completely capture the characteristics of anomalous data, the addition of noise can “blur out” the mischaracterized features. The denoising step then fills in the blurred-out features with features more consistent with the training data.

Data synthesis

Our approach has a couple other wrinkles designed to improve the quality of the synthesized data. One is that, after the diffusion process, the reconstituted graph embedding passes to not one but several decoders, each specialized for a different aspect of the graph.

At minimum, there are two decoders, one for node features and one for graph structure. If the graphs in question include time series data, we use a third decoder to assign time stamps to nodes.

Related content
In the field of knowledge discovery, says Amazon Scholar Christos Faloutsos, “We want to choose the right tool for the given application.”

Another wrinkle is that, during training, we label graph nodes as either anomalous or normal, then train on both positive and negative examples. This helps the model learn the distinction between the two. But it also means that the model learns a distribution that’s conditioned on class labels, so that during synthesis, we can steer it toward samples that will result in graphs that contain anomalies.

Finally, it was important that our model be able to generate heterogeneous graphs — that is, graphs with different node and edge types. In an e-commerce setting, for instance, nodes might represent buyers, sellers, and product pages, while edges might represent purchases, product views, reviews, and the like.

Consequently, as the encoder in our autoencoder, we use a heterogeneous-graph transformer, a module that has several modifications to enable it to handle heterogeneous graphs, including separate attention mechanisms for different node or edge types.

Taken together, these features of our model enable it to outperform its predecessors, and in the paper, we report an ablation study showing that each of these features contributes significantly to our model’s success.

Research areas

Related content

IN, KA, Bengaluru
Amazon Ads delivers advertising experiences across Amazon's owned-and-operated properties and third-party networks, reaching hundreds of millions of customers worldwide. Within Amazon Ads, Advertising Trust is the science-first organization responsible for ensuring every ad shown to customers meets Amazon's content policies — at massive scale, across all ad formats and global marketplaces. The Ads Trust Science team builds the ML systems that automate content moderation decisions: multimodal classification, retrieval-based labeling, LLM reasoning, and agentic self-improvement architectures. This requires inventing new approaches at the intersection of computer vision, NLP, information retrieval, and generative AI. We are seeking an Applied Science Manager to lead a team of applied scientists building next-generation content moderation intelligence. You will own the science roadmap for one of the highest-impact automation programs in Amazon Advertising, defining how multimodal content understanding, retrieval-first classification, and LLM-based reasoning combine into a production system that serves global advertising at scale. Key job responsibilities * Lead a team of applied scientists working across multimodal ML (vision-language models, video understanding), large-scale retrieval systems (embedding-based similarity and deduplication), and generative AI (LLM-based policy reasoning, knowledge distillation, agentic architectures, reinforcement learning). * Define the science strategy for ads trust. * Own end-to-end delivery of ML solutions: problem formulation, offline experimentation, online A/B testing, and production deployment. Your models directly move automation and defect metrics reported to senior leadership. * Build and grow scientists — hire, mentor, and develop team members. Raise the science bar through structured review processes and a publication culture within Amazon. * Partner with engineering, product, and operations teams to translate science investments into measurable automation improvements. Influence roadmaps across dependent teams. * Communicate science strategy and results to senior leadership through narratives, technical deep-dives, and roadmap documents.
IN, KA, Bengaluru
We are embarking on a multi-year journey to improve the shopping experience for customers globally. Amazon Search team creates customer-focused search solutions and technologies that make shopping delightful and effortless for our customers. Our goal is to understand what customers are looking for in whatever language happens to be their choice at the moment and help them find what they need in Amazon's vast catalog of billions of products — starting from the very first keystroke. As Amazon expands to new interfaces, we are faced with the unique challenge of maintaining the bar on Search Results Quality and Search Autocomplete. We are looking for a Applied Scientist II to work on improving search on Amazon using NLP, ML, and DL technology. As an Applied Scientist, you will lead our efforts in query understanding, semantic matching, and ranking. You will build systems that anticipate search query intent and surface the right results. As part of this role, you will develop high precision, high recall, and low latency solutions for search. Your solutions should work for all languages that Amazon supports and will be used in all Amazon locales world-wide. You will develop scalable science and engineering solutions that work successfully in production. Key job responsibilities As an Applied Scientist on the team, you will lead science innovation to improve the customer search experience through higher-quality search results. You will: - Develop and deploy ML models to produce relevant search results. - Design and train semantic matching models (bi-encoders, cross-encoders, and distillation from large foundation models) for ranking and relevance. - Develop reinforcement learning and reward-modeling approaches to continuously improve search results quality. - Train multi-objective ranking and scoring systems that balance suggestion diversity, specificity, and relevance. - Design and implement scalable model architectures optimized for strict latency constraints, including knowledge distillation, quantization, and efficient inference strategies for production deployment. - Lead end-to-end science projects from problem formulation through production launch, collaborating closely with engineers and scientists within and outside the team to deliver customer-facing impact.
US, NY, New York
Are you a scientist interested in pushing the state of the art in machine learning and recommendation systems? Are you interested in working on novel ideas that can positively impact millions of customers? Do you wish you had access to large datasets and tremendous computational resources? Answer yes to any of these questions and you will be a great fit for our team at Amazon. As an Applied Scientist in our team, you will be responsible for the research, design, and development of new AI technologies for Personalization. You will adopt or invent new machine learning and analytical techniques in the realm of recommendations and large language models. You will collaborate with scientists, engineers, and product partners locally and abroad. Your work will include inventing, experimenting with, and launching new features, products and systems. Key job responsibilities - Using Amazon’s large-scale computing resources, you will ask research questions about customer behavior, build state-of-the-art models to optimize the shopping experience, and run these models directly on the retail website. - Develop AI solutions for Recommendation systems using Deep learning, LLMs, Reinforcement Learning, distillation, and Optimization methods; - Work closely with engineers and product managers to design, implement and launch AI solutions end-to-end; - Design and conduct offline and online (A/B) experiments to evaluate proposed solutions based on in-depth data analyses; - Effectively communicate technical and non-technical ideas with teammates and stakeholders; - Stay up-to-date with advancements and the latest modeling techniques in the field; - Publish your research findings in top conferences and journals. About the team Our team is part of Amazon’s Personalization organization, a high-performing group that leverages Amazon’s expertise in machine learning, big data, distributed systems, and user experience design to deliver the best shopping experiences for our customers. We run global experiments and our work has revolutionized e-commerce with features such as "Keep shopping for ...", “Customers who bought this item also bought”, and “Frequently bought together”.
IN, KA, Bengaluru
We are embarking on a multi-year journey to improve the shopping experience for customers globally. Amazon Search team creates customer-focused search solutions and technologies that make shopping delightful and effortless for our customers. Our goal is to understand what customers are looking for in whatever language happens to be their choice at the moment and help them find what they need in Amazon's vast catalog of billions of products — starting from the very first keystroke. As Amazon expands to new interfaces, we are faced with the unique challenge of maintaining the bar on Search Results Quality and Search Autocomplete. We are looking for a Applied Scientist II to work on improving search on Amazon using NLP, ML, and DL technology. As an Applied Scientist, you will lead our efforts in query understanding, semantic matching, and ranking. You will build systems that anticipate search query intent and surface the right results. As part of this role, you will develop high precision, high recall, and low latency solutions for search. Your solutions should work for all languages that Amazon supports and will be used in all Amazon locales world-wide. You will develop scalable science and engineering solutions that work successfully in production. Key job responsibilities As an Applied Scientist on the team, you will lead science innovation to improve the customer search experience through higher-quality search results. You will: - Develop and deploy ML models to produce relevant search results. - Design and train semantic matching models (bi-encoders, cross-encoders, and distillation from large foundation models) for ranking and relevance. - Develop reinforcement learning and reward-modeling approaches to continuously improve search results quality. - Train multi-objective ranking and scoring systems that balance suggestion diversity, specificity, and relevance. - Design and implement scalable model architectures optimized for strict latency constraints, including knowledge distillation, quantization, and efficient inference strategies for production deployment. - Lead end-to-end science projects from problem formulation through production launch, collaborating closely with engineers and scientists within and outside the team to deliver customer-facing impact.
IN, KA, Bengaluru
We are embarking on a multi-year journey to improve the shopping experience for customers globally. Amazon Search team creates customer-focused search solutions and technologies that make shopping delightful and effortless for our customers. Our goal is to understand what customers are looking for in whatever language happens to be their choice at the moment and help them find what they need in Amazon's vast catalog of billions of products — starting from the very first keystroke. As Amazon expands to new interfaces, we are faced with the unique challenge of maintaining the bar on Search Results Quality and Search Autocomplete. We are looking for a Applied Scientist II to work on improving search on Amazon using NLP, ML, and DL technology. As an Applied Scientist, you will lead our efforts in query understanding, semantic matching, and ranking. You will build systems that anticipate search query intent and surface the right results. As part of this role, you will develop high precision, high recall, and low latency solutions for search. Your solutions should work for all languages that Amazon supports and will be used in all Amazon locales world-wide. You will develop scalable science and engineering solutions that work successfully in production. Key job responsibilities As an Applied Scientist on the team, you will lead science innovation to improve the customer search experience through higher-quality search results. You will: - Develop and deploy ML models to produce relevant search results. - Design and train semantic matching models (bi-encoders, cross-encoders, and distillation from large foundation models) for ranking and relevance. - Develop reinforcement learning and reward-modeling approaches to continuously improve search results quality. - Train multi-objective ranking and scoring systems that balance suggestion diversity, specificity, and relevance. - Design and implement scalable model architectures optimized for strict latency constraints, including knowledge distillation, quantization, and efficient inference strategies for production deployment. - Lead end-to-end science projects from problem formulation through production launch, collaborating closely with engineers and scientists within and outside the team to deliver customer-facing impact.
US, WA, Seattle
Stores Economics and Science (SEAS) is an interdisciplinary science and engineering team in Amazon's Stores organization with a peak-jumping mission: we apply expertise in science and engineering to move from local to global optima in methods, models, and software. We pursue this mission by leveraging frontier science; collaborating with partner teams; and learning from the tools, experience, and perspective of others. We scale by solving problems, first in the small to prove concepts, and then in the large by building scalable solutions. We also help other teams within Amazon scale by hiring and developing the best and embedding them in other business units. In 2026, we are focused on economics and science in areas related to (1) lowering cost-to-serve, (2) optimizing selection, and (3) emerging machine learning. We also have some ongoing and highly-leveraged collaborations that help partner teams inside Amazon short-circuit months of R&D or otherwise look around corners. We are looking for an Applied Scientist to build and deliver state-of-the-art science and engineering solutions to improve our Stores business. In this role, you will work in a team of scientists and engineers with backgrounds in machine learning, NLP, IR, statistics, and economics to identify bottlenecks in our business, conceive new ideas to overcome those challenges, and deploy scientific solutions in partnership with product teams. Your responsibilities include developing and maintaining the scientific models, benchmarks, and services. Graduate education or hands-on experience in machine learning, optimization, causal inference, Bayesian statistics, deep learning, or other quantitative scientific fields is a big plus. To be successful in this role, you should be a quick learner and comfortable with a high degree of ambiguity. Key job responsibilities The successful candidate will lead large-scale science initiatives from research to production and translate complex business problems into mathematical frameworks. They will design and implement large-scale algorithms for complex supply chain and marketplace problems, and design incentive-compatible mechanisms for marketplace challenges. The ideal candidate will have a strong publication record in top-tier conferences/journals (INFORMS, EC, WINE, ICML, NeurIPS, etc.) and experience coordinating cross-functional projects. Hands-on experience building science solutions to mechanism design problems (e.g., optimal auction design, welfare maximization under constraints, incentive compatible coordination), with expertise in statistical learning and algorithm development. Leadership responsibilities include influencing technical strategy and roadmaps for complex initiatives, influencing senior stakeholders and shaping technical direction, and fostering team growth.
US, WA, Seattle
Innovators wanted! Are you an entrepreneur? A builder? A dreamer? This role is part of an Amazon Special Projects team that takes the company’s Think Big leadership principle to the limits. We focus on creating entirely new products and services with a goal of positively impacting the lives of our customers. No industries or subject areas are out of bounds. If you’re interested in innovating at scale to address big challenges in the world, this is the team for you. Here at Amazon, we embrace our differences. We are committed to furthering our culture of inclusion. We have thirteen employee-led affinity groups, reaching 40,000 employees in over 190 chapters globally. We are constantly learning through programs that are local, regional, and global. Amazon’s culture of inclusion is reinforced within our 16 Leadership Principles, which remind team members to seek diverse perspectives, learn and be curious, and earn trust. As a Applied Scientist at the intersection of machine learning and the life sciences, you will participate in developing exciting products for customers. Our team rewards curiosity while maintaining a laser-focus in bringing products to market. Competitive candidates are responsive, flexible, and able to succeed within an open, collaborative, entrepreneurial, startup-like environment. At the forefront of both academic and applied research in this product area, you have the opportunity to work together with a diverse and talented team of scientists, engineers, and product managers and collaborate with others teams.
US, WA, Seattle
Interested in modeling and understanding customer behavior through machine learning, artificial intelligence, and data mining over TB scale data with huge business impact on millions of customers? Join our team of Scientists developing models to model customer behavior and optimize the customer experience with Amazon Prime. This includes understanding who our customers are, long-term value of the Prime membership program, and creating the right personalized framework for content and subscription optimization. As an AI/ML expert, you will partner directly with product owners to intake, build, and directly apply your modeling solutions. There are numerous scientific and technical challenges you will get to tackle in this role, such as optimizing/fine-tuning GenAI/LLM solutions for Prime personalization, building GenAI foundation models, global scalability of models, combinatorial optimization, cold start problem, accelerated experimentation, short/long term goals modeling, and multi-step optimization leading to reinforcement learning of the customer journey. We employ techniques from GenAI/LLMs, supervised/semi-supervised learning, deep learning, transformer architectures, using outcomes from causal Econometric modeling, and Reinforcement learning. As the central science team within Prime, our expertise gets routinely called upon to weigh in on a variety of topics. We also emphasize the need and value of scientific research and have developed a strong publication and patent record (internally/externally) which you will be a part of. You will also utilize and be exposed to the latest in ML technologies and infrastructure: AWS technologies (EMR/Spark, Sagemaker, DynamoDB, S3, ClaudeCode), various AI/ML algorithms and techniques (Deep Learning, GenAI/LLMs, transformers, supervised/unsupervised/semi-supervised/reinforcement learning), and statistical modeling techniques. - Stay abreast of current literature in the field and advance/build novel science solutions leveraging SoTA solutions. - Build and develop AI/ML models and supporting infrastructure at TB scale, in coordination with software engineering teams. - Leverage Deep Learning and GenAI solutions for building foundation models and personalized optimization solution. - Develop offline policy estimation tools and integrate with measurement systems/econometric models. - Establish scalable, efficient, automated processes for large scale data analyses, science development, science validation and model implementation. - Analyze and extract relevant information from large amounts of Amazon’s historical business data to help automate and optimize key processes. - Work closely with the business to understand their problem space, identify the opportunities and formulate the problems. - Use AI/machine learning, data mining, statistical techniques and others to create actionable, meaningful, and scalable solutions for the business problems. - Design, develop and evaluate highly innovative models and statistical approaches to understand and predict customer behavior and to solve business problems. Key job responsibilities - Stay abreast of current literature in the field and advance/build novel science solutions leveraging SoTA solutions. - Build and develop AI/ML models and supporting infrastructure at TB scale, in coordination with software engineering teams. - Leverage Deep Learning and GenAI solutions for building foundation models and personalized optimization solution. - Develop offline policy estimation tools and integrate with measurement systems/econometric models. - Establish scalable, efficient, automated processes for large scale data analyses, science development, science validation and model implementation. - Analyze and extract relevant information from large amounts of Amazon’s historical business data to help automate and optimize key processes. - Work closely with the business to understand their problem space, identify the opportunities and formulate the problems. - Use AI/machine learning, data mining, statistical techniques and others to create actionable, meaningful, and scalable solutions for the business problems. - Design, develop and evaluate highly innovative models and statistical approaches to understand and predict customer behavior and to solve business problems.
US, NY, New York
We are seeking a Robotics/AI Motor Control Scientist to develop cutting-edge machine learning algorithms for motor control systems in robots. In this role, you will focus on creating and optimizing intelligent motor control strategies to enable robots to perform complex, whole-body tasks. Your contributions will be essential in advancing robotics by enabling fluid, reliable, and safe interactions between robots and their environments. Key job responsibilities - Develop controllers that leverage reinforcement learning, imitation learning, or other advanced AI techniques to achieve natural, robust, and adaptive motor behaviors - Collaborate with multi-disciplinary teams to integrate motor control systems with robotic hardware, ensuring alignment with real-world constraints such as actuator dynamics and energy efficiency - Use simulation and real-world testing to refine and validate control algorithms - Stay updated on advancements in robotics, AI, and control systems to apply advanced techniques to robotic motion challenges - Lead technical projects from conception through production deployment - Mentor junior scientists and engineers - Bridge research initiatives with practical engineering implementation About the team Fauna Robotics, an Amazon company, is building capable, safe, and genuinely delightful robots for everyday life. Our goal is simple: make robots people actually want to live and interact with in everyday human spaces. We believe that future won’t arrive until building for robotics becomes far more accessible. Today, too much effort is spent reinventing the fundamentals. We’re changing that by developing tightly integrated hardware and software systems that make it faster, safer, and more intuitive to create real-world robotic products. Our work spans the full stack: mechanical design, control systems, dynamic modeling, and intelligent software. The focus is not just functionality, but experience. We’re building robots that feel responsive, expressive, and genuinely useful. At Fauna, you’ll work at the frontier of this space, helping define how robots move, manipulate, and interact with people in natural environments. It’s an opportunity to solve hard problems across hardware and software with a team focused on making robotics accessible and joyful to build. If you care about making robotics real for everyone and building systems that are as delightful as they are capable, we’re interested in hearing from you. an opportunity to solve hard problems across hardware and software with a team focused on making robotics accessible and joyful to build. If you care about making robotics real for everyone and building systems that are as delightful as they are capable, we’re interested in hearing from you.
GB, MLN, Edinburgh
Do you want to make a real difference to real people's lives? Want to design and build fair and explainable systems which automate recruitment processes across Amazon? Come and be part of a team that develops new machine learning (ML) technologies, which help Amazon scale for its customers by recruiting diverse teams. Join our Recommendations team within Intelligent Talent Acquisition (ITA) where you’ll build machine learning products that transform how job seekers find opportunities and recruiters discover talent. You’ll develop sophisticated recommendation systems powering both Amazon Jobs and internal hiring platforms, operating at global scale to match the right people with the right positions. Using techniques including representation learning, reinforcement learning, and probabilistic modeling, your work will directly improve efficiency for recruiters and help candidates find their ideal roles. This position offers the chance to solve complex problems with significant impact by creating systems that make Amazon’s entire hiring ecosystem more effective while collaborating with scientists across the organization. Key job responsibilities - Design and implement machine learning models that power recommendation systems for job seekers and recruiters, ensuring high performance, scalability, and reliability at global scale. Our ideal candidate has a strong scientific foundation and experience of statistical analysis and model building and has a passion for fairness and explainability in ML systems. - Collaborate with engineers, scientists, and product managers to define requirements, create solutions, and deliver products that improve the hiring experience. - Participate in the full software development lifecycle including scoping, design, coding, testing, documentation, deployment, and maintenance of recommendation systems and ML models. - Solve complex ML problems using optimal data structures and algorithms, making thoughtful trade-offs between efficiency and maintainability. - Stay current with scientific literature and develop novel approaches that address business challenges in talent acquisition. You will have the opportunity to provide feedback on scientific work across the organization helping the entire Intelligent Talent Acquisition organization improve. A day in the life You might spend the morning reviewing a colleague’s code for a new recommendation algorithm feature, then collaborate with product managers to refine requirements for an upcoming enhancement. After lunch, you’ll dive into model development, analyzing performance metrics from recent A/B tests and implementing improvements to the job-seeker recommendation pipeline. Throughout the day, you’ll participate in scientific discussions with peers across the organization, providing valuable feedback while continuing to refine your expertise. About the team The Recommendations team is a hybrid group of software engineers and applied scientists located in Edinburgh. We build tools that match people to jobs and jobs to people, optimizing experiences for both recruiters and candidates. Our work directly impacts Amazon’s ability to find and hire exceptional talent globally. The team maintains a collaborative environment with regular knowledge sharing and mentorship opportunities. We work closely with our product teams to understand business needs and develop innovative scientific solutions that improve hiring outcomes across both industry and student requisitions worldwide.