Improving LLM pretraining with better data organization

“Best-fit packing” adapts bin-packing to avoid unnecessary truncation of training documents, improving LLM performance across a wide range of tasks and reducing hallucination.

The documents used to train a large language model (LLM) are typically concatenated to form a single “superdocument”, which is then divided into sequences that match the model's context length. This improves training efficiency but often results in unnecessary truncations, where individual documents are broken up across successive sequences.

Related content
Contiguous parameter management and prefetched activation offloading expand the MiCS tool kit.

In paper we’re presenting at this year’s International Conference on Machine Learning (ICML 2024), titled “Fewer truncations improve language modeling”, we report an in-depth study of this common concatenation-chunking document-processing method. We found that it severely impairs the model's ability to understand contextual coherence and factual consistency. This not only affects the model's performance on downstream tasks but also increases the risk of hallucinations.

To address this issue, we propose best-fit packing, an innovative document-processing strategy that optimizes document combinations to eliminate unnecessary text truncations. In experiments, we compared a model trained using best-fit packing to one trained in the ordinary way on six downstream tasks: reading comprehension, natural-language inference, context following, summarization, commonsense and closed-book question answering, and program synthesis. We found that best-fit packing monotonically improves performance on an array of 22 sub-tasks, by as much as 15% (program synthesis) to 17% (context following). Importantly, best-fit packing also reduces closed-domain hallucination effectively by up to 58.3%.

Best-fit packing.png
A comparison of best-fit packing (left), which seeks to minimize document truncation, with the standard approach to large-language-model training, which concatenates training documents and then divides them into fixed-length sequences.

Consequences of truncation

In the analysis reported in our paper, we identified several problems caused by document truncation, including undefined names, ungrounded content, and missing knowledge.

Related content
Prompt engineering enables researchers to generate customized training examples for lightweight “student” models.

Undefined names: In programming languages like Python, truncation may separate definitions of variables from their invocations, introducing syntax errors and causing some variables to be undefined. As a consequence, the model may learn misleading patterns and possibly hallucinate on downstream tasks.

Ungrounded content: Truncation damages data integrity. In the example below, for instance, a reference (“the earthquake on Monday morning”) is separated from its antecedent, resulting in unfaithful generation.

Missing knowledge: Truncation hinders knowledge acquisition. In the example below, the model cannot learn the location of the ICML conference because the conference name and location occur in different training sequences.

Truncation errors.png
Examples of three common truncation errors: (a) undefined names, (b) ungrounded content, and (c) missing knowledge.

Best-fit packing

To address this issue, we propose optimizing the assignment of documents to training sequences so as to eliminate unnecessary truncations, while minimally increasing the number of sequences relative to concatenation. This is a variation of the well-known bin-packing problem, which is NP-hard in general, but we use a heuristic called the best-fit-decreasing (BFD) algorithm that tends to work well in practice. We thus call our method best-fit packing.

The normal implementation of BFD has quasi-linear time complexity, which is not efficient enough for LLM pretraining, which typically involves millions of documents. By taking advantage of the unique nature of pretraining data, however, we were able to optimize BFD so that it scales linearly with data size, ensuring its applicability to large-scale pretraining datasets. Further, we show that in practical applications, best-fit packing generates approximately the same number of training sequences as the traditional method, while significantly reducing data loss caused by truncation.

Truncations per document.png
Truncations per document as a function of document length, for both best-fit packing (pack) and concatenation (concat), for natural-language data (top) and programming-language data (bottom). The natural-language data is evaluated with context lengths of both 2,000 and 8,000.

Curious to know how we achieve it? Let’s dive deep!

Best-fit packing — an example

Following the standard bin-packing nomenclature, we call each training sequence a “bin”, and each bin has a capacity equal to the LLM’s context size. The goal is to assign a combination of whole documents to each bin so as to minimize the wasted bin capacity.

First, we divide any document that’s larger than the LLM context into context-length chunks, plus a remainder. Then we sort the documents (and document fragments) from largest to smallest. Finally, we work our way down the sorted list, assigning each document to the bin whose available space is as close to the document size as possible.

