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, VA, Arlington
As a Survey Research Scientist within the Reputation Marketing & Insights team, your primary responsibility will be to help manage our employee communications research program, including a global tracking survey. The work will challenge you to be resourceful, think big while staying connected to the details, translate survey, focus group results, and advanced analytics into strategic direction, and embrace a high degree of change and ambiguity at speed. The scope and scale of what we strive to achieve is immense, but it is also meaningful and energizing. This is an individual contributor role. The right candidate possesses endless curiosity and passion for understanding employee perceptions and what drives them. You have end-to-end experience conducting qualitative research, robust large-scale surveys, campaign measurement, as well as advanced modeling skills to uncover perception drivers. You have proficiency in diving deep into large amounts of data and translating research into actionable insights/recommendations for internal communicators. You are an excellent writer who can effectively communicate data-driven insights and recommendations through written documents, presentations, and other internal communication channels. You are a creative problem-solver who seeks to deeply understand the business/communications so you can tailor research that informs stakeholder decision making and strategic messaging tactics. Key job responsibilities - Design and manage the execution of a global tracking survey focused on employee communications - Develop research to identify and test messages to drive employee perceptions - Use advanced statistical methodologies to better understand the relationship between key internal communications metrics and other related measures of perception (e.g., regression, structural equation modeling, latent growth curve modeling, Shapley analysis, etc.) - Develop causal and semi-causal measurement techniques to evaluate the perception impact of internal communications campaigns - Identify opportunities to simplify existing research processes and operate more nimbly - Engage in strategic discussions with internal partner teams to ensure our research generates actionable and on-point findings About the team This team sits within the CCR organization. Our focus is on conducting research that identifies messaging opportunities and informs communication strategies for Amazon as a brand.
US, CA, Santa Clara
Want to work on frontier, world class, AI-powered experiences for health customers and health providers? The Health Science & Analytics group in Amazon's Health Store & Technology organization is looking for a Senior Manager of Applied Science to lead a group of applied scientists and engineers to work hand in hand with physicians to build the future of AI-powered healthcare experiences. We have an ambitious roadmap which includes scaling recently launched products which are already delighting products and the opportunity to build disruptive, new experiences. This role will be responsible for leading the science and technology teams driving these key innovations on behalf of our customers. Key job responsibilities - Independently manage a team of scientists and engineers to sustainably deliver science driven products. - Define the vision and long-term technical roadmap to achieve multi-year business objectives. - Maintain and raise the science bar of the team’s deliverables and keep the broader Amazon Health Services organization apprised of the latest relevant technical developments in the field. - Work across business, clinical, and technical leaders to disambiguate product requirements and socialize progress towards key goals and deliverables. - Proactively identify risks and shape the technical roadmap in anticipation of industry trends in emerging AI subfields.
US, NY, New York
The Artificial General Intelligence (AGI) team is looking for a passionate, talented, and inventive Senior Applied Scientist to work on pre-training methodologies for Generative Artificial Intelligence (GenAI) models. You will interact closely with our customers and with the academic and research communities. Key job responsibilities Join us to work as an integral part of a team that has experience with GenAI models in this space. We work on these areas: - Scaling laws - Hardware-informed efficient model architecture, low-precision training - Optimization methods, learning objectives, curriculum design - Deep learning theories on efficient hyperparameter search and self-supervised learning - Learning objectives and reinforcement learning methods - Distributed training methods and solutions - AI-assisted research About the team The AGI team has a mission to push the envelope in GenAI with Large Language Models (LLMs) and multimodal systems, in order to provide the best-possible experience for our customers.
US, WA, Seattle
Prime Video is a first-stop entertainment destination offering customers a vast collection of premium programming in one app available across thousands of devices. Prime members can customize their viewing experience and find their favorite movies, series, documentaries, and live sports – including Amazon MGM Studios-produced series and movies; licensed fan favorites; and programming from Prime Video add-on subscriptions such as Apple TV+, Max, Crunchyroll and MGM+. All customers, regardless of whether they have a Prime membership or not, can rent or buy titles via the Prime Video Store, and can enjoy even more content for free with ads. Are you interested in shaping the future of entertainment? Prime Video's technology teams are creating best-in-class digital video experience. As a Prime Video technologist, you’ll have end-to-end ownership of the product, user experience, design, and technology required to deliver state-of-the-art experiences for our customers. You’ll get to work on projects that are fast-paced, challenging, and varied. You’ll also be able to experiment with new possibilities, take risks, and collaborate with remarkable people. We’ll look for you to bring your diverse perspectives, ideas, and skill-sets to make Prime Video even better for our customers. With global opportunities for talented technologists, you can decide where a career Prime Video Tech takes you! Key job responsibilities - Develop ML models for various recommendation & search systems using deep learning, online learning, and optimization methods - Work closely with other scientists, engineers and product managers to expand the depth of our product insights with data, create a variety of experiments to determine the high impact projects to include in planning roadmaps - Stay up-to-date with advancements and the latest modeling techniques in the field - Publish your research findings in top conferences and journals A day in the life We're using advanced approaches such as foundation models to connect information about our videos and customers from a variety of information sources, acquiring and processing data sets on a scale that only a few companies in the world can match. This will enable us to recommend titles effectively, even when we don't have a large behavioral signal (to tackle the cold-start title problem). It will also allow us to find our customer's niche interests, helping them discover groups of titles that they didn't even know existed. We are looking for creative & customer obsessed machine learning scientists who can apply the latest research, state of the art algorithms and ML to build highly scalable page personalization solutions. You'll be a research leader in the space and a hands-on ML practitioner, guiding and collaborating with talented teams of engineers and scientists and senior leaders in the Prime Video organization. You will also have the opportunity to publish your research at internal and external conferences.
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. You can work in San Francisco, CA or Seattle, WA. Perks - Medical, Dental, Vision & Disability Insurance - 401(k) - Maternity & Parental Leave - Flexible PTO - Amazon Employee Discount
IN, KA, Bengaluru
AWS Infrastructure Services owns the design, planning, delivery, and operation of all AWS global infrastructure. In other words, we’re the people who keep the cloud running. We support all AWS data centers and all of the servers, storage, networking, power, and cooling equipment that ensure our customers have continual access to the innovation they rely on. We work on the most challenging problems, with thousands of variables impacting the supply chain — and we’re looking for talented people who want to help. You’ll join a diverse team of software, hardware, and network engineers, supply chain specialists, security experts, operations managers, and other vital roles. You’ll collaborate with people across AWS to help us deliver the highest standards for safety and security while providing seemingly infinite capacity at the lowest possible cost for our customers. And you’ll experience an inclusive culture that welcomes bold ideas and empowers you to own them to completion. Do you love problem solving? Are you looking for real world Supply Chain challenges? Do you have a desire to make a major contribution to the future, in the rapid growth environment of Cloud Computing? Amazon Web Services is looking for a highly motivated, Data Scientist to help build scalable, predictive and prescriptive business analytics solutions that supports AWS Supply Chain and Procurement organization. You will be part of the Supply Chain Analytics team working with Global Stakeholders, Data Engineers, Business Intelligence Engineers and Business Analysts to achieve our goals. We are seeking an innovative and technically strong data scientist with a background in optimization, machine learning, and statistical modeling/analysis. This role requires a team member to have strong quantitative modeling skills and the ability to apply optimization/statistical/machine learning methods to complex decision-making problems, with data coming from various data sources. The candidate should have strong communication skills, be able to work closely with stakeholders and translate data-driven findings into actionable insights. The successful candidate will be a self-starter, comfortable with ambiguity, with strong attention to detail and ability to work in a fast-paced and ever-changing environment. Key job responsibilities 1. Demonstrate thorough technical knowledge on feature engineering of massive datasets, effective exploratory data analysis, and model building using industry standard time Series Forecasting techniques like ARIMA, ARIMAX, Holt Winter and formulate ensemble model. 2. Proficiency in both Supervised(Linear/Logistic Regression) and UnSupervised algorithms(k means clustering, Principle Component Analysis, Market Basket analysis). 3. Experience in solving optimization problems like inventory and network optimization . Should have hands on experience in Linear Programming. 4. Work closely with internal stakeholders like the business teams, engineering teams and partner teams and align them with respect to your focus area 5. Detail-oriented and must have an aptitude for solving unstructured problems. You should work in a self-directed environment, own tasks and drive them to completion. 6. Excellent business and communication skills to be able to work with business owners to develop and define key business questions and to build data sets that answer those questions 7. Work with distributed machine learning and statistical algorithms to harness enormous volumes of data at scale to serve our customers About the team Diverse Experiences Amazon values diverse experiences. Even if you do not meet all of the preferred qualifications and skills listed in the job description, we encourage candidates to apply. If your career is just starting, hasn’t followed a traditional path, or includes alternative experiences, don’t let it stop you from applying. Why AWS Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform. We pioneered cloud computing and never stopped innovating — that’s why customers from the most successful startups to Global 500 companies trust our robust suite of products and services to power their businesses. Work/Life Balance We value work-life harmony. Achieving success at work should never come at the expense of sacrifices at home, which is why we strive for flexibility as part of our working culture. When we feel supported in the workplace and at home, there’s nothing we can’t achieve. Inclusive Team Culture AWS values curiosity and connection. Our employee-led and company-sponsored affinity groups promote inclusion and empower our people to take pride in what makes us unique. Our inclusion events foster stronger, more collaborative teams. Our continual innovation is fueled by the bold ideas, fresh perspectives, and passionate voices our teams bring to everything we do. Mentorship and Career Growth We’re continuously raising our performance bar as we strive to become Earth’s Best Employer. That’s why you’ll find endless knowledge-sharing, mentorship and other career-advancing resources here to help you develop into a better-rounded professional.
US, NY, New York
Prime Video is a first-stop entertainment destination offering customers a vast collection of premium programming in one app available across thousands of devices. Prime members can customize their viewing experience and find their favorite movies, series, documentaries, and live sports – including Amazon MGM Studios-produced series and movies; licensed fan favorites; and programming from Prime Video add-on subscriptions such as Apple TV+, Max, Crunchyroll and MGM+. All customers, regardless of whether they have a Prime membership or not, can rent or buy titles via the Prime Video Store, and can enjoy even more content for free with ads. Are you interested in shaping the future of entertainment? Prime Video's technology teams are creating best-in-class digital video experience. As a Prime Video technologist, you’ll have end-to-end ownership of the product, user experience, design, and technology required to deliver state-of-the-art experiences for our customers. You’ll get to work on projects that are fast-paced, challenging, and varied. You’ll also be able to experiment with new possibilities, take risks, and collaborate with remarkable people. We’ll look for you to bring your diverse perspectives, ideas, and skill-sets to make Prime Video even better for our customers. With global opportunities for talented technologists, you can decide where a career Prime Video Tech takes you! We are looking for a self-motivated, passionate and resourceful Applied Scientist to bring diverse perspectives, ideas, and skill-sets to make Prime Video even better for our customers. You will spend your time as a hands-on machine learning practitioner and a research leader. You will play a key role on the team, building and guiding machine learning models from the ground up. At the end of the day, you will have the reward of seeing your contributions benefit millions of Amazon.com customers worldwide. Key job responsibilities - Develop AI solutions for various Prime Video Search systems using Deep learning, GenAI, Reinforcement Learning, 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 Prime Video Search Science team owns science solution to power search experience on various devices, from sourcing, relevance, ranking, to name a few. We work closely with the engineering teams to launch our solutions in production.
US, WA, Bellevue
Are you interested in a unique opportunity to advance the accuracy and efficiency of Artificial General Intelligence (AGI) systems? If so, you're at the right place! As a Quantitative Researcher on our team, you will be working at the intersection of mathematics, computer science, and finance, you will collaborate with a diverse team of engineers in a fast-paced, intellectually challenging environment where innovative thinking is encouraged and rewarded. We operate at Amazon's large scale with the energy of a nimble start-up. If you have a learner's mindset, enjoy solving challenging problems, and value an inclusive team culture, you will thrive in this role, and we hope to hear from you. Key job responsibilities * Conduct statistical analyses on web-scale datasets to develop state-of-the-art multimodal large language models * Conceptualize and develop mathematical models, data sampling and preparation strategies to continuously improve existing algorithms * Identify and utilize data sources to drive innovation and improvements to our LLMs About the team We are passionate engineers and scientists dedicated to pushing the boundaries of innovation. We evaluate and represent the customer perspective through accurate benchmarking.
US, WA, Bellevue
The Artificial General Intelligence (AGI) team is looking for a passionate, talented, and inventive Applied Scientist with a strong deep learning background, to help build industry-leading technology with Large Language Models (LLMs) and multimodal systems. Key job responsibilities As an Applied Scientist with the AGI team, you will work with world-class scientists and engineers to develop novel data, modeling and engineering solutions to support the responsible AI initiatives at AGI. Your work will directly impact our customers in the form of products and services that make use of audio technology. About the team While the rapid advancements in Generative AI have captivated global attention, we see these as just the starting point. Our team is dedicated to pushing the boundaries of what’s possible, leveraging Amazon’s unparalleled ML infrastructure, computing resources, and commitment to responsible AI principles. And Amazon’s leadership principle of customer obsession guides our approach, prioritizing our customers’ needs and preferences each step of the way.
US, CA, Sunnyvale
The Artificial General Intelligence (AGI) team is looking for a highly skilled and experienced Senior Applied Scientist, to lead the development and implementation of algorithms and models for supervised fine-tuning and reinforcement learning through human feedback; with a focus across text, image, and video modalities. As a Senior Applied Scientist, you will play a critical role in driving the development of Generative AI (Gen AI) technologies that can handle Amazon-scale use cases and have a significant impact on our customers' experiences. Key job responsibilities - Collaborate with cross-functional teams of engineers, product managers, and scientists to identify and solve complex problems in GenAI - Design and execute experiments to evaluate the performance of different algorithms and models, and iterate quickly to improve results - Think big about the arc of development of GenAI over a multi-year horizon, and identify new opportunities to apply these technologies to solve real-world problems - Communicate results and insights to both technical and non-technical audiences, including through presentations and written reports - Mentor and guide junior scientists and engineers, and contribute to the overall growth and development of the team