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, MA, N.reading
Amazon 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 Amazonwe 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. 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 - Collaborate with simulation and robotics experts to translate physical modeling needs into robust, scalable, and maintainable simulation solutions. - Design and implement high-performance simulation modeling and tools for rigid and deformable body simulation. - Identify and optimize performance bottlenecks in simulation pipelines to support real-time and batch simulation workflows. - Help build validation and unit testing pipelines to ensure correctness and physical fidelity of simulation results. - Identify potential sources of sim-to-real gaps and propose modeling and numerical approximations to reduce them. - Stay current with the latest advances in numerical methods, parallel computing, and GPU architectures, and incorporate them into our tools.
US, MA, North Reading
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 unprecedented scale, working with world-class teams pushing the boundaries of what's possible in robotic 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 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 robotics foundation models that: Enable unprecedented generalization across diverse tasks Enable unprecedented robustness and reliability, industry-ready Integrate multi-modal learning capabilities (visual, tactile, linguistic) Accelerate skill acquisition through demonstration learning Enhance robotic perception and environmental understanding Streamline development processes through reusable capabilities 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. As an Applied Science Manager in the Foundation Model team, you will build and lead a team that develops and improves machine learning systems that help robots perceive, reason, and act in real-world environments. You will set the technical direction for leveraging state-of-the-art models (open source and internal research), evaluating them on representative tasks, and adapting/optimizing them to meet robustness, safety, and performance needs. You will drive the capability roadmap and the evaluation strategy that defines “what the robot brain can do,” and you will sponsor targeted innovation when gaps remain. You’ll collaborate closely with research, controls, hardware, and product teams, and ensure the team’s outputs can be further customized and deployed by downstream teams on specific robot embodiments.
IN, KA, Bengaluru
Are you passionate about giving customers the richest, most inspiring experience in their shopping journey? Do you like to dive deep to understand how customer-centric solutions drive measurable results? Do you enjoy working closely with the business and software engineers to design rigorous experiments, build the data infrastructure behind them, and translate results into decisions? You are in the right place! Come join our Prime & Marketing Analytics and Science (PRIMAS) team, where your work will directly impact millions of customers. The EU Marketing & Prime organization is looking for a Data Scientist to join the PRIMAS team. This role sits at the intersection of applied statistics and large-scale analytics — you'll design experiments and causal models, and also own the data pipelines, metrics, and reporting infrastructure that make those results usable across the business. The PRIMAS team provides a comprehensive understanding of customer segments, affinities, and lifetime value. We use data science tools and advanced statistical techniques to study customer purchase and engagement behaviors, and generate actionable insights on where, when, and how we deliver products and programs to customers. We help increase customer engagement, sales, and marketing efficiency, and our systems are built entirely in-house on automated large-scale analytics infrastructure. You will design, launch, and measure experiments across marketing channels (SEM/SEO, Affiliates, Display, Social, Mobile, Email, Onsite, etc.), engagement products, and customer segments. You will improve our understanding of customer behavior, run rigorous power and minimum detectable effect (MDE) analyses to size experiments correctly, and build the causal and conversion models that value and target our marketing — then build the pipelines and dashboards that keep those signals flowing reliably to stakeholders and downstream systems. You will work at the forefront of consumer analytics, tackling some of the hardest measurement problems in the industry alongside strong scientists, statisticians, and software engineers. Key job responsibilities 1. Design and implement scalable, statistically rigorous experiments (A/B, geo, holdout, quasi-experiments) to measure marketing incrementality across channels. 2. Perform power analysis and minimum detectable effect (MDE) calculations to determine experiment sample sizes, durations, and design trade-offs before launch. 3. Build causal and treatment-effect models that produce conversion and valuation signals consumed by downstream bidding and budgeting systems. 4. Building the ETL, metric definitions, and datasets that make results scalable, extensible, and repeatable rather than one-off analyses. 5. Develop measurement frameworks that quantify the true, platform-independent contribution of marketing over time, and build the dashboards and reporting that keep those metrics visible to the business. 6. Apply statistical, mathematical, and machine learning techniques to solve ambiguous business problems where the right approach isn't obvious. 7. Analyze experiment results for validity — inspecting distributions, checking for sample ratio mismatch, exploring covariate balance, and tracking down the source of anomalies. 8. Communicate experiment design, results, and trade-offs clearly to business and leadership audiences, including inputs into business reviews, and influence decisions and technical direction across teams. 9. Establish scalable, repeatable processes and best practices for experiment design, data modeling, and analysis.
IN, KA, Bengaluru
Are you passionate about giving customers the richest, most inspiring experience in their shopping journey? Do you like to dive deep to understand how customer-centric solutions drive measurable results? Do you enjoy working closely with the business and software engineers to design rigorous experiments, build the data infrastructure behind them, and translate results into decisions? You are in the right place! Come join our Prime & Marketing Analytics and Science (PRIMAS) team, where your work will directly impact millions of customers. The EU Marketing & Prime organization is looking for a Data Scientist to join the PRIMAS team. This role sits at the intersection of applied statistics and large-scale analytics — you'll design experiments and causal models, and also own the data pipelines, metrics, and reporting infrastructure that make those results usable across the business. The PRIMAS team provides a comprehensive understanding of customer segments, affinities, and lifetime value. We use data science tools and advanced statistical techniques to study customer purchase and engagement behaviors, and generate actionable insights on where, when, and how we deliver products and programs to customers. We help increase customer engagement, sales, and marketing efficiency, and our systems are built entirely in-house on automated large-scale analytics infrastructure. You will design, launch, and measure experiments across marketing channels (SEM/SEO, Affiliates, Display, Social, Mobile, Email, Onsite, etc.), engagement products, and customer segments. You will improve our understanding of customer behavior, run rigorous power and minimum detectable effect (MDE) analyses to size experiments correctly, and build the causal and conversion models that value and target our marketing — then build the pipelines and dashboards that keep those signals flowing reliably to stakeholders and downstream systems. You will work at the forefront of consumer analytics, tackling some of the hardest measurement problems in the industry alongside strong scientists, statisticians, and software engineers. Key job responsibilities 1. Design and implement scalable, statistically rigorous experiments (A/B, geo, holdout, quasi-experiments) to measure marketing incrementality across channels. 2. Perform power analysis and minimum detectable effect (MDE) calculations to determine experiment sample sizes, durations, and design trade-offs before launch. 3. Build causal and treatment-effect models that produce conversion and valuation signals consumed by downstream bidding and budgeting systems. 4. Building the ETL, metric definitions, and datasets that make results scalable, extensible, and repeatable rather than one-off analyses. 5. Develop measurement frameworks that quantify the true, platform-independent contribution of marketing over time, and build the dashboards and reporting that keep those metrics visible to the business. 6. Apply statistical, mathematical, and machine learning techniques to solve ambiguous business problems where the right approach isn't obvious. 7. Analyze experiment results for validity — inspecting distributions, checking for sample ratio mismatch, exploring covariate balance, and tracking down the source of anomalies. 8. Communicate experiment design, results, and trade-offs clearly to business and leadership audiences, including inputs into business reviews, and influence decisions and technical direction across teams. 9. Establish scalable, repeatable processes and best practices for experiment design, data modeling, and analysis.
IN, KA, Bengaluru
Are you passionate about giving customers the richest, most inspiring experience in their shopping journey? Do you like to dive deep to understand how customer-centric solutions drive measurable results? Do you enjoy working closely with the business and software engineers to design rigorous experiments, build the data infrastructure behind them, and translate results into decisions? You are in the right place! Come join our Prime & Marketing Analytics and Science (PRIMAS) team, where your work will directly impact millions of customers. The EU Marketing & Prime organization is looking for a Data Scientist to join the PRIMAS team. This role sits at the intersection of applied statistics and large-scale analytics — you'll design experiments and causal models, and also own the data pipelines, metrics, and reporting infrastructure that make those results usable across the business. The PRIMAS team provides a comprehensive understanding of customer segments, affinities, and lifetime value. We use data science tools and advanced statistical techniques to study customer purchase and engagement behaviors, and generate actionable insights on where, when, and how we deliver products and programs to customers. We help increase customer engagement, sales, and marketing efficiency, and our systems are built entirely in-house on automated large-scale analytics infrastructure. You will design, launch, and measure experiments across marketing channels (SEM/SEO, Affiliates, Display, Social, Mobile, Email, Onsite, etc.), engagement products, and customer segments. You will improve our understanding of customer behavior, run rigorous power and minimum detectable effect (MDE) analyses to size experiments correctly, and build the causal and conversion models that value and target our marketing — then build the pipelines and dashboards that keep those signals flowing reliably to stakeholders and downstream systems. You will work at the forefront of consumer analytics, tackling some of the hardest measurement problems in the industry alongside strong scientists, statisticians, and software engineers. Key job responsibilities 1. Design and implement scalable, statistically rigorous experiments (A/B, geo, holdout, quasi-experiments) to measure marketing incrementality across channels. 2. Perform power analysis and minimum detectable effect (MDE) calculations to determine experiment sample sizes, durations, and design trade-offs before launch. 3. Build causal and treatment-effect models that produce conversion and valuation signals consumed by downstream bidding and budgeting systems. 4. Building the ETL, metric definitions, and datasets that make results scalable, extensible, and repeatable rather than one-off analyses. 5. Develop measurement frameworks that quantify the true, platform-independent contribution of marketing over time, and build the dashboards and reporting that keep those metrics visible to the business. 6. Apply statistical, mathematical, and machine learning techniques to solve ambiguous business problems where the right approach isn't obvious. 7. Analyze experiment results for validity — inspecting distributions, checking for sample ratio mismatch, exploring covariate balance, and tracking down the source of anomalies. 8. Communicate experiment design, results, and trade-offs clearly to business and leadership audiences, including inputs into business reviews, and influence decisions and technical direction across teams. 9. Establish scalable, repeatable processes and best practices for experiment design, data modeling, and analysis.
US, WA, Seattle
Want to apply data science to one of Amazon's fastest-growing payment businesses, serving millions of sellers and buyers across 20+ global marketplaces? As a Data Scientist I on the cross-border payments science team, you will build and deploy production models that power real-time FX risk monitoring, generative AI seller chatbots, and multi-agent AI tools. You will work end-to-end—from problem framing through production deployment on AWS—delivering solutions that directly influence billion-dollar payment flows. This is a high-visibility, small-team environment where your work informs senior leadership decisions and creates measurable impact for customers worldwide. Key job responsibilities - Build, tune, and evaluate large language models and generative AI applications, including seller-facing chatbots and multi-agent AI tools for the cross-border payments business. - Develop and deploy real-time statistical and machine learning models for FX risk monitoring, validating your data, assumptions, and results throughout the process. - Gather and use large datasets from multiple sources across global marketplaces to design production-ready solutions that meet customer needs and team goals. - Write accurate, clear, and mathematically rigorous technical documents that communicate model performance and business impact to both technical and non-technical audiences. - Partner with engineering, business, and science teams to translate payment-domain problems into data science solutions and ensure smooth deployment on AWS. A day in the life You will spend your morning reviewing model outputs from production FX risk systems and tuning generative AI prototypes for seller chatbots. In the afternoon you might pair with an engineer to deploy a new model version on AWS, then present preliminary results to senior leadership. Throughout, you will seek feedback from senior scientists on your methodology and collaborate with cross-functional partners to refine problem framing. About the team We are the science team behind Amazon's cross-border payments business, supporting products that serve millions of sellers and buyers across 20+ global marketplaces. Our team is small and at an inflection point—we are expanding our generative AI capabilities, building multi-agent systems, and strengthening real-time risk models. You will join a group that values end-to-end ownership, from research to production, and whose work directly shapes decisions on large-scale payment flows.
US, TX, Austin
Are You Ready to Redefine How the World Receives Its Packages? What if your algorithms defined the most efficient path for millions of deliveries — every single day? At Amazon, we're building the science that makes that possible, and we're looking for exceptional scientists to help lead the way. The Last Mile Routing & Planning organization develops the software, algorithms, and tools that power the "magic" of home delivery. Our planning and routing intelligence systems drive billions of daily decisions — enabling safe, efficient, and frustration-free routes for drivers across the globe. What You'll Do In this role, you'll sit at the intersection of state-of-the-art research and real-world impact. You will: - Design and build algorithms that solve large-scale, complex logistics problems - Synthesize data from diverse sources to identify high-value business opportunities - Provide research direction and data-driven insights to guide strategic decisions - Translate complex technical approaches into clear communication for scientists, engineers, and business stakeholders - Partner closely with scientists and engineers in a collaborative, high-impact environment What You'll Work On We have an exciting and growing portfolio of research areas, including: - Routing for same-day and grocery deliveries - Planning for electric and autonomous vehicles - District-level and stop-level planning - Forecasting solutions for diverse delivery programs All of this is powered by the latest methods in Operations Research (OR), Machine Learning (ML), and Generative AI — at a truly global scale. Successful candidates will lead one or more of these problem spaces. What We're Looking For - Deep expertise in Operations Research and/or Machine Learning methods - Proven experience applying these methods to large-scale, real-world business problems - Ability to translate models into production-ready code in Python or Java - Strong communication skills — you can explain complex technical concepts to diverse audiences - A bias for action and an iterative mindset when tackling ambitious research challenges Why Amazon We're passionate about your growth. Whether you want to explore emerging technologies, take on broader scope, or accelerate your career trajectory, we'll invest in helping you get there. Our business is scaling fast — and so are the opportunities for the people who build it. If you're driven by the challenge of optimizing one of the world's most complex logistics systems and excited to see your work impact millions of customers daily, we'd love to hear from you. Key job responsibilities - Invent and design novel solutions for scientifically complex problem areas, and identify opportunities for invention within existing and new business initiatives - Deliver large-scale, high-impact solutions to complex problems in support of medium-to-large business goals - Shape the design of scientifically complex software systems, personally contributing significant portions of the critical scientific novelty - Apply mathematical optimization, machine learning, and Generative AI techniques to develop solution methodologies for in-house decision support tools and software - Research, prototype, simulate, and experiment with models — and actively participate in their production-level deployment in Python or Java - Engage with the broader scientific community by publishing research articles and participating in leading research conferences
US, WA, Bellevue
The Amazon GDS-MOP (modeling, Optimization and Planning) Science team is seeking an exceptional Applied Scientist with strong operations research and optimization expertise to develop production solutions for one of the most complex systems in the world: Amazon's Fulfillment Network labor capacity planning. At MOP Science, we design, build, and deploy optimization, statistics, machine learning, and GenAI/LLM solutions that power Amazon Labor Planning systems (ALPS) running across Amazon Fulfillment Centers worldwide. We solve a wide range of challenges encountered throughout the network, including labor planning and staffing, pick scheduling, stow guidance, and capacity risk management. We are tasked with developing innovative, scalable, and reliable science-driven production solutions that exceed the published state of the art, enabling systems to run frequently (ranging from every few minutes to every few hours per use case) and continuously across our large-scale network. Key job responsibilities As an Applied Scientist, you will collaborate with other scientists, software engineers, product managers, and operations leaders to develop optimization-driven solutions using a variety of tools and observe direct impact on process efficiency and associate experience in the fulfillment network. Key responsibilities include: • Develop understanding and domain knowledge of operational processes, system architecture and functions, and business requirements • Deep dive into data and code to identify opportunities for continuous improvement and/or disruptive new approaches • Develop scalable mathematical models for production systems to derive optimal or near-optimal solutions for existing and new challenges • Create prototypes and simulations for agile experimentation of devised solutions • Advocate for technical solutions with business stakeholders, engineering teams, and senior leadership • Partner with engineers to integrate prototypes into production systems • Design experiments to test new or incremental solutions launched in production and build metrics to track performance About the team Amazon offers a full range of benefits that support you and eligible family members, including domestic partners and their children. Benefits can vary by location, the number of regularly scheduled hours you work, length of employment, and job status such as seasonal or temporary employment. The benefits that generally apply to regular, full-time employees include: • Medical, Dental, and Vision Coverage • Maternity and Parental Leave Options • Paid Time Off (PTO) • 401(k) Plan
US, CA, Sunnyvale
We are looking for a Senior Inference Engineer to own inference for real-time multimodal conversational AI. This is a full-stack inference role: you will work across the entire path a model takes from research to production — shaping model architecture so it is servable, building the real-time runtime that serves it within hard latency budgets, and building the offline systems that train and reinforce it. You will operate at the boundary of Science and Inference, taking frontier-scale speech and audio models and making them run within real-time latency budgets on production hardware. You will co-design architectures with scientists to make them inference-friendly from inception, own the low-latency streaming serving path, and build the training and reinforcement-learning infrastructure that closes the loop. You will have the compute, data, and runway to solve problems that few teams in the world are positioned to tackle. As a Senior Engineer, you will own a significant area of the inference stack end to end, drive its technical execution, contribute to the team's roadmap, and work closely with scientists and hardware partners to ensure our models run fast enough to feel human in real time — and at a cost that makes them viable at scale. You may go deep in one of the areas below while contributing across the others. Key job responsibilities Model Architecture & Inference Co-Design • Partner with research scientists to make model architectures servable from inception — surfacing the latency, memory, and cost implications of architecture choices before they are locked in • Implement and optimize the inference path for large-scale multimodal models — attention and KV-cache mechanisms, multimodal/autoregressive decoding, and the compute primitives on the critical path Apply efficiency techniques across the stack — quantization (per-tensor/per-channel/per- group, INT8/FP8/BF16), speculative decoding, operator fusion, and paged KV-cache — and quantify their quality/latency trade-offs • Develop and tune high-performance kernels for critical operations where off-the-shelf implementations leave performance on the table, integrating them into production serving with minimal overhead • Profile end-to-end performance with tools such as Nsight Compute/Systems and roofline analysis to identify and eliminate bottlenecks in large-scale inference workloads Real-Time & Interactive Runtime • Own the real-time serving path for streaming multimodal conversational AI, meeting sub- second, streaming latency budgets under concurrent session load • Build and tune continuous batching, scheduling, and preemption to balance throughput against per-request latency SLAs for interactive workloads • Customize production serving frameworks (e.g., vLLM, PyTorch) for real-time streaming generative models that fall outside standard LLM serving patterns — sustained low-latency output under concurrent session load • Implement multi-GPU inference (tensor parallelism, collective communication) for latency- critical paths, and drive cost toward parity with existing production baselines • Establish latency, throughput, and cost benchmarking, and publish the operational metrics that gate deployment Offline Systems: Training, RL & Evaluation Infrastructure • Build and scale the offline inference systems behind post-training — high-throughput rollout generation and reward-model serving for reinforcement learning (RL/RLHF/RLAIF) • Ensure train/serve consistency — that the inference path used in RL and evaluation faithfully matches production online behavior (e.g., parity across sampling and logit processing) • Work with the evaluation team to enable offline inference that captures the quality dimensions unique to real-time conversation — latency sensitivity, audio quality, and interaction naturalness
US, WA, Redmond
We are searching for a talented candidate with experience in orbital mechanics, orbit determination, launch vehicle trajectories, and launch vehicle mission planning. In this position, a successful candidate would serve as a Research Scientist in support of Amazon Leo’s constellation with particular focus on Launch Vehicle support. Strong analysis skills are required to develop engineering studies of complex large-scale dynamical systems. This position requires demonstrated expertise in computational analysis automation and tool development. 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 Working with the Leo GNC team, you will: • Perform spacecraft maneuver or navigation analysis in support of multi-disciplinary trades within the Amazon Leo team. • Contribute to prototype software development of flight algorithms. • Test and assess navigation software for integration into flight systems. • Assess and trouble-shoot the performance of Leo on-board GNSS hardware and software systems. • Work closely with GNC engineers to manage on-orbit performance and develop flight dynamics operations processes. • Manage engineering trades as needed for various launch vehicle mission designs. • Support Leo’s Launch Vehicle Mission Management team with technical expertise in Launch Vehicle trajectory requirements specification • Evaluate Launch Vehicle performance and compliance with mission requirements • Develop tools to support Mission Management planning for over 80 launches! • Work collaboratively with launch vehicle system technical teams About the team The Flight Dynamics team is responsible for the guidance, navigation, control and safety of the spaceflight of the Amazon Leo constellation. This team provides solutions to spaceflight challenges in constellation design, orbit selection, launch vehicle insertion requirements, navigation, trajectory design, space situational awareness, and space traffic coordination.