More reliable nearest-neighbor search with deep metric learning

Novel loss term that can be added to any loss function regularizes interclass and intraclass distances.

Many machine learning (ML) applications involve embedding data in a representation space, where the geometric relationships between embeddings carry semantic content. Performing a useful task often involves retrieving an embedding’s proximate neighbors in the space: for instance, the answer embeddings near a query embedding, the image embeddings near the embedding of a text description, the text embeddings in one language near a text embedding in another, and so on.

A popular way to ensure that retrieved examples accurately represent the intended semantics is deep metric learning, which is commonly used to train contrastive-learning models like the vision-language model CLIP. In deep metric learning, the ML model learns to structure the representation space according to a specified metric, so as to maximize the distinction between dissimilar training samples while promoting proximity among similar ones.

One drawback of deep metric learning (DML), however, is that both the distances between embeddings of the same class and the distances between different classes of embeddings can vary. This is a problem in many real-world applications, where you want a single distance threshold that meets specific false-positive and false-negative rate requirements. If both the interclass and intraclass distances vary, no single threshold is optimal in all cases. This can cause substantial deployment complexities in large-scale applications, as individual users may require distinct threshold settings.

Related content
New approach speeds graph-based search by 20% to 60%, regardless of graph construction method.

At this year’s International Conference on Learning Representations (ICLR), my colleagues and I presented a way to make the distances between DML embeddings more consistent, so that a single threshold will yield equitable fractions of relevant results across classes.

First, we propose a new evaluation metric for measuring DML models’ threshold consistency, called the operating-point-inconsistency score (OPIS), which we use to show that optimizing model accuracy does not optimize threshold consistency. Then we propose a new loss term, which can be added to any loss function and backbone architecture for training a DML model, that regularizes distances between both hard-positive intraclass and hard-negative interclass embeddings, to make distance thresholds more consistent. This helps to ensure consistent accuracy across customers, even amid significant variations in their query data.

To test our approach, we used four benchmark image retrieval datasets, and with each one we trained eight networks: four of the networks were residual networks, trained with two different loss functions, each with and without our added term; the other four were vision transformer networks, also trained with two different state-of-the-art DML loss functions, with and without our added term.

In the resulting 16 comparisons, the incorporation of our loss term notably enhanced threshold consistency across all experiments, reducing the OPIS inconsistency score by as much as 77.3%. The integration of our proposed loss also led to improved accuracy in 14 out of the 16 comparisons, with the greatest margin of improvement being 3.6% and the highest margin of diminishment being 0.2%.

Measuring consistency

DML models are typically trained using contrastive learning, in which the model receives pairs of inputs, which are either of the same class or of different classes. During training, the model learns an embedding scheme that pushes data of different classes apart from each other and pulls data of the same class together.

As the separation between classes increases, and the separation within classes decreases, you might expect that the embeddings for each class become highly compact, leading to a high degree of distance consistency across classes. But we show that this is not the case, even for models with very high accuracies.

Our evaluation metric, OPIS, relies on a utility score that measures a model’s accuracy at different threshold values. We use the standard F1 score, which factors in both the false-acceptance and false-rejection rate, where a weighting term can be added to emphasize one rate over the other.

Thousands of overlaid approximately-bell-shaped curves, with wide disparity in width, illustrating the difficulty of choosing a single threshold value optimizes utility for all of them.
Utility (U(d)) vs. threshold distance (d) for the iNaturalist dataset, in which the labeled data classes are animal species.

Then we define a range of threshold values, which we call the calibration range, which is typically based on the target performance metric in some way. For instance, it might be chosen so as to impose bounds on the false-acceptance or false-rejection rate. We then compute the average difference between the utility score for a given threshold choice and the average utility score over the complete range of threshold values. As can be seen in the graph of utility vs. threshold distance, the utility-threshold curve can vary significantly for different classes of data in the same dataset.

To gauge the relationship between performance and threshold consistency, we trained a series of models on the same dataset using a range of different loss functions and batch sizes. We found that, among the lower-accuracy models, there was indeed a correlation between accuracy and threshold consistency. But beyond an inflection point, improved performance came at the cost of less consistent thresholds.

