How AWS uses graph neural networks to meet customer needs

Information extraction, drug discovery, and software analysis are just a few applications of this versatile tool.

Graphs are an information-rich way to represent data. A graph consists of nodes — typically represented by circles — and edges — typically represented as line segments between nodes. In a knowledge graph, for instance, the nodes represent entities, and the edges represent relationships between them. In a social graph, the nodes represent people, and an edge indicates that two of those people know each other.

At Amazon Web Services, the use of machine learning (ML) to make the information encoded in graphs more useful to our customers has been a major research focus. In this post, we’ll showcase a variety of graph ML applications that customers have developed in collaboration with AWS scientists, from malicious-account detection and automated document processing to knowledge-graph-assisted drug discovery and protein property prediction.

Introduction to graph learning

Graphs can be homogenous, meaning the nodes represent a single type of entity (say, airports), and the edges represent a single type of relationship (say, scheduled flights). Or they can be heterogeneous, meaning they integrate multiple types of relationships among different entities, such as a graph of customers and products connected by both purchase histories and interests, or a knowledge graph of drugs, diseases, genes, and biological pathways connected by relationships such as indication and regulation. Nodes are often associated with data features, such as a product’s price or text description.

Heterogeneous knowledge graph
In a heterogenous knowledge graph, nodes can represent different classes of objects.

Graph neural networks

In the past 10 years, deep learning has revolutionized a host of AI applications, from natural-language processing to speech synthesis to computer vision.

Graph neural networks (GNNs) extend the performance benefits of deep learning to graph data. Like other popular neural networks, a GNN model has a series of layers, which progress toward higher levels of abstraction.

For instance, the first layer of a GNN computes a representation — or embedding — of the data represented by each node in the graph, while the second layer computes a representation of each node based on the prior embedding and the embeddings of the node’s nearest neighbors. In this way, every layer expands the scope of a node’s embedding, from one-hop neighbors, to two-hop neighbors, and for some applications, even further.

Graph neural network
A demonstration of how graph neural networks use recursive embedding to condense all the information in a two-hop graph into a single vector. Relationships between entities — such as "produce" and "write" in a movie database (red and yellow arrows, respectively) — are encoded in the level-0 embeddings of the entities themselves (red and orange blocks).
Stacy Reilly

GNN tasks

The individual node embeddings can then be used for node-level tasks, such as predicting properties of a node. The embeddings can also be used for higher-level inferences. For instance, using representations across a pair of nodes or across all nodes from the graph, GNNs can perform link-level or graph-level tasks, respectively.

Related content
Amazon’s George Karypis will give a keynote address on graph neural networks, a field in which “there is some fundamental theoretical stuff that we still need to understand.”

In this section, we demonstrate the versatility of GNNs across all three levels of tasks and examine how our customers are using GNNs to tackle a variety of problems.

Node-level tasks

Using GNNs, we can infer the behavior of an individual node in the graph based on the relationships it has to other nodes. One common task is node classification, where the objective is to infer nodes’ missing labels by looking at their neighbors’ labels and features. This method is used in applications such as financial-fraud detection, publication categorization, and disease classification.

In AWS, we have successfully used Amazon Neptune and Deep Graph Library (DGL) to apply GNN node representation learning to customers’ fraud detection use cases. For a large e-commerce sports gadgets customer, for instance, scientists in the Amazon Machine Learning Solutions Lab successfully used GNN models implemented in DGL to detect malicious accounts among billions of registered accounts.

Fraud graph.png
An example of how a graph representation can be used to detect fraud.

These malicious accounts were created in large quantities to abuse usage of promotional codes and block general public access to the vendor’s best-selling items. Using data from e-commerce sites, we built a massive heterogenous graph in which the nodes represented accounts and other entities, such as products purchased, and the edges connected nodes based on usage histories. To identify malicious accounts, we trained a GNN model to propagate labels from accounts that were known to be malicious to unlabeled accounts.