Related content
Novel “checkpointing” scheme that uses CPU memory reduces the time wasted on failure recovery by more than 92%.

To maximize efficiency, we use three data structures to manage the assignment of documents to bins: a binary tree and two tables. We can use this design because (1) the maximum bin size is the model’s context size, so the tree won’t be too deep, and (2) we do not need to distinguish bins with the same remaining capacity, which simplifies the the tree. Instead, we use the tables to map bin capacities to bins.

Consider a simple example, in which the context size (the bin size) is eight. The binary tree has eight leaves, corresponding to the eight possibilities for available space in any given bin. (In a real LLM, the context size is on the order of thousands of tokens, so the tree would have thousands of leaves.)

Each parent node of the tree has an associated number, indicating the size of the largest available bin slot among its descendants. The number associated with the parent’s right child is always greater than or equal to the number associated with the left child.

Initially, the value of the rightmost node in each layer of the tree is eight, and all the other nodes have values of zero. This means that all the available bin slots have a capacity of eight.

Best-fit initialization.png
The initial states of the three data structures we use to implement best-fit packing. The rightmost node of each layer of the tree has a value of eight, and all other nodes have values of zero, indicating that all the bins are empty (i.e., are at maximum capacity).

Now consider a later state, when four documents of size eight, six, six, and four have been packed. The two bins containing documents of size six have available slots of size two (8 – 6), and the bin containing a document of size four has an available slot of size four (8 – 4). These sizes are represented by the numbers two and four at leaves two and four of the tree. Multiple bins remain empty, so leaf eight has a value of eight, too.

Note that the value two at leaf two indicates only that at least one bin slot of size two is available; it doesn’t indicate how many such slots there are or where they can be found. That information is contained in the tables.

Tree after packing.png
The state of the data structures after four documents of sizes six, six, four, and eight have been packed.

Now consider a document of size three, which we wish to assign to a bin. To find the best available bin slot, simply go left at each node of the tree, unless going left leads to a node whose value is less than the document size, in which case, go right.

Document packing.png
Tree traversal identifies the available bin slot that best fits the new document.

The best fit for a document of size three is a slot of size four, and in the “space-to-bins” table, we see that there is one bin — bin three — with a slot of that size. So there we place the document.

Finally, we update all three data structures to reflect the new placement:

Data structure update.png
Data structure updates after the document (item four) of size three has been packed. The tree leaf corresponding to slot sizes of four is reset to zero, and the tree leaf corresponding to slot sizes of one is set to one. The tables are updated accordingly.

Results

To evaluate the effect of bin-packing on downstream tasks, we pretrained models of 7 billion and 13 billion parameters with context lengths of 2,000 and 8,000 on text and code using both best-fit packing and concatenation. We then tested both sets of models on our six downstream tasks. On average, across multiple datasets, context lengths, and metrics, best-fit packing offered better performance on all six tasks. The biggest gains came in reading comprehension (+4.7%), natural-language inference (+9.3%), context following (+16.8%), and program synthesis (+15.0%).

Related content
In a series of papers, Amazon researchers performed a theoretical analysis of a simplified problem that led to a learnable learning-rate scheduler, applied that scheduler to a more complex neural model, and distilled the results into a practical algorithm.

We also found that best-fit packing helped prevent closed-domain hallucination, particularly in program synthesis tasks, where it reduced "undefined name" errors by up to 58.3%, indicating a more complete understanding of program structure and logic.

Additionally, models trained with best-fit packing were better at following instructions, such as adhering to length constraints. And best-fit packing helped the model acquire “tail knowledge” that is truncation sensitive due to scarcity in training data. Indeed, this result suggests a possible reason for why LLMs struggle to learn long-tail knowledge.

While the experiments conducted in our paper primarily focused on LLM pretraining, best-fit packing is broadly applicable to fine tuning as well. Determining the benefits it can offer during fine tuning is an intriguing topic for future study.

Research areas

Related content