Seven blue circles of different sizes, plotted on a plane whose axes are labeled "Threshold inconsistency (OPIS)" and "Recognition error". The three rightmost (highest-error) circles lie almost on a straight line, from upper right to lower left, which is approximated with a downward-pointing red arrow. The circles to the left of the red arrow, however, show a slight upward trend from right to left — that is, toward greater inconsistency, as the error rate goes down. Connected to four of the circles by dotted lines are four red triangles, representing versions of the same models trained using the TCM loss. In all four cases, the triangles are closer to both the x-axis and the y-axis than the associated circles, indicating lower error and greater consistency in threshold distance.
Threshold consistency vs. recognition error for two different models trained using five different loss functions and varied batch sizes. Circles represent models trained using the basic form of the loss function; triangles represent models trained with our additional loss term. Arrows indicate the correlations between increasing accuracy and threshold consistency.

Better threshold consistency

To improve threshold consistency, we introduce a new regularization loss for DML training, called the threshold-consistent margin (TCM) loss. TCM has two parameters. The first is a positive margin for mining hard positive data pairs, where “hard” denotes data items of the same class with small cosine similarity (i.e., they’re so dissimilar that it is hard to assign them to the same class). The second is a negative margin for mining hard negative data pairs, where “hard” indicates data points of different classes with high cosine similarity (i.e., they’re so similar that it is hard to assign them to different classes).

Related content
New loss functions enable better approximation of the optimal loss and more-useful representations of multimodal data.

After mining these hard pairs, the loss term imposes a penalty that’s proportional to the difference between the measured distance and the parameter for the hard pairs exclusively. Like the calibration range, these values can be designed to enforce bounds on the false-acceptance of false-rejection rates — although, because of distribution drift between training and test sets, we do recommend that they be tuned to the data.

In other words, our TCM loss term serves as a “local inspector" by selectively adjusting hard samples to prevent overseparateness and excessive compactness in the vicinity of the boundaries between classes. As can be seen in the figure below, which compares the utility-threshold curves for a model trained using our loss function to one trained without it, our regularization term improves the consistency of threshold distances across data classes.

The superimposed curves from above, now paired with a second set of curves, whose disparity in width is less pronounced. The first set is labeled as having been produced using the Smooth-AP loss function, the second set as having been produced using Smooth-AP and TCM.
Utility (U(d)) vs. threshold distance (d) for the iNaturalist dataset, before and after the use of our additional loss term (TCM).

Below are the results of our experiments on four benchmark datasets, using two models for each and two versions of two loss functions for each model:

TCM results.png
The results of our experiments. Performance is measured according to recall for the top-scoring results (R@1); we also report change in OPIS and change in 10%-OPIS, meaning the difference in OPIS between the worst-performing 10% of data and the remaining 90%. We report results only for models trained with our loss term; the absolute change in performance relative to models trained without our loss term is recorded in red or green, with arrows indicating direction of change.

We also conducted a toy experiment using the MNIST dataset of hand-drawn digits to visualize the effect of our proposed TCM regularization, where the task was to learn to group examples of the same digit together. The addition of our loss term led to more compact class clusters and clearer separation between clusters, as can be seen in the visualization below:

Two figures consisting of 10 symmetrically spaced arrows of equal length radiating out from a point on a blue field. Each arrow is labeled with one of the digits 0 through 9, and the tip of each arrow is surrounded by a reddish oval. In the image at left, the ovals for the number pairs 4 and 9, 8 and 0, and 2 and 5 blur into each other at their edges. In the image at right, the ovals are more compact, and there are clear boundaries of blue between any two of them.
The results of adding our extra term to the ArcFace loss function during training on the MNIST dataset of hand-drawn digits. The color intensity conveys the probability density distribution of embeddings within each class, with higher density depicted in red.

The addition of our TCM loss term may not lead to dramatic improvements in every instance. But because it can be used, at no added computational cost, with any choice of model and any choice of loss function, the occasions are rare when it wouldn’t be worth trying.

Related content