With this method, we were able to detect 10 times as many malicious accounts as a previous rule-based detection method could. Such performance improvements could not be achieved by traditional methods for doing machine learning on tabular datasets, such as CatBoost, which take only account features as inputs, without considering the relationships between accounts captured by the graph.

Besides applications for inherently relational, graph-structured data, such as social-network and citation-network data, there have been extensions of GNNs for data normally presented in Euclidean space, such as images and texts. By transforming data in Euclidean space to graphs based on spatial proximity, GNNs can solve problems that are typically solved by convolutional neural networks (CNNs) and recurrent neural networks (RNNs), which were designed to handle visual data and sequential data.

Related content
New method enables two- to 14-fold speedups over best-performing predecessors.

For example, researchers have explored GNN models to improve the accuracy of information extraction, a task typically handled by RNNs. GNNs turn out to be better at incorporating the nonlocal and nonsequential relationships captured by graph representations of word dependencies.

In a recent collaboration, the Amazon Machine Learning Solutions Lab and United Airlines developed a customized GNN model (DocGCN) to improve the accuracy of automatic information extraction from self-uploaded passenger documents, including travel documents, COVID-19 test results, and vaccine cards. The team built a graph for each scanned travel document that connected textual units based on their spatial proximities and orientations in the document.

Then, the DocGCN model reasoned over the relationships among textual units (nodes of the graph) to improve the identification of relevant textual information. DocGCN also generalized to complex forms with different formats by leveraging graphs to capture relationships between texts in tables, key-value pairs, and paragraphs. This improvement expedited the automation of international travel readiness verification.

Link-level tasks

Another important learning task in graphs is link prediction, which is central to applications such as product or ad recommendation and friendship suggestion. Given two nodes and a relation, the goal is to determine whether the nodes are connected by the relation.

Typically, the prediction is provided by a decoder that consumes the embeddings of the source and destination nodes, as in the work on knowledge graph embedding at scale that members of our team presented at SIGIR 2020. The decoder is trained to correctly predict existing edges in the graph.

DRKG.png
The high-level structure of DRKG. Numerals indicate the number of different types of relationships between classes of entities; terms between parentheses are examples of those relationships.
Credit: Glynis Condon

An exciting opportunity area in this context is drug discovery. AWS has recently provided a drug-repurposing knowledge graph (DRKG) that employs link prediction to identify new targets for existing drugs. Built by scientists at AWS, DRKG is a comprehensive biological knowledge graph that relates human genes, chemical compounds, biological processes, drug side effects, diseases, and symptoms. By performing link prediction around COVID-19 in DRKG, researchers were able to identify 41 drugs that were potentially effective against COVID-19 — 11 of which were already in clinical trials.

AWS also publicly released this solution, built by leveraging DRKG, as the COVID-19 Knowledge Graph (CKG). CKG organizes and represents the information in the COVID-19 Open Research Dataset (CORD-19), enabling fast discovery and prioritization of drug candidates. It can also be employed to identify papers relevant to COVID-19, thereby reducing the scale of human effort required to study, summarize, and interpret findings relevant to the pandemic.

Graph-level tasks

Graph-level tasks involve the analysis of large collections of small and independent graphs. A chemical library of organic compounds is a common example of a graph-level application, where each organic compound is represented as a graph of atoms connected by chemical bonds. Graph-level analyses of chemical libraries are often vital for drug development and discovery use cases; applications include predicting organic compounds’ chemical properties and predicting biological activities such as binding affinity to protein targets.

Code graph.png
An example of a program dependence graph.

Another example of data that can benefit from graph-level representation is code snippets in programming languages. A piece of code can be represented by a program dependence graph (PDG), where variables, operators, and statements are nodes connected by their dependencies (links).

At PAKDD 2021, we presented a new method for using GNNs to represent code snippets. Recently, we have been using that method to identify similar code snippets, to find opportunities to make code more modular and easier to maintain.

GNNs can also be used to encode global properties of the underlying systems and incorporate them into graph embeddings, in a way that is difficult with other deep-learning methods. We recently worked with scientists from Janssen Biopharmaceuticals to predict the function of proteins from their 3-D structure, which is useful for research and development in the pharmaceutical and biotech industries.