US, CA, Sunnyvale
We are seeking an Applied Scientist II to work on development of an AI-based data intelligence and classification platform that will redefine how security and privacy assessments and enforcement are conducted at scale. This mission-critical platform will leverage AI-driven autonomous agents to conduct proactive, intelligent security operations across the company. The platform will integrate deeply with internal security, privacy, engineering, and cloud-native tools to provide self-serve, automated insights, verifications, and enforcement mechanisms. This role requires strong technical expertise in AI/ML, LLMs, and distributed cloud infrastructure, as well as thought leadership to drive alignment across multiple teams, customers, and business units. This is an opportunity to shape the future of AI-driven security and privacy assurance at an enterprise scale, defining standards, influencing company-wide security posture, and leading technical innovation at the highest level. Key job responsibilities * Architect and define the next-generation data classification and search matching platform, leading the technical strategy for AI-driven security automation across applied science and engineering teams * Build on multi-agent LLM framework, and influence your organizations in adopting the promising approaches * Develop a highly scalable, traditional ML-based as well as LLM-based intelligent security agent framework that enables internal teams to automate processing of structured and unstructured data * Combine depth and breadth of domain expertise and provide technical leadership to the entire team while also doing hands-on work by diving deep into details to diagnose complex system performance problems. About the team The Data Categorization team helps Amazonians understand their data and govern it at scale and ensures experiences delivered by Amazon to our customers uphold our high security and privacy standards. The science team harnesses AI to strengthen Amazon’s privacy and security posture more efficiently and effectively.
GB, London
Applied Scientists in AWS Automated Reasoning are dedicated to making AWS the best computing service in the world for customers who require advanced and rigorous solutions for automated reasoning, privacy, and sovereignty. Key job responsibilities The successful candidate will: - Solve large or significantly complex problems that require deep knowledge and understanding of your domain and scientific innovation. - Own strategic problem solving, and take the lead on the design, implementation, and delivery for solutions that have a long-term quantifiable impact. - Provide cross-organizational technical influence, increasing productivity and effectiveness by sharing your deep knowledge and experience. - Develop strategic plans to identify fundamentally new solutions for business problems. - Assist in the career development of others, actively mentoring individuals and the community on advanced technical issues. A day in the life This is a unique and rare opportunity to get in early on a fast-growing segment of AWS and help shape the technology, product and the business. You will have a chance to utilize your deep technical experience within a fast moving, start-up environment and make a large business and customer impact. About the team Diverse Experiences Amazon Automated Reasoning values diverse experiences. Even if you do not meet all of the 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 Amazon Automated Reasoning? At Amazon, automated reasoning is central to maintaining customer trust and delivering delightful customer experiences. Our organization is responsible for creating and maintaining a high bar for automated reasoning across all of Amazon's products and services. We offer talented automated reasoning professionals the chance to accelerate their careers with opportunities to build experience in a wide variety of areas including cloud, devices, retail, entertainment, healthcare, operations, and physical stores. Inclusive Team Culture In Amazon Automated Reasoning, it's in our nature to learn and be curious. Ongoing DEI events and learning experiences inspire us to continue learning and to embrace our uniqueness. Addressing the toughest automated reasoning challenges requires that we seek out and celebrate a diversity of ideas, perspectives, and voices. Training & 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, training, 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 flexible work hours and arrangements are part of our culture. When we feel supported in the workplace and at home, there's nothing we can't achieve.
IN, KA, Bengaluru
Do you want to join an innovative team of scientists who use machine learning and statistical techniques to create state-of-the-art solutions for providing better value to Amazon’s customers? Do you want to build and deploy advanced algorithmic systems that help optimize millions of transactions every day? Are you excited by the prospect of analyzing and modeling terabytes of data to solve real world problems? Do you like to own end-to-end business problems/metrics and directly impact the profitability of the company? Do you like to innovate and simplify? If yes, then you may be a great fit to join the Machine Learning and Data Sciences team for India Consumer Businesses. If you have an entrepreneurial spirit, know how to deliver, love to work with data, are deeply technical, highly innovative and long for the opportunity to build solutions to challenging problems that directly impact the company's bottom-line, we want to talk to you. Major responsibilities - Use machine learning and analytical techniques to create scalable solutions for business problems - Analyze and extract relevant information from large amounts of Amazon’s historical business data to help automate and optimize key processes - Design, development, evaluate and deploy innovative and highly scalable models for predictive learning - Research and implement novel machine learning and statistical approaches - Work closely with software engineering teams to drive real-time model implementations and new feature creations - Work closely with business owners and operations staff to optimize various business operations - Establish scalable, efficient, automated processes for large scale data analyses, model development, model validation and model implementation - Mentor other scientists and engineers in the use of ML techniques Key job responsibilities Use machine learning and analytical techniques to create scalable solutions for business problems Analyze and extract relevant information from large amounts of Amazon’s historical business data to help automate and optimize key processes Design, develop, evaluate and deploy, innovative and highly scalable ML models Work closely with software engineering teams to drive real-time model implementations Work closely with business partners to identify problems and propose machine learning solutions Establish scalable, efficient, automated processes for large scale data analyses, model development, model validation and model maintenance Work proactively with engineering teams and product managers to evangelize new algorithms and drive the implementation of large-scale complex ML models in production Leading projects and mentoring other scientists, engineers in the use of ML techniques About the team International Machine Learning Team is responsible for building novel ML solutions that attack India first (and other Emerging Markets across MENA and LatAm) problems and impact the bottom-line and top-line of India business. Learn more about our team from https://www.amazon.science/working-at-amazon/how-rajeev-rastogis-machine-learning-team-in-india-develops-innovations-for-customers-worldwide
IN, KA, Bengaluru
RBS (Retail Business Services) Tech team works towards enhancing the customer experience (CX) and their trust in product data by providing technologies to find and fix Amazon CX defects at scale. Our platforms help in improving the CX in all phases of customer journey, including selection, discoverability & fulfilment, buying experience and post-buying experience (product quality and customer returns). As a Sciences team in RBS Tech, we focus on foundational ML research and develop scalable state-of-the-art ML solutions to solve the problems covering customer experience (CX) and Selling partner experience (SPX). We work to solve problems related to multi-modal understanding (text and visual), supervised and unsupervised techniques, multi-task learning, multi-label classification, aspect and topic extraction for Customer Anecdote Mining, product similarity, using GenAI, LLMs, NLP and Computer Vision. Key job responsibilities As an Applied Science Manager, you will be responsible to design and deploy scalable GenAI, NLP and Computer Vision solutions that will impact the content visible to millions of customer and solve key customer experience issues. You will Lead scientists on the team and oversee research and development projects at various stages ranging from initial exploration to deployment into production systems. You will partner with business and engineering teams to identify and solve large and significantly complex problems that require scientific innovation. You will help the team leverage your expertise, by coaching and mentoring. You will contribute to the professional development of colleagues, improving their technical knowledge and the engineering practices. You will create the environment in the team to file for patents and/or publish research work where opportunities arise. You will impact the large product strategy, identifies new business opportunities and provides strategic direction to the team.
US, CA, Sunnyvale
Are you excited about developing state-of-the-art Machine Learning, Natural Language Processing, Deep Learning and Computer Vision algorithms and designs using large data sets to solve real world problems? Do you have proven analytical capabilities and can multi-task and thrive in a fast-paced environment? Do you want to build a foundation for your career after your Master's or Ph.D program at an industry-leading company? You enjoy the prospect of solving real-world problems that, quite frankly, have not been solved at scale anywhere before. Along the way, you’ll get opportunities to be a disruptor, prolific innovator, and a reputed problem solver—someone who truly enables machine learning to create significant impacts. As an Applied Scientist, you will bring statistical modeling and machine learning advancements to data analytics for customer-facing solutions in complex industrial settings. You will be working in a fast-paced, cross-disciplinary team of researchers who are leaders in the field. You will take on challenging problems, distill real requirements, and then deliver solutions that either leverage existing academic and industrial research, or utilize your own out-of-the-box pragmatic thinking. In addition to coming up with novel solutions and prototypes, you may even need to deliver these to production in customer facing products
US, WA, Seattle
We are seeking a senior Applied Scientist to join a science team within Amazon Customer Service that is reimagining how customers are connected with the right support experience. This is a senior technical leadership role where you will drive scientific strategy, mentor junior scientists, and deliver foundational models that power real-time personalization at scale. Key job responsibilities - Lead the science for understanding the demand side of customer service interactions - Characterize who is contacting us, what they need, and how complex their situation is - Invent novel representation learning approaches that encode customer interactions - Directly inform intelligent routing decisions across hundreds of millions of annual contacts
US, WA, Seattle
We are seeking an Applied Scientist to join a science team within Amazon Customer Service that is reimagining how customers are connected with the right support experience. This is a role at the intersection of representation learning, behavioral modeling, and large-scale experimentation where you will see your science deployed in production systems serving real-time decisions. Key job responsibilities - Develop machine learning models that capture how service associates perform across different problem types and how their capabilities evolve over time - Power intelligent routing decisions across hundreds of millions of annual customer contacts - Directly improve both customer experience and associate satisfaction through model-driven decisions - Work at the intersection of representation learning, behavioral modeling, and large-scale experimentation - Deploy science into production systems serving real-time decisions
US, CA, Sunnyvale
Amazon's PRISM team is seeking an innovative Applied Scientist to build the intelligence layer powering the Catalog Diagnostic Assistant — a conversational AI agent that unifies Amazon's fragmented catalog diagnostic experience into a single natural-language interface. Rather than switching between legacy tools, internal users ask CDA a question in plain language and CDA coordinates across data sources, reasons through complex diagnostic workflows, and returns a combined answer with source citations. This role sits at the intersection of Generative AI, agentic architectures, and large-scale information retrieval applied to the world's largest product catalog. You will design and build the scientific core of an agent that autonomously investigates catalog anomalies — diagnosing why products aren't live, why attributes aren't publishing, or why matching decisions went wrong — across billions of products, petabytes of multimodal data, and dozens of marketplaces. You will be the founding scientist for the CDA product, defining the research agenda for agentic diagnostics, developing novel approaches to skill-based reasoning and tool orchestration, and owning the full lifecycle from problem formulation through production deployment at Amazon scale. You will pioneer advanced GenAI solutions that power next-generation agentic experiences, working in a collaborative environment where you can experiment with massive data from the world's largest product catalog and tackle problems at the frontier of AI research. Key job responsibilities - Formulate open research problems at the intersection of GenAI, agentic reasoning, and large-scale catalog diagnostics — defining how an autonomous agent should decompose, investigate, and explain complex catalog issues - Design and develop novel agentic architectures (skill planning, tool selection, multi-step reasoning, chain-of-thought verification) that enable CDA to autonomously resolve diagnostic workflows that traditionally required manual expert investigation - Build and optimize retrieval-augmented generation (RAG) systems over Amazon's catalog data, ensuring the agent retrieves the right evidence from the right data sources to ground its diagnostic answers - Advance the science of efficient model deployment — developing distillation, compression, and LLM serving optimization strategies that preserve diagnostic reasoning quality in production-grade architectures while reducing latency and cost - Make frontier models reliable for autonomous decisions — advancing uncertainty calibration, confidence estimation, and interpretability methods so CDA's agentic diagnoses can be trusted at scale - Own the full research lifecycle from problem formulation through production deployment — designing rigorous experiments, iterating rapidly, and seeing your research directly improve diagnostic accuracy and coverage - Partner closely with CDA engineers to translate research prototypes into production systems serving thousands of daily diagnostic sessions - Shape the team's research vision by defining technical roadmaps that balance foundational scientific inquiry with measurable product impact - Mentor engineers on advanced ML/GenAI techniques, experimental design, and scientific rigor About the team We are a GenAI science team within Amazon's Selection and Catalog Systems (ASCS) organization. Our mission is to advance state-of-the-art Generative AI to deeply understand, uniquely identify, and intelligently diagnose every product at Amazon scale. We push the boundaries of multimodal LLMs, agentic systems, and generative AI to solve foundational catalog challenges — from product identity and semantic matching to automated catalog diagnostics and intelligent catalog analytics. Our scientists work across multiple high-impact problem spaces: establishing canonical product identity across billions of items, powering next-generation agentic experiences for catalog operations, and building AI systems that make Amazon's catalog self-diagnosing and self-healing. We operate at the frontier of AI research applied at unprecedented scale — petabytes of multimodal data, millions of sellers, dozens of languages, and infinite product diversity. This is a collaborative, fast-moving environment where you can experiment with massive data from the world's largest product catalog, tackle problems at the frontier of AI research, rapidly implement and deploy your ideas at scale, and publish your findings at top venues.
US, CA, San Francisco
We are seeking a Member of Technical Staff — Mechanical Engineer to lead the structural and electromechanical design of advanced high degree-of-freedom robotic systems within a frontier AI and robotics research lab. You will own the mechanical architecture of our robotics platform end-to-end: actuator selection, joint design, thermal management, cable routing, sensing integration, and structural optimization — all under the demanding constraints of a high-DoF system that must be lightweight, robust, and production-viable. This is a unique opportunity to define the physical design direction of a next-generation robotics platform from first principles. The ideal candidate has deep experience designing complex robotic systems and scaling hardware from concept through prototyping to production. You thrive on analytical problem solving, possess strong intuition for structural and electromechanical tradeoffs, and are equally comfortable in CAD and on the shop floor. You will be the technical lead of a small team of talented mechanical engineers while collaborating closely with electrical, firmware, controls, and AI research teams to set the mechanical and structural direction of the platform. Beyond core platform development, this role offers real latitude to push into novel territory — novel actuation methods, advanced sensor integration, or new approaches to mechatronic packaging. If you have research instincts alongside shipping discipline, you'll find an environment that rewards both. We're looking for someone who wants to be the technical authority on how a high-performance robot is physically built, not just a contributor to the effort. What You Bring: - A systems-thinking mindset with a strong grasp of cross-domain engineering tradeoffs. - A bias toward action: comfortable building, testing, and iterating rapidly. - A collaborative and communicative working style — especially in multi-disciplinary research environments. - A passion for robotics and advancing the state of the art in intelligent, capable machines. Key job responsibilities - Lead mechanical design of robotic subsystems and full platforms, including structures, joints, enclosures, and mechanisms for a research environment. - Own kinematic, dynamic, and structural analyses to guide the design and optimization of full systems and subsystems of high-DoF robots - Specify and integrate actuators and motors for high-torque density applications in high-degree-of-freedom systems. - Drive rapid iteration and prototyping cycles — from concept sketches through functional hardware — to accelerate learning and compress development timelines in a fast-paced R&D environment. - Partner with the AI research team to establish simulation pipelines that enable rapid exploration of mechanical design space, informing actuator choices, structural topology, and system-level tradeoffs before committing to physical builds. - Contribute to thermal management strategies for motors, sensors, and embedded compute hardware. - Integrate sensors such as lidar, stereo cameras, IMUs, tactile sensors, and compute modules into compact, functional assemblies. - Design and route cabling and wire harnesses, ensuring reliability, serviceability, and thermal/electrical integrity. - Prototype and test mechanical systems; support hands-on builds, debug sessions, and field testing. - Conduct root cause analysis on system-level failures or performance issues and implement design improvements. - Apply Design for Manufacturing (DFM) and Design for Assembly (DFA) principles to transition prototypes into scalable builds (10s–100s of units). - Collaborate with cross-functional teams in electrical engineering, controls, perception, and research to meet research and product goals. About the team Frontier AI & Robotics (FAR) is the team at Amazon building the next generation of embodied intelligence. FAR drives the development and implementation of advanced AI models within Amazon’s operations that enable robots to see, reason, and act on the world around them, supporting a number of different warehouse automation tasks.
US, WA, Seattle
Are you interested in building Agentic AI solutions that solve complex builder experience challenges with significant global impact? The Security Tooling team designs and builds high-performance AI systems using LLMs and machine learning that identify builder bottlenecks, automate security workflows, and optimize the software development lifecycle—empowering engineering teams worldwide to ship secure code faster while maintaining the highest security standards. As a Data Scientist on our Security Tool team, you will focus on building state-of-the-art ML models to enhance builder experience and productivity. You will identify builder bottlenecks and pain points across the software development lifecycle, design and apply experiments to study developer behavior, and measure the downstream impacts of security tooling on engineering velocity and code quality. Our team rewards curiosity while maintaining a laser-focus on bringing products to market that empower builders while maintaining security excellence. Competitive candidates are responsive, flexible, and able to succeed within an open, collaborative, entrepreneurial, startup-like environment. At the forefront of both academic and applied research in builder experience and security automation, you have the opportunity to work together with a diverse and talented team of scientists, engineers, and product managers and collaborate with other teams. This role offers a unique opportunity to work on projects that could fundamentally transform how builders interact with security tools and how organizations balance security requirements with developer productivity. Key job responsibilities Design and run rigorous experiments to evaluate and improve security tooling performance, builder experience, and adoption across hundreds of thousands of builders, multiple security tools, and diverse business verticals. Lead the end-to-end lifecycle of data science and ML models — from research and experimentation through production launch — including defining success metrics, obtaining stakeholder sign-off, and managing rollout. Conduct online and offline analyses to measure the real-world impact of security tooling improvements beyond adoption metrics, including downstream effects on vulnerability resolution, builder productivity, and organizational security posture. Develop and deploy production-grade machine learning and statistical models using Python, SQL, and related tools to automate insights, detect patterns, and drive decision-making across STF's security tool ecosystem. Perform large-scale exploratory data analysis on builder feedback, ticket resolution, tool usage, and customer satisfaction data to uncover patterns, identify opportunities, and inform product and tooling decisions. Translate complex research findings into clear insights and recommendations for technical and non-technical stakeholders at all levels, including STF leadership metric reporting and customer satisfaction publications. Contribute to Amazon's scientific community and the broader research field through collaboration and publication in top-tier venues. A day in the life Morning - Review overnight pipeline health — nudge systems, ticket classification models, and adoption dashboards running as expected - Join daily standup with the SDI team to align on priorities and flag blockers - Dive into exploratory analysis — investigating a spike in unresolved tickets or segmenting builder feedback to understand adoption gaps Midday - Partner with security tool owners (e.g., Shepherd, Talos, Scorecard) to review experiment results — did the latest nudge improve resolution rates? - Translate findings into actionable recommendations for leadership reviews or WBR updates - Analyze CSAT survey data to surface emerging dissatisfaction themes Afternoon - Write production code — building features for the classification pipeline, optimizing SQL for the metrics scorecard, or iterating on a model for predicting resolution timelines - Collaborate with STF stakeholders to define success metrics for an upcoming model launch - Document findings, update trackers, and queue next steps About the team Diverse Experiences Amazon Security values diverse experiences. Even if you do not meet all of the 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 Amazon Security? At Amazon, security is central to maintaining customer trust and delivering delightful customer experiences. Our organization is responsible for creating and maintaining a high bar for security across all of Amazon’s products and services. We offer talented security professionals the chance to accelerate their careers with opportunities to build experience in a wide variety of areas including cloud, devices, retail, entertainment, healthcare, operations, and physical stores. Inclusive Team Culture In Amazon Security, it’s in our nature to learn and be curious. Ongoing DEI events and learning experiences inspire us to continue learning and to embrace our uniqueness. Addressing the toughest security challenges requires that we seek out and celebrate a diversity of ideas, perspectives, and voices. Training & 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, training, 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 flexible work hours and arrangements are part of our culture. When we feel supported in the workplace and at home, there’s nothing we can’t achieve.