US, WA, Seattle
MULTIPLE POSITIONS AVAILABLE Employer: AMAZON.COM SERVICES LLC Offered Position: Research Scientist II Job Location: Seattle, Washington Job Number: AMZ10564041 Position Responsibilities: Interact with various software and business groups to develop an understanding of their business requirements and operational processes. Utilize acquired knowledge and business judgment to build decision-supporting and operational tools to improve the bottom line. Build quantitative mathematical models to represent a wide range of supply chain, transportation and logistics systems. Implement these models and tools through the use of modeling languages and engineering code in software languages such as Java, C++, C# or C. Gather required data for analysis and mathematical model building by writing ad-hoc scripts and database queries. Perform quantitative, economic, and numerical performance analyses of these systems under uncertainty using statistical and optimization tools. Create computer simulations to support operational decision-making. Identify areas with potential for improvement and work with internal teams to generate requirements to realize improvements. Design optimal or near optimal solution methodologies to be used by in-house decision support tools and software. Create software prototypes to verify and validate the devised solutions methodologies. Integrate prototypes into production systems using standard software development tools and methodologies. 40 hours / week, 8:00am-5:00pm, Salary Range: $136,000/year to $184,000/year Amazon is a total compensation company. Dependent on the position offered, equity, sign-on payments, and other forms of compensation may be provided as part of a total compensation package, in addition to a full range of medical, financial, and/or other benefits. For more information, visit: https://www.aboutamazon.com/workplace/employee-benefits. Amazon.com is an Equal Opportunity-Affirmative Action Employer – Minority / Female / Disability / Veteran / Gender Identity / Sexual Orientation.#0000
US, NY, New York
MULTIPLE POSITIONS AVAILABLE Employer: AMAZON.COM SERVICES LLC Offered Position: Applied Scientist II Job Location: New York, New York Job Number: AMZ10564066 Position Responsibilities: Participate in the design, development, evaluation, deployment and updating of data-driven models and analytical solutions for machine learning (ML) and/or natural language (NL) applications. Develop and/or apply statistical modeling techniques (e.g. Bayesian models and deep neural networks), optimization methods, and other ML techniques to different applications in business and engineering. Routinely build and deploy ML models on available data. Research and implement novel ML and statistical approaches to add value to the business. Mentor junior engineers and scientists. 40 hours / week, 8:00am-5:00pm, Salary Range: $172,400/year to $223,400/year. Amazon is a total compensation company. Dependent on the position offered, equity, sign-on payments, and other forms of compensation may be provided as part of a total compensation package, in addition to a full range of medical, financial, and/or other benefits. For more information, visit: https://www.aboutamazon.com/workplace/employee-benefits. Amazon.com is an Equal Opportunity-Affirmative Action Employer – Minority / Female / Disability / Veteran / Gender Identity / Sexual Orientation.#0000
US, TX, Austin
MULTIPLE POSITIONS AVAILABLE Employer: AMAZON.COM SERVICES LLC Offered Position: Data Scientist III Job Location: Austin, Texas Job Number: AMZ10593703 Position Responsibilities: Own the data science elements of various products to help with data-based decision making, product performance optimization, and product performance tracking. Work directly with product managers to help drive the design of the product. Work with Technical Product Managers to help drive the build planning. Translate business problems and products into data requirements and metrics. Initiate the design, development, and implementation of scientific analysis projects or deliverables. Own the analysis, modelling, system design, and development of data science solutions for products. Write documents and make presentations that explain model/analysis results to the business. Bridge the degree of uncertainty in both problem definition and data scientific solution approaches. Build consensus on data, metrics, and analysis to drive business and system strategy. Position Requirements: Master's degree or foreign equivalent degree in Statistics, Applied Mathematics, Economics, Engineering, Computer Science or a related field and two years of experience in the job offered or a related occupation. Employer will accept a Bachelor's degree or foreign equivalent degree in Statistics, Applied Mathematics, Economics, Engineering, Computer Science, or a related field and five years of progressive post-baccalaureate experience in the job offered or a related occupation as equivalent to the Master's degree and two years of experience. Must have one year of experience in the following skills: (1) building statistical models and machine learning models using large datasets from multiple resources; (2) building complex data analyses by leveraging scripting languages including Python, Java, or related scripting language; and (3) communicating with users, technical teams, and management to collect requirements, evaluate alternatives, and develop processes and tools to support the organization. Amazon.com is an Equal Opportunity-Affirmative Action Employer – Minority / Female / Disability / Veteran / Gender Identity / Sexual Orientation. 40 hours / week, 8:00am-5:00pm, Salary Range $159,200/year to $215,300/year. Amazon is a total compensation company. Dependent on the position offered, equity, sign-on payments, and other forms of compensation may be provided as part of a total compensation package, in addition to a full range of medical, financial, and/or other benefits. For more information, visit: https://www.aboutamazon.com/workplace/employee-benefits. #0000
US, VA, Arlington
PXT Central Science is seeking an exceptional Data Scientist to join our team. The ideal candidate will thrive in a dynamic, multifaceted role where you'll translate complex business challenges into rigorous quantitative frameworks, extract actionable insights from structured and unstructured datasets, and architect science-backed, scalable solutions that elevate the experience of our 1 million+ employees worldwide. If you're energized by the opportunity to apply data science to our mission of making Amazon Earth's Best Employer, we want to hear from you. Key job responsibilities • Own the design, development, and maintenance of scalable models and prototypes leveraging statistical, machine learning, or GenAI methodologies to enhance employee experience. • Partner with scientists, engineers, and product leaders to solve for employee experience defects using scientific approaches, building new services and tools that deliverable measurable impact. • Author and maintain detailed technical documentation related to the projects you drive. • Communicate results to diverse audiences of varying technical background with effective writing, visualizations, and presentations • Stay current with emerging methods and technologies, and implement them strategically to amplify the team’s impact. About the team The Central Science Team within Amazon’s People Experience and Technology org (PXTCS) uses economics, behavioral science, statistics, machine learning, and Generative AI to proactively identify mechanisms and process improvements which simultaneously improve Amazon and the lives, well-being, and the value of work to Amazonians. We are an interdisciplinary team, which combines the talents of science, engineering, and UX to develop and deliver solutions that measurably achieve this goal.
US, WA, Seattle
MULTIPLE POSITIONS AVAILABLE Employer: AMAZON.COM SERVICES LLC Offered Position: Applied Scientist II Job Location: Seattle, Washington Job Number: AMZ10564086 Position Responsibilities: Participate in the design, development, evaluation, deployment and updating of data-driven models and analytical solutions for machine learning (ML) and/or natural language (NL) applications. Develop and/or apply statistical modeling techniques (e.g. Bayesian models and deep neural networks), optimization methods, and other ML techniques to different applications in business and engineering. Routinely build and deploy ML models on available data. Research and implement novel ML and statistical approaches to add value to the business. Mentor junior engineers and scientists. Specialize in the field of Computational Advertising, directly advancing the techniques in Online Advertising Technology focusing on model optimization and latency reduction. Develop sophisticated machine learning algorithms and models using PyTorch. Develop advanced deep learning architectures to automate the discovery of complex, non-linear feature interactions, effectively capturing high-dimensional data patterns that traditional statistical models are unable to process. Investigate and implement high-order feature interaction architectures, such as DeepFM and DCN-V2, using PyTorch to capture complex non-linear relationships within sparse categorical datasets. Develop custom embedding layers in PyTorch to map high-dimensional, sparse features (e.g., Ad IDs) into dense, low-dimensional vector spaces. Conduct systematic research into the trade-offs between model architecture complexity and inference speed, utilizing PyTorch profiling tools to identify and optimize bottleneck layers. 40 hours / week, 8:00am-5:00pm, Salary Range: $163,617/year to $193,200/year Amazon is a total compensation company. Dependent on the position offered, equity, sign-on payments, and other forms of compensation may be provided as part of a total compensation package, in addition to a full range of medical, financial, and/or other benefits. For more information, visit: https://www.aboutamazon.com/workplace/employee-benefits. Amazon.com is an Equal Opportunity-Affirmative Action Employer – Minority / Female / Disability / Veteran / Gender Identity / Sexual Orientation.#0000
US, NY, New York
MULTIPLE POSITIONS AVAILABLE Employer: AMAZON.COM SERVICES LLC Offered Position: Data Scientist III Job Location: New York, New York Job Number: AMZ10444216 Position Responsibilities: Own the data science elements of various products to help with data-based decision making, product performance optimization, and product performance tracking. Work directly with product managers to help drive the design of the product. Work with Technical Product Managers to help drive the build planning. Translate business problems and products into data requirements and metrics. Initiate the design, development, and implementation of scientific analysis projects or deliverables. Own the analysis, modelling, system design, and development of data science solutions for products. Write documents and make presentations that explain model/analysis results to the business. Bridge the degree of uncertainty in both problem definition and data scientific solution approaches. Build consensus on data, metrics, and analysis to drive business and system strategy. Position Requirements: Master's degree or foreign equivalent degree in Statistics, Applied Mathematics, Economics, Engineering, Computer Science or a related field and two years of experience in the job offered or a related occupation. Employer will accept a Bachelor's degree or foreign equivalent degree in Statistics, Applied Mathematics, Economics, Engineering, Computer Science, or a related field and five years of progressive post-baccalaureate experience in the job offered or a related occupation as equivalent to the Master's degree and two years of experience. Must have one year of experience in the following skills: (1) building statistical models and machine learning models using large datasets from multiple resources; (2) building complex data analyses by leveraging scripting languages including Python, Java, or related scripting language; and (3) communicating with users, technical teams, and management to collect requirements, evaluate alternatives, and develop processes and tools to support the organization. Amazon.com is an Equal Opportunity-Affirmative Action Employer – Minority / Female / Disability / Veteran / Gender Identity / Sexual Orientation. 40 hours / week, 8:00am-5:00pm, Salary Range $175,100/year to $236,900/year. Amazon is a total compensation company. Dependent on the position offered, equity, sign-on payments, and other forms of compensation may be provided as part of a total compensation package, in addition to a full range of medical, financial, and/or other benefits. For more information, visit: https://www.aboutamazon.com/workplace/employee-benefits.#0000
US, CA, Pasadena
The Amazon Web Services (AWS) Center for Quantum Computing (CQC) in Pasadena, CA, is hiring an Applied Scientist to lead integration research and development for superconducting quantum devices. You will design, model, and test the chip-to-chip, chip-to-package, and signal-delivery interfaces that let superconducting quantum computers scale, and you will characterize integrated assemblies at cryogenic temperatures to learn how integration choices affect qubit performance, yield, and manufacturability. You will join a multi-disciplinary team of theoretical and experimental physicists, materials scientists, and hardware and software engineers working at the forefront of quantum computing. You will carry integration technologies from concept through hardware demonstration, build the test standards and automation that make results reproducible across devices, and collaborate with fabrication, hardware, and circuit design engineers to remove the dominant sources of yield loss. You will also contribute to multi-year roadmap planning for integration and scaling capabilities and help establish the scientific foundation for this capability area within the Device team. Key job responsibilities In this role you will develop the integration technologies that let superconducting quantum computers scale. Your work will span four connected areas: - Integration research and development: Design, model, and test integration solutions for superconducting quantum devices, including chip-to-chip, chip-to-package, and signal-delivery interfaces. Build electromagnetic, thermal, and mechanical models to predict and optimize performance, and characterize integrated assemblies at cryogenic temperatures. - Scaling technologies: Develop and evaluate approaches to scaling superconducting quantum hardware against yield, reusability, manufacturability, and scalability, and carry the most promising ones from concept through hardware demonstration. - Test standards and automation: Define test standards that give rigorous, reproducible measurements of how integration affects qubit coherence, loss, and crosstalk. Automate data collection and reporting against these standards so characterization scales across devices and configurations. - Yield and manufacturability: Work with fabrication, hardware, printed circuit board, and circuit design engineers to identify and remove the largest sources of yield loss and integration uncertainty, and to design processes and components that are reused across device generations and manufactured at scale. About the team The Device team at the AWS Center for Quantum Computing designs, builds, and measures the superconducting quantum devices at the heart of our processors, and develops the integration and packaging that turn individual devices into working systems. You will work alongside physicists, materials scientists, and hardware and software engineers across design, fabrication, measurement, and theory, in a lab built for rapid iteration from concept to cryogenic test. Over the coming years the team's focus is making superconducting quantum hardware scale, and this role establishes integration as a scientific capability area within that effort. 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. AWS Utility Computing (UC) provides product innovations — from foundational services such as Amazon's Simple Storage Service (S3) and Amazon Elastic Compute Cloud (EC2), to consistently released new product innovations that continue to set AWS's services and features apart in the industry. As a member of the UC organization, you'll support the development and management of Compute, Database, Storage, Internet of Things (IoT), Platform, and Productivity Apps services in AWS. Within AWS UC, Amazon Dedicated Cloud (ADC) roles engage with AWS customers who require specialized security solutions for their cloud services. Inclusive Team Culture: Here at AWS, it's in our nature to learn and be curious. Our employee-led affinity groups foster a culture of inclusion that empower us to be proud of our differences. Ongoing events and learning experiences, including our Conversations on Race and Ethnicity (CORE) and AmazeCon (diversity) conferences, inspire us to never stop embracing our uniqueness. Diverse Experiences: AWS 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. Mentorship & 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. 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 in the cloud.
CA, BC, Vancouver
Building AI first solutions in a complex regulated space at Amazon scale. Would you like to work on one of the world's largest product classification and Tax computation engine? Or perhaps teaching AI to understanding nuances of domain specific language is what piques your interest? We are responsible for the tax calculation platform, providing the core services that calculate indirect taxes (sales tax and VAT) for all Amazon sales, physical and digital, globally. We are responsible for classifying billions of products in Amazon’s catalogue, calculating accurate Tax amount for every transaction that happens on Amazon’s global platform. Our engineering services are relied upon globally, built to be resilient across some of highest peak traffic demands in the world, while constantly evolving with the state of the art technology. We use language models at scale for Tax classification of the diverse products in Amazon catalogue and comprehending nuances of legislations and legal parlour.Our challenges include staying on top of the complex and fast-changing global tax legislations while ensuring computing calculations correctly and quickly, thousands of times a second, and each one needs to be accurate. Applied Scientists in Tax Engine works closely with Tax specialists, Product team , SDEs and Business teams - tackling a growing portfolio of core-science problems that includes balance of predictive and generative AI -including language comprehension, causal reasoning and active learning. As an Applied scientist, you will provide machine learning expertise to the team that helps increase the accuracy of Tax classification based on product information in Amazon catalogue. You will build various machine learning models to predict accuracy of tax classification, work with large reasoning models to reason with large volumes of system data and expert artefacts to teach domain intuition to AI. You will on variety of legislative changes acting as causal determinants to changes in our systems. You will help us innovate different ways to enhance for our global customers of Amazon.You will need to be entrepreneurial, work in a highly collaborative environment with SDEs, Product managers and businesses. We like to move fast, experiment, iterate and then scale quickly, thoughtfully balancing speed and quality. Whether you're passionate about taking your scientific solves to global reach and scale or one who seeks to solve complex problems under high scrutiny of an audited field, Tax Engine’s scope could offer you an intersting challenge to solve.
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 subscriptions such as Apple TV+, HBO Max, Peacock, 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 team member, 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 The science challenges include: - Heterogeneous customer responses. The same customer responds differently to ads depending on what they’re watching, how engaged they are, and their broader streaming context. We need to understand and predict this variation to make better advertising decisions in real time. - Signal sparsity in streaming. Unlike search or retail advertising, streaming offers no clicks, no conversions, and limited direct feedback. We must develop creative approaches to infer customer preferences, intent, and tolerance from indirect behavioral signals. - Personalization at scale. A one-size-fits-all ad experience leaves value on the table for both customers and the business. We build systems that adapt ad load, placement, and content to individual viewers across 100M+ customers and 100k+ titles. - Small effects, large variance. Ad interventions typically produce 0.1-2% shifts in engagement, effects easily overwhelmed by natural behavioral variance. Measuring, attributing, and optimizing these small signals requires rigorous experimental design and causal methodologies. - Competing objectives. Revenue, customer engagement, long-term retention, and advertiser value are in tension. We develop principled frameworks to navigate these tradeoffs and optimize for sustainable outcomes rather than any single metric. A day in the life - Lead the research and development of ML models that personalize advertising decisions for 100M+ customers across 100k+ titles, with production deployment in mind - Develop deep learning architectures (multi-task learning, embedding-based representations) for customer behavior prediction at scale - Design and analyze large-scale A/B experiments, applying causal inference techniques to measure and optimize the impact of ad strategies on customer engagement and monetization - Partner with engineering to ensure models meet production latency and scalability requirements - Collaborate with product managers to frame business problems as tractable ML problems and translate findings into product decisions - Shape the team’s scientific roadmap, identifying high-impact research directions About the team Prime Video Ads is pioneering the use of Generative AI, Deep Learning and Causal ML to empower the next generation of Ads experience in Prime Video. Our vision is to build the world’s most valuable and differentiated ad-supported streaming platform: one where every ad is relevant to the viewer, and every dollar spent by an advertiser delivers measurable results. We are seeking lead applied scientists who have demonstrated experience in advancing state of the art ML algorithms, particularly in Personalization, Relevance, Casual Inference and Gen-AI areas. Your role will be to deliver these innovations as production-ready systems at Amazon scale.
US, WA, Redmond
Amazon Leo is building a low Earth orbit satellite broadband network to deliver fast, affordable connectivity to customers around the world, including those underserved by traditional infrastructure. Operating a live constellation and its ground network at scale means service disruptions are an inevitable reality, and how quickly we detect them, understand them, and prevent them from recurring defines the trust we earn as a connectivity provider. We are seeking a talented Senior Data Scientist to build the next generation of observability and availability science for the Leo network. Leo already detects outages, notifies affected customers, and restores service. The frontier is prediction and prevention: reasoning over complex network and ground-segment telemetry to autonomously detect anomalies before they reach customers, attribute root cause automatically across a sprawling event surface, and rationalize a large, still-maturing metric set so responders trust what the system tells them. In this role you will work backwards from the needs of customers and operations teams. You will own the scientific direction end to end, partnering closely with network engineers, the Network Operations Center, and the Incident Management team, and the Software and Networking orginization to translate a long-term science vision into concrete research and delivery roadmaps. Export Control Requirement: Due to applicable export control laws and regulations, candidates must be a U.S. citizen or national, U.S. permanent resident (i.e., current Green Card holder), or lawfully admitted into the U.S. as a refugee or granted asylum. Key job responsibilities * Own the observability and availability science end to end, from long-term vision to research roadmap to production delivery, working backwards from the needs of customers, the NOC, and network engineering. * Develop time-series and graph-based models with dynamic baselining that detect network and ground-segment anomalies before they cross the High Severity threshold, enabling proactive investigation rather than reactive response. * Reason over complex, multi-system telemetry to attribute cause automatically during live HSEs and LSEs, so Call Leaders and engineers spend time mitigating, not hunting. * Provide the science behind the network's bucketed availability decomposition (geometric and satellite coverage, ground and network segments, customer terminals, payload, and planning), attributing every movement to a true cause rather than noise, so leadership steers on signal and engineering effort lands where it actually moves availability and throughput. * Deliver the models, analyses, and metrics that feed the daily system readiness and validation review consumed by senior leadership and product and engineering, turning availability and throughput data into a defensible, evidence-based read on progress against GA entry criteria. * Own the recurring, fleet-wide "hot topic" investigations that span ASIC, firmware, payload, network, and planning, separating correlated symptoms from true root cause across thousands of nodes, quantifying how much availability or throughput each is costing, and answering whether it is a launch-blocking risk and whether it is improving. * Deliver alert correlation and deduplication, false-positive reduction, and metric-quality scoring so responders trust what the system tells them, directly supporting a large, still-maturing KPI set. * Tie your science to the unit the org actually measures: reduce detection and attribution time, raise availability against the network's bar, and increase the share of events prevented before customer impact. * Partner day to day with the Network Operations Center, Network Engineering, and the Incident Management (Call Leader) program; sit on live HSE/LSE bridges as the science partner and turn event learnings into model improvements. * Feed COEs and RCAs back into detection and attribution so recurring signatures are caught earlier, and help design and score gamedays that stress-test both the network and your models against real, closed events. * Build and deploy production pipelines on AWS (e.g., SageMaker, Bedrock, Glue) with model validation, monitoring, drift detection, and explainability, because operations teams must be able to trust and act on model output under pressure. * Set data-science standards, mentor scientists, and drive best practices across the Leo networking organization as the science function scales. * Produce explainable output and written narratives that let responders and leaders three or more levels up act on your models during and between events. A day in the life You might start by reviewing overnight anomaly detections and availability movements, join an HSE bridge as the science partner by midday, and spend the afternoon refining root-cause attribution models or presenting availability findings at the readiness review. About the team Amazon Leo Networking Software builds and operates the software behind Leo's satellite and ground network. Our science function partners with the NOC, Network Engineering and Incident Management to make the network more available and resilient, moving from reacting to outages to predicting and preventing them. As a Data Scientist III, you'll help shape that function as it grows.