A protein is composed of a sequence of amino acids folded in a particular way. We developed a graph representation of proteins in which each node was an amino acid, and the interactions between amino acids in the folded protein structure determined whether two nodes were linked or not.

Protein graphs.png
Examples of graph representations of proteins.

This allowed us to encode fine-grained biological information, including the distance, angle, and direction of contact between neighboring amino acid residues. When we combined a GNN trained on these graph representations with a model trained to parse billions of protein sequences, we improved performance on various protein function prediction tasks of real-world importance.

Graph-level tasks for GNNs have different data-engineering requirements than the previous tasks. Node-level and link-level tasks usually operate on a single giant graph, whereas graph-level tasks operate on a large number of independent small graphs.

To help customers scale GNNs up for graph-level tasks, we developed a cloud-based architecture that leverages the highly performant open-source GNN library DGL, the ML resource orchestration tool SageMaker, and Amazon DocumentDB for managing graph data.

Getting started on your GNN journey

Related content
Approach that uses a hierarchical graph neural network improves F-score by 49% relative to predecessors.

In this article, we presented a few examples of GNN applications at all three levels of graph-related tasks to showcase the value of GNNs to various enterprise and research problems. AWS provides several options for customers looking to build and deploy GNN-powered ML solutions. Customers looking to get started quickly can use Amazon Neptune ML to build GNN models directly on graph data stored in Amazon Neptune without writing any code. Amazon Neptune ML can train models to tackle node-level and link-level tasks like those described above. Customers looking to get more hands-on can implement GNN models using DGL on Amazon SageMaker. In the meantime, we will continue to advance the science of GNNs to build more products and solutions to make GNNs more accessible to all our customers.

Acknowledgments: Guang Yang, Soji Adeshina, Jasleen Grewal, Miguel Romero Calvo, Suchitra Sathyanarayana

Research areas

Related content

US, MA, N.reading
Amazon Industrial Robotics is seeking exceptional talent to help develop the next generation of advanced robotics systems that will transform automation at Amazon's scale. We're building revolutionary robotic systems that combine cutting-edge AI, sophisticated control systems, and advanced mechanical design to create adaptable automation solutions capable of working safely alongside humans in dynamic environments. This is a unique opportunity to shape the future of robotics and automation at an unprecedented scale, working with world-class teams pushing the boundaries of what's possible in robotic dexterous manipulation, locomotion, and human-robot interaction. This role presents an opportunity to shape the future of robotics through innovative applications of deep learning and large language models. At Amazon Industrial Robotics we leverage advanced robotics, machine learning, and artificial intelligence to solve complex operational challenges at an unprecedented scale. Our fleet of robots operates across hundreds of facilities worldwide, working in sophisticated coordination to fulfill our mission of customer excellence. We are pioneering the development of dexterous manipulation system that: - Enables unprecedented generalization across diverse tasks - Enables contact-rich manipulation in different environments - Seamlessly integrates low-level skills and high-level behaviors - Leverage mechanical intelligence, multi-modal sensor feedback and advanced control techniques. The ideal candidate will contribute to research that bridges the gap between theoretical advancement and practical implementation in robotics. You will be part of a team that's revolutionizing how robots learn, adapt, and interact with their environment. Join us in building the next generation of intelligent robotics systems that will transform the future of automation and human-robot collaboration. Key job responsibilities - Design and implement methods for dexterous manipulation - Design and implement methods for use of dexterous end effectors with force and tactile sensing - Develop a hierarchical system that combines low-level control with high-level planning - Utilize state-of-the-art manipulation models and optimal control techniques
IN, HR, Gurugram
Lead ML teams building large-scale forecasting and optimization systems that power Amazon’s global transportation network and directly impact customer experience and cost. As an Applied Science Manager, you will set scientific direction, mentor applied scientists, and partner with engineering and product leaders to deliver production-grade ML solutions at massive scale. Key job responsibilities 1. Lead and grow a high-performing team of Applied Scientists, providing technical guidance, mentorship, and career development. 2. Define and own the scientific vision and roadmap for ML solutions powering large-scale transportation planning and execution. 3. Guide model and system design across a range of techniques, including tree-based models, deep learning (LSTMs, transformers), LLMs, and reinforcement learning. 4. Ensure models are production-ready, scalable, and robust through close partnership with stakeholders. Partner with Product, Operations, and Engineering leaders to enable proactive decision-making and corrective actions. 5. Own end-to-end business metrics, directly influencing customer experience, cost optimization, and network reliability. 6. Help contribute to the broader ML community through publications, conference submissions, and internal knowledge sharing. A day in the life Your day includes reviewing model performance and business metrics, guiding technical design and experimentation, mentoring scientists, and driving roadmap execution. You’ll balance near-term delivery with long-term innovation while ensuring solutions are robust, interpretable, and scalable. Ultimately, your work helps improve delivery reliability, reduce costs, and enhance the customer experience at massive scale.
IL, Haifa
Come join the AWS Agentic AI science team in building the next generation models for intelligent automation. AWS, the world-leading provider of cloud services, has fostered the creation and growth of countless new businesses, and is a positive force for good. Our customers bring problems that will give Applied Scientists like you endless opportunities to see your research have a positive and immediate impact in the world. You will have the opportunity to partner with technology and business teams to solve real-world problems, have access to virtually endless data and computational resources, and to world-class engineers and developers that can help bring your ideas into the world. As part of the team, we expect that you will develop innovative solutions to hard problems, and publish your findings at peer reviewed conferences and workshops. We are looking for world class researchers with experience in one or more of the following areas - autonomous agents, API orchestration, Planning, large multimodal models (especially vision-language models), reinforcement learning (RL) and sequential decision making.
AT, Graz
Are you a MS or PhD student interested in a 2026 internship in the field of machine learning, deep learning, generative AI, large language models and speech technology, robotics, computer vision, optimization, operations research, quantum computing, automated reasoning, or formal methods? If so, we want to hear from you! We are looking for students interested in using a variety of domain expertise to invent, design and implement state-of-the-art solutions for never-before-solved problems. You can find more information about the Amazon Science community as well as our interview process via the links below; https://www.amazon.science/ https://amazon.jobs/content/en/career-programs/university/science https://amazon.jobs/content/en/how-we-hire/university-roles/applied-science Key job responsibilities As an Applied Science Intern, you will own the design and development of end-to-end systems. You’ll have the opportunity to write technical white papers, create roadmaps and drive production level projects that will support Amazon Science. You will work closely with Amazon scientists and other science interns to develop solutions and deploy them into production. You will have the opportunity to design new algorithms, models, or other technical solutions whilst experiencing Amazon’s customer focused culture. The ideal intern must have the ability to work with diverse groups of people and cross-functional teams to solve complex business problems. A day in the life At Amazon, you will grow into the high impact person you know you’re ready to be. Every day will be filled with developing new skills and achieving personal growth. How often can you say that your work changes the world? At Amazon, you’ll say it often. Join us and define tomorrow. Some more benefits of an Amazon Science internship include; • All of our internships offer a competitive stipend/salary • Interns are paired with an experienced manager and mentor(s) • Interns receive invitations to different events such as intern program initiatives or site events • Interns can build their professional and personal network with other Amazon Scientists • Interns can potentially publish work at top tier conferences each year About the team Applicants will be reviewed on a rolling basis and are assigned to teams aligned with their research interests and experience prior to interviews. Start dates are available throughout the year and durations can vary in length from 3-6 months for full time internships. This role may available across multiple locations in the EMEA region (Austria, Estonia, France, Germany, Ireland, Israel, Italy, Jordan, Luxembourg, Netherlands, Poland, Romania, Spain, South Africa, UAE, and UK). Please note these are not remote internships.
IL, Haifa
Are you a scientist interested in pushing the state of the art in Information Retrieval, Large Language Models and Recommendation Systems? Are you interested in innovating on behalf of millions of customers, helping them accomplish their every day goals? Do you wish you had access to large datasets and tremendous computational resources? Do you want to join a team of capable scientist and engineers, building the future of e-commerce? Answer yes to any of these questions, and you will be a great fit for our team at Amazon. Our team is part of Amazon’s Personalization organization, a high-performing group that leverages Amazon’s expertise in machine learning, generative AI, large-scale data systems, and user experience design to deliver the best shopping experiences for our customers. Our team builds large-scale machine-learning solutions that delight customers with personalized and up-to-date recommendations that are related to their interests. We are a team uniquely placed within Amazon, to have a direct window of opportunity to influence how customers will think about their shopping journey in the future. 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, information retrieval 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. Please visit https://www.amazon.science for more information.
IL, Haifa
Are you a scientist interested in pushing the state of the art in Information Retrieval, Large Language Models and Recommendation Systems? Are you interested in innovating on behalf of millions of customers, helping them accomplish their every day goals? Do you wish you had access to large datasets and tremendous computational resources? Do you want to join a team of capable scientist and engineers, building the future of e-commerce? Answer yes to any of these questions, and you will be a great fit for our team at Amazon. Our team is part of Amazon’s Personalization organization, a high-performing group that leverages Amazon’s expertise in machine learning, generative AI, large-scale data systems, and user experience design to deliver the best shopping experiences for our customers. Our team builds large-scale machine-learning solutions that delight customers with personalized and up-to-date recommendations that are related to their interests. We are a team uniquely placed within Amazon, to have a direct window of opportunity to influence how customers will think about their shopping journey in the future. 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, information retrieval 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. Please visit https://www.amazon.science for more information.
US, CA, San Francisco
If you are interested in this position, please apply on Twitch's Career site https://www.twitch.tv/jobs/en/ About Us: Twitch is the world’s biggest live streaming service, with global communities built around gaming, entertainment, music, sports, cooking, and more. It is where thousands of communities come together for whatever, every day. We’re about community, inside and out. You’ll find coworkers who are eager to team up, collaborate, and smash (or elegantly solve) problems together. We’re on a quest to empower live communities, so if this sounds good to you, see what we’re up to on LinkedIn and X, and discover the projects we’re solving on our Blog. Be sure to explore our Interviewing Guide to learn how to ace our interview process. About the Role We are looking for an experienced Data Scientist to support our central analytics and finance disciplines at Twitch. Bringing to bear a mixture of data analysis, dashboarding, and SQL query skills, you will use data-driven methods to answer business questions, and deliver insights that deepen understanding of our viewer behavior and monetization performance. Reporting to the VP of Finance, Analytics, and Business Operations, your team will be located in San Francisco. Our team is based in San Francisco, CA. You Will - Create actionable insights from data related to Twitch viewers, creators, advertising revenue, commerce revenue, and content deals. - Develop dashboards and visualizations to communicate points of view that inform business decision-making. - Create and maintain complex queries and data pipelines for ad-hoc analyses. - Author narratives and documentation that support conclusions. - Collaborate effectively with business partners, product managers, and data team members to align data science efforts with strategic goals. Perks * Medical, Dental, Vision & Disability Insurance * 401(k) * Maternity & Parental Leave * Flexible PTO * Amazon Employee Discount
IL, Tel Aviv
Are you a scientist interested in pushing the state of the art in Information Retrieval, Large Language Models and Recommendation Systems? Are you interested in innovating on behalf of millions of customers, helping them accomplish their every day goals? Do you wish you had access to large datasets and tremendous computational resources? Do you want to join a team of capable scientist and engineers, building the future of e-commerce? Answer yes to any of these questions, and you will be a great fit for our team at Amazon. Our team is part of Amazon’s Personalization organization, a high-performing group that leverages Amazon’s expertise in machine learning, generative AI, large-scale data systems, and user experience design to deliver the best shopping experiences for our customers. Our team builds large-scale machine-learning solutions that delight customers with personalized and up-to-date recommendations that are related to their interests. We are a team uniquely placed within Amazon, to have a direct window of opportunity to influence how customers will think about their shopping journey in the future. 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, information retrieval 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. Please visit https://www.amazon.science for more information.
IN, HR, Gurugram
Lead ML teams building large-scale forecasting and optimization systems that power Amazon’s global transportation network and directly impact customer experience and cost. As an Sr Applied Scientist, you will set scientific direction, mentor applied scientists, and partner with engineering and product leaders to deliver production-grade ML solutions at massive scale. Key job responsibilities 1. Lead and grow a high-performing team of Applied Scientists, providing technical guidance, mentorship, and career development. 2. Define and own the scientific vision and roadmap for ML solutions powering large-scale transportation planning and execution. 3. Guide model and system design across a range of techniques, including tree-based models, deep learning (LSTMs, transformers), LLMs, and reinforcement learning. 4. Ensure models are production-ready, scalable, and robust through close partnership with stakeholders. Partner with Product, Operations, and Engineering leaders to enable proactive decision-making and corrective actions. 5. Own end-to-end business metrics, directly influencing customer experience, cost optimization, and network reliability. 6. Help contribute to the broader ML community through publications, conference submissions, and internal knowledge sharing. A day in the life Your day includes reviewing model performance and business metrics, guiding technical design and experimentation, mentoring scientists, and driving roadmap execution. You’ll balance near-term delivery with long-term innovation while ensuring solutions are robust, interpretable, and scalable. Ultimately, your work helps improve delivery reliability, reduce costs, and enhance the customer experience at massive scale.
US, WA, Seattle
Amazon Prime is looking for an ambitious Economist to help create econometric insights for world-wide Prime. Prime is Amazon's premiere membership program, with over 200M members world-wide. This role is at the center of many major company decisions that impact Amazon's customers. These decisions span a variety of industries, each reflecting the diversity of Prime benefits. These range from fast-free e-commerce shipping, digital content (e.g., exclusive streaming video, music, gaming, photos), reading, healthcare, and grocery offerings. Prime Science creates insights that power these decisions. As an economist in this role, you will create statistical tools that embed causal interpretations. You will utilize massive data, state-of-the-art scientific computing, econometrics (causal, counterfactual/structural, experimentation), and machine-learning, to do so. Some of the science you create will be publishable in internal or external scientific journals and conferences. You will work closely with a team of economists, applied scientists, data professionals (business analysts, business intelligence engineers), product managers, and software/data engineers. You will create insights from descriptive statistics, as well as from novel statistical and econometric models. You will create internal-to-Amazon-facing automated scientific data products to power company decisions. You will write strategic documents explaining how senior company leaders should utilize these insights to create sustainable value for customers. These leaders will often include the senior-most leaders at Amazon. The team is unique in its exposure to company-wide strategies as well as senior leadership. It operates at the research frontier of utilizing data, econometrics, artificial intelligence, and machine-learning to form business strategies. A successful candidate will have demonstrated a capacity for building, estimating, and defending statistical models (e.g., causal, counterfactual, machine-learning) using software such as R, Python, or STATA. They will have a willingness to learn and apply a broad set of statistical and computational techniques to supplement deep training in one area of econometrics. For example, many applications on the team motivate the use of structural econometrics and machine-learning. They rely on building scalable production software, which involves a broad set of world-class software-building skills often learned on-the-job. As a consequence, already-obtained knowledge of SQL, machine learning, and large-scale scientific computing using distributed computing infrastructures such as Spark-Scala or PySpark would be a plus. Additionally, this candidate will show a track-record of delivering projects well and on-time, preferably in collaboration with other team members (e.g. co-authors). Candidates must have very strong writing and emotional intelligence skills (for collaborative teamwork, often with colleagues in different functional roles), a growth mindset, and a capacity for dealing with a high-level of ambiguity. Endowed with these traits and on-the-job-growth, the role will provide the opportunity to have a large strategic, world-wide impact on the customer experiences of Prime members.